diff --git a/.azure-pipelines/ci.yml b/.azure-pipelines/ci.yml index d44ad9a90312e58b44562e9ca531de7ed4ce5736_LmF6dXJlLXBpcGVsaW5lcy9jaS55bWw=..8dd72af26abae4c1395bdd7572059de8fccc8d87_LmF6dXJlLXBpcGVsaW5lcy9jaS55bWw= 100644 --- a/.azure-pipelines/ci.yml +++ b/.azure-pipelines/ci.yml @@ -57,7 +57,7 @@ variables: testRunTitle: '$(build.sourceBranchName)-linux' testRunPlatform: linux - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml @@ -83,7 +83,7 @@ variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' testRunPlatform: linux-coverage - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml diff --git a/.azure-pipelines/docs-steps.yml b/.azure-pipelines/docs-steps.yml index d44ad9a90312e58b44562e9ca531de7ed4ce5736_LmF6dXJlLXBpcGVsaW5lcy9kb2NzLXN0ZXBzLnltbA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_LmF6dXJlLXBpcGVsaW5lcy9kb2NzLXN0ZXBzLnltbA== 100644 --- a/.azure-pipelines/docs-steps.yml +++ b/.azure-pipelines/docs-steps.yml @@ -12,7 +12,8 @@ inputs: versionSpec: '>=3.6' -- script: python -m pip install sphinx==2.2.0 blurb python-docs-theme +- script: python -m pip install -r requirements.txt + workingDirectory: '$(build.sourcesDirectory)/Doc' displayName: 'Install build dependencies' - ${{ if ne(parameters.latex, 'true') }}: diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml index d44ad9a90312e58b44562e9ca531de7ed4ce5736_LmF6dXJlLXBpcGVsaW5lcy9wci55bWw=..8dd72af26abae4c1395bdd7572059de8fccc8d87_LmF6dXJlLXBpcGVsaW5lcy9wci55bWw= 100644 --- a/.azure-pipelines/pr.yml +++ b/.azure-pipelines/pr.yml @@ -57,7 +57,7 @@ variables: testRunTitle: '$(system.pullRequest.TargetBranch)-linux' testRunPlatform: linux - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml @@ -83,7 +83,7 @@ variables: testRunTitle: '$(Build.SourceBranchName)-linux-coverage' testRunPlatform: linux-coverage - openssl_version: 1.1.1g + openssl_version: 1.1.1k steps: - template: ./posix-steps.yml diff --git a/.gitattributes b/.gitattributes index d44ad9a90312e58b44562e9ca531de7ed4ce5736_LmdpdGF0dHJpYnV0ZXM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_LmdpdGF0dHJpYnV0ZXM= 100644 --- a/.gitattributes +++ b/.gitattributes @@ -47,7 +47,7 @@ Python/clinic/*.h linguist-generated=true Python/importlib.h linguist-generated=true Python/importlib_external.h linguist-generated=true -Include/Python-ast.h linguist-generated=true +Include/internal/pycore_ast.h linguist-generated=true Python/Python-ast.c linguist-generated=true Include/opcode.h linguist-generated=true Python/opcode_targets.h linguist-generated=true diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d44ad9a90312e58b44562e9ca531de7ed4ce5736_LmdpdGh1Yi9DT0RFT1dORVJT..8dd72af26abae4c1395bdd7572059de8fccc8d87_LmdpdGh1Yi9DT0RFT1dORVJT 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -91,6 +91,10 @@ Parser/asdl_c.py @isidentical Lib/ast.py @isidentical +# Mock +/Lib/unittest/mock.py @cjw296 +/Lib/unittest/test/testmock/* @cjw296 + # SQLite 3 **/*sqlite* @berkerpeksag diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d44ad9a90312e58b44562e9ca531de7ed4ce5736_LmdpdGh1Yi93b3JrZmxvd3MvYnVpbGQueW1s..8dd72af26abae4c1395bdd7572059de8fccc8d87_LmdpdGh1Yi93b3JrZmxvd3MvYnVpbGQueW1s 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,7 @@ runs-on: ubuntu-latest outputs: run_tests: ${{ steps.check.outputs.run_tests }} + run_ssl_tests: ${{ steps.check.outputs.run_ssl_tests }} steps: - uses: actions/checkout@v2 - name: Check for source changes @@ -30,6 +31,7 @@ run: | if [ -z "$GITHUB_BASE_REF" ]; then echo '::set-output name=run_tests::true' + echo '::set-output name=run_ssl_tests::true' else git fetch origin $GITHUB_BASE_REF --depth=1 # git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more @@ -46,6 +48,7 @@ # # https://github.com/python/core-workflow/issues/373 git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true + git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qE '(ssl|hashlib|hmac|^.github)' && echo '::set-output name=run_ssl_tests::true' || true fi check_generated_files: @@ -131,10 +134,10 @@ needs: check_source if: needs.check_source.outputs.run_tests == 'true' env: - OPENSSL_VER: 1.1.1f + OPENSSL_VER: 1.1.1k steps: - uses: actions/checkout@v2 - name: Register gcc problem matcher run: echo "::add-matcher::.github/problem-matchers/gcc.json" - name: Install Dependencies run: sudo ./.github/workflows/posix-deps-apt.sh @@ -135,9 +138,14 @@ steps: - uses: actions/checkout@v2 - name: Register gcc problem matcher run: echo "::add-matcher::.github/problem-matchers/gcc.json" - name: Install Dependencies run: sudo ./.github/workflows/posix-deps-apt.sh + - name: Configure OpenSSL env vars + run: | + echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV + echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV - name: 'Restore OpenSSL build' id: cache-openssl uses: actions/cache@v2.1.4 @@ -146,5 +154,10 @@ key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }} - name: Install OpenSSL if: steps.cache-openssl.outputs.cache-hit != 'true' - run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux + run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux + - name: Add ccache to PATH + run: | + echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV + - name: Configure ccache action + uses: hendrikmuhs/ccache-action@v1 - name: Configure CPython @@ -150,8 +163,8 @@ - name: Configure CPython - run: ./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER + run: ./configure --with-pydebug --with-openssl=$OPENSSL_DIR - name: Build CPython run: make -j4 - name: Display build info run: make pythoninfo - name: Tests run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu" @@ -152,6 +165,54 @@ - name: Build CPython run: make -j4 - name: Display build info run: make pythoninfo - name: Tests run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu" + + build_ubuntu_ssltests: + name: 'Ubuntu SSL tests with OpenSSL ${{ matrix.openssl_ver }}' + runs-on: ubuntu-20.04 + needs: check_source + if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_ssl_tests == 'true' + strategy: + fail-fast: false + matrix: + openssl_ver: [1.0.2u, 1.1.0l, 1.1.1k, 3.0.0-alpha14] + env: + OPENSSL_VER: ${{ matrix.openssl_ver }} + MULTISSL_DIR: ${{ github.workspace }}/multissl + OPENSSL_DIR: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }} + LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib + steps: + - uses: actions/checkout@v2 + - name: Register gcc problem matcher + run: echo "::add-matcher::.github/problem-matchers/gcc.json" + - name: Install Dependencies + run: sudo ./.github/workflows/posix-deps-apt.sh + - name: Configure OpenSSL env vars + run: | + echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV + echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV + - name: 'Restore OpenSSL build' + id: cache-openssl + uses: actions/cache@v2.1.4 + with: + path: ./multissl/openssl/${{ env.OPENSSL_VER }} + key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }} + - name: Install OpenSSL + if: steps.cache-openssl.outputs.cache-hit != 'true' + run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux + - name: Add ccache to PATH + run: | + echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV + - name: Configure ccache action + uses: hendrikmuhs/ccache-action@v1 + - name: Configure CPython + run: ./configure --with-pydebug --with-openssl=$OPENSSL_DIR + - name: Build CPython + run: make -j4 + - name: Display build info + run: make pythoninfo + - name: SSL tests + run: ./python Lib/test/ssltests.py diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index d44ad9a90312e58b44562e9ca531de7ed4ce5736_LmdpdGh1Yi93b3JrZmxvd3MvY292ZXJhZ2UueW1s..8dd72af26abae4c1395bdd7572059de8fccc8d87_LmdpdGh1Yi93b3JrZmxvd3MvY292ZXJhZ2UueW1s 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -25,7 +25,7 @@ name: 'Ubuntu (Coverage)' runs-on: ubuntu-latest env: - OPENSSL_VER: 1.1.1f + OPENSSL_VER: 1.1.1k steps: - uses: actions/checkout@v2 - name: Install Dependencies diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index d44ad9a90312e58b44562e9ca531de7ed4ce5736_LmdpdGh1Yi93b3JrZmxvd3MvZG9jLnltbA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_LmdpdGh1Yi93b3JrZmxvd3MvZG9jLnltbA== 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -36,7 +36,7 @@ - name: 'Install build dependencies' run: make -C Doc/ PYTHON=../python venv - name: 'Build documentation' - run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going -j4" doctest html + run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going -j4" doctest html suspicious - name: 'Upload' uses: actions/upload-artifact@v2.2.2 with: diff --git a/.github/workflows/posix-deps-apt.sh b/.github/workflows/posix-deps-apt.sh index d44ad9a90312e58b44562e9ca531de7ed4ce5736_LmdpdGh1Yi93b3JrZmxvd3MvcG9zaXgtZGVwcy1hcHQuc2g=..8dd72af26abae4c1395bdd7572059de8fccc8d87_LmdpdGh1Yi93b3JrZmxvd3MvcG9zaXgtZGVwcy1hcHQuc2g= 100755 --- a/.github/workflows/posix-deps-apt.sh +++ b/.github/workflows/posix-deps-apt.sh @@ -3,6 +3,7 @@ apt-get -yq install \ build-essential \ + ccache \ gdb \ lcov \ libbz2-dev \ diff --git a/.travis.yml b/.travis.yml index d44ad9a90312e58b44562e9ca531de7ed4ce5736_LnRyYXZpcy55bWw=..8dd72af26abae4c1395bdd7572059de8fccc8d87_LnRyYXZpcy55bWw= 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ env: global: - - OPENSSL=1.1.1f + - OPENSSL=1.1.1k - OPENSSL_DIR="$HOME/multissl/openssl/${OPENSSL}" - PATH="${OPENSSL_DIR}/bin:$PATH" - CFLAGS="-I${OPENSSL_DIR}/include" @@ -53,7 +53,7 @@ - cd Doc - make venv PYTHON=python script: - - make check html SPHINXOPTS="-q -W -j4" + - make check html suspicious SPHINXOPTS="-q -W -j4" - name: "Documentation tests" os: linux language: c diff --git a/Doc/c-api/code.rst b/Doc/c-api/code.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2MtYXBpL2NvZGUucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2MtYXBpL2NvZGUucnN0 100644 --- a/Doc/c-api/code.rst +++ b/Doc/c-api/code.rst @@ -51,3 +51,11 @@ Return a new empty code object with the specified filename, function name, and first line number. It is illegal to :func:`exec` or :func:`eval` the resulting code object. + +.. c:function:: int PyCode_Addr2Line(PyCodeObject *co, int byte_offset) + + Return the line number of the instruction that occurs on or before ``byte_offset`` and ends after it. + If you just need the line number of a frame, use :c:func:`PyFrame_GetLineNumber` instead. + + For efficiently iterating over the line numbers in a code object, use `the API described in PEP 626 + <https://www.python.org/dev/peps/pep-0626/#out-of-process-debuggers-and-profilers>`_. diff --git a/Doc/c-api/concrete.rst b/Doc/c-api/concrete.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2MtYXBpL2NvbmNyZXRlLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2MtYXBpL2NvbmNyZXRlLnJzdA== 100644 --- a/Doc/c-api/concrete.rst +++ b/Doc/c-api/concrete.rst @@ -115,4 +115,3 @@ coro.rst contextvars.rst datetime.rst - decimal.rst diff --git a/Doc/c-api/decimal.rst b/Doc/c-api/decimal.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2MtYXBpL2RlY2ltYWwucnN0..0000000000000000000000000000000000000000 --- a/Doc/c-api/decimal.rst +++ /dev/null @@ -1,231 +0,0 @@ -.. sectionauthor:: Stefan Krah - -.. highlight:: c - - -Decimal capsule API -=================== - -Capsule API functions can be used in the same manner as regular library -functions, provided that the API has been initialized. - - -Initialize ----------- - -Typically, a C extension module that uses the decimal API will do these -steps in its init function: - -.. code-block:: c - - #include "pydecimal.h" - - static int decimal_initialized = 0; - if (!decimal_initialized) { - if (import_decimal() < 0) { - return NULL; - } - - decimal_initialized = 1; - } - - -Type checking, predicates, accessors ------------------------------------- - -.. c:function:: int PyDec_TypeCheck(const PyObject *dec) - - Return 1 if ``dec`` is a Decimal, 0 otherwise. This function does not set - any exceptions. - - -.. c:function:: int PyDec_IsSpecial(const PyObject *dec) - - Return 1 if ``dec`` is ``NaN``, ``sNaN`` or ``Infinity``, 0 otherwise. - - Set TypeError and return -1 if ``dec`` is not a Decimal. It is guaranteed that - this is the only failure mode, so if ``dec`` has already been type-checked, no - errors can occur and the function can be treated as a simple predicate. - - -.. c:function:: int PyDec_IsNaN(const PyObject *dec) - - Return 1 if ``dec`` is ``NaN`` or ``sNaN``, 0 otherwise. - - Set TypeError and return -1 if ``dec`` is not a Decimal. It is guaranteed that - this is the only failure mode, so if ``dec`` has already been type-checked, no - errors can occur and the function can be treated as a simple predicate. - - -.. c:function:: int PyDec_IsInfinite(const PyObject *dec) - - Return 1 if ``dec`` is ``Infinity``, 0 otherwise. - - Set TypeError and return -1 if ``dec`` is not a Decimal. It is guaranteed that - this is the only failure mode, so if ``dec`` has already been type-checked, no - errors can occur and the function can be treated as a simple predicate. - - -.. c:function:: int64_t PyDec_GetDigits(const PyObject *dec) - - Return the number of digits in the coefficient. For ``Infinity``, the - number of digits is always zero. Typically, the same applies to ``NaN`` - and ``sNaN``, but both of these can have a payload that is equivalent to - a coefficient. Therefore, ``NaNs`` can have a nonzero return value. - - Set TypeError and return -1 if ``dec`` is not a Decimal. It is guaranteed that - this is the only failure mode, so if ``dec`` has already been type-checked, no - errors can occur and the function can be treated as a simple accessor. - - -Exact conversions between decimals and primitive C types --------------------------------------------------------- - -This API supports conversions for decimals with a coefficient up to 38 digits. - -Data structures -~~~~~~~~~~~~~~~ - -The conversion functions use the following status codes and data structures: - -.. code-block:: c - - /* status cases for getting a triple */ - enum mpd_triple_class { - MPD_TRIPLE_NORMAL, - MPD_TRIPLE_INF, - MPD_TRIPLE_QNAN, - MPD_TRIPLE_SNAN, - MPD_TRIPLE_ERROR, - }; - - typedef struct { - enum mpd_triple_class tag; - uint8_t sign; - uint64_t hi; - uint64_t lo; - int64_t exp; - } mpd_uint128_triple_t; - -The status cases are explained below. ``sign`` is 0 for positive and 1 for negative. -``((uint128_t)hi << 64) + lo`` is the coefficient, ``exp`` is the exponent. - -The data structure is called "triple" because the decimal triple (sign, coeff, exp) -is an established term and (``hi``, ``lo``) represents a single ``uint128_t`` coefficient. - - -Functions -~~~~~~~~~ - -.. c:function:: mpd_uint128_triple_t PyDec_AsUint128Triple(const PyObject *dec) - - Convert a decimal to a triple. As above, it is guaranteed that the only - Python failure mode is a TypeError, checks can be omitted if the type is - known. - - For simplicity, the usage of the function and all special cases are - explained in code form and comments: - -.. code-block:: c - - triple = PyDec_AsUint128Triple(dec); - switch (triple.tag) { - case MPD_TRIPLE_QNAN: - /* - * Success: handle a quiet NaN. - * 1) triple.sign is 0 or 1. - * 2) triple.exp is always 0. - * 3) If triple.hi or triple.lo are nonzero, the NaN has a payload. - */ - break; - - case MPD_TRIPLE_SNAN: - /* - * Success: handle a signaling NaN. - * 1) triple.sign is 0 or 1. - * 2) triple.exp is always 0. - * 3) If triple.hi or triple.lo are nonzero, the sNaN has a payload. - */ - break; - - case MPD_TRIPLE_INF: - /* - * Success: handle Infinity. - * 1) triple.sign is 0 or 1. - * 2) triple.exp is always 0. - * 3) triple.hi and triple.lo are always zero. - */ - break; - - case MPD_TRIPLE_NORMAL: - /* Success: handle a finite value. */ - break; - - case MPD_TRIPLE_ERROR: - /* TypeError check: can be omitted if the type of dec is known. */ - if (PyErr_Occurred()) { - return NULL; - } - - /* Too large for conversion. PyDec_AsUint128Triple() does not set an - exception so applications can choose themselves. Typically this - would be a ValueError. */ - PyErr_SetString(PyExc_ValueError, - "value out of bounds for a uint128 triple"); - return NULL; - } - -.. c:function:: PyObject *PyDec_FromUint128Triple(const mpd_uint128_triple_t *triple) - - Create a decimal from a triple. The following rules must be observed for - initializing the triple: - - 1) ``triple.sign`` must always be 0 (for positive) or 1 (for negative). - - 2) ``MPD_TRIPLE_QNAN``: ``triple.exp`` must be 0. If ``triple.hi`` or ``triple.lo`` - are nonzero, create a ``NaN`` with a payload. - - 3) ``MPD_TRIPLE_SNAN``: ``triple.exp`` must be 0. If ``triple.hi`` or ``triple.lo`` - are nonzero, create an ``sNaN`` with a payload. - - 4) ``MPD_TRIPLE_INF``: ``triple.exp``, ``triple.hi`` and ``triple.lo`` must be zero. - - 5) ``MPD_TRIPLE_NORMAL``: ``MPD_MIN_ETINY + 38 < triple.exp < MPD_MAX_EMAX - 38``. - ``triple.hi`` and ``triple.lo`` can be chosen freely. - - 6) ``MPD_TRIPLE_ERROR``: It is always an error to set this tag. - - - If one of the above conditions is not met, the function returns ``NaN`` if - the ``InvalidOperation`` trap is not set in the thread local context. Otherwise, - it sets the ``InvalidOperation`` exception and returns NULL. - - Additionally, though extremely unlikely give the small allocation sizes, - the function can set ``MemoryError`` and return ``NULL``. - - -Advanced API ------------- - -This API enables the use of ``libmpdec`` functions. Since Python is compiled with -hidden symbols, the API requires an external libmpdec and the ``mpdecimal.h`` -header. - - -Functions -~~~~~~~~~ - -.. c:function:: PyObject *PyDec_Alloc(void) - - Return a new decimal that can be used in the ``result`` position of ``libmpdec`` - functions. - -.. c:function:: mpd_t *PyDec_Get(PyObject *v) - - Get a pointer to the internal ``mpd_t`` of the decimal. Decimals are immutable, - so this function must only be used on a new Decimal that has been created by - PyDec_Alloc(). - -.. c:function:: const mpd_t *PyDec_GetConst(const PyObject *v) - - Get a pointer to the constant internal ``mpd_t`` of the decimal. diff --git a/Doc/c-api/init_config.rst b/Doc/c-api/init_config.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2MtYXBpL2luaXRfY29uZmlnLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2MtYXBpL2luaXRfY29uZmlnLnJzdA== 100644 --- a/Doc/c-api/init_config.rst +++ b/Doc/c-api/init_config.rst @@ -241,8 +241,9 @@ * ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`Python pymalloc memory allocator <pymalloc>` with debug hooks - ``PYMEM_ALLOCATOR_PYMALLOC`` and ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` - are not supported if Python is configured using ``--without-pymalloc`` + ``PYMEM_ALLOCATOR_PYMALLOC`` and ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` are + not supported if Python is :option:`configured using --without-pymalloc + <--without-pymalloc>`. See :ref:`Memory Management <memory>`. @@ -583,6 +584,15 @@ Default: ``0``. + .. c:member:: int warn_default_encoding + + If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io.TextIOWrapper` + uses its default encoding. See :ref:`io-encoding-warning` for details. + + Default: ``0``. + + .. versionadded:: 3.10 + .. c:member:: wchar_t* check_hash_pycs_mode Control the validation behavior of hash-based ``.pyc`` files: @@ -627,7 +637,8 @@ Set to ``1`` by the :envvar:`PYTHONDUMPREFS` environment variable. - Need a special build of Python with the ``Py_TRACE_REFS`` macro defined. + Need a special build of Python with the ``Py_TRACE_REFS`` macro defined: + see the :option:`configure --with-trace-refs option <--with-trace-refs>`. Default: ``0``. @@ -808,7 +819,8 @@ Set to ``1`` by the :envvar:`PYTHONMALLOCSTATS` environment variable. - The option is ignored if Python is built using ``--without-pymalloc``. + The option is ignored if Python is :option:`configured using + the --without-pymalloc option <--without-pymalloc>`. Default: ``0``. @@ -818,8 +830,9 @@ Set by the :envvar:`PYTHONPLATLIBDIR` environment variable. - Default: value of the ``PLATLIBDIR`` macro which is set at configure time - by ``--with-platlibdir`` (default: ``"lib"``). + Default: value of the ``PLATLIBDIR`` macro which is set by the + :option:`configure --with-platlibdir option <--with-platlibdir>` + (default: ``"lib"``). Part of the :ref:`Python Path Configuration <init-path-config>` input. @@ -1007,7 +1020,8 @@ Set to 1 by :option:`-X showrefcount <-X>` command line option. - Need a debug build of Python (``Py_REF_DEBUG`` macro must be defined). + Need a :ref:`debug build of Python <debug-build>` (the ``Py_REF_DEBUG`` + macro must be defined). Default: ``0``. diff --git a/Doc/c-api/intro.rst b/Doc/c-api/intro.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2MtYXBpL2ludHJvLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2MtYXBpL2ludHJvLnJzdA== 100644 --- a/Doc/c-api/intro.rst +++ b/Doc/c-api/intro.rst @@ -742,9 +742,10 @@ frequently-used builds will be described in the remainder of this section. Compiling the interpreter with the :c:macro:`Py_DEBUG` macro defined produces -what is generally meant by "a debug build" of Python. :c:macro:`Py_DEBUG` is -enabled in the Unix build by adding ``--with-pydebug`` to the -:file:`./configure` command. It is also implied by the presence of the +what is generally meant by :ref:`a debug build of Python <debug-build>`. +:c:macro:`Py_DEBUG` is enabled in the Unix build by adding +:option:`--with-pydebug` to the :file:`./configure` command. +It is also implied by the presence of the not-Python-specific :c:macro:`_DEBUG` macro. When :c:macro:`Py_DEBUG` is enabled in the Unix build, compiler optimization is disabled. @@ -778,7 +779,7 @@ circular doubly linked list of active objects is maintained by adding two extra fields to every :c:type:`PyObject`. Total allocations are tracked as well. Upon exit, all existing references are printed. (In interactive mode this happens -after every statement run by the interpreter.) Implied by :c:macro:`Py_DEBUG`. +after every statement run by the interpreter.) Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source distribution for more detailed information. diff --git a/Doc/c-api/iter.rst b/Doc/c-api/iter.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2MtYXBpL2l0ZXIucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2MtYXBpL2l0ZXIucnN0 100644 --- a/Doc/c-api/iter.rst +++ b/Doc/c-api/iter.rst @@ -12,6 +12,12 @@ Return non-zero if the object *o* supports the iterator protocol, and ``0`` otherwise. This function always succeeds. +.. c:function:: int PyAiter_Check(PyObject *o) + + Returns non-zero if the object 'obj' provides :class:`AsyncIterator` + protocols, and ``0`` otherwise. This function always succeeds. + + .. versionadded:: 3.10 .. c:function:: PyObject* PyIter_Next(PyObject *o) diff --git a/Doc/c-api/memory.rst b/Doc/c-api/memory.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2MtYXBpL21lbW9yeS5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2MtYXBpL21lbW9yeS5yc3Q= 100644 --- a/Doc/c-api/memory.rst +++ b/Doc/c-api/memory.rst @@ -385,5 +385,5 @@ Legend: -* Name: value for :envvar:`PYTHONMALLOC` environment variable +* Name: value for :envvar:`PYTHONMALLOC` environment variable. * ``malloc``: system allocators from the standard C library, C functions: @@ -389,7 +389,8 @@ * ``malloc``: system allocators from the standard C library, C functions: - :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free` -* ``pymalloc``: :ref:`pymalloc memory allocator <pymalloc>` -* "+ debug": with debug hooks installed by :c:func:`PyMem_SetupDebugHooks` + :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`. +* ``pymalloc``: :ref:`pymalloc memory allocator <pymalloc>`. +* "+ debug": with debug hooks installed by :c:func:`PyMem_SetupDebugHooks`. +* "Debug build": :ref:`Python build in debug mode <debug-build>`. .. _customize-memory-allocators: @@ -500,8 +501,8 @@ memory block was traced. These hooks are :ref:`installed by default <default-memory-allocators>` if - Python is compiled in debug - mode. The :envvar:`PYTHONMALLOC` environment variable can be used to install + :ref:`Python is built in debug mode <debug-build>`. + The :envvar:`PYTHONMALLOC` environment variable can be used to install debug hooks on a Python compiled in release mode. .. versionchanged:: 3.6 diff --git a/Doc/c-api/object.rst b/Doc/c-api/object.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2MtYXBpL29iamVjdC5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2MtYXBpL29iamVjdC5yc3Q= 100644 --- a/Doc/c-api/object.rst +++ b/Doc/c-api/object.rst @@ -356,3 +356,14 @@ iterator for the object argument, or the object itself if the object is already an iterator. Raises :exc:`TypeError` and returns ``NULL`` if the object cannot be iterated. + + +.. c:function:: PyObject* PyObject_GetAiter(PyObject *o) + + This is the equivalent to the Python expression ``aiter(o)``. Takes an + :class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. + This is typically a new iterator but if the argument is an + :class:`AsyncIterator`, this returns itself. Raises :exc:`TypeError` and + returns ``NULL`` if the object cannot be iterated. + + .. versionadded:: 3.10 diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2MtYXBpL3N0cnVjdHVyZXMucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2MtYXBpL3N0cnVjdHVyZXMucnN0 100644 --- a/Doc/c-api/structures.rst +++ b/Doc/c-api/structures.rst @@ -62,6 +62,37 @@ See documentation of :c:type:`PyVarObject` above. +.. c:function:: int Py_Is(const PyObject *x, const PyObject *y) + + Test if the *x* object is the *y* object, the same as ``x is y`` in Python. + + .. versionadded:: 3.10 + + +.. c:function:: int Py_IsNone(const PyObject *x) + + Test if an object is the ``None`` singleton, + the same as ``x is None`` in Python. + + .. versionadded:: 3.10 + + +.. c:function:: int Py_IsTrue(const PyObject *x) + + Test if an object is the ``True`` singleton, + the same as ``x is True`` in Python. + + .. versionadded:: 3.10 + + +.. c:function:: int Py_IsFalse(const PyObject *x) + + Test if an object is the ``False`` singleton, + the same as ``x is False`` in Python. + + .. versionadded:: 3.10 + + .. c:function:: PyTypeObject* Py_TYPE(const PyObject *o) Get the type of the Python object *o*. diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2RhdGEvcmVmY291bnRzLmRhdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2RhdGEvcmVmY291bnRzLmRhdA== 100644 --- a/Doc/data/refcounts.dat +++ b/Doc/data/refcounts.dat @@ -1073,6 +1073,9 @@ PyIter_Check:int::: PyIter_Check:PyObject*:o:0: +PyAiter_Check:int::: +PyAiter_Check:PyObject*:o:0: + PyIter_Next:PyObject*::+1: PyIter_Next:PyObject*:o:0: @@ -1679,6 +1682,9 @@ PyObject_GetIter:PyObject*::+1: PyObject_GetIter:PyObject*:o:0: +PyObject_GetAiter:PyObject*::+1: +PyObject_GetAiter:PyObject*:o:0: + PyObject_HasAttr:int::: PyObject_HasAttr:PyObject*:o:0: PyObject_HasAttr:PyObject*:attr_name:0: diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2RhdGEvc3RhYmxlX2FiaS5kYXQ=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2RhdGEvc3RhYmxlX2FiaS5kYXQ= 100644 --- a/Doc/data/stable_abi.dat +++ b/Doc/data/stable_abi.dat @@ -1,5 +1,6 @@ # File generated by 'make regen-limited-abi' # This is NOT an authoritative list of stable ABI symbols +PyAiter_Check PyArg_Parse PyArg_ParseTuple PyArg_ParseTupleAndKeywords @@ -191,6 +192,7 @@ PyExc_ConnectionResetError PyExc_DeprecationWarning PyExc_EOFError +PyExc_EncodingWarning PyExc_EnvironmentError PyExc_Exception PyExc_FileExistsError @@ -465,6 +467,7 @@ PyObject_GenericGetDict PyObject_GenericSetAttr PyObject_GenericSetDict +PyObject_GetAiter PyObject_GetAttr PyObject_GetAttrString PyObject_GetItem @@ -764,4 +767,6 @@ Py_IncRef Py_Initialize Py_InitializeEx +Py_Is +Py_IsFalse Py_IsInitialized @@ -767,4 +772,6 @@ Py_IsInitialized +Py_IsNone +Py_IsTrue Py_LeaveRecursiveCall Py_Main Py_MakePendingCalls diff --git a/Doc/extending/extending.rst b/Doc/extending/extending.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2V4dGVuZGluZy9leHRlbmRpbmcucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2V4dGVuZGluZy9leHRlbmRpbmcucnN0 100644 --- a/Doc/extending/extending.rst +++ b/Doc/extending/extending.rst @@ -410,7 +410,7 @@ /* Optionally import the module; alternatively, import can be deferred until the embedded script imports it. */ - pmodule = PyImport_ImportModule("spam"); + PyObject *pmodule = PyImport_ImportModule("spam"); if (!pmodule) { PyErr_Print(); fprintf(stderr, "Error: could not import module 'spam'\n"); @@ -911,12 +911,7 @@ The cycle detector is able to detect garbage cycles and can reclaim them. The :mod:`gc` module exposes a way to run the detector (the :func:`~gc.collect` function), as well as configuration -interfaces and the ability to disable the detector at runtime. The cycle -detector is considered an optional component; though it is included by default, -it can be disabled at build time using the :option:`!--without-cycle-gc` option -to the :program:`configure` script on Unix platforms (including Mac OS X). If -the cycle detector is disabled in this way, the :mod:`gc` module will not be -available. +interfaces and the ability to disable the detector at runtime. .. _refcountsinpython: diff --git a/Doc/extending/newtypes.rst b/Doc/extending/newtypes.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2V4dGVuZGluZy9uZXd0eXBlcy5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2V4dGVuZGluZy9uZXd0eXBlcy5yc3Q= 100644 --- a/Doc/extending/newtypes.rst +++ b/Doc/extending/newtypes.rst @@ -12,7 +12,7 @@ implement and what they do. Here is the definition of :c:type:`PyTypeObject`, with some fields only used in -debug builds omitted: +:ref:`debug builds <debug-build>` omitted: .. literalinclude:: ../includes/typestruct.h diff --git a/Doc/extending/newtypes_tutorial.rst b/Doc/extending/newtypes_tutorial.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2V4dGVuZGluZy9uZXd0eXBlc190dXRvcmlhbC5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2V4dGVuZGluZy9uZXd0eXBlc190dXRvcmlhbC5yc3Q= 100644 --- a/Doc/extending/newtypes_tutorial.rst +++ b/Doc/extending/newtypes_tutorial.rst @@ -69,7 +69,8 @@ of type :c:type:`PyObject`, containing a pointer to a type object and a reference count (these can be accessed using the macros :c:macro:`Py_REFCNT` and :c:macro:`Py_TYPE` respectively). The reason for the macro is to -abstract away the layout and to enable additional fields in debug builds. +abstract away the layout and to enable additional fields in :ref:`debug builds +<debug-build>`. .. note:: There is no semicolon above after the :c:macro:`PyObject_HEAD` macro. diff --git a/Doc/faq/library.rst b/Doc/faq/library.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2ZhcS9saWJyYXJ5LnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2ZhcS9saWJyYXJ5LnJzdA== 100644 --- a/Doc/faq/library.rst +++ b/Doc/faq/library.rst @@ -319,7 +319,7 @@ try: arg = q.get(block=False) except queue.Empty: - print('Worker', threading.currentThread(), end=' ') + print('Worker', threading.current_thread(), end=' ') print('queue empty') break else: @@ -323,7 +323,7 @@ print('queue empty') break else: - print('Worker', threading.currentThread(), end=' ') + print('Worker', threading.current_thread(), end=' ') print('running with argument', arg) time.sleep(0.5) diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2ZhcS9wcm9ncmFtbWluZy5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2ZhcS9wcm9ncmFtbWluZy5yc3Q= 100644 --- a/Doc/faq/programming.rst +++ b/Doc/faq/programming.rst @@ -1420,6 +1420,41 @@ check whether an object is one of Python's built-in types, e.g. ``isinstance(obj, str)`` or ``isinstance(obj, (int, float, complex))``. +Note that :func:`isinstance` also checks for virtual inheritance from an +:term:`abstract base class`. So, the test will return ``True`` for a +registered class even if hasn't directly or indirectly inherited from it. To +test for "true inheritance", scan the :term:`MRO` of the class: + +.. testcode:: + + from collections.abc import Mapping + + class P: + pass + + class C(P): + pass + + Mapping.register(P) + +.. doctest:: + + >>> c = C() + >>> isinstance(c, C) # direct + True + >>> isinstance(c, P) # indirect + True + >>> isinstance(c, Mapping) # virtual + True + + # Actual inheritance chain + >>> type(c).__mro__ + (<class 'C'>, <class 'P'>, <class 'object'>) + + # Test for "true inheritance" + >>> Mapping in type(c).__mro__ + False + Note that most programs do not use :func:`isinstance` on user-defined classes very often. If you are developing the classes yourself, a more proper object-oriented style is to define methods on the classes that encapsulate a @@ -1701,6 +1736,93 @@ 13891296 +When can I rely on identity tests with the *is* operator? +--------------------------------------------------------- + +The ``is`` operator tests for object identity. The test ``a is b`` is +equivalent to ``id(a) == id(b)``. + +The most important property of an identity test is that an object is always +identical to itself, ``a is a`` always returns ``True``. Identity tests are +usually faster than equality tests. And unlike equality tests, identity tests +are guaranteed to return a boolean ``True`` or ``False``. + +However, identity tests can *only* be substituted for equality tests when +object identity is assured. Generally, there are three circumstances where +identity is guaranteed: + +1) Assignments create new names but do not change object identity. After the +assignment ``new = old``, it is guaranteed that ``new is old``. + +2) Putting an object in a container that stores object references does not +change object identity. After the list assignment ``s[0] = x``, it is +guaranteed that ``s[0] is x``. + +3) If an object is a singleton, it means that only one instance of that object +can exist. After the assignments ``a = None`` and ``b = None``, it is +guaranteed that ``a is b`` because ``None`` is a singleton. + +In most other circumstances, identity tests are inadvisable and equality tests +are preferred. In particular, identity tests should not be used to check +constants such as :class:`int` and :class:`str` which aren't guaranteed to be +singletons:: + + >>> a = 1000 + >>> b = 500 + >>> c = b + 500 + >>> a is c + False + + >>> a = 'Python' + >>> b = 'Py' + >>> c = b + 'thon' + >>> a is c + False + +Likewise, new instances of mutable containers are never identical:: + + >>> a = [] + >>> b = [] + >>> a is b + False + +In the standard library code, you will see several common patterns for +correctly using identity tests: + +1) As recommended by :pep:`8`, an identity test is the preferred way to check +for ``None``. This reads like plain English in code and avoids confusion with +other objects that may have boolean values that evaluate to false. + +2) Detecting optional arguments can be tricky when ``None`` is a valid input +value. In those situations, you can create an singleton sentinel object +guaranteed to be distinct from other objects. For example, here is how +to implement a method that behaves like :meth:`dict.pop`:: + + _sentinel = object() + + def pop(self, key, default=_sentinel): + if key in self: + value = self[key] + del self[key] + return value + if default is _sentinel: + raise KeyError(key) + return default + +3) Container implementations sometimes need to augment equality tests with +identity tests. This prevents the code from being confused by objects such as +``float('NaN')`` that are not equal to themselves. + +For example, here is the implementation of +:meth:`collections.abc.Sequence.__contains__`:: + + def __contains__(self, value): + for v in self: + if v is value or v == value: + return True + return False + + Modules ======= @@ -1776,8 +1898,8 @@ Suppose you have the following modules: -foo.py:: +:file:`foo.py`:: from bar import bar_var foo_var = 1 @@ -1780,11 +1902,11 @@ from bar import bar_var foo_var = 1 -bar.py:: +:file:`bar.py`:: from foo import foo_var bar_var = 2 The problem is that the interpreter will perform the following steps: @@ -1785,17 +1907,17 @@ from foo import foo_var bar_var = 2 The problem is that the interpreter will perform the following steps: -* main imports foo -* Empty globals for foo are created -* foo is compiled and starts executing -* foo imports bar -* Empty globals for bar are created -* bar is compiled and starts executing -* bar imports foo (which is a no-op since there already is a module named foo) -* bar.foo_var = foo.foo_var +* main imports ``foo`` +* Empty globals for ``foo`` are created +* ``foo`` is compiled and starts executing +* ``foo`` imports ``bar`` +* Empty globals for ``bar`` are created +* ``bar`` is compiled and starts executing +* ``bar`` imports ``foo`` (which is a no-op since there already is a module named ``foo``) +* The import mechanism tries to read ``foo_var`` from ``foo`` globals, to set ``bar.foo_var = foo.foo_var`` The last step fails, because Python isn't done with interpreting ``foo`` yet and the global symbol dictionary for ``foo`` is still empty. diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2hvd3RvL2Rlc2NyaXB0b3IucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2hvd3RvL2Rlc2NyaXB0b3IucnN0 100644 --- a/Doc/howto/descriptor.rst +++ b/Doc/howto/descriptor.rst @@ -115,5 +115,5 @@ 20 >>> g.size # The games directory has three files 3 - >>> open('games/newfile').close() # Add a fourth file to the directory + >>> os.remove('games/chess') # Delete a game >>> g.size # File count is automatically updated @@ -119,5 +119,5 @@ >>> g.size # File count is automatically updated - 4 + 2 Besides showing how descriptors can run computations, this example also reveals the purpose of the parameters to :meth:`__get__`. The *self* @@ -281,7 +281,9 @@ INFO:root:Updating 'name' to 'Catherine C' INFO:root:Updating 'age' to 20 -The two *Person* instances contain only the private names:: +The two *Person* instances contain only the private names: + +.. doctest:: >>> vars(pete) {'_name': 'Peter P', '_age': 10} @@ -710,6 +712,38 @@ raise return type(obj).__getattr__(obj, name) # __getattr__ +.. doctest:: + :hide: + + + >>> class ClassWithGetAttr: + ... x = 123 + ... def __getattr__(self, attr): + ... return attr.upper() + ... + >>> cw = ClassWithGetAttr() + >>> cw.y = 456 + >>> getattr_hook(cw, 'x') + 123 + >>> getattr_hook(cw, 'y') + 456 + >>> getattr_hook(cw, 'z') + 'Z' + + >>> class ClassWithoutGetAttr: + ... x = 123 + ... + >>> cwo = ClassWithoutGetAttr() + >>> cwo.y = 456 + >>> getattr_hook(cwo, 'x') + 123 + >>> getattr_hook(cwo, 'y') + 456 + >>> getattr_hook(cwo, 'z') + Traceback (most recent call last): + ... + AttributeError: 'ClassWithoutGetAttr' object has no attribute 'z' + So if :meth:`__getattr__` exists, it is called whenever :meth:`__getattribute__` raises :exc:`AttributeError` (either directly or in one of the descriptor calls). @@ -1064,7 +1098,7 @@ .. testcode:: class MethodType: - "Emulate Py_MethodType in Objects/classobject.c" + "Emulate PyMethod_Type in Objects/classobject.c" def __init__(self, func, obj): self.__func__ = func @@ -1139,8 +1173,8 @@ *cls* comes from in class methods, this is it! -Other kinds of methods ----------------------- +Kinds of methods +---------------- Non-data descriptors provide a simple mechanism for variations on the usual patterns of binding functions into methods. @@ -1193,8 +1227,8 @@ class E: @staticmethod def f(x): - print(x) + return x * 10 .. doctest:: >>> E.f(3) @@ -1197,6 +1231,6 @@ .. doctest:: >>> E.f(3) - 3 + 30 >>> E().f(3) @@ -1202,6 +1236,6 @@ >>> E().f(3) - 3 + 30 Using the non-data descriptor protocol, a pure Python version of :func:`staticmethod` would look like this: @@ -1204,8 +1238,8 @@ Using the non-data descriptor protocol, a pure Python version of :func:`staticmethod` would look like this: -.. doctest:: +.. testcode:: class StaticMethod: "Emulate PyStaticMethod_Type() in Objects/funcobject.c" @@ -1216,6 +1250,22 @@ def __get__(self, obj, objtype=None): return self.f +.. testcode:: + :hide: + + class E_sim: + @StaticMethod + def f(x): + return x * 10 + +.. doctest:: + :hide: + + >>> E_sim.f(3) + 30 + >>> E_sim().f(3) + 30 + Class methods ------------- diff --git a/Doc/howto/enum.rst b/Doc/howto/enum.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2hvd3RvL2VudW0ucnN0 --- /dev/null +++ b/Doc/howto/enum.rst @@ -0,0 +1,1416 @@ +========== +Enum HOWTO +========== + +:Author: Ethan Furman <ethan at stoneleaf dot us> + +.. _enum-basic-tutorial: + +.. currentmodule:: enum + +Basic Enum Tutorial +------------------- + +An :class:`Enum` is a set of symbolic names bound to unique values. They are +similar to global variables, but they offer a more useful :func:`repr()`, +grouping, type-safety, and a few other features. + +They are most useful when you have a variable that can take one of a limited +selection of values. For example, the days of the week:: + + >>> from enum import Enum + >>> class Weekday(Enum): + ... MONDAY = 1 + ... TUESDAY = 2 + ... WEDNESDAY = 3 + ... THURSDAY = 4 + ... FRIDAY = 5 + ... SATURDAY = 6 + ... SUNDAY = 7 + +As you can see, creating an :class:`Enum` is as simple as writing a class that +inherits from :class:`Enum` itself. + +.. note:: Case of Enum Members + + Because Enums are used to represent constants we recommend using + UPPER_CASE names for members, and will be using that style in our examples. + +Depending on the nature of the enum a member's value may or may not be +important, but either way that value can be used to get the corresponding +member:: + + >>> Weekday(3) + Weekday.WEDNESDAY + +As you can see, the ``repr()`` of a member shows the enum name and the +member name. The ``str()`` on a member shows only its name:: + + >>> print(Weekday.THURSDAY) + THURSDAY + +The *type* of an enumeration member is the enum it belongs to:: + + >>> type(Weekday.MONDAY) + <enum 'Weekday'> + >>> isinstance(Weekday.FRIDAY, Weekday) + True + +Enum members have an attribute that contains just their :attr:`name`:: + + >>> print(Weekday.TUESDAY.name) + TUESDAY + +Likewise, they have an attribute for their :attr:`value`:: + + + >>> Weekday.WEDNESDAY.value + 3 + +Unlike many languages that treat enumerations solely as name/value pairs, +Python Enums can have behavior added. For example, :class:`datetime.date` +has two methods for returning the weekday: :meth:`weekday` and :meth:`isoweekday`. +The difference is that one of them counts from 0-6 and the other from 1-7. +Rather than keep track of that ourselves we can add a method to the :class:`Weekday` +enum to extract the day from the :class:`date` instance and return the matching +enum member:: + + @classmethod + def from_date(cls, date): + return cls(date.isoweekday()) + +The complete :class:`Weekday` enum now looks like this:: + + >>> class Weekday(Enum): + ... MONDAY = 1 + ... TUESDAY = 2 + ... WEDNESDAY = 3 + ... THURSDAY = 4 + ... FRIDAY = 5 + ... SATURDAY = 6 + ... SUNDAY = 7 + ... # + ... @classmethod + ... def from_date(cls, date): + ... return cls(date.isoweekday()) + +Now we can find out what today is! Observe:: + + >>> from datetime import date + >>> Weekday.from_date(date.today()) + Weekday.TUESDAY + +Of course, if you're reading this on some other day, you'll see that day instead. + +This :class:`Weekday` enum is great if our variable only needs one day, but +what if we need several? Maybe we're writing a function to plot chores during +a week, and don't want to use a :class:`list` -- we could use a different type +of :class:`Enum`:: + + >>> from enum import Flag + >>> class Weekday(Flag): + ... MONDAY = 1 + ... TUESDAY = 2 + ... WEDNESDAY = 4 + ... THURSDAY = 8 + ... FRIDAY = 16 + ... SATURDAY = 32 + ... SUNDAY = 64 + +We've changed two things: we're inherited from :class:`Flag`, and the values are +all powers of 2. + +Just like the original :class:`Weekday` enum above, we can have a single selection:: + + >>> first_week_day = Weekday.MONDAY + >>> first_week_day + Weekday.MONDAY + +But :class:`Flag` also allows us to combine several members into a single +variable:: + + >>> weekend = Weekday.SATURDAY | Weekday.SUNDAY + >>> weekend + Weekday.SATURDAY|Weekday.SUNDAY + +You can even iterate over a :class:`Flag` variable:: + + >>> for day in weekend: + ... print(day) + SATURDAY + SUNDAY + +Okay, let's get some chores set up:: + + >>> chores_for_ethan = { + ... 'feed the cat': Weekday.MONDAY | Weekday.WEDNESDAY | Weekday.FRIDAY, + ... 'do the dishes': Weekday.TUESDAY | Weekday.THURSDAY, + ... 'answer SO questions': Weekday.SATURDAY, + ... } + +And a function to display the chores for a given day:: + + >>> def show_chores(chores, day): + ... for chore, days in chores.items(): + ... if day in days: + ... print(chore) + >>> show_chores(chores_for_ethan, Weekday.SATURDAY) + answer SO questions + +In cases where the actual values of the members do not matter, you can save +yourself some work and use :func:`auto()` for the values:: + + >>> from enum import auto + >>> class Weekday(Flag): + ... MONDAY = auto() + ... TUESDAY = auto() + ... WEDNESDAY = auto() + ... THURSDAY = auto() + ... FRIDAY = auto() + ... SATURDAY = auto() + ... SUNDAY = auto() + + +.. _enum-advanced-tutorial: + +Programmatic access to enumeration members and their attributes +--------------------------------------------------------------- + +Sometimes it's useful to access members in enumerations programmatically (i.e. +situations where ``Color.RED`` won't do because the exact color is not known +at program-writing time). ``Enum`` allows such access:: + + >>> Color(1) + Color.RED + >>> Color(3) + Color.BLUE + +If you want to access enum members by *name*, use item access:: + + >>> Color['RED'] + Color.RED + >>> Color['GREEN'] + Color.GREEN + +If you have an enum member and need its :attr:`name` or :attr:`value`:: + + >>> member = Color.RED + >>> member.name + 'RED' + >>> member.value + 1 + + +Duplicating enum members and values +----------------------------------- + +Having two enum members with the same name is invalid:: + + >>> class Shape(Enum): + ... SQUARE = 2 + ... SQUARE = 3 + ... + Traceback (most recent call last): + ... + TypeError: 'SQUARE' already defined as: 2 + +However, an enum member can have other names associated with it. Given two +entries ``A`` and ``B`` with the same value (and ``A`` defined first), ``B`` +is an alias for the member ``A``. By-value lookup of the value of ``A`` will +return the member ``A``. By-name lookup of ``A`` will return the member ``A``. +By-name lookup of ``B`` will also return the member ``A``:: + + >>> class Shape(Enum): + ... SQUARE = 2 + ... DIAMOND = 1 + ... CIRCLE = 3 + ... ALIAS_FOR_SQUARE = 2 + ... + >>> Shape.SQUARE + Shape.SQUARE + >>> Shape.ALIAS_FOR_SQUARE + Shape.SQUARE + >>> Shape(2) + Shape.SQUARE + +.. note:: + + Attempting to create a member with the same name as an already + defined attribute (another member, a method, etc.) or attempting to create + an attribute with the same name as a member is not allowed. + + +Ensuring unique enumeration values +---------------------------------- + +By default, enumerations allow multiple names as aliases for the same value. +When this behavior isn't desired, you can use the :func:`unique` decorator:: + + >>> from enum import Enum, unique + >>> @unique + ... class Mistake(Enum): + ... ONE = 1 + ... TWO = 2 + ... THREE = 3 + ... FOUR = 3 + ... + Traceback (most recent call last): + ... + ValueError: duplicate values found in <enum 'Mistake'>: FOUR -> THREE + + +Using automatic values +---------------------- + +If the exact value is unimportant you can use :class:`auto`:: + + >>> from enum import Enum, auto + >>> class Color(Enum): + ... RED = auto() + ... BLUE = auto() + ... GREEN = auto() + ... + >>> [member.value for member in Color] + [1, 2, 3] + +The values are chosen by :func:`_generate_next_value_`, which can be +overridden:: + + >>> class AutoName(Enum): + ... def _generate_next_value_(name, start, count, last_values): + ... return name + ... + >>> class Ordinal(AutoName): + ... NORTH = auto() + ... SOUTH = auto() + ... EAST = auto() + ... WEST = auto() + ... + >>> [member.value for member in Color] + ['NORTH', 'SOUTH', 'EAST', 'WEST'] + +.. note:: + + The :meth:`_generate_next_value_` method must be defined before any members. + +Iteration +--------- + +Iterating over the members of an enum does not provide the aliases:: + + >>> list(Shape) + [Shape.SQUARE, Shape.DIAMOND, Shape.CIRCLE] + +The special attribute ``__members__`` is a read-only ordered mapping of names +to members. It includes all names defined in the enumeration, including the +aliases:: + + >>> for name, member in Shape.__members__.items(): + ... name, member + ... + ('SQUARE', Shape.SQUARE) + ('DIAMOND', Shape.DIAMOND) + ('CIRCLE', Shape.CIRCLE) + ('ALIAS_FOR_SQUARE', Shape.SQUARE) + +The ``__members__`` attribute can be used for detailed programmatic access to +the enumeration members. For example, finding all the aliases:: + + >>> [name for name, member in Shape.__members__.items() if member.name != name] + ['ALIAS_FOR_SQUARE'] + + +Comparisons +----------- + +Enumeration members are compared by identity:: + + >>> Color.RED is Color.RED + True + >>> Color.RED is Color.BLUE + False + >>> Color.RED is not Color.BLUE + True + +Ordered comparisons between enumeration values are *not* supported. Enum +members are not integers (but see `IntEnum`_ below):: + + >>> Color.RED < Color.BLUE + Traceback (most recent call last): + File "<stdin>", line 1, in <module> + TypeError: '<' not supported between instances of 'Color' and 'Color' + +Equality comparisons are defined though:: + + >>> Color.BLUE == Color.RED + False + >>> Color.BLUE != Color.RED + True + >>> Color.BLUE == Color.BLUE + True + +Comparisons against non-enumeration values will always compare not equal +(again, :class:`IntEnum` was explicitly designed to behave differently, see +below):: + + >>> Color.BLUE == 2 + False + + +Allowed members and attributes of enumerations +---------------------------------------------- + +Most of the examples above use integers for enumeration values. Using integers is +short and handy (and provided by default by the `Functional API`_), but not +strictly enforced. In the vast majority of use-cases, one doesn't care what +the actual value of an enumeration is. But if the value *is* important, +enumerations can have arbitrary values. + +Enumerations are Python classes, and can have methods and special methods as +usual. If we have this enumeration:: + + >>> class Mood(Enum): + ... FUNKY = 1 + ... HAPPY = 3 + ... + ... def describe(self): + ... # self is the member here + ... return self.name, self.value + ... + ... def __str__(self): + ... return 'my custom str! {0}'.format(self.value) + ... + ... @classmethod + ... def favorite_mood(cls): + ... # cls here is the enumeration + ... return cls.HAPPY + ... + +Then:: + + >>> Mood.favorite_mood() + Mood.HAPPY + >>> Mood.HAPPY.describe() + ('HAPPY', 3) + >>> str(Mood.FUNKY) + 'my custom str! 1' + +The rules for what is allowed are as follows: names that start and end with +a single underscore are reserved by enum and cannot be used; all other +attributes defined within an enumeration will become members of this +enumeration, with the exception of special methods (:meth:`__str__`, +:meth:`__add__`, etc.), descriptors (methods are also descriptors), and +variable names listed in :attr:`_ignore_`. + +Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__` then +any value(s) given to the enum member will be passed into those methods. +See `Planet`_ for an example. + + +Restricted Enum subclassing +--------------------------- + +A new :class:`Enum` class must have one base enum class, up to one concrete +data type, and as many :class:`object`-based mixin classes as needed. The +order of these base classes is:: + + class EnumName([mix-in, ...,] [data-type,] base-enum): + pass + +Also, subclassing an enumeration is allowed only if the enumeration does not define +any members. So this is forbidden:: + + >>> class MoreColor(Color): + ... PINK = 17 + ... + Traceback (most recent call last): + ... + TypeError: MoreColor: cannot extend enumeration 'Color' + +But this is allowed:: + + >>> class Foo(Enum): + ... def some_behavior(self): + ... pass + ... + >>> class Bar(Foo): + ... HAPPY = 1 + ... SAD = 2 + ... + +Allowing subclassing of enums that define members would lead to a violation of +some important invariants of types and instances. On the other hand, it makes +sense to allow sharing some common behavior between a group of enumerations. +(See `OrderedEnum`_ for an example.) + + +Pickling +-------- + +Enumerations can be pickled and unpickled:: + + >>> from test.test_enum import Fruit + >>> from pickle import dumps, loads + >>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO)) + True + +The usual restrictions for pickling apply: picklable enums must be defined in +the top level of a module, since unpickling requires them to be importable +from that module. + +.. note:: + + With pickle protocol version 4 it is possible to easily pickle enums + nested in other classes. + +It is possible to modify how enum members are pickled/unpickled by defining +:meth:`__reduce_ex__` in the enumeration class. + + +Functional API +-------------- + +The :class:`Enum` class is callable, providing the following functional API:: + + >>> Animal = Enum('Animal', 'ANT BEE CAT DOG') + >>> Animal + <enum 'Animal'> + >>> Animal.ANT + Animal.ANT + >>> Animal.ANT.value + 1 + >>> list(Animal) + [Animal.ANT, Animal.BEE, Animal.CAT, Animal.DOG] + +The semantics of this API resemble :class:`~collections.namedtuple`. The first +argument of the call to :class:`Enum` is the name of the enumeration. + +The second argument is the *source* of enumeration member names. It can be a +whitespace-separated string of names, a sequence of names, a sequence of +2-tuples with key/value pairs, or a mapping (e.g. dictionary) of names to +values. The last two options enable assigning arbitrary values to +enumerations; the others auto-assign increasing integers starting with 1 (use +the ``start`` parameter to specify a different starting value). A +new class derived from :class:`Enum` is returned. In other words, the above +assignment to :class:`Animal` is equivalent to:: + + >>> class Animal(Enum): + ... ANT = 1 + ... BEE = 2 + ... CAT = 3 + ... DOG = 4 + ... + +The reason for defaulting to ``1`` as the starting number and not ``0`` is +that ``0`` is ``False`` in a boolean sense, but by default enum members all +evaluate to ``True``. + +Pickling enums created with the functional API can be tricky as frame stack +implementation details are used to try and figure out which module the +enumeration is being created in (e.g. it will fail if you use a utility +function in separate module, and also may not work on IronPython or Jython). +The solution is to specify the module name explicitly as follows:: + + >>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__) + +.. warning:: + + If ``module`` is not supplied, and Enum cannot determine what it is, + the new Enum members will not be unpicklable; to keep errors closer to + the source, pickling will be disabled. + +The new pickle protocol 4 also, in some circumstances, relies on +:attr:`~definition.__qualname__` being set to the location where pickle will be able +to find the class. For example, if the class was made available in class +SomeData in the global scope:: + + >>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal') + +The complete signature is:: + + Enum( + value='NewEnumName', + names=<...>, + *, + module='...', + qualname='...', + type=<mixed-in class>, + start=1, + ) + +:value: What the new enum class will record as its name. + +:names: The enum members. This can be a whitespace or comma separated string + (values will start at 1 unless otherwise specified):: + + 'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE' + + or an iterator of names:: + + ['RED', 'GREEN', 'BLUE'] + + or an iterator of (name, value) pairs:: + + [('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)] + + or a mapping:: + + {'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42} + +:module: name of module where new enum class can be found. + +:qualname: where in module new enum class can be found. + +:type: type to mix in to new enum class. + +:start: number to start counting at if only names are passed in. + +.. versionchanged:: 3.5 + The *start* parameter was added. + + +Derived Enumerations +-------------------- + +IntEnum +^^^^^^^ + +The first variation of :class:`Enum` that is provided is also a subclass of +:class:`int`. Members of an :class:`IntEnum` can be compared to integers; +by extension, integer enumerations of different types can also be compared +to each other:: + + >>> from enum import IntEnum + >>> class Shape(IntEnum): + ... CIRCLE = 1 + ... SQUARE = 2 + ... + >>> class Request(IntEnum): + ... POST = 1 + ... GET = 2 + ... + >>> Shape == 1 + False + >>> Shape.CIRCLE == 1 + True + >>> Shape.CIRCLE == Request.POST + True + +However, they still can't be compared to standard :class:`Enum` enumerations:: + + >>> class Shape(IntEnum): + ... CIRCLE = 1 + ... SQUARE = 2 + ... + >>> class Color(Enum): + ... RED = 1 + ... GREEN = 2 + ... + >>> Shape.CIRCLE == Color.RED + False + +:class:`IntEnum` values behave like integers in other ways you'd expect:: + + >>> int(Shape.CIRCLE) + 1 + >>> ['a', 'b', 'c'][Shape.CIRCLE] + 'b' + >>> [i for i in range(Shape.SQUARE)] + [0, 1] + + +StrEnum +^^^^^^^ + +The second variation of :class:`Enum` that is provided is also a subclass of +:class:`str`. Members of a :class:`StrEnum` can be compared to strings; +by extension, string enumerations of different types can also be compared +to each other. :class:`StrEnum` exists to help avoid the problem of getting +an incorrect member:: + + >>> from enum import StrEnum + >>> class Directions(StrEnum): + ... NORTH = 'north', # notice the trailing comma + ... SOUTH = 'south' + +Before :class:`StrEnum`, ``Directions.NORTH`` would have been the :class:`tuple` +``('north',)``. + +.. versionadded:: 3.10 + + +IntFlag +^^^^^^^ + +The next variation of :class:`Enum` provided, :class:`IntFlag`, is also based +on :class:`int`. The difference being :class:`IntFlag` members can be combined +using the bitwise operators (&, \|, ^, ~) and the result is still an +:class:`IntFlag` member, if possible. However, as the name implies, :class:`IntFlag` +members also subclass :class:`int` and can be used wherever an :class:`int` is +used. + +.. note:: + + Any operation on an :class:`IntFlag` member besides the bit-wise operations will + lose the :class:`IntFlag` membership. + + Bit-wise operations that result in invalid :class:`IntFlag` values will lose the + :class:`IntFlag` membership. See :class:`FlagBoundary` for + details. + +.. versionadded:: 3.6 +.. versionchanged:: 3.10 + +Sample :class:`IntFlag` class:: + + >>> from enum import IntFlag + >>> class Perm(IntFlag): + ... R = 4 + ... W = 2 + ... X = 1 + ... + >>> Perm.R | Perm.W + Perm.R|Perm.W + >>> Perm.R + Perm.W + 6 + >>> RW = Perm.R | Perm.W + >>> Perm.R in RW + True + +It is also possible to name the combinations:: + + >>> class Perm(IntFlag): + ... R = 4 + ... W = 2 + ... X = 1 + ... RWX = 7 + >>> Perm.RWX + Perm.RWX + >>> ~Perm.RWX + Perm(0) + >>> Perm(7) + Perm.RWX + +.. note:: + + Named combinations are considered aliases. Aliases do not show up during + iteration, but can be returned from by-value lookups. + +.. versionchanged:: 3.10 + +Another important difference between :class:`IntFlag` and :class:`Enum` is that +if no flags are set (the value is 0), its boolean evaluation is :data:`False`:: + + >>> Perm.R & Perm.X + Perm(0) + >>> bool(Perm.R & Perm.X) + False + +Because :class:`IntFlag` members are also subclasses of :class:`int` they can +be combined with them (but may lose :class:`IntFlag` membership:: + + >>> Perm.X | 4 + Perm.R|Perm.X + + >>> Perm.X | 8 + 9 + +.. note:: + + The negation operator, ``~``, always returns an :class:`IntFlag` member with a + positive value:: + + >>> (~Perm.X).value == (Perm.R|Perm.W).value == 6 + True + +:class:`IntFlag` members can also be iterated over:: + + >>> list(RW) + [Perm.R, Perm.W] + +.. versionadded:: 3.10 + + +Flag +^^^^ + +The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` +members can be combined using the bitwise operators (&, \|, ^, ~). Unlike +:class:`IntFlag`, they cannot be combined with, nor compared against, any +other :class:`Flag` enumeration, nor :class:`int`. While it is possible to +specify the values directly it is recommended to use :class:`auto` as the +value and let :class:`Flag` select an appropriate value. + +.. versionadded:: 3.6 + +Like :class:`IntFlag`, if a combination of :class:`Flag` members results in no +flags being set, the boolean evaluation is :data:`False`:: + + >>> from enum import Flag, auto + >>> class Color(Flag): + ... RED = auto() + ... BLUE = auto() + ... GREEN = auto() + ... + >>> Color.RED & Color.GREEN + Color(0) + >>> bool(Color.RED & Color.GREEN) + False + +Individual flags should have values that are powers of two (1, 2, 4, 8, ...), +while combinations of flags won't:: + + >>> class Color(Flag): + ... RED = auto() + ... BLUE = auto() + ... GREEN = auto() + ... WHITE = RED | BLUE | GREEN + ... + >>> Color.WHITE + Color.WHITE + +Giving a name to the "no flags set" condition does not change its boolean +value:: + + >>> class Color(Flag): + ... BLACK = 0 + ... RED = auto() + ... BLUE = auto() + ... GREEN = auto() + ... + >>> Color.BLACK + Color.BLACK + >>> bool(Color.BLACK) + False + +:class:`Flag` members can also be iterated over:: + + >>> purple = Color.RED | Color.BLUE + >>> list(purple) + [Color.RED, Color.BLUE] + +.. versionadded:: 3.10 + +.. note:: + + For the majority of new code, :class:`Enum` and :class:`Flag` are strongly + recommended, since :class:`IntEnum` and :class:`IntFlag` break some + semantic promises of an enumeration (by being comparable to integers, and + thus by transitivity to other unrelated enumerations). :class:`IntEnum` + and :class:`IntFlag` should be used only in cases where :class:`Enum` and + :class:`Flag` will not do; for example, when integer constants are replaced + with enumerations, or for interoperability with other systems. + + +Others +^^^^^^ + +While :class:`IntEnum` is part of the :mod:`enum` module, it would be very +simple to implement independently:: + + class IntEnum(int, Enum): + pass + +This demonstrates how similar derived enumerations can be defined; for example +a :class:`StrEnum` that mixes in :class:`str` instead of :class:`int`. + +Some rules: + +1. When subclassing :class:`Enum`, mix-in types must appear before + :class:`Enum` itself in the sequence of bases, as in the :class:`IntEnum` + example above. +2. While :class:`Enum` can have members of any type, once you mix in an + additional type, all the members must have values of that type, e.g. + :class:`int` above. This restriction does not apply to mix-ins which only + add methods and don't specify another type. +3. When another data type is mixed in, the :attr:`value` attribute is *not the + same* as the enum member itself, although it is equivalent and will compare + equal. +4. %-style formatting: `%s` and `%r` call the :class:`Enum` class's + :meth:`__str__` and :meth:`__repr__` respectively; other codes (such as + `%i` or `%h` for IntEnum) treat the enum member as its mixed-in type. +5. :ref:`Formatted string literals <f-strings>`, :meth:`str.format`, + and :func:`format` will use the mixed-in type's :meth:`__format__` + unless :meth:`__str__` or :meth:`__format__` is overridden in the subclass, + in which case the overridden methods or :class:`Enum` methods will be used. + Use the !s and !r format codes to force usage of the :class:`Enum` class's + :meth:`__str__` and :meth:`__repr__` methods. + +When to use :meth:`__new__` vs. :meth:`__init__` +------------------------------------------------ + +:meth:`__new__` must be used whenever you want to customize the actual value of +the :class:`Enum` member. Any other modifications may go in either +:meth:`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred. + +For example, if you want to pass several items to the constructor, but only +want one of them to be the value:: + + >>> class Coordinate(bytes, Enum): + ... """ + ... Coordinate with binary codes that can be indexed by the int code. + ... """ + ... def __new__(cls, value, label, unit): + ... obj = bytes.__new__(cls, [value]) + ... obj._value_ = value + ... obj.label = label + ... obj.unit = unit + ... return obj + ... PX = (0, 'P.X', 'km') + ... PY = (1, 'P.Y', 'km') + ... VX = (2, 'V.X', 'km/s') + ... VY = (3, 'V.Y', 'km/s') + ... + + >>> print(Coordinate['PY']) + PY + + >>> print(Coordinate(3)) + VY + + +Finer Points +^^^^^^^^^^^^ + +Supported ``__dunder__`` names +"""""""""""""""""""""""""""""" + +:attr:`__members__` is a read-only ordered mapping of ``member_name``:``member`` +items. It is only available on the class. + +:meth:`__new__`, if specified, must create and return the enum members; it is +also a very good idea to set the member's :attr:`_value_` appropriately. Once +all the members are created it is no longer used. + + +Supported ``_sunder_`` names +"""""""""""""""""""""""""""" + +- ``_name_`` -- name of the member +- ``_value_`` -- value of the member; can be set / modified in ``__new__`` + +- ``_missing_`` -- a lookup function used when a value is not found; may be + overridden +- ``_ignore_`` -- a list of names, either as a :class:`list` or a :class:`str`, + that will not be transformed into members, and will be removed from the final + class +- ``_order_`` -- used in Python 2/3 code to ensure member order is consistent + (class attribute, removed during class creation) +- ``_generate_next_value_`` -- used by the `Functional API`_ and by + :class:`auto` to get an appropriate value for an enum member; may be + overridden + +.. note:: + + For standard :class:`Enum` classes the next value chosen is the last value seen + incremented by one. + + For :class:`Flag` classes the next value chosen will be the next highest + power-of-two, regardless of the last value seen. + +.. versionadded:: 3.6 ``_missing_``, ``_order_``, ``_generate_next_value_`` +.. versionadded:: 3.7 ``_ignore_`` + +To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute can +be provided. It will be checked against the actual order of the enumeration +and raise an error if the two do not match:: + + >>> class Color(Enum): + ... _order_ = 'RED GREEN BLUE' + ... RED = 1 + ... BLUE = 3 + ... GREEN = 2 + ... + Traceback (most recent call last): + ... + TypeError: member order does not match _order_: + ['RED', 'BLUE', 'GREEN'] + ['RED', 'GREEN', 'BLUE'] + +.. note:: + + In Python 2 code the :attr:`_order_` attribute is necessary as definition + order is lost before it can be recorded. + + +_Private__names +""""""""""""""" + +Private names are not converted to enum members, but remain normal attributes. + +.. versionchanged:: 3.10 + + +``Enum`` member type +"""""""""""""""""""" + +Enum members are instances of their enum class, and are normally accessed as +``EnumClass.member``. In Python versions ``3.5`` to ``3.9`` you could access +members from other members -- this practice was discouraged, and in ``3.12`` +:class:`Enum` will return to not allowing it, while in ``3.10`` and ``3.11`` +it will raise a :exc:`DeprecationWarning`:: + + >>> class FieldTypes(Enum): + ... name = 0 + ... value = 1 + ... size = 2 + ... + >>> FieldTypes.value.size # doctest: +SKIP + DeprecationWarning: accessing one member from another is not supported, + and will be disabled in 3.12 + <FieldTypes.size: 2> + +.. versionchanged:: 3.5 +.. versionchanged:: 3.10 + + +Creating members that are mixed with other data types +""""""""""""""""""""""""""""""""""""""""""""""""""""" + +When subclassing other data types, such as :class:`int` or :class:`str`, with +an :class:`Enum`, all values after the `=` are passed to that data type's +constructor. For example:: + + >>> class MyEnum(IntEnum): + ... example = '11', 16 # '11' will be interpreted as a hexadecimal + ... # number + >>> MyEnum.example.value + 17 + + +Boolean value of ``Enum`` classes and members +""""""""""""""""""""""""""""""""""""""""""""" + +Enum classes that are mixed with non-:class:`Enum` types (such as +:class:`int`, :class:`str`, etc.) are evaluated according to the mixed-in +type's rules; otherwise, all members evaluate as :data:`True`. To make your +own enum's boolean evaluation depend on the member's value add the following to +your class:: + + def __bool__(self): + return bool(self.value) + +Plain :class:`Enum` classes always evaluate as :data:`True`. + + +``Enum`` classes with methods +""""""""""""""""""""""""""""" + +If you give your enum subclass extra methods, like the `Planet`_ +class above, those methods will show up in a :func:`dir` of the member, +but not of the class:: + + >>> dir(Planet) + ['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__doc__', '__members__', '__module__'] + >>> dir(Planet.EARTH) + ['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', 'surface_gravity', 'value'] + + +Combining members of ``Flag`` +""""""""""""""""""""""""""""" + +Iterating over a combination of :class:`Flag` members will only return the members that +are comprised of a single bit:: + + >>> class Color(Flag): + ... RED = auto() + ... GREEN = auto() + ... BLUE = auto() + ... MAGENTA = RED | BLUE + ... YELLOW = RED | GREEN + ... CYAN = GREEN | BLUE + ... + >>> Color(3) # named combination + Color.YELLOW + >>> Color(7) # not named combination + Color.RED|Color.GREEN|Color.BLUE + +``StrEnum`` and :meth:`str.__str__` +""""""""""""""""""""""""""""""""""" + +An important difference between :class:`StrEnum` and other Enums is the +:meth:`__str__` method; because :class:`StrEnum` members are strings, some +parts of Python will read the string data directly, while others will call +:meth:`str()`. To make those two operations have the same result, +:meth:`StrEnum.__str__` will be the same as :meth:`str.__str__` so that +``str(StrEnum.member) == StrEnum.member`` is true. + +``Flag`` and ``IntFlag`` minutia +"""""""""""""""""""""""""""""""" + +Using the following snippet for our examples:: + + >>> class Color(IntFlag): + ... BLACK = 0 + ... RED = 1 + ... GREEN = 2 + ... BLUE = 4 + ... PURPLE = RED | BLUE + ... WHITE = RED | GREEN | BLUE + ... + +the following are true: + +- single-bit flags are canonical +- multi-bit and zero-bit flags are aliases +- only canonical flags are returned during iteration:: + + >>> list(Color.WHITE) + [Color.RED, Color.GREEN, Color.BLUE] + +- negating a flag or flag set returns a new flag/flag set with the + corresponding positive integer value:: + + >>> Color.BLUE + Color.BLUE + + >>> ~Color.BLUE + Color.RED|Color.GREEN + +- names of pseudo-flags are constructed from their members' names:: + + >>> (Color.RED | Color.GREEN).name + 'RED|GREEN' + +- multi-bit flags, aka aliases, can be returned from operations:: + + >>> Color.RED | Color.BLUE + Color.PURPLE + + >>> Color(7) # or Color(-1) + Color.WHITE + + >>> Color(0) + Color.BLACK + +- membership / containment checking has changed slightly -- zero valued flags + are never considered to be contained:: + + >>> Color.BLACK in Color.WHITE + False + + otherwise, if all bits of one flag are in the other flag, True is returned:: + + >>> Color.PURPLE in Color.WHITE + True + +There is a new boundary mechanism that controls how out-of-range / invalid +bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``: + + * STRICT --> raises an exception when presented with invalid values + * CONFORM --> discards any invalid bits + * EJECT --> lose Flag status and become a normal int with the given value + * KEEP --> keep the extra bits + - keeps Flag status and extra bits + - extra bits do not show up in iteration + - extra bits do show up in repr() and str() + +The default for Flag is ``STRICT``, the default for ``IntFlag`` is ``EJECT``, +and the default for ``_convert_`` is ``KEEP`` (see ``ssl.Options`` for an +example of when ``KEEP`` is needed). + + +.. _enum-class-differences: + +How are Enums different? +------------------------ + +Enums have a custom metaclass that affects many aspects of both derived :class:`Enum` +classes and their instances (members). + + +Enum Classes +^^^^^^^^^^^^ + +The :class:`EnumType` metaclass is responsible for providing the +:meth:`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that +allow one to do things with an :class:`Enum` class that fail on a typical +class, such as `list(Color)` or `some_enum_var in Color`. :class:`EnumType` is +responsible for ensuring that various other methods on the final :class:`Enum` +class are correct (such as :meth:`__new__`, :meth:`__getnewargs__`, +:meth:`__str__` and :meth:`__repr__`). + + +Enum Members (aka instances) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The most interesting thing about enum members is that they are singletons. +:class:`EnumType` creates them all while it is creating the enum class itself, +and then puts a custom :meth:`__new__` in place to ensure that no new ones are +ever instantiated by returning only the existing member instances. + + +.. _enum-cookbook: + + +While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and +:class:`IntFlag` are expected to cover the majority of use-cases, they cannot +cover them all. Here are recipes for some different types of enumerations +that can be used directly, or as examples for creating one's own. + + +Omitting values +^^^^^^^^^^^^^^^ + +In many use-cases one doesn't care what the actual value of an enumeration +is. There are several ways to define this type of simple enumeration: + +- use instances of :class:`auto` for the value +- use instances of :class:`object` as the value +- use a descriptive string as the value +- use a tuple as the value and a custom :meth:`__new__` to replace the + tuple with an :class:`int` value + +Using any of these methods signifies to the user that these values are not +important, and also enables one to add, remove, or reorder members without +having to renumber the remaining members. + + +Using :class:`auto` +""""""""""""""""""" + +Using :class:`auto` would look like:: + + >>> class Color(Enum): + ... RED = auto() + ... BLUE = auto() + ... GREEN = auto() + ... + >>> Color.GREEN + <Color.GREEN> + + +Using :class:`object` +""""""""""""""""""""" + +Using :class:`object` would look like:: + + >>> class Color(Enum): + ... RED = object() + ... GREEN = object() + ... BLUE = object() + ... + >>> Color.GREEN + <Color.GREEN> + + +Using a descriptive string +"""""""""""""""""""""""""" + +Using a string as the value would look like:: + + >>> class Color(Enum): + ... RED = 'stop' + ... GREEN = 'go' + ... BLUE = 'too fast!' + ... + >>> Color.GREEN + <Color.GREEN> + >>> Color.GREEN.value + 'go' + + +Using a custom :meth:`__new__` +"""""""""""""""""""""""""""""" + +Using an auto-numbering :meth:`__new__` would look like:: + + >>> class AutoNumber(Enum): + ... def __new__(cls): + ... value = len(cls.__members__) + 1 + ... obj = object.__new__(cls) + ... obj._value_ = value + ... return obj + ... + >>> class Color(AutoNumber): + ... RED = () + ... GREEN = () + ... BLUE = () + ... + >>> Color.GREEN + <Color.GREEN> + >>> Color.GREEN.value + 2 + +To make a more general purpose ``AutoNumber``, add ``*args`` to the signature:: + + >>> class AutoNumber(Enum): + ... def __new__(cls, *args): # this is the only change from above + ... value = len(cls.__members__) + 1 + ... obj = object.__new__(cls) + ... obj._value_ = value + ... return obj + ... + +Then when you inherit from ``AutoNumber`` you can write your own ``__init__`` +to handle any extra arguments:: + + >>> class Swatch(AutoNumber): + ... def __init__(self, pantone='unknown'): + ... self.pantone = pantone + ... AUBURN = '3497' + ... SEA_GREEN = '1246' + ... BLEACHED_CORAL = () # New color, no Pantone code yet! + ... + >>> Swatch.SEA_GREEN + <Swatch.SEA_GREEN> + >>> Swatch.SEA_GREEN.pantone + '1246' + >>> Swatch.BLEACHED_CORAL.pantone + 'unknown' + +.. note:: + + The :meth:`__new__` method, if defined, is used during creation of the Enum + members; it is then replaced by Enum's :meth:`__new__` which is used after + class creation for lookup of existing members. + + +OrderedEnum +^^^^^^^^^^^ + +An ordered enumeration that is not based on :class:`IntEnum` and so maintains +the normal :class:`Enum` invariants (such as not being comparable to other +enumerations):: + + >>> class OrderedEnum(Enum): + ... def __ge__(self, other): + ... if self.__class__ is other.__class__: + ... return self.value >= other.value + ... return NotImplemented + ... def __gt__(self, other): + ... if self.__class__ is other.__class__: + ... return self.value > other.value + ... return NotImplemented + ... def __le__(self, other): + ... if self.__class__ is other.__class__: + ... return self.value <= other.value + ... return NotImplemented + ... def __lt__(self, other): + ... if self.__class__ is other.__class__: + ... return self.value < other.value + ... return NotImplemented + ... + >>> class Grade(OrderedEnum): + ... A = 5 + ... B = 4 + ... C = 3 + ... D = 2 + ... F = 1 + ... + >>> Grade.C < Grade.A + True + + +DuplicateFreeEnum +^^^^^^^^^^^^^^^^^ + +Raises an error if a duplicate member name is found instead of creating an +alias:: + + >>> class DuplicateFreeEnum(Enum): + ... def __init__(self, *args): + ... cls = self.__class__ + ... if any(self.value == e.value for e in cls): + ... a = self.name + ... e = cls(self.value).name + ... raise ValueError( + ... "aliases not allowed in DuplicateFreeEnum: %r --> %r" + ... % (a, e)) + ... + >>> class Color(DuplicateFreeEnum): + ... RED = 1 + ... GREEN = 2 + ... BLUE = 3 + ... GRENE = 2 + ... + Traceback (most recent call last): + ... + ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN' + +.. note:: + + This is a useful example for subclassing Enum to add or change other + behaviors as well as disallowing aliases. If the only desired change is + disallowing aliases, the :func:`unique` decorator can be used instead. + + +Planet +^^^^^^ + +If :meth:`__new__` or :meth:`__init__` is defined the value of the enum member +will be passed to those methods:: + + >>> class Planet(Enum): + ... MERCURY = (3.303e+23, 2.4397e6) + ... VENUS = (4.869e+24, 6.0518e6) + ... EARTH = (5.976e+24, 6.37814e6) + ... MARS = (6.421e+23, 3.3972e6) + ... JUPITER = (1.9e+27, 7.1492e7) + ... SATURN = (5.688e+26, 6.0268e7) + ... URANUS = (8.686e+25, 2.5559e7) + ... NEPTUNE = (1.024e+26, 2.4746e7) + ... def __init__(self, mass, radius): + ... self.mass = mass # in kilograms + ... self.radius = radius # in meters + ... @property + ... def surface_gravity(self): + ... # universal gravitational constant (m3 kg-1 s-2) + ... G = 6.67300E-11 + ... return G * self.mass / (self.radius * self.radius) + ... + >>> Planet.EARTH.value + (5.976e+24, 6378140.0) + >>> Planet.EARTH.surface_gravity + 9.802652743337129 + +.. _enum-time-period: + +TimePeriod +^^^^^^^^^^ + +An example to show the :attr:`_ignore_` attribute in use:: + + >>> from datetime import timedelta + >>> class Period(timedelta, Enum): + ... "different lengths of time" + ... _ignore_ = 'Period i' + ... Period = vars() + ... for i in range(367): + ... Period['day_%d' % i] = i + ... + >>> list(Period)[:2] + [Period.day_0, Period.day_1] + >>> list(Period)[-2:] + [Period.day_365, Period.day_366] + + +Conforming input to Flag +^^^^^^^^^^^^^^^^^^^^^^^^ + +Creating a :class:`Flag` enum that is more resilient out-of-bounds results to +mathematical operations, you can use the :attr:`FlagBoundary.CONFORM` setting:: + + >>> from enum import Flag, CONFORM, auto + >>> class Weekday(Flag, boundary=CONFORM): + ... MONDAY = auto() + ... TUESDAY = auto() + ... WEDNESDAY = auto() + ... THURSDAY = auto() + ... FRIDAY = auto() + ... SATURDAY = auto() + ... SUNDAY = auto() + >>> today = Weekday.TUESDAY + >>> Weekday(today + 22) # what day is three weeks from tomorrow? + >>> Weekday.WEDNESDAY + + +.. _enumtype-examples: + +Subclassing EnumType +-------------------- + +While most enum needs can be met by customizing :class:`Enum` subclasses, +either with class decorators or custom functions, :class:`EnumType` can be +subclassed to provide a different Enum experience. + diff --git a/Doc/howto/index.rst b/Doc/howto/index.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2hvd3RvL2luZGV4LnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2hvd3RvL2luZGV4LnJzdA== 100644 --- a/Doc/howto/index.rst +++ b/Doc/howto/index.rst @@ -17,6 +17,7 @@ cporting.rst curses.rst descriptor.rst + enum.rst functional.rst logging.rst logging-cookbook.rst diff --git a/Doc/howto/instrumentation.rst b/Doc/howto/instrumentation.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2hvd3RvL2luc3RydW1lbnRhdGlvbi5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2hvd3RvL2luc3RydW1lbnRhdGlvbi5yc3Q= 100644 --- a/Doc/howto/instrumentation.rst +++ b/Doc/howto/instrumentation.rst @@ -46,7 +46,8 @@ $ sudo apt-get install systemtap-sdt-dev -CPython must then be configured ``--with-dtrace``: +CPython must then be :option:`configured with the --with-dtrace option +<--with-dtrace>`: .. code-block:: none @@ -77,7 +78,8 @@ $ readelf -S ./python | grep .note.stapsdt [30] .note.stapsdt NOTE 0000000000000000 00308d78 -If you've built Python as a shared library (with --enable-shared), you +If you've built Python as a shared library +(with the :option:`--enable-shared` configure option), you need to look instead within the shared library. For example:: $ readelf -S libpython3.3dm.so.1.0 | grep .note.stapsdt @@ -252,7 +254,7 @@ and the remainder indicates the call/return hierarchy as the script executes. -For a `--enable-shared` build of CPython, the markers are contained within the +For a :option:`--enable-shared` build of CPython, the markers are contained within the libpython shared library, and the probe's dotted path needs to reflect this. For example, this line from the above example: @@ -266,7 +268,7 @@ probe process("python").library("libpython3.6dm.so.1.0").mark("function__entry") { -(assuming a debug build of CPython 3.6) +(assuming a :ref:`debug build <debug-build>` of CPython 3.6) Available static markers diff --git a/Doc/howto/logging.rst b/Doc/howto/logging.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2hvd3RvL2xvZ2dpbmcucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2hvd3RvL2xvZ2dpbmcucnN0 100644 --- a/Doc/howto/logging.rst +++ b/Doc/howto/logging.rst @@ -684,7 +684,6 @@ [formatter_simpleFormatter] format=%(asctime)s - %(name)s - %(levelname)s - %(message)s - datefmt= The output is nearly identical to that of the non-config-file-based example: diff --git a/Doc/library/array.rst b/Doc/library/array.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvYXJyYXkucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvYXJyYXkucnN0 100644 --- a/Doc/library/array.rst +++ b/Doc/library/array.rst @@ -178,6 +178,6 @@ array of some other type. -.. method:: array.index(x) +.. method:: array.index(x[, start[, stop]]) Return the smallest *i* such that *i* is the index of the first occurrence of @@ -182,4 +182,6 @@ Return the smallest *i* such that *i* is the index of the first occurrence of - *x* in the array. + *x* in the array. The optional arguments *start* and *stop* can be + specified to search for *x* within a subsection of the array. Raise + :exc:`ValueError` if *x* is not found. @@ -185,4 +187,6 @@ + .. versionchanged:: 3.10 + Added optional *start* and *stop* parameters. .. method:: array.insert(i, x) diff --git a/Doc/library/bz2.rst b/Doc/library/bz2.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvYnoyLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvYnoyLnJzdA== 100644 --- a/Doc/library/bz2.rst +++ b/Doc/library/bz2.rst @@ -25,8 +25,6 @@ * The :func:`compress` and :func:`decompress` functions for one-shot (de)compression. -All of the classes in this module may safely be accessed from multiple threads. - (De)compression of files ------------------------ @@ -140,6 +138,11 @@ The *compresslevel* parameter became keyword-only. + .. versionchanged:: 3.10 + This class is thread unsafe in the face of multiple simultaneous + readers or writers, just like its equivalent classes in :mod:`gzip` and + :mod:`lzma` have always been. + Incremental (de)compression --------------------------- diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvY29kZWNzLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvY29kZWNzLnJzdA== 100644 --- a/Doc/library/codecs.rst +++ b/Doc/library/codecs.rst @@ -1417,6 +1417,9 @@ Internationalized Domain Names (IDN)). It builds upon the ``punycode`` encoding and :mod:`stringprep`. +If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the +third-party `idna module <https://pypi.org/project/idna/>_`. + These RFCs together define a protocol to support non-ASCII characters in domain names. A domain name containing non-ASCII characters (such as ``www.Alliancefrançaise.nu``) is converted into an ASCII-compatible encoding diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvY3R5cGVzLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvY3R5cGVzLnJzdA== 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -919,5 +919,5 @@ other, and finally follow the pointer chain a few times:: >>> c1 = cell() - >>> c1.name = "foo" + >>> c1.name = b"foo" >>> c2 = cell() @@ -923,5 +923,5 @@ >>> c2 = cell() - >>> c2.name = "bar" + >>> c2.name = b"bar" >>> c1.next = pointer(c2) >>> c2.next = pointer(c1) >>> p = c1 diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvY3Vyc2VzLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvY3Vyc2VzLnJzdA== 100644 --- a/Doc/library/curses.rst +++ b/Doc/library/curses.rst @@ -915,6 +915,9 @@ determining what subset of the screen windows enclose the location of a mouse event. + .. versionchanged:: 3.10 + Previously it returned ``1`` or ``0`` instead of ``True`` or ``False``. + .. attribute:: window.encoding diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvZGF0YWNsYXNzZXMucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvZGF0YWNsYXNzZXMucnN0 100644 --- a/Doc/library/dataclasses.rst +++ b/Doc/library/dataclasses.rst @@ -46,7 +46,7 @@ Module-level decorators, classes, and functions ----------------------------------------------- -.. decorator:: dataclass(*, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False) +.. decorator:: dataclass(*, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True) This function is a :term:`decorator` that is used to add generated :term:`special method`\s to classes, as described below. @@ -79,7 +79,7 @@ class C: ... - @dataclass(init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False) + @dataclass(init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True) class C: ... @@ -161,6 +161,14 @@ :meth:`__setattr__` or :meth:`__delattr__` is defined in the class, then :exc:`TypeError` is raised. See the discussion below. + - ``match_args``: If true (the default is ``True``), the + ``__match_args__`` tuple will be created from the list of + parameters to the generated :meth:`__init__` method (even if + :meth:`__init__` is not generated, see above). If false, or if + ``__match_args__`` is already defined in the class, then + ``__match_args__`` will not be generated. + + ``field``\s may optionally specify a default value, using normal Python syntax:: @@ -325,7 +333,7 @@ Raises :exc:`TypeError` if ``instance`` is not a dataclass instance. -.. function:: make_dataclass(cls_name, fields, *, bases=(), namespace=None, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False) +.. function:: make_dataclass(cls_name, fields, *, bases=(), namespace=None, init=True, repr=True, eq=True, order=False, unsafe_hash=False, frozen=False, match_args=True) Creates a new dataclass with name ``cls_name``, fields as defined in ``fields``, base classes as given in ``bases``, and initialized @@ -333,8 +341,9 @@ iterable whose elements are each either ``name``, ``(name, type)``, or ``(name, type, Field)``. If just ``name`` is supplied, ``typing.Any`` is used for ``type``. The values of ``init``, - ``repr``, ``eq``, ``order``, ``unsafe_hash``, and ``frozen`` have - the same meaning as they do in :func:`dataclass`. + ``repr``, ``eq``, ``order``, ``unsafe_hash``, ``frozen``, and + ``match_args`` have the same meaning as they do in + :func:`dataclass`. This function is not strictly required, because any Python mechanism for creating a new class with ``__annotations__`` can diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvZGVjaW1hbC5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvZGVjaW1hbC5yc3Q= 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -1484,7 +1484,8 @@ .. data:: HAVE_CONTEXTVAR - The default value is ``True``. If Python is compiled ``--without-decimal-contextvar``, + The default value is ``True``. If Python is :option:`configured using + the --without-decimal-contextvar option <--without-decimal-contextvar>`, the C version uses a thread-local rather than a coroutine-local context and the value is ``False``. This is slightly faster in some nested context scenarios. diff --git a/Doc/library/devmode.rst b/Doc/library/devmode.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvZGV2bW9kZS5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvZGV2bW9kZS5yc3Q= 100644 --- a/Doc/library/devmode.rst +++ b/Doc/library/devmode.rst @@ -13,6 +13,8 @@ It can be enabled using the :option:`-X dev <-X>` command line option or by setting the :envvar:`PYTHONDEVMODE` environment variable to ``1``. +See also :ref:`Python debug build <debug-build>`. + Effects of the Python Development Mode ====================================== diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvZGlzLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvZGlzLnJzdA== 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1247,6 +1247,14 @@ .. versionadded:: 3.10 +.. opcode:: GEN_START (kind) + + Pops TOS. If TOS was not ``None``, raises an exception. The ``kind`` + operand corresponds to the type of generator or coroutine and determines + the error message. The legal kinds are 0 for generator, 1 for coroutine, + and 2 for async generator. + + .. versionadded:: 3.10 .. opcode:: HAVE_ARGUMENT diff --git a/Doc/library/enum.rst b/Doc/library/enum.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvZW51bS5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvZW51bS5yc3Q= 100644 --- a/Doc/library/enum.rst +++ b/Doc/library/enum.rst @@ -13,5 +13,14 @@ **Source code:** :source:`Lib/enum.py` +.. sidebar:: Important + + This page contains the API reference information. For tutorial + information and discussion of more advanced topics, see + + * :ref:`Basic Tutorial <enum-basic-tutorial>` + * :ref:`Advanced Tutorial <enum-advanced-tutorial>` + * :ref:`Enum Cookbook <enum-cookbook>` + ---------------- @@ -16,6 +25,14 @@ ---------------- -An enumeration is a set of symbolic names (members) bound to unique, -constant values. Within an enumeration, the members can be compared -by identity, and the enumeration itself can be iterated over. +An enumeration: + +* is a set of symbolic names (members) bound to unique values +* can be iterated over to return its members in definition order +* uses :meth:`call` syntax to return members by value +* uses :meth:`index` syntax to return members by name + +Enumerations are created either by using the :keyword:`class` syntax, or by +using function-call syntax:: + + >>> from enum import Enum @@ -21,3 +38,10 @@ -.. note:: Case of Enum Members + >>> # class syntax + >>> class Color(Enum): + ... RED = 1 + ... GREEN = 2 + ... BLUE = 3 + + >>> # functional syntax + >>> Color = Enum('Color', ['RED', 'GREEN', 'BLUE']) @@ -23,9 +47,18 @@ - Because Enums are used to represent constants we recommend using - UPPER_CASE names for enum members, and will be using that style - in our examples. +Even though we can use the :keyword:`class` syntax to create Enums, Enums +are not normal Python classes. See +:ref:`How are Enums different? <enum-class-differences>` for more details. + +.. note:: Nomenclature + + - The class :class:`Color` is an *enumeration* (or *enum*) + - The attributes :attr:`Color.RED`, :attr:`Color.GREEN`, etc., are + *enumeration members* (or *enum members*) and are functionally constants. + - The enum members have *names* and *values* (the name of + :attr:`Color.RED` is ``RED``, the value of :attr:`Color.BLUE` is + ``3``, etc.) Module Contents --------------- @@ -27,10 +60,9 @@ Module Contents --------------- -This module defines four enumeration classes that can be used to define unique -sets of names and values: :class:`Enum`, :class:`IntEnum`, :class:`Flag`, and -:class:`IntFlag`. It also defines one decorator, :func:`unique`, and one -helper, :class:`auto`. + :class:`EnumType` + + The ``type`` for Enum and its subclasses. @@ -36,3 +68,3 @@ -.. class:: Enum + :class:`Enum` @@ -38,4 +70,5 @@ - Base class for creating enumerated constants. See section - `Functional API`_ for an alternate construction syntax. + Base class for creating enumerated constants. + + :class:`IntEnum` @@ -41,3 +74,4 @@ -.. class:: IntEnum + Base class for creating enumerated constants that are also + subclasses of :class:`int`. @@ -43,4 +77,3 @@ - Base class for creating enumerated constants that are also - subclasses of :class:`int`. + :class:`StrEnum` @@ -46,3 +79,6 @@ -.. class:: StrEnum + Base class for creating enumerated constants that are also + subclasses of :class:`str`. + + :class:`Flag` @@ -48,4 +84,6 @@ - Base class for creating enumerated constants that are also - subclasses of :class:`str`. + Base class for creating enumerated constants that can be combined using + the bitwise operations without losing their :class:`Flag` membership. + + :class:`IntFlag` @@ -51,3 +89,7 @@ -.. class:: IntFlag + Base class for creating enumerated constants that can be combined using + the bitwise operators without losing their :class:`IntFlag` membership. + :class:`IntFlag` members are also subclasses of :class:`int`. + + :class:`FlagBoundary` @@ -53,5 +95,5 @@ - Base class for creating enumerated constants that can be combined using - the bitwise operators without losing their :class:`IntFlag` membership. - :class:`IntFlag` members are also subclasses of :class:`int`. + An enumeration with the values ``STRICT``, ``CONFORM``, ``EJECT``, and + ``KEEP`` which allows for more fine-grained control over how invalid values + are dealt with in an enumeration. @@ -57,6 +99,3 @@ -.. class:: Flag - - Base class for creating enumerated constants that can be combined using - the bitwise operations without losing their :class:`Flag` membership. + :class:`auto` @@ -62,4 +101,5 @@ -.. function:: unique - :noindex: + Instances are replaced with an appropriate value for Enum members. + :class:`StrEnum` defaults to the lower-cased version of the member name, + while other Enums default to 1 and increase from there. @@ -65,3 +105,6 @@ - Enum class decorator that ensures only one name is bound to any one value. + :func:`global_enum` + + :class:`Enum` class decorator to apply the appropriate global `__repr__`, + and export its members into the global name space. @@ -67,3 +110,6 @@ -.. class:: auto + :func:`property` + + Allows :class:`Enum` members to have attributes without conflicting with + other members' names. @@ -69,8 +115,9 @@ - Instances are replaced with an appropriate value for Enum members. - :class:`StrEnum` defaults to the lower-cased version of the member name, - while other Enums default to 1 and increase from there. + :func:`unique` + + Enum class decorator that ensures only one name is bound to any one value. + .. versionadded:: 3.6 ``Flag``, ``IntFlag``, ``auto`` .. versionadded:: 3.10 ``StrEnum`` @@ -73,7 +120,5 @@ .. versionadded:: 3.6 ``Flag``, ``IntFlag``, ``auto`` .. versionadded:: 3.10 ``StrEnum`` -Creating an Enum ----------------- @@ -79,6 +124,7 @@ -Enumerations are created using the :keyword:`class` syntax, which makes them -easy to read and write. An alternative creation method is described in -`Functional API`_. To define an enumeration, subclass :class:`Enum` as -follows:: +Data Types +---------- + + +.. class:: EnumType @@ -84,8 +130,5 @@ - >>> from enum import Enum - >>> class Color(Enum): - ... RED = 1 - ... GREEN = 2 - ... BLUE = 3 - ... + *EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible + to subclass *EnumType* -- see :ref:`Subclassing EnumType <enumtype-examples>` + for details. @@ -91,3 +134,5 @@ -.. note:: Enum member values + .. method:: EnumType.__contains__(cls, member) + + Returns ``True`` if member belongs to the ``cls``:: @@ -93,6 +138,5 @@ - Member values can be anything: :class:`int`, :class:`str`, etc.. If - the exact value is unimportant you may use :class:`auto` instances and an - appropriate value will be chosen for you. Care must be taken if you mix - :class:`auto` with other values. + >>> some_var = Color.RED + >>> some_var in Color + True @@ -98,3 +142,3 @@ -.. note:: Nomenclature + .. method:: EnumType.__dir__(cls) @@ -100,8 +144,4 @@ - - The class :class:`Color` is an *enumeration* (or *enum*) - - The attributes :attr:`Color.RED`, :attr:`Color.GREEN`, etc., are - *enumeration members* (or *enum members*) and are functionally constants. - - The enum members have *names* and *values* (the name of - :attr:`Color.RED` is ``RED``, the value of :attr:`Color.BLUE` is - ``3``, etc.) + Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the + names of the members in *cls*:: @@ -107,3 +147,4 @@ -.. note:: + >>> dir(Color) + ['BLUE', 'GREEN', 'RED', '__class__', '__doc__', '__members__', '__module__'] @@ -109,5 +150,3 @@ - Even though we use the :keyword:`class` syntax to create Enums, Enums - are not normal Python classes. See `How are Enums different?`_ for - more details. + .. method:: EnumType.__getattr__(cls, name) @@ -113,3 +152,3 @@ -Enumeration members have human readable string representations:: + Returns the Enum member in *cls* matching *name*, or raises an :exc:`AttributeError`:: @@ -115,6 +154,4 @@ - >>> print(Color.RED) - Color.RED - -...while their ``repr`` has more information:: + >>> Color.GREEN + Color.GREEN @@ -120,4 +157,3 @@ - >>> print(repr(Color.RED)) - <Color.RED: 1> + .. method:: EnumType.__getitem__(cls, name) @@ -123,3 +159,3 @@ -The *type* of an enumeration member is the enumeration it belongs to:: + Returns the Enum member in *cls* matching *name*, or raises an :exc:`KeyError`:: @@ -125,6 +161,4 @@ - >>> type(Color.RED) - <enum 'Color'> - >>> isinstance(Color.GREEN, Color) - True + >>> Color['BLUE'] + Color.BLUE @@ -130,3 +164,3 @@ -Enum members also have a property that contains just their item name:: + .. method:: EnumType.__iter__(cls) @@ -132,6 +166,3 @@ - >>> print(Color.RED.name) - RED - -Enumerations support iteration, in definition order:: + Returns each member in *cls* in definition order:: @@ -137,15 +168,8 @@ - >>> class Shake(Enum): - ... VANILLA = 7 - ... CHOCOLATE = 4 - ... COOKIES = 9 - ... MINT = 3 - ... - >>> for shake in Shake: - ... print(shake) - ... - Shake.VANILLA - Shake.CHOCOLATE - Shake.COOKIES - Shake.MINT + >>> list(Color) + [Color.RED, Color.GREEN, Color.BLUE] + + .. method:: EnumType.__len__(cls) + + Returns the number of member in *cls*:: @@ -151,3 +175,6 @@ -Enumeration members are hashable, so they can be used in dictionaries and sets:: + >>> len(Color) + 3 + + .. method:: EnumType.__reversed__(cls) @@ -153,8 +180,7 @@ - >>> apples = {} - >>> apples[Color.RED] = 'red delicious' - >>> apples[Color.GREEN] = 'granny smith' - >>> apples == {Color.RED: 'red delicious', Color.GREEN: 'granny smith'} - True + Returns each member in *cls* in reverse definition order:: + + >>> list(reversed(Color)) + [Color.BLUE, Color.GREEN, Color.RED] @@ -159,5 +185,4 @@ -Programmatic access to enumeration members and their attributes ---------------------------------------------------------------- +.. class:: Enum @@ -163,5 +188,5 @@ -Sometimes it's useful to access members in enumerations programmatically (i.e. -situations where ``Color.RED`` won't do because the exact color is not known -at program-writing time). ``Enum`` allows such access:: + *Enum* is the base class for all *enum* enumerations. + + .. attribute:: Enum.name @@ -167,6 +192,3 @@ - >>> Color(1) - <Color.RED: 1> - >>> Color(3) - <Color.BLUE: 3> + The name used to define the ``Enum`` member:: @@ -172,3 +194,6 @@ -If you want to access enum members by *name*, use item access:: + >>> Color.BLUE.name + 'BLUE' + + .. attribute:: Enum.value @@ -174,6 +199,3 @@ - >>> Color['RED'] - <Color.RED: 1> - >>> Color['GREEN'] - <Color.GREEN: 2> + The value given to the ``Enum`` member:: @@ -179,3 +201,6 @@ -If you have an enum member and need its :attr:`name` or :attr:`value`:: + >>> Color.RED.value + 1 + + .. note:: Enum member values @@ -181,7 +206,6 @@ - >>> member = Color.RED - >>> member.name - 'RED' - >>> member.value - 1 + Member values can be anything: :class:`int`, :class:`str`, etc.. If + the exact value is unimportant you may use :class:`auto` instances and an + appropriate value will be chosen for you. Care must be taken if you mix + :class:`auto` with other values. @@ -187,2 +211,3 @@ + .. attribute:: Enum._ignore_ @@ -188,4 +213,4 @@ -Duplicating enum members and values ------------------------------------ + ``_ignore_`` is only used during creation and is removed from the + enumeration once that is complete. @@ -191,3 +216,5 @@ -Having two enum members with the same name is invalid:: + ``_ignore_`` is a list of names that will not become members, and whose + names will also be removed from the completed enumeration. See + :ref:`TimePeriod <enum-time-period>` for an example. @@ -193,9 +220,10 @@ - >>> class Shape(Enum): - ... SQUARE = 2 - ... SQUARE = 3 - ... - Traceback (most recent call last): - ... - TypeError: 'SQUARE' already defined as: 2 + .. method:: Enum.__call__(cls, value, names=None, \*, module=None, qualname=None, type=None, start=1, boundary=None) + + This method is called in two different ways: + + * to look up an existing member: + + :cls: The enum class being called. + :value: The value to lookup. @@ -201,6 +229,3 @@ -However, two enum members are allowed to have the same value. Given two members -A and B with the same value (and A defined first), B is an alias to A. By-value -lookup of the value of A and B will return A. By-name lookup of B will also -return A:: + * to use the ``cls`` enum to create a new enum: @@ -206,14 +231,10 @@ - >>> class Shape(Enum): - ... SQUARE = 2 - ... DIAMOND = 1 - ... CIRCLE = 3 - ... ALIAS_FOR_SQUARE = 2 - ... - >>> Shape.SQUARE - <Shape.SQUARE: 2> - >>> Shape.ALIAS_FOR_SQUARE - <Shape.SQUARE: 2> - >>> Shape(2) - <Shape.SQUARE: 2> + :cls: The enum class being called. + :value: The name of the new Enum to create. + :names: The names/values of the members for the new Enum. + :module: The name of the module the new Enum is created in. + :qualname: The actual location in the module where this Enum can be found. + :type: A mix-in type for the new Enum. + :start: The first integer value for the Enum (used by :class:`auto`) + :boundary: How to handle out-of-range values from bit operations (:class:`Flag` only) @@ -219,3 +240,6 @@ -.. note:: + .. method:: Enum.__dir__(self) + + Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and + any public methods defined on *self.__class__*:: @@ -221,6 +245,16 @@ - Attempting to create a member with the same name as an already - defined attribute (another member, a method, etc.) or attempting to create - an attribute with the same name as a member is not allowed. - + >>> from datetime import date + >>> class Weekday(Enum): + ... MONDAY = 1 + ... TUESDAY = 2 + ... WEDNESDAY = 3 + ... THURSDAY = 4 + ... FRIDAY = 5 + ... SATURDAY = 6 + ... SUNDAY = 7 + ... @classmethod + ... def today(cls): + ... print('today is %s' % cls(date.today.isoweekday).naem) + >>> dir(Weekday.SATURDAY) + ['__class__', '__doc__', '__module__', 'name', 'today', 'value'] @@ -226,10 +260,3 @@ -Ensuring unique enumeration values ----------------------------------- - -By default, enumerations allow multiple names as aliases for the same value. -When this behavior isn't desired, the following decorator can be used to -ensure each value is used only once in the enumeration: - -.. decorator:: unique + .. method:: Enum._generate_next_value_(name, start, count, last_values) @@ -235,5 +262,9 @@ -A :keyword:`class` decorator specifically for enumerations. It searches an -enumeration's :attr:`__members__` gathering any aliases it finds; if any are -found :exc:`ValueError` is raised with the details:: + :name: The name of the member being defined (e.g. 'RED'). + :start: The start value for the Enum; the default is 1. + :count: The number of members currently defined, not including this one. + :last_values: A list of the previous values. + + A *staticmethod* that is used to determine the next value returned by + :class:`auto`:: @@ -239,13 +270,11 @@ - >>> from enum import Enum, unique - >>> @unique - ... class Mistake(Enum): - ... ONE = 1 - ... TWO = 2 - ... THREE = 3 - ... FOUR = 3 - ... - Traceback (most recent call last): - ... - ValueError: duplicate values found in <enum 'Mistake'>: FOUR -> THREE + >>> from enum import auto + >>> class PowersOfThree(Enum): + ... @staticmethod + ... def _generate_next_value_(name, start, count, last_values): + ... return (count + 1) * 3 + ... FIRST = auto() + ... SECOND = auto() + >>> PowersOfThree.SECOND.value + 6 @@ -251,2 +280,6 @@ + .. method:: Enum._missing_(cls, value) + + A *classmethod* for looking up values not found in *cls*. By default it + does nothing, but can be overridden to implement custom search behavior:: @@ -252,6 +285,17 @@ -Using automatic values ----------------------- - -If the exact value is unimportant you can use :class:`auto`:: + >>> from enum import StrEnum + >>> class Build(StrEnum): + ... DEBUG = auto() + ... OPTIMIZED = auto() + ... @classmethod + ... def _missing_(cls, value): + ... value = value.lower() + ... for member in cls: + ... if member.value == value: + ... return member + ... return None + >>> Build.DEBUG.value + 'debug' + >>> Build('deBUG') + Build.DEBUG @@ -257,10 +301,3 @@ - >>> from enum import Enum, auto - >>> class Color(Enum): - ... RED = auto() - ... BLUE = auto() - ... GREEN = auto() - ... - >>> list(Color) - [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>] + .. method:: Enum.__repr__(self) @@ -266,4 +303,4 @@ -The values are chosen by :func:`_generate_next_value_`, which can be -overridden:: + Returns the string used for *repr()* calls. By default, returns the + *Enum* name and the member name, but can be overridden:: @@ -269,14 +306,13 @@ - >>> class AutoName(Enum): - ... def _generate_next_value_(name, start, count, last_values): - ... return name - ... - >>> class Ordinal(AutoName): - ... NORTH = auto() - ... SOUTH = auto() - ... EAST = auto() - ... WEST = auto() - ... - >>> list(Ordinal) - [<Ordinal.NORTH: 'NORTH'>, <Ordinal.SOUTH: 'SOUTH'>, <Ordinal.EAST: 'EAST'>, <Ordinal.WEST: 'WEST'>] + >>> class OldStyle(Enum): + ... RETRO = auto() + ... OLD_SCHOOl = auto() + ... YESTERYEAR = auto() + ... def __repr__(self): + ... cls_name = self.__class__.__name__ + ... return f'<{cls_name}.{self.name}: {self.value}>' + >>> OldStyle.RETRO + <OldStyle.RETRO: 1> + + .. method:: Enum.__str__(self) @@ -282,3 +318,4 @@ -.. note:: + Returns the string used for *str()* calls. By default, returns the + member name, but can be overridden:: @@ -284,7 +321,13 @@ - The goal of the default :meth:`_generate_next_value_` method is to provide - the next :class:`int` in sequence with the last :class:`int` provided, but - the way it does this is an implementation detail and may change. + >>> class OldStyle(Enum): + ... RETRO = auto() + ... OLD_SCHOOl = auto() + ... YESTERYEAR = auto() + ... def __str__(self): + ... cls_name = self.__class__.__name__ + ... return f'{cls_name}.{self.name}' + >>> OldStyle.RETRO + OldStyle.RETRO .. note:: @@ -288,179 +331,7 @@ .. note:: - The :meth:`_generate_next_value_` method must be defined before any members. - -Iteration ---------- - -Iterating over the members of an enum does not provide the aliases:: - - >>> list(Shape) - [<Shape.SQUARE: 2>, <Shape.DIAMOND: 1>, <Shape.CIRCLE: 3>] - -The special attribute ``__members__`` is a read-only ordered mapping of names -to members. It includes all names defined in the enumeration, including the -aliases:: - - >>> for name, member in Shape.__members__.items(): - ... name, member - ... - ('SQUARE', <Shape.SQUARE: 2>) - ('DIAMOND', <Shape.DIAMOND: 1>) - ('CIRCLE', <Shape.CIRCLE: 3>) - ('ALIAS_FOR_SQUARE', <Shape.SQUARE: 2>) - -The ``__members__`` attribute can be used for detailed programmatic access to -the enumeration members. For example, finding all the aliases:: - - >>> [name for name, member in Shape.__members__.items() if member.name != name] - ['ALIAS_FOR_SQUARE'] - - -Comparisons ------------ - -Enumeration members are compared by identity:: - - >>> Color.RED is Color.RED - True - >>> Color.RED is Color.BLUE - False - >>> Color.RED is not Color.BLUE - True - -Ordered comparisons between enumeration values are *not* supported. Enum -members are not integers (but see `IntEnum`_ below):: - - >>> Color.RED < Color.BLUE - Traceback (most recent call last): - File "<stdin>", line 1, in <module> - TypeError: '<' not supported between instances of 'Color' and 'Color' - -Equality comparisons are defined though:: - - >>> Color.BLUE == Color.RED - False - >>> Color.BLUE != Color.RED - True - >>> Color.BLUE == Color.BLUE - True - -Comparisons against non-enumeration values will always compare not equal -(again, :class:`IntEnum` was explicitly designed to behave differently, see -below):: - - >>> Color.BLUE == 2 - False - - -Allowed members and attributes of enumerations ----------------------------------------------- - -The examples above use integers for enumeration values. Using integers is -short and handy (and provided by default by the `Functional API`_), but not -strictly enforced. In the vast majority of use-cases, one doesn't care what -the actual value of an enumeration is. But if the value *is* important, -enumerations can have arbitrary values. - -Enumerations are Python classes, and can have methods and special methods as -usual. If we have this enumeration:: - - >>> class Mood(Enum): - ... FUNKY = 1 - ... HAPPY = 3 - ... - ... def describe(self): - ... # self is the member here - ... return self.name, self.value - ... - ... def __str__(self): - ... return 'my custom str! {0}'.format(self.value) - ... - ... @classmethod - ... def favorite_mood(cls): - ... # cls here is the enumeration - ... return cls.HAPPY - ... - -Then:: - - >>> Mood.favorite_mood() - <Mood.HAPPY: 3> - >>> Mood.HAPPY.describe() - ('HAPPY', 3) - >>> str(Mood.FUNKY) - 'my custom str! 1' - -The rules for what is allowed are as follows: names that start and end with -a single underscore are reserved by enum and cannot be used; all other -attributes defined within an enumeration will become members of this -enumeration, with the exception of special methods (:meth:`__str__`, -:meth:`__add__`, etc.), descriptors (methods are also descriptors), and -variable names listed in :attr:`_ignore_`. - -Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__` then -any value(s) given to the enum member will be passed into those methods. -See `Planet`_ for an example. - - -Restricted Enum subclassing ---------------------------- - -A new :class:`Enum` class must have one base Enum class, up to one concrete -data type, and as many :class:`object`-based mixin classes as needed. The -order of these base classes is:: - - class EnumName([mix-in, ...,] [data-type,] base-enum): - pass - -Also, subclassing an enumeration is allowed only if the enumeration does not define -any members. So this is forbidden:: - - >>> class MoreColor(Color): - ... PINK = 17 - ... - Traceback (most recent call last): - ... - TypeError: MoreColor: cannot extend enumeration 'Color' - -But this is allowed:: - - >>> class Foo(Enum): - ... def some_behavior(self): - ... pass - ... - >>> class Bar(Foo): - ... HAPPY = 1 - ... SAD = 2 - ... - -Allowing subclassing of enums that define members would lead to a violation of -some important invariants of types and instances. On the other hand, it makes -sense to allow sharing some common behavior between a group of enumerations. -(See `OrderedEnum`_ for an example.) - - -Pickling --------- - -Enumerations can be pickled and unpickled:: - - >>> from test.test_enum import Fruit - >>> from pickle import dumps, loads - >>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO)) - True - -The usual restrictions for pickling apply: picklable enums must be defined in -the top level of a module, since unpickling requires them to be importable -from that module. - -.. note:: - - With pickle protocol version 4 it is possible to easily pickle enums - nested in other classes. - -It is possible to modify how Enum members are pickled/unpickled by defining -:meth:`__reduce_ex__` in the enumeration class. + Using :class:`auto` with :class:`Enum` results in integers of increasing value, + starting with ``1``. @@ -465,63 +336,4 @@ -Functional API --------------- - -The :class:`Enum` class is callable, providing the following functional API:: - - >>> Animal = Enum('Animal', 'ANT BEE CAT DOG') - >>> Animal - <enum 'Animal'> - >>> Animal.ANT - <Animal.ANT: 1> - >>> Animal.ANT.value - 1 - >>> list(Animal) - [<Animal.ANT: 1>, <Animal.BEE: 2>, <Animal.CAT: 3>, <Animal.DOG: 4>] - -The semantics of this API resemble :class:`~collections.namedtuple`. The first -argument of the call to :class:`Enum` is the name of the enumeration. - -The second argument is the *source* of enumeration member names. It can be a -whitespace-separated string of names, a sequence of names, a sequence of -2-tuples with key/value pairs, or a mapping (e.g. dictionary) of names to -values. The last two options enable assigning arbitrary values to -enumerations; the others auto-assign increasing integers starting with 1 (use -the ``start`` parameter to specify a different starting value). A -new class derived from :class:`Enum` is returned. In other words, the above -assignment to :class:`Animal` is equivalent to:: - - >>> class Animal(Enum): - ... ANT = 1 - ... BEE = 2 - ... CAT = 3 - ... DOG = 4 - ... - -The reason for defaulting to ``1`` as the starting number and not ``0`` is -that ``0`` is ``False`` in a boolean sense, but enum members all evaluate -to ``True``. - -Pickling enums created with the functional API can be tricky as frame stack -implementation details are used to try and figure out which module the -enumeration is being created in (e.g. it will fail if you use a utility -function in separate module, and also may not work on IronPython or Jython). -The solution is to specify the module name explicitly as follows:: - - >>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__) - -.. warning:: - - If ``module`` is not supplied, and Enum cannot determine what it is, - the new Enum members will not be unpicklable; to keep errors closer to - the source, pickling will be disabled. - -The new pickle protocol 4 also, in some circumstances, relies on -:attr:`~definition.__qualname__` being set to the location where pickle will be able -to find the class. For example, if the class was made available in class -SomeData in the global scope:: - - >>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal') - -The complete signature is:: +.. class:: IntEnum @@ -527,63 +339,5 @@ - Enum(value='NewEnumName', names=<...>, *, module='...', qualname='...', type=<mixed-in class>, start=1) - -:value: What the new Enum class will record as its name. - -:names: The Enum members. This can be a whitespace or comma separated string - (values will start at 1 unless otherwise specified):: - - 'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE' - - or an iterator of names:: - - ['RED', 'GREEN', 'BLUE'] - - or an iterator of (name, value) pairs:: - - [('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)] - - or a mapping:: - - {'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42} - -:module: name of module where new Enum class can be found. - -:qualname: where in module new Enum class can be found. - -:type: type to mix in to new Enum class. - -:start: number to start counting at if only names are passed in. - -.. versionchanged:: 3.5 - The *start* parameter was added. - - -Derived Enumerations --------------------- - -IntEnum -^^^^^^^ - -The first variation of :class:`Enum` that is provided is also a subclass of -:class:`int`. Members of an :class:`IntEnum` can be compared to integers; -by extension, integer enumerations of different types can also be compared -to each other:: - - >>> from enum import IntEnum - >>> class Shape(IntEnum): - ... CIRCLE = 1 - ... SQUARE = 2 - ... - >>> class Request(IntEnum): - ... POST = 1 - ... GET = 2 - ... - >>> Shape == 1 - False - >>> Shape.CIRCLE == 1 - True - >>> Shape.CIRCLE == Request.POST - True - -However, they still can't be compared to standard :class:`Enum` enumerations:: + *IntEnum* is the same as *Enum*, but its members are also integers and can be + used anywhere that an integer can be used. If any integer operation is performed + with an *IntEnum* member, the resulting value loses its enumeration status. @@ -589,126 +343,17 @@ - >>> class Shape(IntEnum): - ... CIRCLE = 1 - ... SQUARE = 2 - ... - >>> class Color(Enum): - ... RED = 1 - ... GREEN = 2 - ... - >>> Shape.CIRCLE == Color.RED - False - -:class:`IntEnum` values behave like integers in other ways you'd expect:: - - >>> int(Shape.CIRCLE) - 1 - >>> ['a', 'b', 'c'][Shape.CIRCLE] - 'b' - >>> [i for i in range(Shape.SQUARE)] - [0, 1] - - -StrEnum -^^^^^^^ - -The second variation of :class:`Enum` that is provided is also a subclass of -:class:`str`. Members of a :class:`StrEnum` can be compared to strings; -by extension, string enumerations of different types can also be compared -to each other. :class:`StrEnum` exists to help avoid the problem of getting -an incorrect member:: - - >>> from enum import StrEnum - >>> class Directions(StrEnum): - ... NORTH = 'north', # notice the trailing comma - ... SOUTH = 'south' - -Before :class:`StrEnum`, ``Directions.NORTH`` would have been the :class:`tuple` -``('north',)``. - -.. note:: - - Unlike other Enum's, ``str(StrEnum.member)`` will return the value of the - member instead of the usual ``"EnumClass.member"``. - -.. versionadded:: 3.10 - - -IntFlag -^^^^^^^ - -The next variation of :class:`Enum` provided, :class:`IntFlag`, is also based -on :class:`int`. The difference being :class:`IntFlag` members can be combined -using the bitwise operators (&, \|, ^, ~) and the result is still an -:class:`IntFlag` member, if possible. However, as the name implies, :class:`IntFlag` -members also subclass :class:`int` and can be used wherever an :class:`int` is -used. - -.. note:: - - Any operation on an :class:`IntFlag` member besides the bit-wise operations will - lose the :class:`IntFlag` membership. - -.. note:: - - Bit-wise operations that result in invalid :class:`IntFlag` values will lose the - :class:`IntFlag` membership. - -.. versionadded:: 3.6 -.. versionchanged:: 3.10 - -Sample :class:`IntFlag` class:: - - >>> from enum import IntFlag - >>> class Perm(IntFlag): - ... R = 4 - ... W = 2 - ... X = 1 - ... - >>> Perm.R | Perm.W - <Perm.R|W: 6> - >>> Perm.R + Perm.W - 6 - >>> RW = Perm.R | Perm.W - >>> Perm.R in RW - True - -It is also possible to name the combinations:: - - >>> class Perm(IntFlag): - ... R = 4 - ... W = 2 - ... X = 1 - ... RWX = 7 - >>> Perm.RWX - <Perm.RWX: 7> - >>> ~Perm.RWX - <Perm: 0> - >>> Perm(7) - <Perm.RWX: 7> - -.. note:: - - Named combinations are considered aliases. Aliases do not show up during - iteration, but can be returned from by-value lookups. - -.. versionchanged:: 3.10 - -Another important difference between :class:`IntFlag` and :class:`Enum` is that -if no flags are set (the value is 0), its boolean evaluation is :data:`False`:: - - >>> Perm.R & Perm.X - <Perm: 0> - >>> bool(Perm.R & Perm.X) - False - -Because :class:`IntFlag` members are also subclasses of :class:`int` they can -be combined with them (but may lose :class:`IntFlag` membership:: - - >>> Perm.X | 4 - <Perm.R|X: 5> - - >>> Perm.X | 8 - 9 + >>> from enum import IntEnum + >>> class Numbers(IntEnum): + ... ONE = 1 + ... TWO = 2 + ... THREE = 3 + >>> Numbers.THREE + Numbers.THREE + >>> Numbers.ONE + Numbers.TWO + 3 + >>> Numbers.THREE + 5 + 8 + >>> Numbers.THREE == 3 + True .. note:: @@ -712,17 +357,7 @@ .. note:: - The negation operator, ``~``, always returns an :class:`IntFlag` member with a - positive value:: - - >>> (~Perm.X).value == (Perm.R|Perm.W).value == 6 - True - -:class:`IntFlag` members can also be iterated over:: - - >>> list(RW) - [<Perm.R: 4>, <Perm.W: 2>] - -.. versionadded:: 3.10 + Using :class:`auto` with :class:`IntEnum` results in integers of increasing value, + starting with ``1``. @@ -727,14 +362,4 @@ -Flag -^^^^ - -The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` -members can be combined using the bitwise operators (&, \|, ^, ~). Unlike -:class:`IntFlag`, they cannot be combined with, nor compared against, any -other :class:`Flag` enumeration, nor :class:`int`. While it is possible to -specify the values directly it is recommended to use :class:`auto` as the -value and let :class:`Flag` select an appropriate value. - -.. versionadded:: 3.6 +.. class:: StrEnum @@ -740,18 +365,5 @@ -Like :class:`IntFlag`, if a combination of :class:`Flag` members results in no -flags being set, the boolean evaluation is :data:`False`:: - - >>> from enum import Flag, auto - >>> class Color(Flag): - ... RED = auto() - ... BLUE = auto() - ... GREEN = auto() - ... - >>> Color.RED & Color.GREEN - <Color: 0> - >>> bool(Color.RED & Color.GREEN) - False - -Individual flags should have values that are powers of two (1, 2, 4, 8, ...), -while combinations of flags won't:: + *StrEnum* is the same as *Enum*, but its members are also strings and can be used + in most of the same places that a string can be used. The result of any string + operation performed on or with a *StrEnum* member is not part of the enumeration. @@ -757,13 +369,6 @@ - >>> class Color(Flag): - ... RED = auto() - ... BLUE = auto() - ... GREEN = auto() - ... WHITE = RED | BLUE | GREEN - ... - >>> Color.WHITE - <Color.WHITE: 7> - -Giving a name to the "no flags set" condition does not change its boolean -value:: + .. note:: There are places in the stdlib that check for an exact :class:`str` + instead of a :class:`str` subclass (i.e. ``type(unknown) == str`` + instead of ``isinstance(str, unknown)``), and in those locations you + will need to use ``str(StrEnum.member)``. @@ -769,22 +374,4 @@ - >>> class Color(Flag): - ... BLACK = 0 - ... RED = auto() - ... BLUE = auto() - ... GREEN = auto() - ... - >>> Color.BLACK - <Color.BLACK: 0> - >>> bool(Color.BLACK) - False - -:class:`Flag` members can also be iterated over:: - - >>> purple = Color.RED | Color.BLUE - >>> list(purple) - [<Color.RED: 1>, <Color.BLUE: 2>] - -.. versionadded:: 3.10 .. note:: @@ -788,87 +375,7 @@ .. note:: - For the majority of new code, :class:`Enum` and :class:`Flag` are strongly - recommended, since :class:`IntEnum` and :class:`IntFlag` break some - semantic promises of an enumeration (by being comparable to integers, and - thus by transitivity to other unrelated enumerations). :class:`IntEnum` - and :class:`IntFlag` should be used only in cases where :class:`Enum` and - :class:`Flag` will not do; for example, when integer constants are replaced - with enumerations, or for interoperability with other systems. - - -Others -^^^^^^ - -While :class:`IntEnum` is part of the :mod:`enum` module, it would be very -simple to implement independently:: - - class IntEnum(int, Enum): - pass - -This demonstrates how similar derived enumerations can be defined; for example -a :class:`StrEnum` that mixes in :class:`str` instead of :class:`int`. - -Some rules: - -1. When subclassing :class:`Enum`, mix-in types must appear before - :class:`Enum` itself in the sequence of bases, as in the :class:`IntEnum` - example above. -2. While :class:`Enum` can have members of any type, once you mix in an - additional type, all the members must have values of that type, e.g. - :class:`int` above. This restriction does not apply to mix-ins which only - add methods and don't specify another type. -3. When another data type is mixed in, the :attr:`value` attribute is *not the - same* as the enum member itself, although it is equivalent and will compare - equal. -4. %-style formatting: `%s` and `%r` call the :class:`Enum` class's - :meth:`__str__` and :meth:`__repr__` respectively; other codes (such as - `%i` or `%h` for IntEnum) treat the enum member as its mixed-in type. -5. :ref:`Formatted string literals <f-strings>`, :meth:`str.format`, - and :func:`format` will use the mixed-in type's :meth:`__format__` - unless :meth:`__str__` or :meth:`__format__` is overridden in the subclass, - in which case the overridden methods or :class:`Enum` methods will be used. - Use the !s and !r format codes to force usage of the :class:`Enum` class's - :meth:`__str__` and :meth:`__repr__` methods. - -When to use :meth:`__new__` vs. :meth:`__init__` ------------------------------------------------- - -:meth:`__new__` must be used whenever you want to customize the actual value of -the :class:`Enum` member. Any other modifications may go in either -:meth:`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred. - -For example, if you want to pass several items to the constructor, but only -want one of them to be the value:: - - >>> class Coordinate(bytes, Enum): - ... """ - ... Coordinate with binary codes that can be indexed by the int code. - ... """ - ... def __new__(cls, value, label, unit): - ... obj = bytes.__new__(cls, [value]) - ... obj._value_ = value - ... obj.label = label - ... obj.unit = unit - ... return obj - ... PX = (0, 'P.X', 'km') - ... PY = (1, 'P.Y', 'km') - ... VX = (2, 'V.X', 'km/s') - ... VY = (3, 'V.Y', 'km/s') - ... - - >>> print(Coordinate['PY']) - Coordinate.PY - - >>> print(Coordinate(3)) - Coordinate.VY - -Interesting examples --------------------- - -While :class:`Enum`, :class:`IntEnum`, :class:`IntFlag`, and :class:`Flag` are -expected to cover the majority of use-cases, they cannot cover them all. Here -are recipes for some different types of enumerations that can be used directly, -or as examples for creating one's own. + Using :class:`auto` with :class:`StrEnum` results in values of the member name, + lower-cased. @@ -873,14 +380,4 @@ -Omitting values -^^^^^^^^^^^^^^^ - -In many use-cases one doesn't care what the actual value of an enumeration -is. There are several ways to define this type of simple enumeration: - -- use instances of :class:`auto` for the value -- use instances of :class:`object` as the value -- use a descriptive string as the value -- use a tuple as the value and a custom :meth:`__new__` to replace the - tuple with an :class:`int` value +.. class:: Flag @@ -886,8 +383,5 @@ -Using any of these methods signifies to the user that these values are not -important, and also enables one to add, remove, or reorder members without -having to renumber the remaining members. - -Whichever method you choose, you should provide a :meth:`repr` that also hides -the (unimportant) value:: + *Flag* members support the bitwise operators ``&`` (*AND*), ``|`` (*OR*), + ``^`` (*XOR*), and ``~`` (*INVERT*); the results of those operators are members + of the enumeration. @@ -893,6 +387,3 @@ - >>> class NoValue(Enum): - ... def __repr__(self): - ... return '<%s.%s>' % (self.__class__.__name__, self.name) - ... + .. method:: __contains__(self, value) @@ -898,5 +389,3 @@ - -Using :class:`auto` -""""""""""""""""""" + Returns *True* if value is in self:: @@ -902,3 +391,17 @@ -Using :class:`auto` would look like:: + >>> from enum import Flag, auto + >>> class Color(Flag): + ... RED = auto() + ... GREEN = auto() + ... BLUE = auto() + >>> purple = Color.RED | Color.BLUE + >>> white = Color.RED | Color.GREEN | Color.BLUE + >>> Color.GREEN in purple + False + >>> Color.GREEN in white + True + >>> purple in white + True + >>> white in purple + False @@ -904,13 +407,3 @@ - >>> class Color(NoValue): - ... RED = auto() - ... BLUE = auto() - ... GREEN = auto() - ... - >>> Color.GREEN - <Color.GREEN> - - -Using :class:`object` -""""""""""""""""""""" + .. method:: __iter__(self): @@ -916,3 +409,10 @@ -Using :class:`object` would look like:: + Returns all contained members:: + + >>> list(Color.RED) + [Color.RED] + >>> list(purple) + [Color.RED, Color.BLUE] + + .. method:: __len__(self): @@ -918,9 +418,3 @@ - >>> class Color(NoValue): - ... RED = object() - ... GREEN = object() - ... BLUE = object() - ... - >>> Color.GREEN - <Color.GREEN> + Returns number of members in flag:: @@ -926,2 +420,6 @@ + >>> len(Color.GREEN) + 1 + >>> len(white) + 3 @@ -927,6 +425,3 @@ -Using a descriptive string -"""""""""""""""""""""""""" - -Using a string as the value would look like:: + .. method:: __bool__(self): @@ -932,11 +427,11 @@ - >>> class Color(NoValue): - ... RED = 'stop' - ... GREEN = 'go' - ... BLUE = 'too fast!' - ... - >>> Color.GREEN - <Color.GREEN> - >>> Color.GREEN.value - 'go' + Returns *True* if any members in flag, *False* otherwise:: + + >>> bool(Color.GREEN) + True + >>> bool(white) + True + >>> black = Color(0) + >>> bool(black) + False @@ -942,2 +437,3 @@ + .. method:: __or__(self, other) @@ -943,4 +439,3 @@ -Using a custom :meth:`__new__` -"""""""""""""""""""""""""""""" + Returns current flag binary or'ed with other:: @@ -946,3 +441,8 @@ -Using an auto-numbering :meth:`__new__` would look like:: + >>> Color.RED | Color.GREEN + Color.RED|Color.GREEN + + .. method:: __and__(self, other) + + Returns current flag binary and'ed with other:: @@ -948,18 +448,6 @@ - >>> class AutoNumber(NoValue): - ... def __new__(cls): - ... value = len(cls.__members__) + 1 - ... obj = object.__new__(cls) - ... obj._value_ = value - ... return obj - ... - >>> class Color(AutoNumber): - ... RED = () - ... GREEN = () - ... BLUE = () - ... - >>> Color.GREEN - <Color.GREEN> - >>> Color.GREEN.value - 2 + >>> purple & white + Color.RED|Color.BLUE + >>> purple & Color.GREEN + 0x0 @@ -965,3 +453,5 @@ -To make a more general purpose ``AutoNumber``, add ``*args`` to the signature:: + .. method:: __xor__(self, other) + + Returns current flag binary xor'ed with other:: @@ -967,9 +457,6 @@ - >>> class AutoNumber(NoValue): - ... def __new__(cls, *args): # this is the only change from above - ... value = len(cls.__members__) + 1 - ... obj = object.__new__(cls) - ... obj._value_ = value - ... return obj - ... + >>> purple ^ white + Color.GREEN + >>> purple ^ Color.GREEN + Color.RED|Color.GREEN|Color.BLUE @@ -975,4 +462,3 @@ -Then when you inherit from ``AutoNumber`` you can write your own ``__init__`` -to handle any extra arguments:: + .. method:: __invert__(self): @@ -978,17 +464,12 @@ - >>> class Swatch(AutoNumber): - ... def __init__(self, pantone='unknown'): - ... self.pantone = pantone - ... AUBURN = '3497' - ... SEA_GREEN = '1246' - ... BLEACHED_CORAL = () # New color, no Pantone code yet! - ... - >>> Swatch.SEA_GREEN - <Swatch.SEA_GREEN> - >>> Swatch.SEA_GREEN.pantone - '1246' - >>> Swatch.BLEACHED_CORAL.pantone - 'unknown' + Returns all the flags in *type(self)* that are not in self:: + + >>> ~white + 0x0 + >>> ~purple + Color.GREEN + >>> ~Color.RED + Color.GREEN|Color.BLUE .. note:: @@ -992,77 +473,7 @@ .. note:: - The :meth:`__new__` method, if defined, is used during creation of the Enum - members; it is then replaced by Enum's :meth:`__new__` which is used after - class creation for lookup of existing members. - - -OrderedEnum -^^^^^^^^^^^ - -An ordered enumeration that is not based on :class:`IntEnum` and so maintains -the normal :class:`Enum` invariants (such as not being comparable to other -enumerations):: - - >>> class OrderedEnum(Enum): - ... def __ge__(self, other): - ... if self.__class__ is other.__class__: - ... return self.value >= other.value - ... return NotImplemented - ... def __gt__(self, other): - ... if self.__class__ is other.__class__: - ... return self.value > other.value - ... return NotImplemented - ... def __le__(self, other): - ... if self.__class__ is other.__class__: - ... return self.value <= other.value - ... return NotImplemented - ... def __lt__(self, other): - ... if self.__class__ is other.__class__: - ... return self.value < other.value - ... return NotImplemented - ... - >>> class Grade(OrderedEnum): - ... A = 5 - ... B = 4 - ... C = 3 - ... D = 2 - ... F = 1 - ... - >>> Grade.C < Grade.A - True - - -DuplicateFreeEnum -^^^^^^^^^^^^^^^^^ - -Raises an error if a duplicate member name is found instead of creating an -alias:: - - >>> class DuplicateFreeEnum(Enum): - ... def __init__(self, *args): - ... cls = self.__class__ - ... if any(self.value == e.value for e in cls): - ... a = self.name - ... e = cls(self.value).name - ... raise ValueError( - ... "aliases not allowed in DuplicateFreeEnum: %r --> %r" - ... % (a, e)) - ... - >>> class Color(DuplicateFreeEnum): - ... RED = 1 - ... GREEN = 2 - ... BLUE = 3 - ... GRENE = 2 - ... - Traceback (most recent call last): - ... - ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN' - -.. note:: - - This is a useful example for subclassing Enum to add or change other - behaviors as well as disallowing aliases. If the only desired change is - disallowing aliases, the :func:`unique` decorator can be used instead. + Using :class:`auto` with :class:`Flag` results in integers that are powers + of two, starting with ``1``. @@ -1067,8 +478,4 @@ -Planet -^^^^^^ - -If :meth:`__new__` or :meth:`__init__` is defined the value of the enum member -will be passed to those methods:: +.. class:: IntFlag @@ -1074,47 +481,4 @@ - >>> class Planet(Enum): - ... MERCURY = (3.303e+23, 2.4397e6) - ... VENUS = (4.869e+24, 6.0518e6) - ... EARTH = (5.976e+24, 6.37814e6) - ... MARS = (6.421e+23, 3.3972e6) - ... JUPITER = (1.9e+27, 7.1492e7) - ... SATURN = (5.688e+26, 6.0268e7) - ... URANUS = (8.686e+25, 2.5559e7) - ... NEPTUNE = (1.024e+26, 2.4746e7) - ... def __init__(self, mass, radius): - ... self.mass = mass # in kilograms - ... self.radius = radius # in meters - ... @property - ... def surface_gravity(self): - ... # universal gravitational constant (m3 kg-1 s-2) - ... G = 6.67300E-11 - ... return G * self.mass / (self.radius * self.radius) - ... - >>> Planet.EARTH.value - (5.976e+24, 6378140.0) - >>> Planet.EARTH.surface_gravity - 9.802652743337129 - - -TimePeriod -^^^^^^^^^^ - -An example to show the :attr:`_ignore_` attribute in use:: - - >>> from datetime import timedelta - >>> class Period(timedelta, Enum): - ... "different lengths of time" - ... _ignore_ = 'Period i' - ... Period = vars() - ... for i in range(367): - ... Period['day_%d' % i] = i - ... - >>> list(Period)[:2] - [<Period.day_0: datetime.timedelta(0)>, <Period.day_1: datetime.timedelta(days=1)>] - >>> list(Period)[-2:] - [<Period.day_365: datetime.timedelta(days=365)>, <Period.day_366: datetime.timedelta(days=366)>] - - -How are Enums different? ------------------------- + *IntFlag* is the same as *Flag*, but its members are also integers and can be + used anywhere that an integer can be used. @@ -1120,27 +484,11 @@ -Enums have a custom metaclass that affects many aspects of both derived Enum -classes and their instances (members). - - -Enum Classes -^^^^^^^^^^^^ - -The :class:`EnumMeta` metaclass is responsible for providing the -:meth:`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that -allow one to do things with an :class:`Enum` class that fail on a typical -class, such as `list(Color)` or `some_enum_var in Color`. :class:`EnumMeta` is -responsible for ensuring that various other methods on the final :class:`Enum` -class are correct (such as :meth:`__new__`, :meth:`__getnewargs__`, -:meth:`__str__` and :meth:`__repr__`). - - -Enum Members (aka instances) -^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -The most interesting thing about Enum members is that they are singletons. -:class:`EnumMeta` creates them all while it is creating the :class:`Enum` -class itself, and then puts a custom :meth:`__new__` in place to ensure -that no new ones are ever instantiated by returning only the existing -member instances. - + >>> from enum import IntFlag, auto + >>> class Color(IntFlag): + ... RED = auto() + ... GREEN = auto() + ... BLUE = auto() + >>> Color.RED & 2 + 0x0 + >>> Color.RED | 2 + Color.RED|Color.GREEN @@ -1146,15 +494,4 @@ -Finer Points -^^^^^^^^^^^^ - -Supported ``__dunder__`` names -"""""""""""""""""""""""""""""" - -:attr:`__members__` is a read-only ordered mapping of ``member_name``:``member`` -items. It is only available on the class. - -:meth:`__new__`, if specified, must create and return the enum members; it is -also a very good idea to set the member's :attr:`_value_` appropriately. Once -all the members are created it is no longer used. - + If any integer operation is performed with an *IntFlag* member, the result is + not an *IntFlag*:: @@ -1160,7 +497,4 @@ -Supported ``_sunder_`` names -"""""""""""""""""""""""""""" - -- ``_name_`` -- name of the member -- ``_value_`` -- value of the member; can be set / modified in ``__new__`` + >>> Color.RED + 2 + 3 @@ -1166,14 +500,8 @@ -- ``_missing_`` -- a lookup function used when a value is not found; may be - overridden -- ``_ignore_`` -- a list of names, either as a :class:`list` or a :class:`str`, - that will not be transformed into members, and will be removed from the final - class -- ``_order_`` -- used in Python 2/3 code to ensure member order is consistent - (class attribute, removed during class creation) -- ``_generate_next_value_`` -- used by the `Functional API`_ and by - :class:`auto` to get an appropriate value for an enum member; may be - overridden + If a *Flag* operation is performed with an *IntFlag* member and: + + * the result is a valid *IntFlag*: an *IntFlag* is returned + * the result is not a valid *IntFlag*: the result depends on the *FlagBoundary* setting .. note:: @@ -1177,6 +505,6 @@ .. note:: - For standard :class:`Enum` classes the next value chosen is the last value seen - incremented by one. + Using :class:`auto` with :class:`IntFlag` results in integers that are powers + of two, starting with ``1``. @@ -1182,4 +510,3 @@ - For :class:`Flag`-type classes the next value chosen will be the next highest - power-of-two, regardless of the last value seen. +.. class:: FlagBoundary @@ -1185,4 +512,4 @@ -.. versionadded:: 3.6 ``_missing_``, ``_order_``, ``_generate_next_value_`` -.. versionadded:: 3.7 ``_ignore_`` + *FlagBoundary* controls how out-of-range values are handled in *Flag* and its + subclasses. @@ -1188,5 +515,6 @@ -To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute can -be provided. It will be checked against the actual order of the enumeration -and raise an error if the two do not match:: + .. attribute:: STRICT + + Out-of-range values cause a :exc:`ValueError` to be raised. This is the + default for :class:`Flag`:: @@ -1192,15 +520,13 @@ - >>> class Color(Enum): - ... _order_ = 'RED GREEN BLUE' - ... RED = 1 - ... BLUE = 3 - ... GREEN = 2 - ... - Traceback (most recent call last): - ... - TypeError: member order does not match _order_: - ['RED', 'BLUE', 'GREEN'] - ['RED', 'GREEN', 'BLUE'] - -.. note:: + >>> from enum import Flag, STRICT + >>> class StrictFlag(Flag, boundary=STRICT): + ... RED = auto() + ... GREEN = auto() + ... BLUE = auto() + >>> StrictFlag(2**2 + 2**4) + Traceback (most recent call last): + ... + ValueError: StrictFlag: invalid value: 20 + given 0b0 10100 + allowed 0b0 00111 @@ -1206,8 +532,3 @@ - In Python 2 code the :attr:`_order_` attribute is necessary as definition - order is lost before it can be recorded. - - -_Private__names -""""""""""""""" + .. attribute:: CONFORM @@ -1213,9 +534,4 @@ -Private names are not converted to Enum members, but remain normal attributes. - -.. versionchanged:: 3.10 - - -``Enum`` member type -"""""""""""""""""""" + Out-of-range values have invalid values removed, leaving a valid *Flag* + value:: @@ -1221,7 +537,9 @@ -:class:`Enum` members are instances of their :class:`Enum` class, and are -normally accessed as ``EnumClass.member``. In Python versions ``3.5`` to -``3.9`` you could access members from other members -- this practice was -discouraged, and in ``3.12`` :class:`Enum` will return to not allowing it, -while in ``3.10`` and ``3.11`` it will raise a :exc:`DeprecationWarning`:: + >>> from enum import Flag, CONFORM + >>> class ConformFlag(Flag, boundary=CONFORM): + ... RED = auto() + ... GREEN = auto() + ... BLUE = auto() + >>> ConformFlag(2**2 + 2**4) + ConformFlag.BLUE @@ -1227,11 +545,3 @@ - >>> class FieldTypes(Enum): - ... name = 0 - ... value = 1 - ... size = 2 - ... - >>> FieldTypes.value.size # doctest: +SKIP - DeprecationWarning: accessing one member from another is not supported, - and will be disabled in 3.12 - <FieldTypes.size: 2> + .. attribute:: EJECT @@ -1237,8 +547,4 @@ -.. versionchanged:: 3.5 -.. versionchanged:: 3.10 - - -Creating members that are mixed with other data types -""""""""""""""""""""""""""""""""""""""""""""""""""""" + Out-of-range values lose their *Flag* membership and revert to :class:`int`. + This is the default for :class:`IntFlag`:: @@ -1244,5 +550,9 @@ -When subclassing other data types, such as :class:`int` or :class:`str`, with -an :class:`Enum`, all values after the `=` are passed to that data type's -constructor. For example:: + >>> from enum import Flag, EJECT + >>> class EjectFlag(Flag, boundary=EJECT): + ... RED = auto() + ... GREEN = auto() + ... BLUE = auto() + >>> EjectFlag(2**2 + 2**4) + 20 @@ -1248,8 +558,3 @@ - >>> class MyEnum(IntEnum): - ... example = '11', 16 # '11' will be interpreted as a hexadecimal - ... # number - >>> MyEnum.example - <MyEnum.example: 17> - + .. attribute:: KEEP @@ -1255,4 +560,4 @@ -Boolean value of ``Enum`` classes and members -""""""""""""""""""""""""""""""""""""""""""""" + Out-of-range values are kept, and the *Flag* membership is kept. This is + used for some stdlib flags: @@ -1258,13 +563,10 @@ -:class:`Enum` members that are mixed with non-:class:`Enum` types (such as -:class:`int`, :class:`str`, etc.) are evaluated according to the mixed-in -type's rules; otherwise, all members evaluate as :data:`True`. To make your -own Enum's boolean evaluation depend on the member's value add the following to -your class:: - - def __bool__(self): - return bool(self.value) - -:class:`Enum` classes always evaluate as :data:`True`. + >>> from enum import Flag, KEEP + >>> class KeepFlag(Flag, boundary=KEEP): + ... RED = auto() + ... GREEN = auto() + ... BLUE = auto() + >>> KeepFlag(2**2 + 2**4) + KeepFlag.BLUE|0x10 @@ -1269,5 +571,7 @@ -``Enum`` classes with methods -""""""""""""""""""""""""""""" +Utilites and Decorators +----------------------- + +.. class:: auto @@ -1273,5 +577,8 @@ -If you give your :class:`Enum` subclass extra methods, like the `Planet`_ -class above, those methods will show up in a :func:`dir` of the member, -but not of the class:: + *auto* can be used in place of a value. If used, the *Enum* machinery will + call an *Enum*'s :meth:`_generate_next_value_` to get an appropriate value. + For *Enum* and *IntEnum* that appropriate value will be the last value plus + one; for *Flag* and *IntFlag* it will be the first power-of-two greater + than the last value; for *StrEnum* it will be the lower-cased version of the + member's name. @@ -1277,7 +584,12 @@ - >>> dir(Planet) - ['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', 'VENUS', '__class__', '__doc__', '__members__', '__module__'] - >>> dir(Planet.EARTH) - ['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', 'surface_gravity', 'value'] + ``_generate_next_value_`` can be overridden to customize the values used by + *auto*. + +.. decorator:: global_enum + + A :keyword:`class` decorator specifically for enumerations. It replaces the + :meth:`__repr__` method with one that shows *module_name*.*member_name*. It + also injects the members, and their aliases, into the the global namespace + they were defined in. @@ -1282,8 +594,4 @@ -Combining members of ``Flag`` -""""""""""""""""""""""""""""" - -Iterating over a combination of Flag members will only return the members that -are comprised of a single bit:: +.. decorator:: property @@ -1289,17 +597,5 @@ - >>> class Color(Flag): - ... RED = auto() - ... GREEN = auto() - ... BLUE = auto() - ... MAGENTA = RED | BLUE - ... YELLOW = RED | GREEN - ... CYAN = GREEN | BLUE - ... - >>> Color(3) - <Color.YELLOW: 3> - >>> Color(7) - <Color.RED|GREEN|BLUE: 7> - -``StrEnum`` and :meth:`str.__str__` -""""""""""""""""""""""""""""""""""" + A decorator similar to the built-in *property*, but specifically for + enumerations. It allows member attributes to have the same names as members + themselves. @@ -1305,13 +601,6 @@ -An important difference between :class:`StrEnum` and other Enums is the -:meth:`__str__` method; because :class:`StrEnum` members are strings, some -parts of Python will read the string data directly, while others will call -:meth:`str()`. To make those two operations have the same result, -:meth:`StrEnum.__str__` will be the same as :meth:`str.__str__` so that -``str(StrEnum.member) == StrEnum.member`` is true. - -``Flag`` and ``IntFlag`` minutia -"""""""""""""""""""""""""""""""" - -The code sample:: + .. note:: the *property* and the member must be defined in separate classes; + for example, the *value* and *name* attributes are defined in the + *Enum* class, and *Enum* subclasses can define members with the + names ``value`` and ``name``. @@ -1317,14 +606,3 @@ - >>> class Color(IntFlag): - ... BLACK = 0 - ... RED = 1 - ... GREEN = 2 - ... BLUE = 4 - ... PURPLE = RED | BLUE - ... WHITE = RED | GREEN | BLUE - ... - -- single-bit flags are canonical -- multi-bit and zero-bit flags are aliases -- only canonical flags are returned during iteration:: +.. decorator:: unique @@ -1330,26 +608,5 @@ - >>> list(Color.WHITE) - [<Color.RED: 1>, <Color.GREEN: 2>, <Color.BLUE: 4>] - -- negating a flag or flag set returns a new flag/flag set with the - corresponding positive integer value:: - - >>> Color.GREEN - <Color.GREEN: 2> - - >>> ~Color.GREEN - <Color.PURPLE: 5> - -- names of pseudo-flags are constructed from their members' names:: - - >>> (Color.RED | Color.GREEN).name - 'RED|GREEN' - -- multi-bit flags, aka aliases, can be returned from operations:: - - >>> Color.RED | Color.BLUE - <Color.PURPLE: 5> - - >>> Color(7) # or Color(-1) - <Color.WHITE: 7> + A :keyword:`class` decorator specifically for enumerations. It searches an + enumeration's :attr:`__members__`, gathering any aliases it finds; if any are + found :exc:`ValueError` is raised with the details:: @@ -1355,12 +612,13 @@ -- membership / containment checking has changed slightly -- zero valued flags - are never considered to be contained:: - - >>> Color.BLACK in Color.WHITE - False - - otherwise, if all bits of one flag are in the other flag, True is returned:: - - >>> Color.PURPLE in Color.WHITE - True + >>> from enum import Enum, unique + >>> @unique + ... class Mistake(Enum): + ... ONE = 1 + ... TWO = 2 + ... THREE = 3 + ... FOUR = 3 + ... + Traceback (most recent call last): + ... + ValueError: duplicate values found in <enum 'Mistake'>: FOUR -> THREE @@ -1366,15 +624,1 @@ -There is a new boundary mechanism that controls how out-of-range / invalid -bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``: - - * STRICT --> raises an exception when presented with invalid values - * CONFORM --> discards any invalid bits - * EJECT --> lose Flag status and become a normal int with the given value - * KEEP --> keep the extra bits - - keeps Flag status and extra bits - - extra bits do not show up in iteration - - extra bits do show up in repr() and str() - -The default for Flag is ``STRICT``, the default for ``IntFlag`` is ``DISCARD``, -and the default for ``_convert_`` is ``KEEP`` (see ``ssl.Options`` for an -example of when ``KEEP`` is needed). diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvZXhjZXB0aW9ucy5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvZXhjZXB0aW9ucy5yc3Q= 100644 --- a/Doc/library/exceptions.rst +++ b/Doc/library/exceptions.rst @@ -149,6 +149,13 @@ assignment fails. (When an object does not support attribute references or attribute assignments at all, :exc:`TypeError` is raised.) + The :attr:`name` and :attr:`obj` attributes can be set using keyword-only + arguments to the constructor. When set they represent the name of the attribute + that was attempted to be accessed and the object that was accessed for said + attribute, respectively. + + .. versionchanged:: 3.10 + Added the :attr:`name` and :attr:`obj` attributes. .. exception:: EOFError @@ -402,9 +409,25 @@ or :func:`eval`, or when reading the initial script or standard input (also interactively). - Instances of this class have attributes :attr:`filename`, :attr:`lineno`, - :attr:`offset` and :attr:`text` for easier access to the details. :func:`str` - of the exception instance returns only the message. + The :func:`str` of the exception instance returns only the error message. + + .. attribute:: filename + + The name of the file the syntax error occurred in. + + .. attribute:: lineno + + Which line number in the file the error occurred in. This is + 1-indexed: the first line in the file has a ``lineno`` of 1. + + .. attribute:: offset + + The column in the line where the error occurred. This is + 1-indexed: the first character in the line has an ``offset`` of 1. + + .. attribute:: text + + The source code text involved in the error. .. exception:: IndentationError @@ -741,6 +764,15 @@ Base class for warnings related to Unicode. +.. exception:: EncodingWarning + + Base class for warnings related to encodings. + + See :ref:`io-encoding-warning` for details. + + .. versionadded:: 3.10 + + .. exception:: BytesWarning Base class for warnings related to :class:`bytes` and :class:`bytearray`. diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvZmlsZWlucHV0LnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvZmlsZWlucHV0LnJzdA== 100644 --- a/Doc/library/fileinput.rst +++ b/Doc/library/fileinput.rst @@ -18,7 +18,7 @@ The typical use is:: import fileinput - for line in fileinput.input(): + for line in fileinput.input(encoding="utf-8"): process(line) This iterates over the lines of all files listed in ``sys.argv[1:]``, defaulting @@ -49,9 +49,10 @@ You can control how files are opened by providing an opening hook via the *openhook* parameter to :func:`fileinput.input` or :class:`FileInput()`. The hook must be a function that takes two arguments, *filename* and *mode*, and -returns an accordingly opened file-like object. Two useful hooks are already -provided by this module. +returns an accordingly opened file-like object. If *encoding* and/or *errors* +are specified, they will be passed to the hook as aditional keyword arguments. +This module provides a :func:`hook_encoded` to support compressed files. The following function is the primary interface of this module: @@ -54,8 +55,8 @@ The following function is the primary interface of this module: -.. function:: input(files=None, inplace=False, backup='', *, mode='r', openhook=None) +.. function:: input(files=None, inplace=False, backup='', *, mode='r', openhook=None, encoding=None, errors=None) Create an instance of the :class:`FileInput` class. The instance will be used as global state for the functions of this module, and is also returned to use @@ -66,7 +67,7 @@ :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with` statement is exited, even if an exception occurs:: - with fileinput.input(files=('spam.txt', 'eggs.txt')) as f: + with fileinput.input(files=('spam.txt', 'eggs.txt'), encoding="utf-8") as f: for line in f: process(line) @@ -76,6 +77,9 @@ .. versionchanged:: 3.8 The keyword parameters *mode* and *openhook* are now keyword-only. + .. versionchanged:: 3.10 + The keyword-only parameter *encoding* and *errors* are added. + The following functions use the global state created by :func:`fileinput.input`; if there is no active state, :exc:`RuntimeError` is raised. @@ -137,7 +141,7 @@ available for subclassing as well: -.. class:: FileInput(files=None, inplace=False, backup='', *, mode='r', openhook=None) +.. class:: FileInput(files=None, inplace=False, backup='', *, mode='r', openhook=None, encoding=None, errors=None) Class :class:`FileInput` is the implementation; its methods :meth:`filename`, :meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:`isfirstline`, @@ -155,6 +159,8 @@ *filename* and *mode*, and returns an accordingly opened file-like object. You cannot use *inplace* and *openhook* together. + You can specify *encoding* and *errors* that is passed to :func:`open` or *openhook*. + A :class:`FileInput` instance can be used as a context manager in the :keyword:`with` statement. In this example, *input* is closed after the :keyword:`!with` statement is exited, even if an exception occurs:: @@ -162,7 +168,6 @@ with FileInput(files=('spam.txt', 'eggs.txt')) as input: process(input) - .. versionchanged:: 3.2 Can be used as a context manager. @@ -175,6 +180,8 @@ .. versionchanged:: 3.8 The keyword parameter *mode* and *openhook* are now keyword-only. + .. versionchanged:: 3.10 + The keyword-only parameter *encoding* and *errors* are added. **Optional in-place filtering:** if the keyword argument ``inplace=True`` is @@ -191,10 +198,10 @@ The two following opening hooks are provided by this module: -.. function:: hook_compressed(filename, mode) +.. function:: hook_compressed(filename, mode, *, encoding=None, errors=None) Transparently opens files compressed with gzip and bzip2 (recognized by the extensions ``'.gz'`` and ``'.bz2'``) using the :mod:`gzip` and :mod:`bz2` modules. If the filename extension is not ``'.gz'`` or ``'.bz2'``, the file is opened normally (ie, using :func:`open` without any decompression). @@ -195,10 +202,16 @@ Transparently opens files compressed with gzip and bzip2 (recognized by the extensions ``'.gz'`` and ``'.bz2'``) using the :mod:`gzip` and :mod:`bz2` modules. If the filename extension is not ``'.gz'`` or ``'.bz2'``, the file is opened normally (ie, using :func:`open` without any decompression). - Usage example: ``fi = fileinput.FileInput(openhook=fileinput.hook_compressed)`` + The *encoding* and *errors* values are passed to to :class:`io.TextIOWrapper` + for compressed files and open for normal files. + + Usage example: ``fi = fileinput.FileInput(openhook=fileinput.hook_compressed, encoding="utf-8")`` + + .. versionchanged:: 3.10 + The keyword-only parameter *encoding* and *errors* are added. .. function:: hook_encoded(encoding, errors=None) @@ -212,3 +225,7 @@ .. versionchanged:: 3.6 Added the optional *errors* parameter. + + .. deprecated:: 3.10 + This function is deprecated since :func:`input` and :class:`FileInput` + now have *encoding* and *errors* parameters. diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvZnVuY3Rpb25zLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvZnVuY3Rpb25zLnJzdA== 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -12,31 +12,31 @@ +=========================+=======================+=======================+=========================+ | | **A** | | **E** | | **L** | | **R** | | | :func:`abs` | | :func:`enumerate` | | :func:`len` | | |func-range|_ | -| | :func:`all` | | :func:`eval` | | |func-list|_ | | :func:`repr` | -| | :func:`any` | | :func:`exec` | | :func:`locals` | | :func:`reversed` | -| | :func:`ascii` | | | | | | :func:`round` | -| | | | **F** | | **M** | | | -| | **B** | | :func:`filter` | | :func:`map` | | **S** | -| | :func:`bin` | | :func:`float` | | :func:`max` | | |func-set|_ | -| | :func:`bool` | | :func:`format` | | |func-memoryview|_ | | :func:`setattr` | -| | :func:`breakpoint` | | |func-frozenset|_ | | :func:`min` | | :func:`slice` | -| | |func-bytearray|_ | | | | | | :func:`sorted` | -| | |func-bytes|_ | | **G** | | **N** | | :func:`staticmethod` | -| | | | :func:`getattr` | | :func:`next` | | |func-str|_ | -| | **C** | | :func:`globals` | | | | :func:`sum` | -| | :func:`callable` | | | | **O** | | :func:`super` | -| | :func:`chr` | | **H** | | :func:`object` | | | -| | :func:`classmethod` | | :func:`hasattr` | | :func:`oct` | | **T** | -| | :func:`compile` | | :func:`hash` | | :func:`open` | | |func-tuple|_ | -| | :func:`complex` | | :func:`help` | | :func:`ord` | | :func:`type` | -| | | | :func:`hex` | | | | | -| | **D** | | | | **P** | | **V** | -| | :func:`delattr` | | **I** | | :func:`pow` | | :func:`vars` | -| | |func-dict|_ | | :func:`id` | | :func:`print` | | | -| | :func:`dir` | | :func:`input` | | :func:`property` | | **Z** | -| | :func:`divmod` | | :func:`int` | | | | :func:`zip` | -| | | | :func:`isinstance` | | | | | -| | | | :func:`issubclass` | | | | **_** | +| | :func:`aiter` | | :func:`eval` | | |func-list|_ | | :func:`repr` | +| | :func:`all` | | :func:`exec` | | :func:`locals` | | :func:`reversed` | +| | :func:`any` | | | | | | :func:`round` | +| | :func:`anext` | | **F** | | **M** | | | +| | :func:`ascii` | | :func:`filter` | | :func:`map` | | **S** | +| | | | :func:`float` | | :func:`max` | | |func-set|_ | +| | **B** | | :func:`format` | | |func-memoryview|_ | | :func:`setattr` | +| | :func:`bin` | | |func-frozenset|_ | | :func:`min` | | :func:`slice` | +| | :func:`bool` | | | | | | :func:`sorted` | +| | :func:`breakpoint` | | **G** | | **N** | | :func:`staticmethod` | +| | |func-bytearray|_ | | :func:`getattr` | | :func:`next` | | |func-str|_ | +| | |func-bytes|_ | | :func:`globals` | | | | :func:`sum` | +| | | | | | **O** | | :func:`super` | +| | **C** | | **H** | | :func:`object` | | | +| | :func:`callable` | | :func:`hasattr` | | :func:`oct` | | **T** | +| | :func:`chr` | | :func:`hash` | | :func:`open` | | |func-tuple|_ | +| | :func:`classmethod` | | :func:`help` | | :func:`ord` | | :func:`type` | +| | :func:`compile` | | :func:`hex` | | | | | +| | :func:`complex` | | | | **P** | | **V** | +| | | | **I** | | :func:`pow` | | :func:`vars` | +| | **D** | | :func:`id` | | :func:`print` | | | +| | :func:`delattr` | | :func:`input` | | :func:`property` | | **Z** | +| | |func-dict|_ | | :func:`int` | | | | :func:`zip` | +| | :func:`dir` | | :func:`isinstance` | | | | | +| | :func:`divmod` | | :func:`issubclass` | | | | **_** | | | | | :func:`iter` | | | | :func:`__import__` | +-------------------------+-----------------------+-----------------------+-------------------------+ @@ -61,6 +61,18 @@ If the argument is a complex number, its magnitude is returned. +.. function:: aiter(async_iterable) + + Return an :term:`asynchronous iterator` for an :term:`asynchronous iterable`. + Equivalent to calling ``x.__aiter__()``. + + ``aiter(x)`` itself has an ``__aiter__()`` method that returns ``x``, + so ``aiter(aiter(x))`` is the same as ``aiter(x)``. + + Note: Unlike :func:`iter`, :func:`aiter` has no 2-argument variant. + + .. versionadded:: 3.10 + .. function:: all(iterable) Return ``True`` if all elements of the *iterable* are true (or if the iterable @@ -73,6 +85,21 @@ return True +.. awaitablefunction:: anext(async_iterator[, default]) + + When awaited, return the next item from the given :term:`asynchronous + iterator`, or *default* if given and the iterator is exhausted. + + This is the async variant of the :func:`next` builtin, and behaves + similarly. + + This calls the :meth:`~object.__anext__` method of *async_iterator*, + returning an :term:`awaitable`. Awaiting this returns the next value of the + iterator. If *default* is given, it is returned if the iterator is exhausted, + otherwise :exc:`StopAsyncIteration` is raised. + + .. versionadded:: 3.10 + .. function:: any(iterable) Return ``True`` if any element of the *iterable* is true. If the iterable @@ -242,6 +269,11 @@ Class methods can now wrap other :term:`descriptors <descriptor>` such as :func:`property`. + .. versionchanged:: 3.10 + Class methods now inherit the method attributes (``__module__``, + ``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``) and + have a new ``__wrapped__`` attribute. + .. function:: compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1) Compile the *source* into a code or AST object. Code objects can be executed @@ -1587,8 +1619,9 @@ The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:`function` for details. - A static method can be called either on the class (such as ``C.f()``) or on an instance (such - as ``C().f()``). + A static method can be called either on the class (such as ``C.f()``) or on + an instance (such as ``C().f()``). Moreover, they can be called as regular + functions (such as ``f()``). Static methods in Python are similar to those found in Java or C++. Also see :func:`classmethod` for a variant that is useful for creating alternate class @@ -1600,4 +1633,7 @@ body and you want to avoid the automatic transformation to instance method. For these cases, use this idiom:: + def regular_function(): + ... + class C: @@ -1603,5 +1639,5 @@ class C: - builtin_open = staticmethod(open) + method = staticmethod(regular_function) For more information on static methods, see :ref:`types`. @@ -1605,6 +1641,12 @@ For more information on static methods, see :ref:`types`. + .. versionchanged:: 3.10 + Static methods now inherit the method attributes (``__module__``, + ``__name__``, ``__qualname__``, ``__doc__`` and ``__annotations__``), + have a new ``__wrapped__`` attribute, and are now callable as regular + functions. + .. index:: single: string; str() (built-in function) diff --git a/Doc/library/hashlib.rst b/Doc/library/hashlib.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvaGFzaGxpYi5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvaGFzaGxpYi5yc3Q= 100644 --- a/Doc/library/hashlib.rst +++ b/Doc/library/hashlib.rst @@ -118,6 +118,6 @@ Using :func:`new` with an algorithm provided by OpenSSL: - >>> h = hashlib.new('ripemd160') + >>> h = hashlib.new('sha512_256') >>> h.update(b"Nobody inspects the spammish repetition") >>> h.hexdigest() @@ -122,6 +122,6 @@ >>> h.update(b"Nobody inspects the spammish repetition") >>> h.hexdigest() - 'cc4a5ce1b3df48aec5d22d1f16b894a0b894eccc' + '19197dc4d03829df858011c6c87600f994a858103bbc19005f20987aa19a97e2' Hashlib provides the following constant attributes: diff --git a/Doc/library/http.rst b/Doc/library/http.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvaHR0cC5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvaHR0cC5yc3Q= 100644 --- a/Doc/library/http.rst +++ b/Doc/library/http.rst @@ -35,7 +35,7 @@ >>> from http import HTTPStatus >>> HTTPStatus.OK - <HTTPStatus.OK: 200> + HTTPStatus.OK >>> HTTPStatus.OK == 200 True >>> HTTPStatus.OK.value @@ -45,7 +45,7 @@ >>> HTTPStatus.OK.description 'Request fulfilled, document follows' >>> list(HTTPStatus) - [<HTTPStatus.CONTINUE: 100>, <HTTPStatus.SWITCHING_PROTOCOLS: 101>, ...] + [HTTPStatus.CONTINUE, HTTPStatus.SWITCHING_PROTOCOLS, ...] .. _http-status-codes: diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvaWRsZS5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvaWRsZS5yc3Q= 100644 --- a/Doc/library/idle.rst +++ b/Doc/library/idle.rst @@ -670,8 +670,16 @@ code execution process. A connection must be established whenever the Shell starts or restarts. (The latter is indicated by a divider line that says 'RESTART'). If the user process fails to connect to the GUI process, it -displays a ``Tk`` error box with a 'cannot connect' message that directs the -user here. It then exits. +usually displays a ``Tk`` error box with a 'cannot connect' message +that directs the user here. It then exits. + +One specific connection failure on Unix systems results from +misconfigured masquerading rules somewhere in a system's network setup. +When IDLE is started from a terminal, one will see a message starting +with ``** Invalid host:``. +The valid value is ``127.0.0.1 (idlelib.rpc.LOCALHOST)``. +One can diagnose with ``tcpconnect -irv 127.0.0.1 6543`` in one +terminal window and ``tcplisten <same args>`` in another. A common cause of failure is a user-written file with the same name as a standard library module, such as *random.py* and *tkinter.py*. When such a @@ -709,6 +717,13 @@ starting it from a console or terminal (``python -m idlelib``) and see if this results in an error message. +On Unix-based systems with tcl/tk older than ``8.6.11`` (see +``About IDLE``) certain characters of certain fonts can cause +a tk failure with a message to the terminal. This can happen either +if one starts IDLE to edit a file with such a character or later +when entering such a character. If one cannot upgrade tcl/tk, +then re-configure IDLE to use a font that works better. + Running user code ^^^^^^^^^^^^^^^^^ @@ -717,7 +732,7 @@ directly with Python in a text-mode system console or terminal window. However, the different interface and operation occasionally affect visible results. For instance, ``sys.modules`` starts with more entries, -and ``threading.activeCount()`` returns 2 instead of 1. +and ``threading.active_count()`` returns 2 instead of 1. By default, IDLE runs user code in a separate OS process rather than in the user interface process that runs the shell and editor. In the execution diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvaW1wb3J0bGliLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvaW1wb3J0bGliLnJzdA== 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -208,7 +208,7 @@ .. versionadded:: 3.4 .. versionchanged:: 3.7 :exc:`ModuleNotFoundError` is raised when the module being reloaded lacks - a :class:`ModuleSpec`. + a :class:`~importlib.machinery.ModuleSpec`. :mod:`importlib.abc` -- Abstract base classes related to import @@ -257,6 +257,10 @@ Returns ``None`` when called instead of raising :exc:`NotImplementedError`. + .. deprecated:: 3.10 + Implement :meth:`MetaPathFinder.find_spec` or + :meth:`PathEntryFinder.find_spec` instead. + .. class:: MetaPathFinder @@ -265,6 +269,9 @@ .. versionadded:: 3.3 + .. versionchanged:: 3.10 + No longer a subclass of :class:`Finder`. + .. method:: find_spec(fullname, path, target=None) An abstract method for finding a :term:`spec <module spec>` for @@ -313,8 +320,7 @@ An abstract base class representing a :term:`path entry finder`. Though it bears some similarities to :class:`MetaPathFinder`, ``PathEntryFinder`` is meant for use only within the path-based import subsystem provided - by :class:`PathFinder`. This ABC is a subclass of :class:`Finder` for - compatibility reasons only. + by :class:`importlib.machinery.PathFinder`. .. versionadded:: 3.3 @@ -318,6 +324,9 @@ .. versionadded:: 3.3 + .. versionchanged:: 3.10 + No longer a subclass of :class:`Finder`. + .. method:: find_spec(fullname, target=None) An abstract method for finding a :term:`spec <module spec>` for @@ -363,7 +372,8 @@ .. method:: invalidate_caches() An optional method which, when called, should invalidate any internal - cache used by the finder. Used by :meth:`PathFinder.invalidate_caches` + cache used by the finder. Used by + :meth:`importlib.machinery.PathFinder.invalidate_caches` when invalidating the caches of all cached finders. @@ -891,6 +901,22 @@ .. versionadded:: 3.9 +.. function:: as_file(traversable) + + Given a :class:`importlib.resources.abc.Traversable` object representing + a file, typically from :func:`importlib.resources.files`, return + a context manager for use in a :keyword:`with` statement. + The context manager provides a :class:`pathlib.Path` object. + + Exiting the context manager cleans up any temporary file created when the + resource was extracted from e.g. a zip file. + + Use ``as_file`` when the Traversable methods + (``read_text``, etc) are insufficient and an actual file on + the file system is required. + + .. versionadded:: 3.9 + .. function:: open_binary(package, resource) Open for binary reading the *resource* within *package*. @@ -1177,6 +1203,9 @@ Attempt to find the loader to handle *fullname* within :attr:`path`. + .. deprecated:: 3.10 + Use :meth:`find_spec` instead. + .. method:: invalidate_caches() Clear out the internal cache. @@ -1591,9 +1620,9 @@ .. function:: spec_from_loader(name, loader, *, origin=None, is_package=None) - A factory function for creating a :class:`ModuleSpec` instance based - on a loader. The parameters have the same meaning as they do for - ModuleSpec. The function uses available :term:`loader` APIs, such as + A factory function for creating a :class:`~importlib.machinery.ModuleSpec` + instance based on a loader. The parameters have the same meaning as they do + for ModuleSpec. The function uses available :term:`loader` APIs, such as :meth:`InspectLoader.is_package`, to fill in any missing information on the spec. @@ -1601,9 +1630,9 @@ .. function:: spec_from_file_location(name, location, *, loader=None, submodule_search_locations=None) - A factory function for creating a :class:`ModuleSpec` instance based - on the path to a file. Missing information will be filled in on the - spec by making use of loader APIs and by the implication that the + A factory function for creating a :class:`~importlib.machinery.ModuleSpec` + instance based on the path to a file. Missing information will be filled in + on the spec by making use of loader APIs and by the implication that the module will be file-based. .. versionadded:: 3.4 diff --git a/Doc/library/io.rst b/Doc/library/io.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvaW8ucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvaW8ucnN0 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -106,6 +106,56 @@ The raw stream API is described in detail in the docs of :class:`RawIOBase`. +.. _io-text-encoding: + +Text Encoding +------------- + +The default encoding of :class:`TextIOWrapper` and :func:`open` is +locale-specific (:func:`locale.getpreferredencoding(False) <locale.getpreferredencoding>`). + +However, many developers forget to specify the encoding when opening text files +encoded in UTF-8 (e.g. JSON, TOML, Markdown, etc...) since most Unix +platforms use UTF-8 locale by default. This causes bugs because the locale +encoding is not UTF-8 for most Windows users. For example:: + + # May not work on Windows when non-ASCII characters in the file. + with open("README.md") as f: + long_description = f.read() + +Additionally, while there is no concrete plan as of yet, Python may change +the default text file encoding to UTF-8 in the future. + +Accordingly, it is highly recommended that you specify the encoding +explicitly when opening text files. If you want to use UTF-8, pass +``encoding="utf-8"``. To use the current locale encoding, +``encoding="locale"`` is supported in Python 3.10. + +When you need to run existing code on Windows that attempts to opens +UTF-8 files using the default locale encoding, you can enable the UTF-8 +mode. See :ref:`UTF-8 mode on Windows <win-utf8-mode>`. + +.. _io-encoding-warning: + +Opt-in EncodingWarning +^^^^^^^^^^^^^^^^^^^^^^ + +.. versionadded:: 3.10 + See :pep:`597` for more details. + +To find where the default locale encoding is used, you can enable +the ``-X warn_default_encoding`` command line option or set the +:envvar:`PYTHONWARNDEFAULTENCODING` environment variable, which will +emit an :exc:`EncodingWarning` when the default encoding is used. + +If you are providing an API that uses :func:`open` or +:class:`TextIOWrapper` and passes ``encoding=None`` as a parameter, you +can use :func:`text_encoding` so that callers of the API will emit an +:exc:`EncodingWarning` if they don't pass an ``encoding``. However, +please consider using UTF-8 by default (i.e. ``encoding="utf-8"``) for +new APIs. + + High-level Module Interface --------------------------- @@ -143,6 +193,32 @@ .. versionadded:: 3.8 +.. function:: text_encoding(encoding, stacklevel=2) + + This is a helper function for callables that use :func:`open` or + :class:`TextIOWrapper` and have an ``encoding=None`` parameter. + + This function returns *encoding* if it is not ``None`` and ``"locale"`` if + *encoding* is ``None``. + + This function emits an :class:`EncodingWarning` if + :data:`sys.flags.warn_default_encoding <sys.flags>` is true and *encoding* + is None. *stacklevel* specifies where the warning is emitted. + For example:: + + def read_text(path, encoding=None): + encoding = io.text_encoding(encoding) # stacklevel=2 + with open(path, encoding) as f: + return f.read() + + In this example, an :class:`EncodingWarning` is emitted for the caller of + ``read_text()``. + + See :ref:`io-text-encoding` for more information. + + .. versionadded:: 3.10 + + .. exception:: BlockingIOError This is a compatibility alias for the builtin :exc:`BlockingIOError` @@ -155,16 +231,6 @@ when an unsupported operation is called on a stream. -In-memory streams -^^^^^^^^^^^^^^^^^ - -It is also possible to use a :class:`str` or :term:`bytes-like object` as a -file for both reading and writing. For strings :class:`StringIO` can be used -like a file opened in text mode. :class:`BytesIO` can be used like a file -opened in binary mode. Both provide full read-write capabilities with random -access. - - .. seealso:: :mod:`sys` @@ -879,6 +945,8 @@ *encoding* gives the name of the encoding that the stream will be decoded or encoded with. It defaults to :func:`locale.getpreferredencoding(False) <locale.getpreferredencoding>`. + ``encoding="locale"`` can be used to specify the current locale's encoding + explicitly. See :ref:`io-text-encoding` for more information. *errors* is an optional string that specifies how encoding and decoding errors are to be handled. Pass ``'strict'`` to raise a :exc:`ValueError` @@ -930,6 +998,9 @@ locale encoding using :func:`locale.setlocale`, use the current locale encoding instead of the user preferred encoding. + .. versionchanged:: 3.10 + The *encoding* argument now supports the ``"locale"`` dummy encoding name. + :class:`TextIOWrapper` provides these data attributes and methods in addition to those from :class:`TextIOBase` and :class:`IOBase`: diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvbG9jYWxlLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvbG9jYWxlLnJzdA== 100644 --- a/Doc/library/locale.rst +++ b/Doc/library/locale.rst @@ -427,6 +427,14 @@ .. versionadded:: 3.5 +.. function:: localize(string, grouping=False, monetary=False) + + Converts a normalized number string into a formatted string following the + :const:`LC_NUMERIC` settings. + + .. versionadded:: 3.10 + + .. function:: atof(string) Converts a string to a floating point number, following the :const:`LC_NUMERIC` diff --git a/Doc/library/logging.config.rst b/Doc/library/logging.config.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvbG9nZ2luZy5jb25maWcucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvbG9nZ2luZy5jb25maWcucnN0 100644 --- a/Doc/library/logging.config.rst +++ b/Doc/library/logging.config.rst @@ -77,7 +77,7 @@ .. versionadded:: 3.2 -.. function:: fileConfig(fname, defaults=None, disable_existing_loggers=True) +.. function:: fileConfig(fname, defaults=None, disable_existing_loggers=True, encoding=None) Reads the logging configuration from a :mod:`configparser`\-format file. The format of the file should be as described in @@ -111,6 +111,8 @@ they or their ancestors are explicitly named in the logging configuration. + :param encoding: The encoding used to open file when *fname* is filename. + .. versionchanged:: 3.4 An instance of a subclass of :class:`~configparser.RawConfigParser` is now accepted as a value for ``fname``. This facilitates: @@ -121,6 +123,9 @@ application (e.g. based on command-line parameters or other aspects of the runtime environment) before being passed to ``fileConfig``. + .. versionadded:: 3.10 + The *encoding* parameter is added. + .. function:: listen(port=DEFAULT_LOGGING_CONFIG_PORT, verify=None) Starts up a socket server on the specified port, and listens for new diff --git a/Doc/library/lzma.rst b/Doc/library/lzma.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvbHptYS5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvbHptYS5yc3Q= 100644 --- a/Doc/library/lzma.rst +++ b/Doc/library/lzma.rst @@ -19,8 +19,8 @@ :program:`xz` utility, as well as raw compressed streams. The interface provided by this module is very similar to that of the :mod:`bz2` -module. However, note that :class:`LZMAFile` is *not* thread-safe, unlike -:class:`bz2.BZ2File`, so if you need to use a single :class:`LZMAFile` instance +module. Note that :class:`LZMAFile` and :class:`bz2.BZ2File` are *not* +thread-safe, so if you need to use a single :class:`LZMAFile` instance from multiple threads, it is necessary to protect it with a lock. diff --git a/Doc/library/os.path.rst b/Doc/library/os.path.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvb3MucGF0aC5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvb3MucGF0aC5yc3Q= 100644 --- a/Doc/library/os.path.rst +++ b/Doc/library/os.path.rst @@ -175,8 +175,8 @@ On Windows, :envvar:`USERPROFILE` will be used if set, otherwise a combination of :envvar:`HOMEPATH` and :envvar:`HOMEDRIVE` will be used. An initial - ``~user`` is handled by stripping the last directory component from the created - user path derived above. + ``~user`` is handled by checking that the last directory component of the current + user's home directory matches :envvar:`USERNAME`, and replacing it if so. If the expansion fails or if the path does not begin with a tilde, the path is returned unchanged. @@ -306,11 +306,10 @@ Join one or more path components intelligently. The return value is the concatenation of *path* and any members of *\*paths* with exactly one - directory separator (``os.sep``) following each non-empty part except the - last, meaning that the result will only end in a separator if the last - part is empty. If a component is an absolute path, all previous - components are thrown away and joining continues from the absolute path - component. + directory separator following each non-empty part except the last, meaning + that the result will only end in a separator if the last part is empty. If + a component is an absolute path, all previous components are thrown away + and joining continues from the absolute path component. On Windows, the drive letter is not reset when an absolute path component (e.g., ``r'\foo'``) is encountered. If a component contains a drive @@ -367,7 +366,8 @@ Return a relative filepath to *path* either from the current directory or from an optional *start* directory. This is a path computation: the filesystem is not accessed to confirm the existence or nature of *path* or - *start*. + *start*. On Windows, :exc:`ValueError` is raised when *path* and *start* + are on different drives. *start* defaults to :attr:`os.curdir`. diff --git a/Doc/library/pathlib.rst b/Doc/library/pathlib.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvcGF0aGxpYi5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvcGF0aGxpYi5yc3Q= 100644 --- a/Doc/library/pathlib.rst +++ b/Doc/library/pathlib.rst @@ -705,7 +705,10 @@ .. classmethod:: Path.home() Return a new path object representing the user's home directory (as - returned by :func:`os.path.expanduser` with ``~`` construct):: + returned by :func:`os.path.expanduser` with ``~`` construct). If the home + directory can't be resolved, :exc:`RuntimeError` is raised. + + :: >>> Path.home() PosixPath('/home/antoine') @@ -713,8 +716,8 @@ .. versionadded:: 3.5 -.. method:: Path.stat() +.. method:: Path.stat(*, follow_symlinks=True) Return a :class:`os.stat_result` object containing information about this path, like :func:`os.stat`. The result is looked up at each call to this method. @@ -717,7 +720,10 @@ Return a :class:`os.stat_result` object containing information about this path, like :func:`os.stat`. The result is looked up at each call to this method. + This method normally follows symlinks; to stat a symlink add the argument + ``follow_symlinks=False``, or use :meth:`~Path.lstat`. + :: >>> p = Path('setup.py') @@ -726,4 +732,6 @@ >>> p.stat().st_mtime 1327883547.852554 + .. versionchanged:: 3.10 + The *follow_symlinks* parameter was added. @@ -729,3 +737,5 @@ -.. method:: Path.chmod(mode) +.. method:: Path.chmod(mode, *, follow_symlinks=True) + + Change the file mode and permissions, like :func:`os.chmod`. @@ -731,5 +741,9 @@ - Change the file mode and permissions, like :func:`os.chmod`:: + This method normally follows symlinks. Some Unix flavours support changing + permissions on the symlink itself; on these platforms you may add the + argument ``follow_symlinks=False``, or use :meth:`~Path.lchmod`. + + :: >>> p = Path('setup.py') >>> p.stat().st_mode @@ -738,6 +752,8 @@ >>> p.stat().st_mode 33060 + .. versionchanged:: 3.10 + The *follow_symlinks* parameter was added. .. method:: Path.exists() @@ -760,7 +776,10 @@ .. method:: Path.expanduser() Return a new path with expanded ``~`` and ``~user`` constructs, - as returned by :meth:`os.path.expanduser`:: + as returned by :meth:`os.path.expanduser`. If a home directory can't be + resolved, :exc:`RuntimeError` is raised. + + :: >>> p = PosixPath('~/films/Monty Python') >>> p.expanduser() @@ -1121,6 +1140,20 @@ of :func:`os.symlink`'s. +.. method:: Path.link_to(target) + + Make *target* a hard link to this path. + + .. warning:: + + This function does not make this path a hard link to *target*, despite + the implication of the function and argument names. The argument order + (target, link) is the reverse of :func:`Path.symlink_to`, but matches + that of :func:`os.link`. + + .. versionadded:: 3.8 + + .. method:: Path.touch(mode=0o666, exist_ok=True) Create a file at this given path. If *mode* is given, it is combined @@ -1145,13 +1178,6 @@ The *missing_ok* parameter was added. -.. method:: Path.link_to(target) - - Create a hard link pointing to a path named *target*. - - .. versionadded:: 3.8 - - .. method:: Path.write_bytes(data) Open the file pointed to in bytes mode, write *data* to it, and close the diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvcHByaW50LnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvcHByaW50LnJzdA== 100644 --- a/Doc/library/pprint.rst +++ b/Doc/library/pprint.rst @@ -28,6 +28,9 @@ .. versionchanged:: 3.9 Added support for pretty-printing :class:`types.SimpleNamespace`. +.. versionchanged:: 3.10 + Added support for pretty-printing :class:`dataclasses.dataclass`. + The :mod:`pprint` module defines one class: .. First the implementation class: @@ -36,7 +39,7 @@ .. index:: single: ...; placeholder .. class:: PrettyPrinter(indent=1, width=80, depth=None, stream=None, *, \ - compact=False, sort_dicts=True) + compact=False, sort_dicts=True, underscore_numbers=False) Construct a :class:`PrettyPrinter` instance. This constructor understands several keyword parameters. An output stream may be set using the *stream* @@ -55,7 +58,10 @@ will be formatted on a separate line. If *compact* is true, as many items as will fit within the *width* will be formatted on each output line. If *sort_dicts* is true (the default), dictionaries will be formatted with their - keys sorted, otherwise they will display in insertion order. + keys sorted, otherwise they will display in insertion order. If + *underscore_numbers* is true, integers will be formatted with the + ``_`` character for a thousands separator, otherwise underscores are not + displayed (the default). .. versionchanged:: 3.4 Added the *compact* parameter. @@ -63,6 +69,8 @@ .. versionchanged:: 3.8 Added the *sort_dicts* parameter. + .. versionchanged:: 3.10 + Added the *underscore_numbers* parameter. >>> import pprint >>> stuff = ['spam', 'eggs', 'lumberjack', 'knights', 'ni'] @@ -91,6 +99,6 @@ The :mod:`pprint` module also provides several shortcut functions: .. function:: pformat(object, indent=1, width=80, depth=None, *, \ - compact=False, sort_dicts=True) + compact=False, sort_dicts=True, underscore_numbers=False) Return the formatted representation of *object* as a string. *indent*, @@ -95,6 +103,6 @@ Return the formatted representation of *object* as a string. *indent*, - *width*, *depth*, *compact* and *sort_dicts* will be passed to the + *width*, *depth*, *compact*, *sort_dicts* and *underscore_numbers* will be passed to the :class:`PrettyPrinter` constructor as formatting parameters. .. versionchanged:: 3.4 @@ -103,6 +111,9 @@ .. versionchanged:: 3.8 Added the *sort_dicts* parameter. + .. versionchanged:: 3.10 + Added the *underscore_numbers* parameter. + .. function:: pp(object, *args, sort_dicts=False, **kwargs) @@ -116,9 +127,9 @@ .. function:: pprint(object, stream=None, indent=1, width=80, depth=None, *, \ - compact=False, sort_dicts=True) + compact=False, sort_dicts=True, underscore_numbers=False) Prints the formatted representation of *object* on *stream*, followed by a newline. If *stream* is ``None``, ``sys.stdout`` is used. This may be used in the interactive interpreter instead of the :func:`print` function for inspecting values (you can even reassign ``print = pprint.pprint`` for use @@ -120,9 +131,9 @@ Prints the formatted representation of *object* on *stream*, followed by a newline. If *stream* is ``None``, ``sys.stdout`` is used. This may be used in the interactive interpreter instead of the :func:`print` function for inspecting values (you can even reassign ``print = pprint.pprint`` for use - within a scope). *indent*, *width*, *depth*, *compact* and *sort_dicts* will + within a scope). *indent*, *width*, *depth*, *compact*, *sort_dicts* and *underscore_numbers* will be passed to the :class:`PrettyPrinter` constructor as formatting parameters. .. versionchanged:: 3.4 @@ -131,6 +142,9 @@ .. versionchanged:: 3.8 Added the *sort_dicts* parameter. + .. versionchanged:: 3.10 + Added the *underscore_numbers* parameter. + >>> import pprint >>> stuff = ['spam', 'eggs', 'lumberjack', 'knights', 'ni'] >>> stuff.insert(0, stuff) diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvc29ja2V0LnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvc29ja2V0LnJzdA== 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -610,6 +610,9 @@ .. versionchanged:: 3.9 The CAN_J1939 protocol was added. + .. versionchanged:: 3.10 + The IPPROTO_MPTCP protocol was added. + .. function:: socketpair([family[, type[, proto]]]) Build a pair of connected socket objects using the given address family, socket @@ -782,5 +785,5 @@ system if IPv6 isn't enabled):: >>> socket.getaddrinfo("example.org", 80, proto=socket.IPPROTO_TCP) - [(<AddressFamily.AF_INET6: 10>, <SocketType.SOCK_STREAM: 1>, + [(socket.AF_INET6, socket.SOCK_STREAM, 6, '', ('2606:2800:220:1:248:1893:25c8:1946', 80, 0, 0)), @@ -786,5 +789,5 @@ 6, '', ('2606:2800:220:1:248:1893:25c8:1946', 80, 0, 0)), - (<AddressFamily.AF_INET: 2>, <SocketType.SOCK_STREAM: 1>, + (socket.AF_INET, socket.SOCK_STREAM, 6, '', ('93.184.216.34', 80))] .. versionchanged:: 3.2 diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvc3FsaXRlMy5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvc3FsaXRlMy5yc3Q= 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -1090,5 +1090,5 @@ .. [#f1] The sqlite3 module is not built with loadable extension support by default, because some platforms (notably Mac OS X) have SQLite libraries which are compiled without this feature. To get loadable - extension support, you must pass ``--enable-loadable-sqlite-extensions`` to - configure. + extension support, you must pass the + :option:`--enable-loadable-sqlite-extensions` option to configure. diff --git a/Doc/library/ssl.rst b/Doc/library/ssl.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvc3NsLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvc3NsLnJzdA== 100644 --- a/Doc/library/ssl.rst +++ b/Doc/library/ssl.rst @@ -893,6 +893,14 @@ .. versionadded:: 3.6 +.. data:: OP_IGNORE_UNEXPECTED_EOF + + Ignore unexpected shutdown of TLS connections. + + This option is only available with OpenSSL 3.0.0 and later. + + .. versionadded:: 3.10 + .. data:: HAS_ALPN Whether the OpenSSL library has built-in support for the *Application-Layer @@ -1885,7 +1893,7 @@ .. attribute:: SSLContext.check_hostname - Whether to match the peer cert's hostname with :func:`match_hostname` in + Whether to match the peer cert's hostname in :meth:`SSLSocket.do_handshake`. The context's :attr:`~SSLContext.verify_mode` must be set to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, and you must pass *server_hostname* to @@ -2062,7 +2070,7 @@ :attr:`SSLContext.verify_flags` returns :class:`VerifyFlags` flags: >>> ssl.create_default_context().verify_flags # doctest: +SKIP - <VerifyFlags.VERIFY_X509_TRUSTED_FIRST: 32768> + ssl.VERIFY_X509_TRUSTED_FIRST .. attribute:: SSLContext.verify_mode @@ -2074,7 +2082,7 @@ :attr:`SSLContext.verify_mode` returns :class:`VerifyMode` enum: >>> ssl.create_default_context().verify_mode - <VerifyMode.CERT_REQUIRED: 2> + ssl.CERT_REQUIRED .. index:: single: certificates diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvc3RkdHlwZXMucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvc3RkdHlwZXMucnN0 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1581,9 +1581,10 @@ By default, the *errors* argument is not checked for best performances, but only used at the first encoding error. Enable the :ref:`Python Development - Mode <devmode>`, or use a debug build to check *errors*. + Mode <devmode>`, or use a :ref:`debug build <debug-build>` to check + *errors*. .. versionchanged:: 3.1 Support for keyword arguments added. .. versionchanged:: 3.9 @@ -1585,9 +1586,10 @@ .. versionchanged:: 3.1 Support for keyword arguments added. .. versionchanged:: 3.9 - The *errors* is now checked in development mode and in debug mode. + The *errors* is now checked in development mode and + in :ref:`debug mode <debug-build>`. .. method:: str.endswith(suffix[, start[, end]]) @@ -2710,7 +2712,7 @@ By default, the *errors* argument is not checked for best performances, but only used at the first decoding error. Enable the :ref:`Python Development - Mode <devmode>`, or use a debug build to check *errors*. + Mode <devmode>`, or use a :ref:`debug build <debug-build>` to check *errors*. .. note:: @@ -2722,7 +2724,8 @@ Added support for keyword arguments. .. versionchanged:: 3.9 - The *errors* is now checked in development mode and in debug mode. + The *errors* is now checked in development mode and + in :ref:`debug mode <debug-build>`. .. method:: bytes.endswith(suffix[, start[, end]]) diff --git a/Doc/library/string.rst b/Doc/library/string.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvc3RyaW5nLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvc3RyaW5nLnJzdA== 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -188,8 +188,8 @@ The :meth:`str.format` method and the :class:`Formatter` class share the same syntax for format strings (although in the case of :class:`Formatter`, subclasses can define their own format string syntax). The syntax is -related to that of :ref:`formatted string literals <f-strings>`, but -there are differences. +related to that of :ref:`formatted string literals <f-strings>`, but it is +less sophisticated and, in particular, does not support arbitrary expressions. .. index:: single: {} (curly brackets); in string formatting diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvc3lzLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvc3lzLnJzdA== 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -250,7 +250,8 @@ Print low-level information to stderr about the state of CPython's memory allocator. - If Python is configured --with-pydebug, it also performs some expensive + If Python is `built in debug mode <debug-build>` (:option:`configure + --with-pydebug option <--with-pydebug>`), it also performs some expensive internal consistency checks. .. versionadded:: 3.3 diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvdGVtcGZpbGUucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvdGVtcGZpbGUucnN0 100644 --- a/Doc/library/tempfile.rst +++ b/Doc/library/tempfile.rst @@ -305,7 +305,7 @@ explicit ``prefix``, ``suffix``, or ``dir`` arguments of type str are supplied. Please do not write code expecting or depending on this. This awkward behavior is maintained for - compatibility with the historcal implementation. + compatibility with the historical implementation. .. _tempfile-examples: diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvdGhyZWFkaW5nLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvdGhyZWFkaW5nLnJzdA== 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -16,9 +16,9 @@ .. note:: - While they are not listed below, the ``camelCase`` names used for some - methods and functions in this module in the Python 2.x series are still - supported by this module. + In the Python 2.x series, this module contained ``camelCase`` names + for some methods and functions. These are deprecated as of Python 3.10, + but they are still supported for compatibility with Python 2.5 and lower. .. impl-detail:: @@ -42,6 +42,8 @@ Return the number of :class:`Thread` objects currently alive. The returned count is equal to the length of the list returned by :func:`.enumerate`. + The function ``activeCount`` is a deprecated alias for this function. + .. function:: current_thread() @@ -50,6 +52,8 @@ :mod:`threading` module, a dummy thread object with limited functionality is returned. + The function ``currentThread`` is a deprecated alias for this function. + .. function:: excepthook(args, /) @@ -381,6 +385,6 @@ .. method:: getName() setName() - Old getter/setter API for :attr:`~Thread.name`; use it directly as a + Deprecated getter/setter API for :attr:`~Thread.name`; use it directly as a property instead. @@ -385,5 +389,7 @@ property instead. + .. deprecated:: 3.10 + .. attribute:: ident The 'thread identifier' of this thread or ``None`` if the thread has not @@ -433,6 +439,6 @@ .. method:: isDaemon() setDaemon() - Old getter/setter API for :attr:`~Thread.daemon`; use it directly as a + Deprecated getter/setter API for :attr:`~Thread.daemon`; use it directly as a property instead. @@ -437,5 +443,7 @@ property instead. + .. deprecated:: 3.10 + .. _lock-objects: @@ -771,6 +779,8 @@ calling thread has not acquired the lock when this method is called, a :exc:`RuntimeError` is raised. + The method ``notifyAll`` is a deprecated alias for this method. + .. _semaphore-objects: @@ -908,6 +918,8 @@ Return ``True`` if and only if the internal flag is true. + The method ``isSet`` is a deprecated alias for this method. + .. method:: set() Set the internal flag to true. All threads waiting for it to become true diff --git a/Doc/library/types.rst b/Doc/library/types.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvdHlwZXMucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvdHlwZXMucnN0 100644 --- a/Doc/library/types.rst +++ b/Doc/library/types.rst @@ -223,7 +223,7 @@ .. class:: ModuleType(name, doc=None) - The type of :term:`modules <module>`. Constructor takes the name of the + The type of :term:`modules <module>`. The constructor takes the name of the module to be created and optionally its :term:`docstring`. .. note:: @@ -238,8 +238,18 @@ The :term:`loader` which loaded the module. Defaults to ``None``. + This attribute is to match :attr:`importlib.machinery.ModuleSpec.loader` + as stored in the attr:`__spec__` object. + + .. note:: + A future version of Python may stop setting this attribute by default. + To guard against this potential change, preferrably read from the + :attr:`__spec__` attribute instead or use + ``getattr(module, "__loader__", None)`` if you explicitly need to use + this attribute. + .. versionchanged:: 3.4 Defaults to ``None``. Previously the attribute was optional. .. attribute:: __name__ @@ -241,9 +251,10 @@ .. versionchanged:: 3.4 Defaults to ``None``. Previously the attribute was optional. .. attribute:: __name__ - The name of the module. + The name of the module. Expected to match + :attr:`importlib.machinery.ModuleSpec.name`. .. attribute:: __package__ @@ -252,6 +263,16 @@ to ``''``, else it should be set to the name of the package (which can be :attr:`__name__` if the module is a package itself). Defaults to ``None``. + This attribute is to match :attr:`importlib.machinery.ModuleSpec.parent` + as stored in the attr:`__spec__` object. + + .. note:: + A future version of Python may stop setting this attribute by default. + To guard against this potential change, preferrably read from the + :attr:`__spec__` attribute instead or use + ``getattr(module, "__package__", None)`` if you explicitly need to use + this attribute. + .. versionchanged:: 3.4 Defaults to ``None``. Previously the attribute was optional. @@ -255,6 +276,13 @@ .. versionchanged:: 3.4 Defaults to ``None``. Previously the attribute was optional. + .. attribute:: __spec__ + + A record of the the module's import-system-related state. Expected to be + an instance of :class:`importlib.machinery.ModuleSpec`. + + .. versionadded:: 3.4 + .. data:: EllipsisType diff --git a/Doc/library/typing.rst b/Doc/library/typing.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvdHlwaW5nLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvdHlwaW5nLnJzdA== 100644 --- a/Doc/library/typing.rst +++ b/Doc/library/typing.rst @@ -1058,8 +1058,10 @@ components. ``P.args`` represents the tuple of positional parameters in a given call and should only be used to annotate ``*args``. ``P.kwargs`` represents the mapping of keyword parameters to their values in a given call, - and should be only be used to annotate ``**kwargs`` or ``**kwds``. Both - attributes require the annotated parameter to be in scope. + and should be only be used to annotate ``**kwargs``. Both + attributes require the annotated parameter to be in scope. At runtime, + ``P.args`` and ``P.kwargs`` are instances respectively of + :class:`ParamSpecArgs` and :class:`ParamSpecKwargs`. Parameter specification variables created with ``covariant=True`` or ``contravariant=True`` can be used to declare covariant or contravariant @@ -1078,6 +1080,24 @@ ``ParamSpec`` and ``Concatenate``). * :class:`Callable` and :class:`Concatenate`. +.. data:: ParamSpecArgs +.. data:: ParamSpecKwargs + + Arguments and keyword arguments attributes of a :class:`ParamSpec`. The + ``P.args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, + and ``P.kwargs`` is an instance of ``ParamSpecKwargs``. They are intended + for runtime introspection and have no special meaning to static type checkers. + + Calling :func:`get_origin` on either of these objects will return the + original ``ParamSpec``:: + + P = ParamSpec("P") + get_origin(P.args) # returns P + get_origin(P.kwargs) # returns P + + .. versionadded:: 3.10 + + .. data:: AnyStr ``AnyStr`` is a type variable defined as @@ -1144,10 +1164,7 @@ .. note:: :func:`runtime_checkable` will check only the presence of the required methods, - not their type signatures! For example, :class:`builtins.complex <complex>` - implements :func:`__float__`, therefore it passes an :func:`issubclass` check - against :class:`SupportsFloat`. However, the ``complex.__float__`` method - exists only to raise a :class:`TypeError` with a more informative message. + not their type signatures. .. versionadded:: 3.8 @@ -1948,7 +1965,7 @@ .. class:: ForwardRef A class used for internal typing representation of string forward references. - For example, ``list["SomeClass"]`` is implicitly transformed into - ``list[ForwardRef("SomeClass")]``. This class should not be instantiated by + For example, ``List["SomeClass"]`` is implicitly transformed into + ``List[ForwardRef("SomeClass")]``. This class should not be instantiated by a user, but may be used by introspection tools. @@ -1953,5 +1970,10 @@ a user, but may be used by introspection tools. + .. note:: + :pep:`585` generic types such as ``list["SomeClass"]`` will not be + implicitly transformed into ``list[ForwardRef("SomeClass")]`` and thus + will not automatically resolve to ``list[SomeClass]``. + .. versionadded:: 3.7.4 Constant diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvd2FybmluZ3MucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvd2FybmluZ3MucnN0 100644 --- a/Doc/library/warnings.rst +++ b/Doc/library/warnings.rst @@ -229,7 +229,7 @@ ignore::ImportWarning ignore::ResourceWarning -In debug builds, the list of default warning filters is empty. +In a :ref:`debug build <debug-build>`, the list of default warning filters is empty. .. versionchanged:: 3.2 :exc:`DeprecationWarning` is now ignored by default in addition to diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkveG1scnBjLmNsaWVudC5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkveG1scnBjLmNsaWVudC5yc3Q= 100644 --- a/Doc/library/xmlrpc.client.rst +++ b/Doc/library/xmlrpc.client.rst @@ -378,7 +378,7 @@ .. attribute:: faultCode - A string indicating the fault type. + An int indicating the fault type. .. attribute:: faultString diff --git a/Doc/library/zoneinfo.rst b/Doc/library/zoneinfo.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL2xpYnJhcnkvem9uZWluZm8ucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL2xpYnJhcnkvem9uZWluZm8ucnN0 100644 --- a/Doc/library/zoneinfo.rst +++ b/Doc/library/zoneinfo.rst @@ -124,8 +124,9 @@ locations for time zone data). On POSIX systems, downstream distributors and those building Python from source who know where their system time zone data is deployed may change the default time zone path by specifying -the compile-time option ``TZPATH`` (or, more likely, the ``configure`` flag -``--with-tzpath``), which should be a string delimited by :data:`os.pathsep`. +the compile-time option ``TZPATH`` (or, more likely, the :option:`configure +flag --with-tzpath <--with-tzpath>`), which should be a string delimited by +:data:`os.pathsep`. On all platforms, the configured value is available as the ``TZPATH`` key in :func:`sysconfig.get_config_var`. diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3JlZmVyZW5jZS9jb21wb3VuZF9zdG10cy5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3JlZmVyZW5jZS9jb21wb3VuZF9zdG10cy5yc3Q= 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -533,7 +533,7 @@ match_stmt: 'match' `subject_expr` ":" NEWLINE INDENT `case_block`+ DEDENT subject_expr: `star_named_expression` "," `star_named_expressions`? : | `named_expression` - case_block: 'case' `patterns` [`guard`] ':' `block` + case_block: 'case' `patterns` [`guard`] ":" `block` .. note:: This section uses single quotes to denote @@ -861,7 +861,7 @@ Syntax: .. productionlist:: python-grammar - group_pattern: '(' `pattern` ')' + group_pattern: "(" `pattern` ")" In simple terms ``(P)`` has the same effect as ``P``. @@ -1030,7 +1030,7 @@ For a number of built-in types (specified below), a single positional subpattern is accepted which will match the entire subject; for these types - no keyword patterns are accepted. + keyword patterns also work as for other types. If only keyword patterns are present, they are processed as follows, one by one: @@ -1057,7 +1057,7 @@ * If this raises an exception, the exception bubbles up. - * If the returned value is not a list or tuple, the conversion fails and + * If the returned value is not a tuple, the conversion fails and :exc:`TypeError` is raised. * If there are more positional patterns than ``len(cls.__match_args__)``, @@ -1138,7 +1138,6 @@ : ["->" `expression`] ":" `suite` decorators: `decorator`+ decorator: "@" `assignment_expression` NEWLINE - dotted_name: `identifier` ("." `identifier`)* parameter_list: `defparameter` ("," `defparameter`)* "," "/" ["," [`parameter_list_no_posonly`]] : | `parameter_list_no_posonly` parameter_list_no_posonly: `defparameter` ("," `defparameter`)* ["," [`parameter_list_starargs`]] @@ -1215,8 +1214,9 @@ return penguin .. index:: + single: / (slash); function definition single: * (asterisk); function definition single: **; function definition Function call semantics are described in more detail in section :ref:`calls`. A function call always assigns values to all parameters mentioned in the parameter @@ -1218,12 +1218,12 @@ single: * (asterisk); function definition single: **; function definition Function call semantics are described in more detail in section :ref:`calls`. A function call always assigns values to all parameters mentioned in the parameter -list, either from position arguments, from keyword arguments, or from default +list, either from positional arguments, from keyword arguments, or from default values. If the form "``*identifier``" is present, it is initialized to a tuple receiving any excess positional parameters, defaulting to the empty tuple. If the form "``**identifier``" is present, it is initialized to a new ordered mapping receiving any excess keyword arguments, defaulting to a new empty mapping of the same type. Parameters after "``*``" or "``*identifier``" are keyword-only parameters and may only be passed @@ -1224,10 +1224,15 @@ values. If the form "``*identifier``" is present, it is initialized to a tuple receiving any excess positional parameters, defaulting to the empty tuple. If the form "``**identifier``" is present, it is initialized to a new ordered mapping receiving any excess keyword arguments, defaulting to a new empty mapping of the same type. Parameters after "``*``" or "``*identifier``" are keyword-only parameters and may only be passed -used keyword arguments. +by keyword arguments. Parameters before "``/``" are positional-only parameters +and may only be passed by positional arguments. + +.. versionchanged:: 3.8 + The ``/`` function parameter syntax may be used to indicate positional-only + parameters. See :pep:`570` for details. .. index:: pair: function; annotations diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3JlZmVyZW5jZS9kYXRhbW9kZWwucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3JlZmVyZW5jZS9kYXRhbW9kZWwucnN0 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1132,9 +1132,8 @@ around any other object, usually a user-defined method object. When a static method object is retrieved from a class or a class instance, the object actually returned is the wrapped object, which is not subject to any further - transformation. Static method objects are not themselves callable, although the - objects they wrap usually are. Static method objects are created by the built-in - :func:`staticmethod` constructor. + transformation. Static method objects are also callable. Static method + objects are created by the built-in :func:`staticmethod` constructor. Class method objects A class method object, like a static method object, is a wrapper around another @@ -2565,7 +2564,7 @@ .. data:: object.__match_args__ - This class variable can be assigned a tuple or list of strings. When this class is + This class variable can be assigned a tuple of strings. When this class is used in a class pattern with positional arguments, each positional argument will be converted into a keyword argument, using the corresponding value in *__match_args__* as the keyword. The absence of this attribute is equivalent to diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3JlZmVyZW5jZS9leHByZXNzaW9ucy5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3JlZmVyZW5jZS9leHByZXNzaW9ucy5yc3Q= 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -185,7 +185,7 @@ comprehension: `assignment_expression` `comp_for` comp_for: ["async"] "for" `target_list` "in" `or_test` [`comp_iter`] comp_iter: `comp_for` | `comp_if` - comp_if: "if" `expression_nocond` [`comp_iter`] + comp_if: "if" `or_test` [`comp_iter`] The comprehension consists of a single expression followed by at least one :keyword:`!for` clause and zero or more :keyword:`!for` or :keyword:`!if` clauses. @@ -1707,7 +1707,6 @@ .. productionlist:: python-grammar conditional_expression: `or_test` ["if" `or_test` "else" `expression`] expression: `conditional_expression` | `lambda_expr` - expression_nocond: `or_test` | `lambda_expr_nocond` Conditional expressions (sometimes called a "ternary operator") have the lowest priority of all Python operations. @@ -1733,7 +1732,6 @@ .. productionlist:: python-grammar lambda_expr: "lambda" [`parameter_list`] ":" `expression` - lambda_expr_nocond: "lambda" [`parameter_list`] ":" `expression_nocond` Lambda expressions (sometimes called lambda forms) are used to create anonymous functions. The expression ``lambda parameters: expression`` yields a function diff --git a/Doc/reference/import.rst b/Doc/reference/import.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3JlZmVyZW5jZS9pbXBvcnQucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3JlZmVyZW5jZS9pbXBvcnQucnN0 100644 --- a/Doc/reference/import.rst +++ b/Doc/reference/import.rst @@ -329,6 +329,10 @@ import machinery will try it only if the finder does not implement ``find_spec()``. +.. versionchanged:: 3.10 + Use of :meth:`~importlib.abc.MetaPathFinder.find_module` by the import system + now raises :exc:`ImportWarning`. + Loading ======= @@ -470,6 +474,9 @@ An :exc:`ImportError` is raised when ``exec_module()`` is defined but ``create_module()`` is not. +.. versionchanged:: 3.10 + Use of ``load_module()`` will raise :exc:`ImportWarning`. + Submodules ---------- @@ -675,6 +682,13 @@ :meth:`~importlib.abc.Loader.module_repr` method, if defined, before trying either approach described above. However, the method is deprecated. +.. versionchanged:: 3.10 + + Calling :meth:`~importlib.abc.Loader.module_repr` now occurs after trying to + use a module's ``__spec__`` attribute but before falling back on + ``__file__``. Use of :meth:`~importlib.abc.Loader.module_repr` is slated to + stop in Python 3.12. + .. _pyc-invalidation: Cached bytecode invalidation @@ -889,6 +903,11 @@ exist on a path entry finder, the import system will always call ``find_loader()`` in preference to ``find_module()``. +.. versionchanged:: 3.10 + Calls to :meth:`~importlib.abc.PathEntryFinder.find_module` and + :meth:`~importlib.abc.PathEntryFinder.find_loader` by the import + system will raise :exc:`ImportWarning`. + Replacing the standard import system ==================================== diff --git a/Doc/reference/simple_stmts.rst b/Doc/reference/simple_stmts.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3JlZmVyZW5jZS9zaW1wbGVfc3RtdHMucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3JlZmVyZW5jZS9zaW1wbGVfc3RtdHMucnN0 100644 --- a/Doc/reference/simple_stmts.rst +++ b/Doc/reference/simple_stmts.rst @@ -591,10 +591,13 @@ __context__ (exception attribute) The ``from`` clause is used for exception chaining: if given, the second -*expression* must be another exception class or instance, which will then be -attached to the raised exception as the :attr:`__cause__` attribute (which is -writable). If the raised exception is not handled, both exceptions will be -printed:: +*expression* must be another exception class or instance. If the second +expression is an exception instance, it will be attached to the raised +exception as the :attr:`__cause__` attribute (which is writable). If the +expression is an exception class, the class will be instantiated and the +resulting exception instance will be attached to the raised exception as the +:attr:`__cause__` attribute. If the raised exception is not handled, both +exceptions will be printed:: >>> try: ... print(1 / 0) @@ -874,9 +877,6 @@ * blank lines, and * other future statements. -The only feature that requires using the future statement is -``annotations`` (see :pep:`563`). - All historical features enabled by the future statement are still recognized by Python 3. The list includes ``absolute_import``, ``division``, ``generators``, ``generator_stop``, ``unicode_literals``, @@ -880,8 +880,8 @@ All historical features enabled by the future statement are still recognized by Python 3. The list includes ``absolute_import``, ``division``, ``generators``, ``generator_stop``, ``unicode_literals``, -``print_function``, ``nested_scopes`` and ``with_statement``. They are -all redundant because they are always enabled, and only kept for +``print_function``, ``nested_scopes``, ``with_statement`` and ``annotations``. +They are all redundant because they are always enabled, and only kept for backwards compatibility. A future statement is recognized and treated specially at compile time: Changes diff --git a/Doc/tools/extensions/glossary_search.py b/Doc/tools/extensions/glossary_search.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3Rvb2xzL2V4dGVuc2lvbnMvZ2xvc3Nhcnlfc2VhcmNoLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3Rvb2xzL2V4dGVuc2lvbnMvZ2xvc3Nhcnlfc2VhcmNoLnB5 100644 --- a/Doc/tools/extensions/glossary_search.py +++ b/Doc/tools/extensions/glossary_search.py @@ -7,6 +7,8 @@ :license: Python license. """ -from os import path +import json +import os.path +from docutils.nodes import definition_list_item from sphinx.addnodes import glossary from sphinx.util import logging @@ -11,7 +13,5 @@ from sphinx.addnodes import glossary from sphinx.util import logging -from docutils.nodes import definition_list_item -import json logger = logging.getLogger(__name__) @@ -15,6 +15,8 @@ logger = logging.getLogger(__name__) +STATIC_DIR = '_static' +JSON = 'glossary.json' def process_glossary_nodes(app, doctree, fromdocname): @@ -45,8 +47,12 @@ if not app.env.glossary_terms: return - logger.info('Writing glossary.json', color='green') - with open(path.join(app.outdir, '_static', 'glossary.json'), 'w') as f: + logger.info(f'Writing {JSON}', color='green') + + dest_dir = os.path.join(app.outdir, STATIC_DIR) + os.makedirs(dest_dir, exist_ok=True) + + with open(os.path.join(dest_dir, JSON), 'w') as f: json.dump(app.env.glossary_terms, f) diff --git a/Doc/tools/susp-ignored.csv b/Doc/tools/susp-ignored.csv index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3Rvb2xzL3N1c3AtaWdub3JlZC5jc3Y=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3Rvb2xzL3N1c3AtaWdub3JlZC5jc3Y= 100644 --- a/Doc/tools/susp-ignored.csv +++ b/Doc/tools/susp-ignored.csv @@ -365,3 +365,4 @@ library/importlib.metadata,,:main,"EntryPoint(name='wheel', value='wheel.cli:main', group='console_scripts')" library/importlib.metadata,,`,loading the metadata for packages for the indicated ``context``. library/re,,`,"`" +using/configure,84,:db2,=db1:db2:... diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3R1dG9yaWFsL2NvbnRyb2xmbG93LnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3R1dG9yaWFsL2NvbnRyb2xmbG93LnJzdA== 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -1038,7 +1038,7 @@ by an expression evaluating to the value of the annotation. Return annotations are defined by a literal ``->``, followed by an expression, between the parameter list and the colon denoting the end of the :keyword:`def` statement. The -following example has a positional argument, a keyword argument, and the return +following example has a required argument, an optional argument, and the return value annotated:: >>> def f(ham: str, eggs: str = 'eggs') -> str: diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3R1dG9yaWFsL2RhdGFzdHJ1Y3R1cmVzLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3R1dG9yaWFsL2RhdGFzdHJ1Y3R1cmVzLnJzdA== 100644 --- a/Doc/tutorial/datastructures.rst +++ b/Doc/tutorial/datastructures.rst @@ -661,9 +661,8 @@ The comparison operators ``in`` and ``not in`` check whether a value occurs (does not occur) in a sequence. The operators ``is`` and ``is not`` compare -whether two objects are really the same object; this only matters for mutable -objects like lists. All comparison operators have the same priority, which is -lower than that of all numerical operators. +whether two objects are really the same object. All comparison operators have +the same priority, which is lower than that of all numerical operators. Comparisons can be chained. For example, ``a < b == c`` tests whether ``a`` is less than ``b`` and moreover ``b`` equals ``c``. diff --git a/Doc/tutorial/venv.rst b/Doc/tutorial/venv.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3R1dG9yaWFsL3ZlbnYucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3R1dG9yaWFsL3ZlbnYucnN0 100644 --- a/Doc/tutorial/venv.rst +++ b/Doc/tutorial/venv.rst @@ -95,8 +95,5 @@ You can install, upgrade, and remove packages using a program called :program:`pip`. By default ``pip`` will install packages from the Python Package Index, <https://pypi.org>. You can browse the Python -Package Index by going to it in your web browser, or you can use ``pip``'s -limited search feature: - -.. code-block:: bash +Package Index by going to it in your web browser. @@ -102,13 +99,5 @@ - (tutorial-env) $ pip search astronomy - skyfield - Elegant astronomy for Python - gary - Galactic astronomy and gravitational dynamics. - novas - The United States Naval Observatory NOVAS astronomy library - astroobs - Provides astronomy ephemeris to plan telescope observations - PyAstronomy - A collection of astronomy related tools for Python. - ... - -``pip`` has a number of subcommands: "search", "install", "uninstall", +``pip`` has a number of subcommands: "install", "uninstall", "freeze", etc. (Consult the :ref:`installing-index` guide for complete documentation for ``pip``.) diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3VzaW5nL2NtZGxpbmUucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3VzaW5nL2NtZGxpbmUucnN0 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -433,7 +433,8 @@ * ``-X faulthandler`` to enable :mod:`faulthandler`; * ``-X showrefcount`` to output the total reference count and number of used memory blocks when the program finishes or after each statement in the - interactive interpreter. This only works on debug builds. + interactive interpreter. This only works on :ref:`debug builds + <debug-build>`. * ``-X tracemalloc`` to start tracing Python memory allocations using the :mod:`tracemalloc` module. By default, only the most recent frame is stored in a traceback of a trace. Use ``-X tracemalloc=NFRAME`` to start @@ -453,6 +454,9 @@ * ``-X pycache_prefix=PATH`` enables writing ``.pyc`` files to a parallel tree rooted at the given directory instead of to the code tree. See also :envvar:`PYTHONPYCACHEPREFIX`. + * ``-X warn_default_encoding`` issues a :class:`EncodingWarning` when the + locale-specific default encoding is used for opening files. + See also :envvar:`PYTHONWARNDEFAULTENCODING`. It also allows passing arbitrary values and retrieving them through the :data:`sys._xoptions` dictionary. @@ -482,6 +486,9 @@ The ``-X showalloccount`` option has been removed. + .. versionadded:: 3.10 + The ``-X warn_default_encoding`` option. + .. deprecated-removed:: 3.9 3.10 The ``-X oldparser`` option. @@ -907,7 +914,16 @@ .. versionadded:: 3.7 +.. envvar:: PYTHONWARNDEFAULTENCODING + + If this environment variable is set to a non-empty string, issue a + :class:`EncodingWarning` when the locale-specific default encoding is used. + + See :ref:`io-encoding-warning` for details. + + .. versionadded:: 3.10 + Debug-mode variables ~~~~~~~~~~~~~~~~~~~~ @@ -910,10 +926,8 @@ Debug-mode variables ~~~~~~~~~~~~~~~~~~~~ -Setting these variables only has an effect in a debug build of Python. - .. envvar:: PYTHONTHREADDEBUG If set, Python will print threading debug info. @@ -916,8 +930,8 @@ .. envvar:: PYTHONTHREADDEBUG If set, Python will print threading debug info. - Need Python configured with the ``--with-pydebug`` build option. + Need a :ref:`debug build of Python <debug-build>`. .. envvar:: PYTHONDUMPREFS @@ -925,4 +939,4 @@ If set, Python will dump objects and reference counts still alive after shutting down the interpreter. - Need Python configured with the ``--with-trace-refs`` build option. + Need Python configured with the :option:`--with-trace-refs` build option. diff --git a/Doc/using/configure.rst b/Doc/using/configure.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3VzaW5nL2NvbmZpZ3VyZS5yc3Q= --- /dev/null +++ b/Doc/using/configure.rst @@ -0,0 +1,807 @@ +**************** +Configure Python +**************** + +.. _configure-options: + +Configure Options +================= + +List all ``./configure`` script options using:: + + ./configure --help + +See also the :file:`Misc/SpecialBuilds.txt` in the Python source distribution. + +General Options +--------------- + +.. cmdoption:: --enable-loadable-sqlite-extensions + + Support loadable extensions in the :mod:`_sqlite` extension module (default + is no). + + See the :meth:`sqlite3.Connection.enable_load_extension` method of the + :mod:`sqlite3` module. + + .. versionadded:: 3.6 + +.. cmdoption:: --disable-ipv6 + + Disable IPv6 support (enabled by default if supported), see the + :mod:`socket` module. + +.. cmdoption:: --enable-big-digits=[15|30] + + Define the size in bits of Python :class:`int` digits: 15 or 30 bits. + + By default, the number of bits is selected depending on ``sizeof(void*)``: + 30 bits if ``void*`` size is 64-bit or larger, 15 bits otherwise. + + Define the ``PYLONG_BITS_IN_DIGIT`` to ``15`` or ``30``. + + See :data:`sys.int_info.bits_per_digit <sys.int_info>`. + +.. cmdoption:: --with-cxx-main +.. cmdoption:: --with-cxx-main=COMPILER + + Compile the Python ``main()`` function and link Python executable with C++ + compiler: ``$CXX``, or *COMPILER* if specified. + +.. cmdoption:: --with-suffix=SUFFIX + + Set the Python executable suffix to *SUFFIX*. + + The default suffix is ``.exe`` on Windows and macOS (``python.exe`` + executable), and an empty string on other platforms (``python`` executable). + +.. cmdoption:: --with-tzpath=<list of absolute paths separated by pathsep> + + Select the default time zone search path for :data:`zoneinfo.TZPATH`. + See the :ref:`Compile-time configuration + <zoneinfo_data_compile_time_config>` of the :mod:`zoneinfo` module. + + Default: ``/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/zoneinfo``. + + See :data:`os.pathsep` path separator. + + .. versionadded:: 3.9 + +.. cmdoption:: --without-decimal-contextvar + + Build the ``_decimal`` extension module using a thread-local context rather + than a coroutine-local context (default), see the :mod:`decimal` module. + + See :data:`decimal.HAVE_CONTEXTVAR` and the :mod:`contextvars` module. + + .. versionadded:: 3.9 + +.. cmdoption:: --with-dbmliborder=db1:db2:... + + Override order to check db backends for the :mod:`dbm` module + + A valid value is a colon (``:``) separated string with the backend names: + + * ``ndbm``; + * ``gdbm``; + * ``bdb``. + +.. cmdoption:: --without-c-locale-coercion + + Disable C locale coercion to a UTF-8 based locale (enabled by default). + + Don't define the ``PY_COERCE_C_LOCALE`` macro. + + See :envvar:`PYTHONCOERCECLOCALE` and the :pep:`538`. + +.. cmdoption:: --with-platlibdir=DIRNAME + + Python library directory name (default is ``lib``). + + Fedora and SuSE use ``lib64`` on 64-bit platforms. + + See :data:`sys.platlibdir`. + + .. versionadded:: 3.9 + +.. cmdoption:: --with-wheel-pkg-dir=PATH + + Directory of wheel packages used by the :mod:`ensurepip` module + (none by default). + + Some Linux distribution packaging policies recommend against bundling + dependencies. For example, Fedora installs wheel packages in the + ``/usr/share/python-wheels/`` directory and don't install the + :mod:`ensurepip._bundled` package. + + .. versionadded:: 3.10 + + +Install Options +--------------- + +.. cmdoption:: --disable-test-modules + + Don't build nor install test modules, like the :mod:`test` package or the + :mod:`_testcapi` extension module (built and installed by default). + + .. versionadded:: 3.10 + +.. cmdoption:: --with-ensurepip=[upgrade|install|no] + + Select the :mod:`ensurepip` command run on Python installation: + + * ``upgrade`` (default): run ``python -m ensurepip --altinstall --upgrade`` + command. + * ``install``: run ``python -m ensurepip --altinstall`` command; + * ``no``: don't run ensurepip; + + .. versionadded:: 3.6 + + +Performance options +------------------- + +Configuring Python using ``--enable-optimizations --with-lto`` (PGO + LTO) is +recommended for best performance. + +.. cmdoption:: --enable-optimizations + + Enable Profile Guided Optimization (PGO) using :envvar:`PROFILE_TASK` + (disabled by default). + + The C compiler Clang requires ``llvm-profdata`` program for PGO. On + macOS, GCC also requires it: GCC is just an alias to Clang on macOS. + + Disable also semantic interposition in libpython if ``--enable-shared`` and + GCC is used: add ``-fno-semantic-interposition`` to the compiler and linker + flags. + + .. versionadded:: 3.6 + + .. versionchanged:: 3.10 + Use ``-fno-semantic-interposition`` on GCC. + +.. envvar:: PROFILE_TASK + + Environment variable used in the Makefile: Python command line arguments for + the PGO generation task. + + Default: ``-m test --pgo --timeout=$(TESTTIMEOUT)``. + + .. versionadded:: 3.8 + +.. cmdoption:: --with-lto + + Enable Link Time Optimization (LTO) in any build (disabled by default). + + The C compiler Clang requires ``llvm-ar`` for LTO, as well as an LTO-aware + linker (``ld.gold`` or ``lld``). + + .. versionadded:: 3.6 + +.. cmdoption:: --with-computed-gotos + + Enable computed gotos in evaluation loop (enabled by default on supported + compilers). + +.. cmdoption:: --without-pymalloc + + Disable the specialized Python memory allocator :ref:`pymalloc <pymalloc>` + (enabled by default). + + See also :envvar:`PYTHONMALLOC` environment variable. + +.. cmdoption:: --without-doc-strings + + Disable static documentation strings to reduce the memory footprint (enabled + by default). Documentation strings defined in Python are not affected. + + Don't define the ``WITH_DOC_STRINGS`` macro. + + See the ``PyDoc_STRVAR()`` macro. + +.. cmdoption:: --enable-profiling + + Enable C-level code profiling with ``gprof`` (disabled by default). + + +.. _debug-build: + +Debug build +----------- + +A debug build is Python built with the :option:`--with-pydebug` configure +option. + +Effects of a debug build: + +* Define ``Py_DEBUG`` and ``Py_REF_DEBUG`` macros. +* Add ``d`` to :data:`sys.abiflags`. +* Add :func:`sys.gettotalrefcount` function. +* Add :option:`-X showrefcount <-X>` command line option. +* Add :envvar:`PYTHONTHREADDEBUG` environment variable. +* Add support for the ``__ltrace__`` variable: enable low-level tracing in the + bytecode evaluation loop if the variable is defined. +* The list of default warning filters is empty in the :mod:`warnings` module. +* Install debug hooks on memory allocators to detect buffer overflow and other + memory errors: see :c:func:`PyMem_SetupDebugHooks`. +* Build Python with assertions (don't set ``NDEBUG`` macro): + ``assert(...);`` and ``_PyObject_ASSERT(...);``. + See also the :option:`--with-assertions` configure option. +* Unicode and int objects are created with their memory filled with a pattern + to help detecting uninitialized bytes. +* Many functions ensure that are not called with an exception raised, since + they can clear or replace the current exception. +* The garbage collector (:func:`gc.collect` function) runs some basic checks on + objects consistency. +* More generally, add runtime checks, code surroundeded by ``#ifdef Py_DEBUG`` + and ``#endif``. + +See also the :ref:`Python Development Mode <devmode>` and the +:option:`--with-trace-refs` configure option. + +.. versionchanged:: 3.8 + Release builds and debug builds are now ABI compatible: defining the + ``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro, which + introduces the only ABI incompatibility. + + +Debug options +------------- + +.. cmdoption:: --with-pydebug + + :ref:`Build Python in debug mode <debug-build>`: define the ``Py_DEBUG`` + macro (disabled by default). + +.. cmdoption:: --with-trace-refs + + Enable tracing references for debugging purpose (disabled by default). + + Effects: + + * Define the ``Py_TRACE_REFS`` macro. + * Add :func:`sys.getobjects` function. + * Add :envvar:`PYTHONDUMPREFS` environment variable. + + This build is not ABI compatible with release build (default build) or debug + build (``Py_DEBUG`` and ``Py_REF_DEBUG`` macros). + + .. versionadded:: 3.8 + +.. cmdoption:: --with-assertions + + Build with C assertions enabled (default is no): ``assert(...);`` and + ``_PyObject_ASSERT(...);``. + + If set, the ``NDEBUG`` macro is not defined in the :envvar:`OPT` compiler + variable. + + See also the :option:`--with-pydebug` option (:ref:`debug build + <debug-build>`) which also enables assertions. + + .. versionadded:: 3.6 + +.. cmdoption:: --with-valgrind + + Enable Valgrind support (default is no). + +.. cmdoption:: --with-dtrace + + Enable DTrace support (default is no). + + See :ref:`Instrumenting CPython with DTrace and SystemTap + <instrumentation>`. + + .. versionadded:: 3.6 + +.. cmdoption:: --with-address-sanitizer + + Enable AddressSanitizer memory error detector, ``asan`` (default is no). + + .. versionadded:: 3.6 + +.. cmdoption:: --with-memory-sanitizer + + Enable MemorySanitizer allocation error detector, ``msan`` (default is no). + + .. versionadded:: 3.6 + +.. cmdoption:: --with-undefined-behavior-sanitizer + + Enable UndefinedBehaviorSanitizer undefined behaviour detector, ``ubsan`` + (default is no). + + .. versionadded:: 3.6 + + +Linker options +-------------- + +.. cmdoption:: --enable-shared + + Enable building a shared Python library: ``libpython`` (default is no). + +.. cmdoption:: --without-static-libpython + + Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o`` + (built and enabled by default). + + .. versionadded:: 3.10 + + +Libraries options +----------------- + +.. cmdoption:: --with-libs='lib1 ...' + + Link against additional libraries (default is no). + +.. cmdoption:: --with-system-expat + + Build the :mod:`pyexpat` module using an installed ``expat`` library + (default is no). + +.. cmdoption:: --with-system-ffi + + Build the :mod:`_ctypes` extension module using an installed ``ffi`` + library, see the :mod:`ctypes` module (default is system-dependent). + +.. cmdoption:: --with-system-libmpdec + + Build the ``_decimal`` extension module using an installed ``mpdec`` + library, see the :mod:`decimal` module (default is no). + + .. versionadded:: 3.3 + +.. cmdoption:: --with-readline=editline + + Use ``editline`` library for backend of the :mod:`readline` module. + + Define the ``WITH_EDITLINE`` macro. + + .. versionadded:: 3.10 + +.. cmdoption:: --without-readline + + Don't build the :mod:`readline` module (built by default). + + Don't define the ``HAVE_LIBREADLINE`` macro. + + .. versionadded:: 3.10 + +.. cmdoption:: --with-tcltk-includes='-I...' + + Override search for Tcl and Tk include files. + +.. cmdoption:: --with-tcltk-libs='-L...' + + Override search for Tcl and Tk libraries. + +.. cmdoption:: --with-libm=STRING + + Override ``libm`` math library to *STRING* (default is system-dependent). + +.. cmdoption:: --with-libc=STRING + + Override ``libc`` C library to *STRING* (default is system-dependent). + +.. cmdoption:: --with-openssl=DIR + + Root of the OpenSSL directory. + + .. versionadded:: 3.7 + +.. cmdoption:: --with-openssl-rpath=[no|auto|DIR] + + Set runtime library directory (rpath) for OpenSSL libraries: + + * ``no`` (default): don't set rpath; + * ``auto``: auto-detect rpath from :option:`--with-openssl` and + ``pkg-config``; + * *DIR*: set an explicit rpath. + + .. versionadded:: 3.10 + + +Security Options +---------------- + +.. cmdoption:: --with-hash-algorithm=[fnv|siphash24] + + Select hash algorithm for use in ``Python/pyhash.c``: + + * ``siphash24`` (default). + * ``fnv``; + + .. versionadded:: 3.4 + +.. cmdoption:: --with-builtin-hashlib-hashes=md5,sha1,sha256,sha512,sha3,blake2 + + Built-in hash modules: + + * ``md5``; + * ``sha1``; + * ``sha256``; + * ``sha512``; + * ``sha3`` (with shake); + * ``blake2``. + + .. versionadded:: 3.9 + +.. cmdoption:: --with-ssl-default-suites=[python|openssl|STRING] + + Override the OpenSSL default cipher suites string: + + * ``python`` (default): use Python's preferred selection; + * ``openssl``: leave OpenSSL's defaults untouched; + * *STRING*: use a custom string, PROTOCOL_SSLv2 ignores the setting. + + See the :mod:`ssl` module. + + .. versionadded:: 3.7 + + +macOS Options +------------- + +See ``Mac/README.rst``. + +.. cmdoption:: --enable-universalsdk +.. cmdoption:: --enable-universalsdk=SDKDIR + + Create a universal binary build. *SDKDIR* specifies which macOS SDK should + be used to perform the build (default is no). + +.. cmdoption:: --enable-framework +.. cmdoption:: --enable-framework=INSTALLDIR + + Create a Python.framework rather than a traditional Unix install. Optional + *INSTALLDIR* specifies the installation path (default is no). + +.. cmdoption:: --with-universal-archs=ARCH + + Specify the kind of universal binary that should be created. This option is + only valid when :option:`--enable-universalsdk` is set. + + Options: + + * ``universal2``; + * ``32-bit``; + * ``64-bit``; + * ``3-way``; + * ``intel``; + * ``intel-32``; + * ``intel-64``; + * ``all``. + +.. cmdoption:: --with-framework-name=FRAMEWORK + + Specify the name for the python framework on macOS only valid when + :option:`--enable-framework` is set (default: ``Python``). + + +Python Build System +=================== + +Main files of the build system +------------------------------ + +* :file:`configure.ac` => :file:`configure`; +* :file:`Makefile.pre.in` => :file:`Makefile` (created by :file:`configure`); +* :file:`pyconfig.h` (created by :file:`configure`); +* :file:`Modules/Setup`: C extensions built by the Makefile using + :file:`Module/makesetup` shell script; +* :file:`setup.py`: C extensions built using the :mod:`distutils` module. + +Main build steps +---------------- + +* C files (``.c``) are built as object files (``.o``). +* A static ``libpython`` library (``.a``) is created from objects files. +* ``python.o`` and the static ``libpython`` library are linked into the + final ``python`` program. +* C extensions are built by the Makefile (see :file:`Modules/Setup`) + and ``python setup.py build``. + +Main Makefile targets +--------------------- + +* ``make``: Build Python with the standard library. +* ``make platform:``: build the ``python`` program, but don't build the + standard library extension modules. +* ``make profile-opt``: build Python using Profile Guided Optimization (PGO). + You can use the configure :option:`--enable-optimizations` option to make + this the default target of the ``make`` command (``make all`` or just + ``make``). +* ``make buildbottest``: Build Python and run the Python test suite, the same + way than buildbots test Python. Set ``TESTTIMEOUT`` variable (in seconds) + to change the test timeout (1200 by default: 20 minutes). +* ``make install``: Build and install Python. +* ``make regen-all``: Regenerate (almost) all generated files; + ``make regen-stdlib-module-names`` and ``autoconf`` must be run separately + for the remaining generated files. +* ``make clean``: Remove built files. +* ``make distclean``: Same than ``make clean``, but remove also files created + by the configure script. + +C extensions +------------ + +Some C extensions are built as built-in modules, like the ``sys`` module. +They are built with the ``Py_BUILD_CORE_BUILTIN`` macro defined. +Built-in modules have no ``__file__`` attribute:: + + >>> import sys + >>> sys + <module 'sys' (built-in)> + >>> sys.__file__ + Traceback (most recent call last): + File "<stdin>", line 1, in <module> + AttributeError: module 'sys' has no attribute '__file__' + +Other C extensins are built as dynamic libraires, like the ``_asyncio`` module. +They are built with the ``Py_BUILD_CORE_MODULE`` macro defined. +Example on Linux x86-64:: + + >>> import _asyncio + >>> _asyncio + <module '_asyncio' from '/usr/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so'> + >>> _asyncio.__file__ + '/usr/lib64/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so' + +:file:`Modules/Setup` is used to generate Makefile targets to build C extensions. +At the beginning of the files, C extensions are built as built-in modules. +Extensions defined after the ``*shared*`` marker are built as dynamic libraries. + +The :file:`setup.py` script only builds C extensions as shared libraries using +the :mod:`distutils` module. + +The :c:macro:`PyAPI_FUNC()`, :c:macro:`PyAPI_API()` and +:c:macro:`PyMODINIT_FUNC()` macros of :file:`Include/pyport.h` are defined +differently depending if the ``Py_BUILD_CORE_MODULE`` macro is defined: + +* Use ``Py_EXPORTED_SYMBOL`` if the ``Py_BUILD_CORE_MODULE`` is defined +* Use ``Py_IMPORTED_SYMBOL`` otherwise. + +If the ``Py_BUILD_CORE_BUILTIN`` macro is used by mistake on a C extension +built as a shared library, its ``PyInit_xxx()`` function is not exported, +causing an :exc:`ImportError` on import. + + +Compiler and linker flags +========================= + +Options set by the ``./configure`` script and environment variables and used by +``Makefile``. + +Preprocessor flags +------------------ + +.. envvar:: CONFIGURE_CPPFLAGS + + Value of :envvar:`CPPFLAGS` variable passed to the ``./configure`` script. + + .. versionadded:: 3.6 + +.. envvar:: CPPFLAGS + + (Objective) C/C++ preprocessor flags, e.g. ``-I<include dir>`` if you have + headers in a nonstandard directory ``<include dir>``. + + Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's + value for setup.py to be able to build extension modules using the + directories specified in the environment variables. + +.. envvar:: BASECPPFLAGS + + .. versionadded:: 3.4 + +.. envvar:: PY_CPPFLAGS + + Extra preprocessor flags added for building the interpreter object files. + + Default: ``$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS)``. + + .. versionadded:: 3.2 + +Compiler flags +-------------- + +.. envvar:: CC + + C compiler command. + + Example: ``gcc -pthread``. + +.. envvar:: MAINCC + + C compiler command used to build the ``main()`` function of programs like + ``python``. + + Variable set by the :option:`--with-cxx-main` option of the configure + script. + + Default: ``$(CC)``. + +.. envvar:: CXX + + C++ compiler command. + + Used if the :option:`--with-cxx-main` option is used. + + Example: ``g++ -pthread``. + +.. envvar:: CFLAGS + + C compiler flags. + +.. envvar:: CFLAGS_NODIST + + :envvar:`CFLAGS_NODIST` is used for building the interpreter and stdlib C + extensions. Use it when a compiler flag should *not* be part of the + distutils :envvar:`CFLAGS` once Python is installed (:issue:`21121`). + + .. versionadded:: 3.5 + +.. envvar:: EXTRA_CFLAGS + + Extra C compiler flags. + +.. envvar:: CONFIGURE_CFLAGS + + Value of :envvar:`CFLAGS` variable passed to the ``./configure`` + script. + + .. versionadded:: 3.2 + +.. envvar:: CONFIGURE_CFLAGS_NODIST + + Value of :envvar:`CFLAGS_NODIST` variable passed to the ``./configure`` + script. + + .. versionadded:: 3.5 + +.. envvar:: BASECFLAGS + + Base compiler flags. + +.. envvar:: OPT + + Optimization flags. + +.. envvar:: CFLAGS_ALIASING + + Strict or non-strict aliasing flags used to compile ``Python/dtoa.c``. + + .. versionadded:: 3.7 + +.. envvar:: CCSHARED + + Compiler flags used to build a shared library. + + For example, ``-fPIC`` is used on Linux and on BSD. + +.. envvar:: CFLAGSFORSHARED + + Extra C flags added for building the interpreter object files. + + Default: ``$(CCSHARED)`` when :option:`--enable-shared` is used, or an empty + string otherwise. + +.. envvar:: PY_CFLAGS + + Default: ``$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)``. + +.. envvar:: PY_CFLAGS_NODIST + + Default: ``$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/internal``. + + .. versionadded:: 3.5 + +.. envvar:: PY_STDMODULE_CFLAGS + + C flags used for building the interpreter object files. + + Default: ``$(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED)``. + + .. versionadded:: 3.7 + +.. envvar:: PY_CORE_CFLAGS + + Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE``. + + .. versionadded:: 3.2 + +.. envvar:: PY_BUILTIN_MODULE_CFLAGS + + Compiler flags to build a standard library extension module as a built-in + module, like the :mod:`posix` module. + + Default: ``$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN``. + + .. versionadded:: 3.8 + +.. envvar:: PURIFY + + Purify command. Purify is a memory debugger program. + + Default: empty string (not used). + + +Linker flags +------------ + +.. envvar:: LINKCC + + Linker command used to build programs like ``python`` and ``_testembed``. + + Default: ``$(PURIFY) $(MAINCC)``. + +.. envvar:: CONFIGURE_LDFLAGS + + Value of :envvar:`LDFLAGS` variable passed to the ``./configure`` script. + + Avoid assigning :envvar:`CFLAGS`, :envvar:`LDFLAGS`, etc. so users can use + them on the command line to append to these values without stomping the + pre-set values. + + .. versionadded:: 3.2 + +.. envvar:: LDFLAGS_NODIST + + :envvar:`LDFLAGS_NODIST` is used in the same manner as + :envvar:`CFLAGS_NODIST`. Use it when a linker flag should *not* be part of + the distutils :envvar:`LDFLAGS` once Python is installed (:issue:`35257`). + +.. envvar:: CONFIGURE_LDFLAGS_NODIST + + Value of :envvar:`LDFLAGS_NODIST` variable passed to the ``./configure`` + script. + + .. versionadded:: 3.8 + +.. envvar:: LDFLAGS + + Linker flags, e.g. ``-L<lib dir>`` if you have libraries in a nonstandard + directory ``<lib dir>``. + + Both :envvar:`CPPFLAGS` and :envvar:`LDFLAGS` need to contain the shell's + value for setup.py to be able to build extension modules using the + directories specified in the environment variables. + +.. envvar:: LIBS + + Linker flags to pass libraries to the linker when linking the Python + executable. + + Example: ``-lrt``. + +.. envvar:: LDSHARED + + Command to build a shared library. + + Default: ``@LDSHARED@ $(PY_LDFLAGS)``. + +.. envvar:: BLDSHARED + + Command to build ``libpython`` shared library. + + Default: ``@BLDSHARED@ $(PY_CORE_LDFLAGS)``. + +.. envvar:: PY_LDFLAGS + + Default: ``$(CONFIGURE_LDFLAGS) $(LDFLAGS)``. + +.. envvar:: PY_LDFLAGS_NODIST + + Default: ``$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)``. + + .. versionadded:: 3.8 + +.. envvar:: PY_CORE_LDFLAGS + + Linker flags used for building the interpreter object files. + + .. versionadded:: 3.8 diff --git a/Doc/using/index.rst b/Doc/using/index.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3VzaW5nL2luZGV4LnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3VzaW5nL2luZGV4LnJzdA== 100644 --- a/Doc/using/index.rst +++ b/Doc/using/index.rst @@ -15,6 +15,7 @@ cmdline.rst unix.rst + configure.rst windows.rst mac.rst editors.rst diff --git a/Doc/using/unix.rst b/Doc/using/unix.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3VzaW5nL3VuaXgucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3VzaW5nL3VuaXgucnN0 100644 --- a/Doc/using/unix.rst +++ b/Doc/using/unix.rst @@ -78,9 +78,9 @@ make make install -Configuration options and caveats for specific Unix platforms are extensively -documented in the :source:`README.rst` file in the root of the Python source -tree. +:ref:`Configuration options <configure-options>` and caveats for specific Unix +platforms are extensively documented in the :source:`README.rst` file in the +root of the Python source tree. .. warning:: @@ -168,6 +168,7 @@ $ popd 3. Build Python with custom OpenSSL + (see the configure `--with-openssl` and `--with-openssl-rpath` options) .. code-block:: shell-session diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3doYXRzbmV3LzMuMTAucnN0..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3doYXRzbmV3LzMuMTAucnN0 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -125,8 +125,11 @@ in :issue:`12782` and :issue:`40334`.) -Better error messages in the parser ------------------------------------ +Better error messages +--------------------- + +SyntaxErrors +~~~~~~~~~~~~ When parsing code that contains unclosed parentheses or brackets the interpreter now includes the location of the unclosed bracket of parentheses instead of displaying @@ -167,9 +170,26 @@ (Contributed by Pablo Galindo in :issue:`42864` and Batuhan Taskaya in :issue:`40176`.) + +AttributeErrors +~~~~~~~~~~~~~~~ + +When printing :exc:`AttributeError`, :c:func:`PyErr_Display` will offer +suggestions of simmilar attribute names in the object that the exception was +raised from: + +.. code-block:: python + + >>> collections.namedtoplo + Traceback (most recent call last): + File "<stdin>", line 1, in <module> + AttributeError: module 'collections' has no attribute 'namedtoplo'. Did you mean: namedtuple? + +(Contributed by Pablo Galindo in :issue:`38530`.) + PEP 626: Precise line numbers for debugging and other tools ----------------------------------------------------------- PEP 626 brings more precise and reliable line numbers for debugging, profiling and coverage tools. Tracing events, with the correct line number, are generated for all lines of code executed and only for lines of code that are executed. @@ -170,10 +190,10 @@ PEP 626: Precise line numbers for debugging and other tools ----------------------------------------------------------- PEP 626 brings more precise and reliable line numbers for debugging, profiling and coverage tools. Tracing events, with the correct line number, are generated for all lines of code executed and only for lines of code that are executed. -The ``f_lineo`` attribute of frame objects will always contain the expected line number. +The ``f_lineno`` attribute of frame objects will always contain the expected line number. The ``co_lnotab`` attribute of code objects is deprecated and will be removed in 3.12. Code that needs to convert from offset to line number should use the new ``co_lines()`` method instead. @@ -215,7 +235,7 @@ match 5. If an exact match is not confirmed, the last case, a wildcard ``_``, if provided, will be used as the matching case. If an exact match is - not confirmed and a wildcard case does not exists, the entire match + not confirmed and a wildcard case does not exist, the entire match block is a no-op. Declarative approach @@ -420,7 +440,7 @@ - Mapping patterns: ``{"bandwidth": b, "latency": l}`` captures the ``"bandwidth"`` and ``"latency"`` values from a dict. Unlike sequence patterns, extra keys are ignored. A wildcard ``**rest`` is also - supported. (But ``**_`` would be redundant, so it not allowed.) + supported. (But ``**_`` would be redundant, so is not allowed.) - Subpatterns may be captured using the ``as`` keyword:: @@ -454,6 +474,30 @@ are in :pep:`635`, and a longer tutorial is in :pep:`636`. +.. _whatsnew310-pep597: + +Optional ``EncodingWarning`` and ``encoding="locale"`` option +------------------------------------------------------------- + +The default encoding of :class:`TextIOWrapper` and :func:`open` is +platform and locale dependent. Since UTF-8 is used on most Unix +platforms, omitting ``encoding`` option when opening UTF-8 files +(e.g. JSON, YAML, TOML, Markdown) is a very common bug. For example:: + + # BUG: "rb" mode or encoding="utf-8" should be used. + with open("data.json") as f: + data = json.load(f) + +To find this type of bug, optional ``EncodingWarning`` is added. +It is emitted when :data:`sys.flags.warn_default_encoding <sys.flags>` +is true and locale-specific default encoding is used. + +``-X warn_default_encoding`` option and :envvar:`PYTHONWARNDEFAULTENCODING` +are added to enable the warning. + +See :ref:`io-text-encoding` for more information. + + New Features Related to Type Annotations ======================================== @@ -526,5 +570,6 @@ be found in :class:`typing.Concatenate`. See :class:`typing.Callable`, :class:`typing.ParamSpec`, -:class:`typing.Concatenate` and :pep:`612` for more details. +:class:`typing.Concatenate`, :class:`typing.ParamSpecArgs`, +:class:`typing.ParamSpecKwargs`, and :pep:`612` for more details. @@ -530,5 +575,6 @@ -(Contributed by Ken Jin in :issue:`41559`.) +(Contributed by Ken Jin in :issue:`41559`, with minor enhancements by Jelle +Zijlstra in :issue:`43783`. PEP written by Mark Mendoza.) PEP 613: TypeAlias Annotation @@ -588,6 +634,18 @@ ``__globals__["__builtins__"]`` if it exists, else from the current builtins. (Contributed by Mark Shannon in :issue:`42990`.) +* Two new builtin functions -- :func:`aiter` and :func:`anext` have been added + to provide asynchronous counterparts to :func:`iter` and :func:`next`, + respectively. + (Contributed by Joshua Bronson, Daniel Pope, and Justin Wang in :issue:`31861`.) + +* Static methods (:func:`@staticmethod <staticmethod>`) and class methods + (:func:`@classmethod <classmethod>`) now inherit the method attributes + (``__module__``, ``__name__``, ``__qualname__``, ``__doc__``, + ``__annotations__``) and have a new ``__wrapped__`` attribute. + Moreover, static methods are now callable as regular functions. + (Contributed by Victor Stinner in :issue:`43682`.) + New Modules =========== @@ -604,6 +662,13 @@ Misleading phrase "optional arguments" was replaced with "options" in argparse help. Some tests might require adaptation if they rely on exact output match. (Contributed by Raymond Hettinger in :issue:`9694`.) +array +----- + +The :meth:`~array.array.index` method of :class:`array.array` now has +optional *start* and *stop* parameters. +(Contributed by Anders Lorentsen and Zackery Spytz in :issue:`31956`.) + base64 ------ @@ -687,6 +752,25 @@ :func:`encodings.normalize_encoding` now ignores non-ASCII characters. (Contributed by Hai Shi in :issue:`39337`.) +enum +---- + +:class:`Enum` :func:`__repr__` now returns ``enum_name.member_name`` and +:func:`__str__` now returns ``member_name``. Stdlib enums available as +module constants have a :func:`repr` of ``module_name.member_name``. +(Contributed by Ethan Furman in :issue:`40066`.) + +fileinput +--------- + +Added *encoding* and *errors* parameters in :func:`fileinput.input` and +:class:`fileinput.FileInput`. +(Contributed by Inada Naoki in :issue:`43712`.) + +:func:`fileinput.hook_compressed` now returns :class:`TextIOWrapper` object +when *mode* is "r" and file is compressed, like uncompressed files. +(Contributed by Inada Naoki in :issue:`5758`.) + gc -- @@ -767,6 +851,12 @@ <https://www.freedesktop.org/software/systemd/man/os-release.html>`_ standard file. (Contributed by Christian Heimes in :issue:`28468`) +pprint +------ + +:mod:`pprint` can now pretty-print :class:`dataclasses.dataclass` instances. +(Contributed by Lewis Gaul in :issue:`43080`.) + py_compile ---------- @@ -800,6 +890,9 @@ The exception :exc:`socket.timeout` is now an alias of :exc:`TimeoutError`. (Contributed by Christian Heimes in :issue:`42413`.) +Added option to create MPTCP sockets with ``IPPROTO_MPTCP`` +(Contributed by Rui Cunha in :issue:`43571`.) + sys --- @@ -919,9 +1012,10 @@ (Contributed by Serhiy Storchaka in :issue:`41334`.) * The :mod:`runpy` module now imports fewer modules. - The ``python3 -m module-name`` command startup time is 1.3x faster in - average. - (Contributed by Victor Stinner in :issue:`41006`.) + The ``python3 -m module-name`` command startup time is 1.4x faster in + average. On Linux, ``python3 -I -m module-name`` imports 69 modules on Python + 3.9, whereas it only imports 51 modules (-18) on Python 3.10. + (Contributed by Victor Stinner in :issue:`41006` and :issue:`41718`.) * The ``LOAD_ATTR`` instruction now uses new "per opcode cache" mechanism. It is about 36% faster now for regular attributes and 44% faster for slots. @@ -929,5 +1023,5 @@ van Rossum in :issue:`42927`, based on ideas implemented originally in PyPy and MicroPython.) -* When building Python with ``--enable-optimizations`` now +* When building Python with :option:`--enable-optimizations` now ``-fno-semantic-interposition`` is added to both the compile and link line. @@ -933,7 +1027,7 @@ ``-fno-semantic-interposition`` is added to both the compile and link line. - This speeds builds of the Python interpreter created with ``--enable-shared`` + This speeds builds of the Python interpreter created with :option:`--enable-shared` with ``gcc`` by up to 30%. See `this article <https://developers.redhat.com/blog/2020/06/25/red-hat-enterprise-linux-8-2-brings-faster-python-3-8-run-speeds/>`_ for more details. (Contributed by Victor Stinner and Pablo Galindo in :issue:`38980`.) @@ -935,9 +1029,8 @@ with ``gcc`` by up to 30%. See `this article <https://developers.redhat.com/blog/2020/06/25/red-hat-enterprise-linux-8-2-brings-faster-python-3-8-run-speeds/>`_ for more details. (Contributed by Victor Stinner and Pablo Galindo in :issue:`38980`.) - * Function parameters and their annotations are no longer computed at runtime, but rather at compilation time. They are stored as a tuple of strings at the bytecode level. It is now around 2 times faster to create a function with @@ -949,6 +1042,19 @@ algorithm to avoid quadratic behavior on long strings. (Contributed by Dennis Sweeney in :issue:`41972`) +* Added micro-optimizations to ``_PyType_Lookup()`` to improve type attribute cache lookup + performance in the common case of cache hits. This makes the interpreter 1.04 times faster + in average (Contributed by Dino Viehland in :issue:`43452`) + +* Following built-in functions now support the faster :pep:`590` vectorcall calling convention: + :func:`map`, :func:`filter`, :func:`reversed`, :func:`bool` and :func:`float`. + (Contributed by Dong-hee Na and Jeroen Demeyerin in :issue:`43575`, :issue:`43287`, :issue:`41922`, :issue:`41873` and :issue:`41870`) + +* :class:`BZ2File` performance is improved by removing internal ``RLock``. + This makes :class:`BZ2File` thread unsafe in the face of multiple simultaneous + readers or writers, just like its equivalent classes in :mod:`gzip` and + :mod:`lzma` have always been. (Contributed by Inada Naoki in :issue:`43785`). + Deprecated ========== @@ -992,6 +1098,66 @@ :meth:`~importlib.abc.Loader.exec_module` is preferred. (Contributed by Brett Cannon in :issue:`26131`.) +* The use of :meth:`importlib.abc.MetaPathFinder.find_module` and + :meth:`importlib.abc.PathEntryFinder.find_module` by the import system now + trigger an :exc:`ImportWarning` as + :meth:`importlib.abc.MetaPathFinder.find_spec` and + :meth:`importlib.abc.PathEntryFinder.find_spec` + are preferred, respectively. You can use + :func:`importlib.util.spec_from_loader` to help in porting. + (Contributed by Brett Cannon in :issue:`42134`.) + +* The use of :meth:`importlib.abc.PathEntryFinder.find_loader` by the import + system now triggers an :exc:`ImportWarning` as + :meth:`importlib.abc.PathEntryFinder.find_spec` is preferred. You can use + :func:`importlib.util.spec_from_loader` to help in porting. + (Contributed by Brett Cannon in :issue:`43672`.) + +* The various implementations of + :meth:`importlib.abc.MetaPathFinder.find_module` ( + :meth:`importlib.machinery.BuiltinImporter.find_module`, + :meth:`importlib.machinery.FrozenImporter.find_module`, + :meth:`importlib.machinery.WindowsRegistryFinder.find_module`, + :meth:`importlib.machinery.PathFinder.find_module`, + :meth:`importlib.abc.MetaPathFinder.find_module`), + :meth:`importlib.abc.PathEntryFinder.find_module` ( + :meth:`importlib.machinery.FileFinder.find_module`, + ), and + :meth:`importlib.abc.PathEntryFinder.find_loader` ( + :meth:`importlib.machinery.FileFinder.find_loader` + ) now raise :exc:`DeprecationWarning` and are slated for removal in + Python 3.12 (previously they were documented as deprecated in Python 3.4). + (Contributed by Brett Cannon in :issue:`42135`.) + +* :class:`importlib.abc.Finder` is deprecated (including its sole method, + :meth:`~importlib.abc.Finder.find_module`). Both + :class:`importlib.abc.MetaPathFinder` and :class:`importlib.abc.PathEntryFinder` + no longer inherit from the class. Users should inherit from one of these two + classes as appropriate instead. + (Contributed by Brett Cannon in :issue:`42135`.) + +* The deprecations of :mod:`imp`, :func:`importlib.find_loader`, + :func:`importlib.util.set_package_wrapper`, + :func:`importlib.util.set_loader_wrapper`, + :func:`importlib.util.module_for_loader`, + :class:`pkgutil.ImpImporter`, and + :class:`pkgutil.ImpLoader` have all been updated to list Python 3.12 as the + slated version of removal (they began raising :exc:`DeprecationWarning` in + previous versions of Python). + (Contributed by Brett Cannon in :issue:`43720`.) + +* The import system now uses the ``__spec__`` attribute on modules before + falling back on :meth:`~importlib.abc.Loader.module_repr` for a module's + ``__repr__()`` method. Removal of the use of ``module_repr()`` is scheduled + for Python 3.12. + (Contributed by Brett Cannon in :issue:`42137`.) + +* :meth:`importlib.abc.Loader.module_repr`, + :meth:`importlib.machinery.FrozenLoader.module_repr`, and + :meth:`importlib.machinery.BuiltinLoader.module_repr` are deprecated and + slated for removal in Python 3.12. + (Contributed by Brett Cannon in :issue:`42136`.) + * ``sqlite3.OptimizedUnicode`` has been undocumented and obsolete since Python 3.3, when it was made an alias to :class:`str`. It is now deprecated, scheduled for removal in Python 3.12. @@ -1005,6 +1171,27 @@ ``cache=shared`` query parameter. (Contributed by Erlend E. Aasland in :issue:`24464`.) +* The following ``threading`` methods are now deprecated: + + * ``threading.currentThread`` => :func:`threading.current_thread` + + * ``threading.activeCount`` => :func:`threading.active_count` + + * ``threading.Condition.notifyAll`` => + :meth:`threading.Condition.notify_all` + + * ``threading.Event.isSet`` => :meth:`threading.Event.is_set` + + * ``threading.Thread.setName`` => :attr:`threading.Thread.name` + + * ``threading.thread.getName`` => :attr:`threading.Thread.name` + + * ``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon` + + * ``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon` + + (Contributed by Jelle Zijlstra in :issue:`21574`.) + Removed ======= @@ -1155,7 +1342,7 @@ * The :mod:`atexit` module must now always be built as a built-in module. (Contributed by Victor Stinner in :issue:`42639`.) -* Added ``--disable-test-modules`` option to the ``configure`` script: +* Added :option:`--disable-test-modules` option to the ``configure`` script: don't build nor install test modules. (Contributed by Xavier de Gaye, Thomas Petazzoni and Peixing Xin in :issue:`27640`.) @@ -1159,7 +1346,8 @@ don't build nor install test modules. (Contributed by Xavier de Gaye, Thomas Petazzoni and Peixing Xin in :issue:`27640`.) -* Add ``--with-wheel-pkg-dir=PATH`` option to the ``./configure`` script. If +* Add :option:`--with-wheel-pkg-dir=PATH option <--with-wheel-pkg-dir>` + to the ``./configure`` script. If specified, the :mod:`ensurepip` module looks for ``setuptools`` and ``pip`` wheel packages in this directory: if both are present, these wheel packages are used instead of ensurepip bundled wheel packages. @@ -1171,11 +1359,11 @@ (Contributed by Victor Stinner in :issue:`42856`.) -* Add a new configure ``--without-static-libpython`` option to not build the - ``libpythonMAJOR.MINOR.a`` static library and not install the ``python.o`` - object file. +* Add a new :option:`configure --without-static-libpython option + <--without-static-libpython>` to not build the ``libpythonMAJOR.MINOR.a`` + static library and not install the ``python.o`` object file. (Contributed by Victor Stinner in :issue:`43103`.) * The ``configure`` script now uses the ``pkg-config`` utility, if available, to detect the location of Tcl/Tk headers and libraries. As before, those @@ -1177,9 +1365,9 @@ (Contributed by Victor Stinner in :issue:`43103`.) * The ``configure`` script now uses the ``pkg-config`` utility, if available, to detect the location of Tcl/Tk headers and libraries. As before, those - locations can be explicitly specified with the ``--with-tcltk-includes`` - and ``--with-tcltk-libs`` configuration options. + locations can be explicitly specified with the :option:`--with-tcltk-includes` + and :option:`--with-tcltk-libs` configuration options. (Contributed by Manolis Stamatogiannakis in :issue:`42603`.) @@ -1184,6 +1372,6 @@ (Contributed by Manolis Stamatogiannakis in :issue:`42603`.) -* Add ``--with-openssl-rpath`` option to ``configure`` script. The option +* Add :option:`--with-openssl-rpath` option to ``configure`` script. The option simplifies building Python with a custom OpenSSL installation, e.g. ``./configure --with-openssl=/path/to/openssl --with-openssl-rpath=auto``. (Contributed by Christian Heimes in :issue:`43466`.) @@ -1250,6 +1438,26 @@ to simulate. (Contributed by Antoine Pitrou in :issue:`43356`.) +* The limited C API is now supported if :ref:`Python is built in debug mode + <debug-build>` (if the ``Py_DEBUG`` macro is defined). In the limited C API, + the :c:func:`Py_INCREF` and :c:func:`Py_DECREF` functions are now implemented + as opaque function + calls, rather than accessing directly the :c:member:`PyObject.ob_refcnt` + member, if Python is built in debug mode and the ``Py_LIMITED_API`` macro + targets Python 3.10 or newer. It became possible to support the limited C API + in debug mode because the :c:type:`PyObject` structure is the same in release + and debug mode since Python 3.8 (see :issue:`36465`). + + The limited C API is still not supported in the :option:`--with-trace-refs` + special build (``Py_TRACE_REFS`` macro). + (Contributed by Victor Stinner in :issue:`43688`.) + +* Add the :c:func:`Py_Is(x, y) <Py_Is>` function to test if the *x* object is + the *y* object, the same as ``x is y`` in Python. Add also the + :c:func:`Py_IsNone`, :c:func:`Py_IsTrue`, :c:func:`Py_IsFalse` functions to + test if an object is, respectively, the ``None`` singleton, the ``True`` + singleton or the ``False`` singleton. + (Contributed by Victor Stinner in :issue:`43753`.) Porting to Python 3.10 ---------------------- @@ -1380,5 +1588,13 @@ it could not be used, because the ``symtable.h`` header file was excluded from the limited C API. - The Python :mod:`symtable` module remains available and is unchanged. + Use Python :mod:`symtable` module instead. + (Contributed by Victor Stinner in :issue:`43244`.) + +* Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header files. + These functions were undocumented and excluded from the limited C API. + Most names defined by these header files were not prefixed by ``Py`` and so + could create names conflicts. For example, ``Python-ast.h`` defined a + ``Yield`` macro which was conflict with the ``Yield`` name used by the + Windows ``<winbase.h>`` header. Use the Python :mod:`ast` module instead. (Contributed by Victor Stinner in :issue:`43244`.) @@ -1384,1 +1600,29 @@ (Contributed by Victor Stinner in :issue:`43244`.) + +* Remove the compiler and parser functions using ``struct _mod`` type, because + the public AST C API was removed: + + * ``PyAST_Compile()`` + * ``PyAST_CompileEx()`` + * ``PyAST_CompileObject()`` + * ``PyFuture_FromAST()`` + * ``PyFuture_FromASTObject()`` + * ``PyParser_ASTFromFile()`` + * ``PyParser_ASTFromFileObject()`` + * ``PyParser_ASTFromFilename()`` + * ``PyParser_ASTFromString()`` + * ``PyParser_ASTFromStringObject()`` + + These functions were undocumented and excluded from the limited C API. + (Contributed by Victor Stinner in :issue:`43244`.) + +* Remove the ``pyarena.h`` header file with functions: + + * ``PyArena_New()`` + * ``PyArena_Free()`` + * ``PyArena_Malloc()`` + * ``PyArena_AddPyObject()`` + + These functions were undocumented, excluded from the limited C API, and were + only used internally by the compiler. + (Contributed by Victor Stinner in :issue:`43244`.) diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3doYXRzbmV3LzMuNi5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3doYXRzbmV3LzMuNi5yc3Q= 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -722,8 +722,8 @@ * line of code executed. This can be used to instrument running interpreters in production, -without the need to recompile specific debug builds or providing -application-specific profiling/debugging code. +without the need to recompile specific :ref:`debug builds <debug-build>` or +providing application-specific profiling/debugging code. More details in :ref:`instrumentation`. diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3doYXRzbmV3LzMuNy5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3doYXRzbmV3LzMuNy5yc3Q= 100644 --- a/Doc/whatsnew/3.7.rst +++ b/Doc/whatsnew/3.7.rst @@ -1588,8 +1588,8 @@ for the new ``-X dev`` mode) * any implicit filters defined directly by the warnings machinery -* in CPython debug builds, all warnings are now displayed by default (the - implicit filter list is empty) +* in :ref:`CPython debug builds <debug-build>`, all warnings are now displayed + by default (the implicit filter list is empty) (Contributed by Nick Coghlan and Victor Stinner in :issue:`20361`, :issue:`32043`, and :issue:`32230`.) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3doYXRzbmV3LzMuOC5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3doYXRzbmV3LzMuOC5yc3Q= 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -211,7 +211,7 @@ Unix, when Python is built in debug mode, it is now possible to load C extensions built in release mode and C extensions built using the stable ABI. -Release builds and debug builds are now ABI compatible: defining the +Release builds and :ref:`debug builds <debug-build>` are now ABI compatible: defining the ``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS`` macro, which introduces the only ABI incompatibility. The ``Py_TRACE_REFS`` macro, which adds the :func:`sys.getobjects` function and the :envvar:`PYTHONDUMPREFS` @@ -904,7 +904,7 @@ io -- -In development mode (:option:`-X` ``env``) and in debug build, the +In development mode (:option:`-X` ``env``) and in :ref:`debug build <debug-build>`, the :class:`io.IOBase` finalizer now logs the exception if the ``close()`` method fails. The exception is ignored silently by default in release build. (Contributed by Victor Stinner in :issue:`18748`.) @@ -2246,4 +2246,4 @@ :func:`cgi.parse` and :func:`cgi.parse_multipart` as they use the affected functions internally. For more details, please see their respective documentation. -(Contributed by Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.) \ No newline at end of file +(Contributed by Adam Goldschmidt, Senthil Kumaran and Ken Jin in :issue:`42967`.) diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_RG9jL3doYXRzbmV3LzMuOS5yc3Q=..8dd72af26abae4c1395bdd7572059de8fccc8d87_RG9jL3doYXRzbmV3LzMuOS5yc3Q= 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -231,7 +231,7 @@ absolute path for :mod:`__main__` module frames in this case. (Contributed by Victor Stinner in :issue:`20443`.) -* In the :ref:`Python Development Mode <devmode>` and in debug build, the +* In the :ref:`Python Development Mode <devmode>` and in :ref:`debug build <debug-build>`, the *encoding* and *errors* arguments are now checked for string encoding and decoding operations. Examples: :func:`open`, :meth:`str.encode` and :meth:`bytes.decode`. @@ -267,6 +267,10 @@ :func:`~operator.countOf` of the :mod:`operator` module. (Contributed by Serhiy Storchaka in :issue:`40824`.) +* Unparenthesized lambda expressions can no longer be the expression part in an + ``if`` clause in comprehensions and generator expressions. See :issue:`41848` + and :issue:`43755` for details. + New Modules =========== @@ -1207,5 +1211,5 @@ non-system Tcl and Tk frameworks if they are installed in ``/Library/Frameworks``, as had been the case on older releases of macOS. If a macOS SDK is explicitly configured, by using - ``--enable-universalsdk=`` or ``-isysroot``, only the SDK itself is + :option:`--enable-universalsdk` or ``-isysroot``, only the SDK itself is searched. The default behavior can still be overridden with @@ -1211,5 +1215,5 @@ searched. The default behavior can still be overridden with - ``--with-tcltk-includes`` and ``--with-tcltk-libs``. + :option:`--with-tcltk-includes` and :option:`--with-tcltk-libs`. (Contributed by Ned Deily in :issue:`34956`.) * Python can now be built for Windows 10 ARM64. diff --git a/Grammar/python.gram b/Grammar/python.gram index d44ad9a90312e58b44562e9ca531de7ed4ce5736_R3JhbW1hci9weXRob24uZ3JhbQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_R3JhbW1hci9weXRob24uZ3JhbQ== 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -28,9 +28,9 @@ // The end ''' file[mod_ty]: a=[statements] ENDMARKER { _PyPegen_make_module(p, a) } -interactive[mod_ty]: a=statement_newline { Interactive(a, p->arena) } -eval[mod_ty]: a=expressions NEWLINE* ENDMARKER { Expression(a, p->arena) } -func_type[mod_ty]: '(' a=[type_expressions] ')' '->' b=expression NEWLINE* ENDMARKER { FunctionType(a, b, p->arena) } +interactive[mod_ty]: a=statement_newline { _PyAST_Interactive(a, p->arena) } +eval[mod_ty]: a=expressions NEWLINE* ENDMARKER { _PyAST_Expression(a, p->arena) } +func_type[mod_ty]: '(' a=[type_expressions] ')' '->' b=expression NEWLINE* ENDMARKER { _PyAST_FunctionType(a, b, p->arena) } fstring[expr_ty]: star_expressions # type_expressions allow */** but ignore them @@ -56,7 +56,7 @@ statement_newline[asdl_stmt_seq*]: | a=compound_stmt NEWLINE { (asdl_stmt_seq*)_PyPegen_singleton_seq(p, a) } | simple_stmts - | NEWLINE { (asdl_stmt_seq*)_PyPegen_singleton_seq(p, CHECK(stmt_ty, _Py_Pass(EXTRA))) } + | NEWLINE { (asdl_stmt_seq*)_PyPegen_singleton_seq(p, CHECK(stmt_ty, _PyAST_Pass(EXTRA))) } | ENDMARKER { _PyPegen_interactive_exit(p) } simple_stmts[asdl_stmt_seq*]: | a=simple_stmt !';' NEWLINE { (asdl_stmt_seq*)_PyPegen_singleton_seq(p, a) } # Not needed, there for speedup @@ -65,7 +65,7 @@ # will throw a SyntaxError. simple_stmt[stmt_ty] (memo): | assignment - | e=star_expressions { _Py_Expr(e, EXTRA) } + | e=star_expressions { _PyAST_Expr(e, EXTRA) } | &'return' return_stmt | &('import' | 'from') import_stmt | &'raise' raise_stmt @@ -69,7 +69,7 @@ | &'return' return_stmt | &('import' | 'from') import_stmt | &'raise' raise_stmt - | 'pass' { _Py_Pass(EXTRA) } + | 'pass' { _PyAST_Pass(EXTRA) } | &'del' del_stmt | &'yield' yield_stmt | &'assert' assert_stmt @@ -73,8 +73,8 @@ | &'del' del_stmt | &'yield' yield_stmt | &'assert' assert_stmt - | 'break' { _Py_Break(EXTRA) } - | 'continue' { _Py_Continue(EXTRA) } + | 'break' { _PyAST_Break(EXTRA) } + | 'continue' { _PyAST_Continue(EXTRA) } | &'global' global_stmt | &'nonlocal' nonlocal_stmt compound_stmt[stmt_ty]: @@ -94,7 +94,7 @@ stmt_ty, 6, "Variable annotation syntax is", - _Py_AnnAssign(CHECK(expr_ty, _PyPegen_set_expr_context(p, a, Store)), b, c, 1, EXTRA) + _PyAST_AnnAssign(CHECK(expr_ty, _PyPegen_set_expr_context(p, a, Store)), b, c, 1, EXTRA) ) } | a=('(' b=single_target ')' { b } | single_subscript_attribute_target) ':' b=expression c=['=' d=annotated_rhs { d }] { @@ -98,5 +98,5 @@ ) } | a=('(' b=single_target ')' { b } | single_subscript_attribute_target) ':' b=expression c=['=' d=annotated_rhs { d }] { - CHECK_VERSION(stmt_ty, 6, "Variable annotations syntax is", _Py_AnnAssign(a, b, c, 0, EXTRA)) } + CHECK_VERSION(stmt_ty, 6, "Variable annotations syntax is", _PyAST_AnnAssign(a, b, c, 0, EXTRA)) } | a[asdl_expr_seq*]=(z=star_targets '=' { z })+ b=(yield_expr | star_expressions) !'=' tc=[TYPE_COMMENT] { @@ -102,3 +102,3 @@ | a[asdl_expr_seq*]=(z=star_targets '=' { z })+ b=(yield_expr | star_expressions) !'=' tc=[TYPE_COMMENT] { - _Py_Assign(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) } + _PyAST_Assign(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) } | a=single_target b=augassign ~ c=(yield_expr | star_expressions) { @@ -104,5 +104,5 @@ | a=single_target b=augassign ~ c=(yield_expr | star_expressions) { - _Py_AugAssign(a, b->kind, c, EXTRA) } + _PyAST_AugAssign(a, b->kind, c, EXTRA) } | invalid_assignment augassign[AugOperator*]: @@ -121,5 +121,5 @@ | '//=' { _PyPegen_augoperator(p, FloorDiv) } global_stmt[stmt_ty]: 'global' a[asdl_expr_seq*]=','.NAME+ { - _Py_Global(CHECK(asdl_identifier_seq*, _PyPegen_map_names_to_ids(p, a)), EXTRA) } + _PyAST_Global(CHECK(asdl_identifier_seq*, _PyPegen_map_names_to_ids(p, a)), EXTRA) } nonlocal_stmt[stmt_ty]: 'nonlocal' a[asdl_expr_seq*]=','.NAME+ { @@ -125,3 +125,3 @@ nonlocal_stmt[stmt_ty]: 'nonlocal' a[asdl_expr_seq*]=','.NAME+ { - _Py_Nonlocal(CHECK(asdl_identifier_seq*, _PyPegen_map_names_to_ids(p, a)), EXTRA) } + _PyAST_Nonlocal(CHECK(asdl_identifier_seq*, _PyPegen_map_names_to_ids(p, a)), EXTRA) } @@ -127,3 +127,3 @@ -yield_stmt[stmt_ty]: y=yield_expr { _Py_Expr(y, EXTRA) } +yield_stmt[stmt_ty]: y=yield_expr { _PyAST_Expr(y, EXTRA) } @@ -129,4 +129,4 @@ -assert_stmt[stmt_ty]: 'assert' a=expression b=[',' z=expression { z }] { _Py_Assert(a, b, EXTRA) } +assert_stmt[stmt_ty]: 'assert' a=expression b=[',' z=expression { z }] { _PyAST_Assert(a, b, EXTRA) } del_stmt[stmt_ty]: @@ -131,6 +131,6 @@ del_stmt[stmt_ty]: - | 'del' a=del_targets &(';' | NEWLINE) { _Py_Delete(a, EXTRA) } + | 'del' a=del_targets &(';' | NEWLINE) { _PyAST_Delete(a, EXTRA) } | invalid_del_stmt import_stmt[stmt_ty]: import_name | import_from @@ -134,7 +134,7 @@ | invalid_del_stmt import_stmt[stmt_ty]: import_name | import_from -import_name[stmt_ty]: 'import' a=dotted_as_names { _Py_Import(a, EXTRA) } +import_name[stmt_ty]: 'import' a=dotted_as_names { _PyAST_Import(a, EXTRA) } # note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS import_from[stmt_ty]: | 'from' a=('.' | '...')* b=dotted_name 'import' c=import_from_targets { @@ -138,5 +138,5 @@ # note below: the ('.' | '...') is necessary because '...' is tokenized as ELLIPSIS import_from[stmt_ty]: | 'from' a=('.' | '...')* b=dotted_name 'import' c=import_from_targets { - _Py_ImportFrom(b->v.Name.id, c, _PyPegen_seq_count_dots(a), EXTRA) } + _PyAST_ImportFrom(b->v.Name.id, c, _PyPegen_seq_count_dots(a), EXTRA) } | 'from' a=('.' | '...')+ 'import' b=import_from_targets { @@ -142,5 +142,5 @@ | 'from' a=('.' | '...')+ 'import' b=import_from_targets { - _Py_ImportFrom(NULL, b, _PyPegen_seq_count_dots(a), EXTRA) } + _PyAST_ImportFrom(NULL, b, _PyPegen_seq_count_dots(a), EXTRA) } import_from_targets[asdl_alias_seq*]: | '(' a=import_from_as_names [','] ')' { a } | import_from_as_names !',' @@ -144,8 +144,8 @@ import_from_targets[asdl_alias_seq*]: | '(' a=import_from_as_names [','] ')' { a } | import_from_as_names !',' - | '*' { (asdl_alias_seq*)_PyPegen_singleton_seq(p, CHECK(alias_ty, _PyPegen_alias_for_star(p))) } + | '*' { (asdl_alias_seq*)_PyPegen_singleton_seq(p, CHECK(alias_ty, _PyPegen_alias_for_star(p, EXTRA))) } | invalid_import_from_targets import_from_as_names[asdl_alias_seq*]: | a[asdl_alias_seq*]=','.import_from_as_name+ { a } import_from_as_name[alias_ty]: @@ -148,6 +148,6 @@ | invalid_import_from_targets import_from_as_names[asdl_alias_seq*]: | a[asdl_alias_seq*]=','.import_from_as_name+ { a } import_from_as_name[alias_ty]: - | a=NAME b=['as' z=NAME { z }] { _Py_alias(a->v.Name.id, + | a=NAME b=['as' z=NAME { z }] { _PyAST_alias(a->v.Name.id, (b) ? ((expr_ty) b)->v.Name.id : NULL, @@ -153,5 +153,5 @@ (b) ? ((expr_ty) b)->v.Name.id : NULL, - p->arena) } + EXTRA) } dotted_as_names[asdl_alias_seq*]: | a[asdl_alias_seq*]=','.dotted_as_name+ { a } dotted_as_name[alias_ty]: @@ -155,5 +155,5 @@ dotted_as_names[asdl_alias_seq*]: | a[asdl_alias_seq*]=','.dotted_as_name+ { a } dotted_as_name[alias_ty]: - | a=dotted_name b=['as' z=NAME { z }] { _Py_alias(a->v.Name.id, + | a=dotted_name b=['as' z=NAME { z }] { _PyAST_alias(a->v.Name.id, (b) ? ((expr_ty) b)->v.Name.id : NULL, @@ -159,7 +159,7 @@ (b) ? ((expr_ty) b)->v.Name.id : NULL, - p->arena) } + EXTRA) } dotted_name[expr_ty]: | a=dotted_name '.' b=NAME { _PyPegen_join_names_with_dot(p, a, b) } | NAME if_stmt[stmt_ty]: @@ -161,9 +161,10 @@ dotted_name[expr_ty]: | a=dotted_name '.' b=NAME { _PyPegen_join_names_with_dot(p, a, b) } | NAME if_stmt[stmt_ty]: - | 'if' a=named_expression &&':' b=block c=elif_stmt { - _Py_If(a, b, CHECK(asdl_stmt_seq*, _PyPegen_singleton_seq(p, c)), EXTRA) } - | 'if' a=named_expression &&':' b=block c=[else_block] { _Py_If(a, b, c, EXTRA) } + | 'if' a=named_expression ':' b=block c=elif_stmt { + _PyAST_If(a, b, CHECK(asdl_stmt_seq*, _PyPegen_singleton_seq(p, c)), EXTRA) } + | 'if' a=named_expression ':' b=block c=[else_block] { _PyAST_If(a, b, c, EXTRA) } + | invalid_if_stmt elif_stmt[stmt_ty]: @@ -169,7 +170,8 @@ elif_stmt[stmt_ty]: - | 'elif' a=named_expression &&':' b=block c=elif_stmt { - _Py_If(a, b, CHECK(asdl_stmt_seq*, _PyPegen_singleton_seq(p, c)), EXTRA) } - | 'elif' a=named_expression &&':' b=block c=[else_block] { _Py_If(a, b, c, EXTRA) } + | 'elif' a=named_expression ':' b=block c=elif_stmt { + _PyAST_If(a, b, CHECK(asdl_stmt_seq*, _PyPegen_singleton_seq(p, c)), EXTRA) } + | 'elif' a=named_expression ':' b=block c=[else_block] { _PyAST_If(a, b, c, EXTRA) } + | invalid_elif_stmt else_block[asdl_stmt_seq*]: 'else' &&':' b=block { b } while_stmt[stmt_ty]: @@ -173,7 +175,8 @@ else_block[asdl_stmt_seq*]: 'else' &&':' b=block { b } while_stmt[stmt_ty]: - | 'while' a=named_expression &&':' b=block c=[else_block] { _Py_While(a, b, c, EXTRA) } + | 'while' a=named_expression ':' b=block c=[else_block] { _PyAST_While(a, b, c, EXTRA) } + | invalid_while_stmt for_stmt[stmt_ty]: | 'for' t=star_targets 'in' ~ ex=star_expressions &&':' tc=[TYPE_COMMENT] b=block el=[else_block] { @@ -177,5 +180,5 @@ for_stmt[stmt_ty]: | 'for' t=star_targets 'in' ~ ex=star_expressions &&':' tc=[TYPE_COMMENT] b=block el=[else_block] { - _Py_For(t, ex, b, el, NEW_TYPE_COMMENT(p, tc), EXTRA) } + _PyAST_For(t, ex, b, el, NEW_TYPE_COMMENT(p, tc), EXTRA) } | ASYNC 'for' t=star_targets 'in' ~ ex=star_expressions &&':' tc=[TYPE_COMMENT] b=block el=[else_block] { @@ -181,6 +184,6 @@ | ASYNC 'for' t=star_targets 'in' ~ ex=star_expressions &&':' tc=[TYPE_COMMENT] b=block el=[else_block] { - CHECK_VERSION(stmt_ty, 5, "Async for loops are", _Py_AsyncFor(t, ex, b, el, NEW_TYPE_COMMENT(p, tc), EXTRA)) } + CHECK_VERSION(stmt_ty, 5, "Async for loops are", _PyAST_AsyncFor(t, ex, b, el, NEW_TYPE_COMMENT(p, tc), EXTRA)) } | invalid_for_target with_stmt[stmt_ty]: | 'with' '(' a[asdl_withitem_seq*]=','.with_item+ ','? ')' ':' b=block { @@ -183,6 +186,6 @@ | invalid_for_target with_stmt[stmt_ty]: | 'with' '(' a[asdl_withitem_seq*]=','.with_item+ ','? ')' ':' b=block { - _Py_With(a, b, NULL, EXTRA) } + _PyAST_With(a, b, NULL, EXTRA) } | 'with' a[asdl_withitem_seq*]=','.with_item+ ':' tc=[TYPE_COMMENT] b=block { @@ -188,3 +191,3 @@ | 'with' a[asdl_withitem_seq*]=','.with_item+ ':' tc=[TYPE_COMMENT] b=block { - _Py_With(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) } + _PyAST_With(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) } | ASYNC 'with' '(' a[asdl_withitem_seq*]=','.with_item+ ','? ')' ':' b=block { @@ -190,3 +193,3 @@ | ASYNC 'with' '(' a[asdl_withitem_seq*]=','.with_item+ ','? ')' ':' b=block { - CHECK_VERSION(stmt_ty, 5, "Async with statements are", _Py_AsyncWith(a, b, NULL, EXTRA)) } + CHECK_VERSION(stmt_ty, 5, "Async with statements are", _PyAST_AsyncWith(a, b, NULL, EXTRA)) } | ASYNC 'with' a[asdl_withitem_seq*]=','.with_item+ ':' tc=[TYPE_COMMENT] b=block { @@ -192,5 +195,5 @@ | ASYNC 'with' a[asdl_withitem_seq*]=','.with_item+ ':' tc=[TYPE_COMMENT] b=block { - CHECK_VERSION(stmt_ty, 5, "Async with statements are", _Py_AsyncWith(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA)) } + CHECK_VERSION(stmt_ty, 5, "Async with statements are", _PyAST_AsyncWith(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA)) } | invalid_with_stmt with_item[withitem_ty]: @@ -194,5 +197,5 @@ | invalid_with_stmt with_item[withitem_ty]: - | e=expression 'as' t=star_target &(',' | ')' | ':') { _Py_withitem(e, t, p->arena) } + | e=expression 'as' t=star_target &(',' | ')' | ':') { _PyAST_withitem(e, t, p->arena) } | invalid_with_item @@ -198,4 +201,4 @@ | invalid_with_item - | e=expression { _Py_withitem(e, NULL, p->arena) } + | e=expression { _PyAST_withitem(e, NULL, p->arena) } try_stmt[stmt_ty]: @@ -200,6 +203,6 @@ try_stmt[stmt_ty]: - | 'try' &&':' b=block f=finally_block { _Py_Try(b, NULL, NULL, f, EXTRA) } - | 'try' &&':' b=block ex[asdl_excepthandler_seq*]=except_block+ el=[else_block] f=[finally_block] { _Py_Try(b, ex, el, f, EXTRA) } + | 'try' &&':' b=block f=finally_block { _PyAST_Try(b, NULL, NULL, f, EXTRA) } + | 'try' &&':' b=block ex[asdl_excepthandler_seq*]=except_block+ el=[else_block] f=[finally_block] { _PyAST_Try(b, ex, el, f, EXTRA) } except_block[excepthandler_ty]: | 'except' e=expression t=['as' z=NAME { z }] ':' b=block { @@ -204,9 +207,9 @@ except_block[excepthandler_ty]: | 'except' e=expression t=['as' z=NAME { z }] ':' b=block { - _Py_ExceptHandler(e, (t) ? ((expr_ty) t)->v.Name.id : NULL, b, EXTRA) } - | 'except' ':' b=block { _Py_ExceptHandler(NULL, NULL, b, EXTRA) } + _PyAST_ExceptHandler(e, (t) ? ((expr_ty) t)->v.Name.id : NULL, b, EXTRA) } + | 'except' ':' b=block { _PyAST_ExceptHandler(NULL, NULL, b, EXTRA) } | invalid_except_block finally_block[asdl_stmt_seq*]: 'finally' ':' a=block { a } match_stmt[stmt_ty]: | "match" subject=subject_expr ':' NEWLINE INDENT cases[asdl_match_case_seq*]=case_block+ DEDENT { @@ -208,9 +211,9 @@ | invalid_except_block finally_block[asdl_stmt_seq*]: 'finally' ':' a=block { a } match_stmt[stmt_ty]: | "match" subject=subject_expr ':' NEWLINE INDENT cases[asdl_match_case_seq*]=case_block+ DEDENT { - CHECK_VERSION(stmt_ty, 10, "Pattern matching is", _Py_Match(subject, cases, EXTRA)) } + CHECK_VERSION(stmt_ty, 10, "Pattern matching is", _PyAST_Match(subject, cases, EXTRA)) } | invalid_match_stmt subject_expr[expr_ty]: | value=star_named_expression ',' values=star_named_expressions? { @@ -214,7 +217,7 @@ | invalid_match_stmt subject_expr[expr_ty]: | value=star_named_expression ',' values=star_named_expressions? { - _Py_Tuple(CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, value, values)), Load, EXTRA) } + _PyAST_Tuple(CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, value, values)), Load, EXTRA) } | named_expression case_block[match_case_ty]: | "case" pattern=patterns guard=guard? ':' body=block { @@ -218,9 +221,9 @@ | named_expression case_block[match_case_ty]: | "case" pattern=patterns guard=guard? ':' body=block { - _Py_match_case(pattern, guard, body, p->arena) } + _PyAST_match_case(pattern, guard, body, p->arena) } | invalid_case_block guard[expr_ty]: 'if' guard=named_expression { guard } patterns[expr_ty]: | values[asdl_expr_seq*]=open_sequence_pattern { @@ -222,12 +225,12 @@ | invalid_case_block guard[expr_ty]: 'if' guard=named_expression { guard } patterns[expr_ty]: | values[asdl_expr_seq*]=open_sequence_pattern { - _Py_Tuple(values, Load, EXTRA) } + _PyAST_Tuple(values, Load, EXTRA) } | pattern pattern[expr_ty]: | as_pattern | or_pattern as_pattern[expr_ty]: | pattern=or_pattern 'as' target=capture_pattern { @@ -228,9 +231,9 @@ | pattern pattern[expr_ty]: | as_pattern | or_pattern as_pattern[expr_ty]: | pattern=or_pattern 'as' target=capture_pattern { - _Py_MatchAs(pattern, target->v.Name.id, EXTRA) } + _PyAST_MatchAs(pattern, target->v.Name.id, EXTRA) } or_pattern[expr_ty]: | patterns[asdl_expr_seq*]='|'.closed_pattern+ { @@ -235,6 +238,6 @@ or_pattern[expr_ty]: | patterns[asdl_expr_seq*]='|'.closed_pattern+ { - asdl_seq_LEN(patterns) == 1 ? asdl_seq_GET(patterns, 0) : _Py_MatchOr(patterns, EXTRA) } + asdl_seq_LEN(patterns) == 1 ? asdl_seq_GET(patterns, 0) : _PyAST_MatchOr(patterns, EXTRA) } closed_pattern[expr_ty]: | literal_pattern | capture_pattern @@ -247,6 +250,6 @@ literal_pattern[expr_ty]: | signed_number !('+' | '-') - | real=signed_number '+' imag=NUMBER { _Py_BinOp(real, Add, imag, EXTRA) } - | real=signed_number '-' imag=NUMBER { _Py_BinOp(real, Sub, imag, EXTRA) } + | real=signed_number '+' imag=NUMBER { _PyAST_BinOp(real, Add, imag, EXTRA) } + | real=signed_number '-' imag=NUMBER { _PyAST_BinOp(real, Sub, imag, EXTRA) } | strings @@ -252,6 +255,6 @@ | strings - | 'None' { _Py_Constant(Py_None, NULL, EXTRA) } - | 'True' { _Py_Constant(Py_True, NULL, EXTRA) } - | 'False' { _Py_Constant(Py_False, NULL, EXTRA) } + | 'None' { _PyAST_Constant(Py_None, NULL, EXTRA) } + | 'True' { _PyAST_Constant(Py_True, NULL, EXTRA) } + | 'False' { _PyAST_Constant(Py_False, NULL, EXTRA) } signed_number[expr_ty]: | NUMBER @@ -256,9 +259,9 @@ signed_number[expr_ty]: | NUMBER - | '-' number=NUMBER { _Py_UnaryOp(USub, number, EXTRA) } + | '-' number=NUMBER { _PyAST_UnaryOp(USub, number, EXTRA) } capture_pattern[expr_ty]: | !"_" name=NAME !('.' | '(' | '=') { _PyPegen_set_expr_context(p, name, Store) } wildcard_pattern[expr_ty]: @@ -259,12 +262,12 @@ capture_pattern[expr_ty]: | !"_" name=NAME !('.' | '(' | '=') { _PyPegen_set_expr_context(p, name, Store) } wildcard_pattern[expr_ty]: - | "_" { _Py_Name(CHECK(PyObject*, _PyPegen_new_identifier(p, "_")), Store, EXTRA) } + | "_" { _PyAST_Name(CHECK(PyObject*, _PyPegen_new_identifier(p, "_")), Store, EXTRA) } value_pattern[expr_ty]: | attr=attr !('.' | '(' | '=') { attr } attr[expr_ty]: | value=name_or_attr '.' attr=NAME { @@ -266,9 +269,9 @@ value_pattern[expr_ty]: | attr=attr !('.' | '(' | '=') { attr } attr[expr_ty]: | value=name_or_attr '.' attr=NAME { - _Py_Attribute(value, attr->v.Name.id, Load, EXTRA) } + _PyAST_Attribute(value, attr->v.Name.id, Load, EXTRA) } name_or_attr[expr_ty]: | attr | NAME @@ -277,8 +280,8 @@ | '(' pattern=pattern ')' { pattern } sequence_pattern[expr_ty]: - | '[' values=maybe_sequence_pattern? ']' { _Py_List(values, Load, EXTRA) } - | '(' values=open_sequence_pattern? ')' { _Py_Tuple(values, Load, EXTRA) } + | '[' values=maybe_sequence_pattern? ']' { _PyAST_List(values, Load, EXTRA) } + | '(' values=open_sequence_pattern? ')' { _PyAST_Tuple(values, Load, EXTRA) } open_sequence_pattern[asdl_seq*]: | value=maybe_star_pattern ',' values=maybe_sequence_pattern? { _PyPegen_seq_insert_in_front(p, value, values) } @@ -289,7 +292,7 @@ | pattern star_pattern[expr_ty]: | '*' value=(capture_pattern | wildcard_pattern) { - _Py_Starred(value, Store, EXTRA) } + _PyAST_Starred(value, Store, EXTRA) } mapping_pattern[expr_ty]: | '{' items=items_pattern? '}' { @@ -293,7 +296,7 @@ mapping_pattern[expr_ty]: | '{' items=items_pattern? '}' { - _Py_Dict(CHECK(asdl_expr_seq*, _PyPegen_get_keys(p, items)), CHECK(asdl_expr_seq*, _PyPegen_get_values(p, items)), EXTRA) } + _PyAST_Dict(CHECK(asdl_expr_seq*, _PyPegen_get_keys(p, items)), CHECK(asdl_expr_seq*, _PyPegen_get_values(p, items)), EXTRA) } items_pattern[asdl_seq*]: | items=','.key_value_pattern+ ','? { items } key_value_pattern[KeyValuePair*]: @@ -304,5 +307,5 @@ | '**' value=capture_pattern { _PyPegen_key_value_pair(p, NULL, value) } class_pattern[expr_ty]: - | func=name_or_attr '(' ')' { _Py_Call(func, NULL, NULL, EXTRA) } + | func=name_or_attr '(' ')' { _PyAST_Call(func, NULL, NULL, EXTRA) } | func=name_or_attr '(' args=positional_patterns ','? ')' { @@ -308,3 +311,3 @@ | func=name_or_attr '(' args=positional_patterns ','? ')' { - _Py_Call(func, args, NULL, EXTRA) } + _PyAST_Call(func, args, NULL, EXTRA) } | func=name_or_attr '(' keywords=keyword_patterns ','? ')' { @@ -310,3 +313,3 @@ | func=name_or_attr '(' keywords=keyword_patterns ','? ')' { - _Py_Call(func, NULL, keywords, EXTRA) } + _PyAST_Call(func, NULL, keywords, EXTRA) } | func=name_or_attr '(' args=positional_patterns ',' keywords=keyword_patterns ','? ')' { @@ -312,7 +315,7 @@ | func=name_or_attr '(' args=positional_patterns ',' keywords=keyword_patterns ','? ')' { - _Py_Call(func, args, keywords, EXTRA) } + _PyAST_Call(func, args, keywords, EXTRA) } positional_patterns[asdl_expr_seq*]: | args[asdl_expr_seq*]=','.pattern+ { args } keyword_patterns[asdl_keyword_seq*]: | keywords[asdl_keyword_seq*]=','.keyword_pattern+ { keywords } keyword_pattern[keyword_ty]: @@ -314,8 +317,8 @@ positional_patterns[asdl_expr_seq*]: | args[asdl_expr_seq*]=','.pattern+ { args } keyword_patterns[asdl_keyword_seq*]: | keywords[asdl_keyword_seq*]=','.keyword_pattern+ { keywords } keyword_pattern[keyword_ty]: - | arg=NAME '=' value=pattern { _Py_keyword(arg->v.Name.id, value, EXTRA) } + | arg=NAME '=' value=pattern { _PyAST_keyword(arg->v.Name.id, value, EXTRA) } return_stmt[stmt_ty]: @@ -320,5 +323,5 @@ return_stmt[stmt_ty]: - | 'return' a=[star_expressions] { _Py_Return(a, EXTRA) } + | 'return' a=[star_expressions] { _PyAST_Return(a, EXTRA) } raise_stmt[stmt_ty]: @@ -323,7 +326,7 @@ raise_stmt[stmt_ty]: - | 'raise' a=expression b=['from' z=expression { z }] { _Py_Raise(a, b, EXTRA) } - | 'raise' { _Py_Raise(NULL, NULL, EXTRA) } + | 'raise' a=expression b=['from' z=expression { z }] { _PyAST_Raise(a, b, EXTRA) } + | 'raise' { _PyAST_Raise(NULL, NULL, EXTRA) } function_def[stmt_ty]: | d=decorators f=function_def_raw { _PyPegen_function_def_decorators(p, d, f) } @@ -331,7 +334,7 @@ function_def_raw[stmt_ty]: | 'def' n=NAME '(' params=[params] ')' a=['->' z=expression { z }] &&':' tc=[func_type_comment] b=block { - _Py_FunctionDef(n->v.Name.id, + _PyAST_FunctionDef(n->v.Name.id, (params) ? params : CHECK(arguments_ty, _PyPegen_empty_arguments(p)), b, NULL, a, NEW_TYPE_COMMENT(p, tc), EXTRA) } | ASYNC 'def' n=NAME '(' params=[params] ')' a=['->' z=expression { z }] &&':' tc=[func_type_comment] b=block { @@ -339,7 +342,7 @@ stmt_ty, 5, "Async functions are", - _Py_AsyncFunctionDef(n->v.Name.id, + _PyAST_AsyncFunctionDef(n->v.Name.id, (params) ? params : CHECK(arguments_ty, _PyPegen_empty_arguments(p)), b, NULL, a, NEW_TYPE_COMMENT(p, tc), EXTRA) ) } @@ -403,7 +406,7 @@ param_maybe_default[NameDefaultPair*]: | a=param c=default? ',' tc=TYPE_COMMENT? { _PyPegen_name_default_pair(p, a, c, tc) } | a=param c=default? tc=TYPE_COMMENT? &')' { _PyPegen_name_default_pair(p, a, c, tc) } -param[arg_ty]: a=NAME b=annotation? { _Py_arg(a->v.Name.id, b, NULL, EXTRA) } +param[arg_ty]: a=NAME b=annotation? { _PyAST_arg(a->v.Name.id, b, NULL, EXTRA) } annotation[expr_ty]: ':' a=expression { a } default[expr_ty]: '=' a=expression { a } @@ -415,7 +418,7 @@ | class_def_raw class_def_raw[stmt_ty]: | 'class' a=NAME b=['(' z=[arguments] ')' { z }] &&':' c=block { - _Py_ClassDef(a->v.Name.id, + _PyAST_ClassDef(a->v.Name.id, (b) ? ((expr_ty) b)->v.Call.args : NULL, (b) ? ((expr_ty) b)->v.Call.keywords : NULL, c, NULL, EXTRA) } @@ -427,7 +430,7 @@ star_expressions[expr_ty]: | a=star_expression b=(',' c=star_expression { c })+ [','] { - _Py_Tuple(CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, a, b)), Load, EXTRA) } - | a=star_expression ',' { _Py_Tuple(CHECK(asdl_expr_seq*, _PyPegen_singleton_seq(p, a)), Load, EXTRA) } + _PyAST_Tuple(CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, a, b)), Load, EXTRA) } + | a=star_expression ',' { _PyAST_Tuple(CHECK(asdl_expr_seq*, _PyPegen_singleton_seq(p, a)), Load, EXTRA) } | star_expression star_expression[expr_ty] (memo): @@ -432,7 +435,7 @@ | star_expression star_expression[expr_ty] (memo): - | '*' a=bitwise_or { _Py_Starred(a, Load, EXTRA) } + | '*' a=bitwise_or { _PyAST_Starred(a, Load, EXTRA) } | expression star_named_expressions[asdl_expr_seq*]: a[asdl_expr_seq*]=','.star_named_expression+ [','] { a } star_named_expression[expr_ty]: @@ -435,6 +438,6 @@ | expression star_named_expressions[asdl_expr_seq*]: a[asdl_expr_seq*]=','.star_named_expression+ [','] { a } star_named_expression[expr_ty]: - | '*' a=bitwise_or { _Py_Starred(a, Load, EXTRA) } + | '*' a=bitwise_or { _PyAST_Starred(a, Load, EXTRA) } | named_expression @@ -440,2 +443,3 @@ | named_expression + named_expression[expr_ty]: @@ -441,3 +445,4 @@ named_expression[expr_ty]: - | a=NAME ':=' ~ b=expression { _Py_NamedExpr(CHECK(expr_ty, _PyPegen_set_expr_context(p, a, Store)), b, EXTRA) } + | a=NAME ':=' ~ b=expression { _PyAST_NamedExpr(CHECK(expr_ty, _PyPegen_set_expr_context(p, a, Store)), b, EXTRA) } + | invalid_named_expression | expression !':=' @@ -443,7 +448,10 @@ | expression !':=' - | invalid_named_expression + +direct_named_expression[expr_ty]: + | a=NAME ':=' ~ b=expression { _PyAST_NamedExpr(CHECK(expr_ty, _PyPegen_set_expr_context(p, a, Store)), b, EXTRA) } + | expression !':=' annotated_rhs[expr_ty]: yield_expr | star_expressions expressions[expr_ty]: | a=expression b=(',' c=expression { c })+ [','] { @@ -445,9 +453,9 @@ annotated_rhs[expr_ty]: yield_expr | star_expressions expressions[expr_ty]: | a=expression b=(',' c=expression { c })+ [','] { - _Py_Tuple(CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, a, b)), Load, EXTRA) } - | a=expression ',' { _Py_Tuple(CHECK(asdl_expr_seq*, _PyPegen_singleton_seq(p, a)), Load, EXTRA) } + _PyAST_Tuple(CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, a, b)), Load, EXTRA) } + | a=expression ',' { _PyAST_Tuple(CHECK(asdl_expr_seq*, _PyPegen_singleton_seq(p, a)), Load, EXTRA) } | expression expression[expr_ty] (memo): @@ -452,8 +460,8 @@ | expression expression[expr_ty] (memo): - | a=disjunction 'if' b=disjunction 'else' c=expression { _Py_IfExp(b, a, c, EXTRA) } + | a=disjunction 'if' b=disjunction 'else' c=expression { _PyAST_IfExp(b, a, c, EXTRA) } | disjunction | lambdef lambdef[expr_ty]: | 'lambda' a=[lambda_params] ':' b=expression { @@ -455,9 +463,9 @@ | disjunction | lambdef lambdef[expr_ty]: | 'lambda' a=[lambda_params] ':' b=expression { - _Py_Lambda((a) ? a : CHECK(arguments_ty, _PyPegen_empty_arguments(p)), b, EXTRA) } + _PyAST_Lambda((a) ? a : CHECK(arguments_ty, _PyPegen_empty_arguments(p)), b, EXTRA) } lambda_params[arguments_ty]: | invalid_lambda_parameters @@ -503,6 +511,6 @@ lambda_param_maybe_default[NameDefaultPair*]: | a=lambda_param c=default? ',' { _PyPegen_name_default_pair(p, a, c, NULL) } | a=lambda_param c=default? &':' { _PyPegen_name_default_pair(p, a, c, NULL) } -lambda_param[arg_ty]: a=NAME { _Py_arg(a->v.Name.id, NULL, NULL, EXTRA) } +lambda_param[arg_ty]: a=NAME { _PyAST_arg(a->v.Name.id, NULL, NULL, EXTRA) } disjunction[expr_ty] (memo): @@ -507,8 +515,8 @@ disjunction[expr_ty] (memo): - | a=conjunction b=('or' c=conjunction { c })+ { _Py_BoolOp( + | a=conjunction b=('or' c=conjunction { c })+ { _PyAST_BoolOp( Or, CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, a, b)), EXTRA) } | conjunction conjunction[expr_ty] (memo): @@ -510,11 +518,11 @@ Or, CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, a, b)), EXTRA) } | conjunction conjunction[expr_ty] (memo): - | a=inversion b=('and' c=inversion { c })+ { _Py_BoolOp( + | a=inversion b=('and' c=inversion { c })+ { _PyAST_BoolOp( And, CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, a, b)), EXTRA) } | inversion inversion[expr_ty] (memo): @@ -516,9 +524,9 @@ And, CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, a, b)), EXTRA) } | inversion inversion[expr_ty] (memo): - | 'not' a=inversion { _Py_UnaryOp(Not, a, EXTRA) } + | 'not' a=inversion { _PyAST_UnaryOp(Not, a, EXTRA) } | comparison comparison[expr_ty]: | a=bitwise_or b=compare_op_bitwise_or_pair+ { @@ -522,7 +530,7 @@ | comparison comparison[expr_ty]: | a=bitwise_or b=compare_op_bitwise_or_pair+ { - _Py_Compare( + _PyAST_Compare( a, CHECK(asdl_int_seq*, _PyPegen_get_cmpops(p, b)), CHECK(asdl_expr_seq*, _PyPegen_get_exprs(p, b)), @@ -552,6 +560,6 @@ is_bitwise_or[CmpopExprPair*]: 'is' a=bitwise_or { _PyPegen_cmpop_expr_pair(p, Is, a) } bitwise_or[expr_ty]: - | a=bitwise_or '|' b=bitwise_xor { _Py_BinOp(a, BitOr, b, EXTRA) } + | a=bitwise_or '|' b=bitwise_xor { _PyAST_BinOp(a, BitOr, b, EXTRA) } | bitwise_xor bitwise_xor[expr_ty]: @@ -556,5 +564,5 @@ | bitwise_xor bitwise_xor[expr_ty]: - | a=bitwise_xor '^' b=bitwise_and { _Py_BinOp(a, BitXor, b, EXTRA) } + | a=bitwise_xor '^' b=bitwise_and { _PyAST_BinOp(a, BitXor, b, EXTRA) } | bitwise_and bitwise_and[expr_ty]: @@ -559,5 +567,5 @@ | bitwise_and bitwise_and[expr_ty]: - | a=bitwise_and '&' b=shift_expr { _Py_BinOp(a, BitAnd, b, EXTRA) } + | a=bitwise_and '&' b=shift_expr { _PyAST_BinOp(a, BitAnd, b, EXTRA) } | shift_expr shift_expr[expr_ty]: @@ -562,7 +570,7 @@ | shift_expr shift_expr[expr_ty]: - | a=shift_expr '<<' b=sum { _Py_BinOp(a, LShift, b, EXTRA) } - | a=shift_expr '>>' b=sum { _Py_BinOp(a, RShift, b, EXTRA) } + | a=shift_expr '<<' b=sum { _PyAST_BinOp(a, LShift, b, EXTRA) } + | a=shift_expr '>>' b=sum { _PyAST_BinOp(a, RShift, b, EXTRA) } | sum sum[expr_ty]: @@ -566,7 +574,7 @@ | sum sum[expr_ty]: - | a=sum '+' b=term { _Py_BinOp(a, Add, b, EXTRA) } - | a=sum '-' b=term { _Py_BinOp(a, Sub, b, EXTRA) } + | a=sum '+' b=term { _PyAST_BinOp(a, Add, b, EXTRA) } + | a=sum '-' b=term { _PyAST_BinOp(a, Sub, b, EXTRA) } | term term[expr_ty]: @@ -571,9 +579,9 @@ | term term[expr_ty]: - | a=term '*' b=factor { _Py_BinOp(a, Mult, b, EXTRA) } - | a=term '/' b=factor { _Py_BinOp(a, Div, b, EXTRA) } - | a=term '//' b=factor { _Py_BinOp(a, FloorDiv, b, EXTRA) } - | a=term '%' b=factor { _Py_BinOp(a, Mod, b, EXTRA) } - | a=term '@' b=factor { CHECK_VERSION(expr_ty, 5, "The '@' operator is", _Py_BinOp(a, MatMult, b, EXTRA)) } + | a=term '*' b=factor { _PyAST_BinOp(a, Mult, b, EXTRA) } + | a=term '/' b=factor { _PyAST_BinOp(a, Div, b, EXTRA) } + | a=term '//' b=factor { _PyAST_BinOp(a, FloorDiv, b, EXTRA) } + | a=term '%' b=factor { _PyAST_BinOp(a, Mod, b, EXTRA) } + | a=term '@' b=factor { CHECK_VERSION(expr_ty, 5, "The '@' operator is", _PyAST_BinOp(a, MatMult, b, EXTRA)) } | factor factor[expr_ty] (memo): @@ -578,7 +586,7 @@ | factor factor[expr_ty] (memo): - | '+' a=factor { _Py_UnaryOp(UAdd, a, EXTRA) } - | '-' a=factor { _Py_UnaryOp(USub, a, EXTRA) } - | '~' a=factor { _Py_UnaryOp(Invert, a, EXTRA) } + | '+' a=factor { _PyAST_UnaryOp(UAdd, a, EXTRA) } + | '-' a=factor { _PyAST_UnaryOp(USub, a, EXTRA) } + | '~' a=factor { _PyAST_UnaryOp(Invert, a, EXTRA) } | power power[expr_ty]: @@ -583,5 +591,5 @@ | power power[expr_ty]: - | a=await_primary '**' b=factor { _Py_BinOp(a, Pow, b, EXTRA) } + | a=await_primary '**' b=factor { _PyAST_BinOp(a, Pow, b, EXTRA) } | await_primary await_primary[expr_ty] (memo): @@ -586,6 +594,6 @@ | await_primary await_primary[expr_ty] (memo): - | AWAIT a=primary { CHECK_VERSION(expr_ty, 5, "Await expressions are", _Py_Await(a, EXTRA)) } + | AWAIT a=primary { CHECK_VERSION(expr_ty, 5, "Await expressions are", _PyAST_Await(a, EXTRA)) } | primary primary[expr_ty]: | invalid_primary # must be before 'primay genexp' because of invalid_genexp @@ -589,6 +597,6 @@ | primary primary[expr_ty]: | invalid_primary # must be before 'primay genexp' because of invalid_genexp - | a=primary '.' b=NAME { _Py_Attribute(a, b->v.Name.id, Load, EXTRA) } - | a=primary b=genexp { _Py_Call(a, CHECK(asdl_expr_seq*, (asdl_expr_seq*)_PyPegen_singleton_seq(p, b)), NULL, EXTRA) } + | a=primary '.' b=NAME { _PyAST_Attribute(a, b->v.Name.id, Load, EXTRA) } + | a=primary b=genexp { _PyAST_Call(a, CHECK(asdl_expr_seq*, (asdl_expr_seq*)_PyPegen_singleton_seq(p, b)), NULL, EXTRA) } | a=primary '(' b=[arguments] ')' { @@ -594,5 +602,5 @@ | a=primary '(' b=[arguments] ')' { - _Py_Call(a, + _PyAST_Call(a, (b) ? ((expr_ty) b)->v.Call.args : NULL, (b) ? ((expr_ty) b)->v.Call.keywords : NULL, EXTRA) } @@ -596,8 +604,8 @@ (b) ? ((expr_ty) b)->v.Call.args : NULL, (b) ? ((expr_ty) b)->v.Call.keywords : NULL, EXTRA) } - | a=primary '[' b=slices ']' { _Py_Subscript(a, b, Load, EXTRA) } + | a=primary '[' b=slices ']' { _PyAST_Subscript(a, b, Load, EXTRA) } | atom slices[expr_ty]: | a=slice !',' { a } @@ -600,6 +608,6 @@ | atom slices[expr_ty]: | a=slice !',' { a } - | a[asdl_expr_seq*]=','.slice+ [','] { _Py_Tuple(a, Load, EXTRA) } + | a[asdl_expr_seq*]=','.slice+ [','] { _PyAST_Tuple(a, Load, EXTRA) } slice[expr_ty]: @@ -605,5 +613,5 @@ slice[expr_ty]: - | a=[expression] ':' b=[expression] c=[':' d=[expression] { d }] { _Py_Slice(a, b, c, EXTRA) } + | a=[expression] ':' b=[expression] c=[':' d=[expression] { d }] { _PyAST_Slice(a, b, c, EXTRA) } | a=named_expression { a } atom[expr_ty]: | NAME @@ -607,11 +615,11 @@ | a=named_expression { a } atom[expr_ty]: | NAME - | 'True' { _Py_Constant(Py_True, NULL, EXTRA) } - | 'False' { _Py_Constant(Py_False, NULL, EXTRA) } - | 'None' { _Py_Constant(Py_None, NULL, EXTRA) } + | 'True' { _PyAST_Constant(Py_True, NULL, EXTRA) } + | 'False' { _PyAST_Constant(Py_False, NULL, EXTRA) } + | 'None' { _PyAST_Constant(Py_None, NULL, EXTRA) } | &STRING strings | NUMBER | &'(' (tuple | group | genexp) | &'[' (list | listcomp) | &'{' (dict | set | dictcomp | setcomp) @@ -613,9 +621,9 @@ | &STRING strings | NUMBER | &'(' (tuple | group | genexp) | &'[' (list | listcomp) | &'{' (dict | set | dictcomp | setcomp) - | '...' { _Py_Constant(Py_Ellipsis, NULL, EXTRA) } + | '...' { _PyAST_Constant(Py_Ellipsis, NULL, EXTRA) } strings[expr_ty] (memo): a=STRING+ { _PyPegen_concatenate_strings(p, a) } list[expr_ty]: @@ -619,5 +627,5 @@ strings[expr_ty] (memo): a=STRING+ { _PyPegen_concatenate_strings(p, a) } list[expr_ty]: - | '[' a=[star_named_expressions] ']' { _Py_List(a, Load, EXTRA) } + | '[' a=[star_named_expressions] ']' { _PyAST_List(a, Load, EXTRA) } listcomp[expr_ty]: @@ -623,5 +631,5 @@ listcomp[expr_ty]: - | '[' a=named_expression b=for_if_clauses ']' { _Py_ListComp(a, b, EXTRA) } + | '[' a=named_expression b=for_if_clauses ']' { _PyAST_ListComp(a, b, EXTRA) } | invalid_comprehension tuple[expr_ty]: | '(' a=[y=star_named_expression ',' z=[star_named_expressions] { _PyPegen_seq_insert_in_front(p, y, z) } ] ')' { @@ -625,8 +633,8 @@ | invalid_comprehension tuple[expr_ty]: | '(' a=[y=star_named_expression ',' z=[star_named_expressions] { _PyPegen_seq_insert_in_front(p, y, z) } ] ')' { - _Py_Tuple(a, Load, EXTRA) } + _PyAST_Tuple(a, Load, EXTRA) } group[expr_ty]: | '(' a=(yield_expr | named_expression) ')' { a } | invalid_group genexp[expr_ty]: @@ -629,6 +637,6 @@ group[expr_ty]: | '(' a=(yield_expr | named_expression) ')' { a } | invalid_group genexp[expr_ty]: - | '(' a=named_expression b=for_if_clauses ')' { _Py_GeneratorExp(a, b, EXTRA) } + | '(' a=direct_named_expression b=for_if_clauses ')' { _PyAST_GeneratorExp(a, b, EXTRA) } | invalid_comprehension @@ -634,3 +642,3 @@ | invalid_comprehension -set[expr_ty]: '{' a=star_named_expressions '}' { _Py_Set(a, EXTRA) } +set[expr_ty]: '{' a=star_named_expressions '}' { _PyAST_Set(a, EXTRA) } setcomp[expr_ty]: @@ -636,5 +644,5 @@ setcomp[expr_ty]: - | '{' a=named_expression b=for_if_clauses '}' { _Py_SetComp(a, b, EXTRA) } + | '{' a=named_expression b=for_if_clauses '}' { _PyAST_SetComp(a, b, EXTRA) } | invalid_comprehension dict[expr_ty]: | '{' a=[double_starred_kvpairs] '}' { @@ -638,8 +646,8 @@ | invalid_comprehension dict[expr_ty]: | '{' a=[double_starred_kvpairs] '}' { - _Py_Dict( + _PyAST_Dict( CHECK(asdl_expr_seq*, _PyPegen_get_keys(p, a)), CHECK(asdl_expr_seq*, _PyPegen_get_values(p, a)), EXTRA) } dictcomp[expr_ty]: @@ -642,8 +650,8 @@ CHECK(asdl_expr_seq*, _PyPegen_get_keys(p, a)), CHECK(asdl_expr_seq*, _PyPegen_get_values(p, a)), EXTRA) } dictcomp[expr_ty]: - | '{' a=kvpair b=for_if_clauses '}' { _Py_DictComp(a->key, a->value, b, EXTRA) } + | '{' a=kvpair b=for_if_clauses '}' { _PyAST_DictComp(a->key, a->value, b, EXTRA) } | invalid_dict_comprehension double_starred_kvpairs[asdl_seq*]: a=','.double_starred_kvpair+ [','] { a } double_starred_kvpair[KeyValuePair*]: @@ -654,5 +662,5 @@ | a[asdl_comprehension_seq*]=for_if_clause+ { a } for_if_clause[comprehension_ty]: | ASYNC 'for' a=star_targets 'in' ~ b=disjunction c[asdl_expr_seq*]=('if' z=disjunction { z })* { - CHECK_VERSION(comprehension_ty, 6, "Async comprehensions are", _Py_comprehension(a, b, c, 1, p->arena)) } + CHECK_VERSION(comprehension_ty, 6, "Async comprehensions are", _PyAST_comprehension(a, b, c, 1, p->arena)) } | 'for' a=star_targets 'in' ~ b=disjunction c[asdl_expr_seq*]=('if' z=disjunction { z })* { @@ -658,5 +666,5 @@ | 'for' a=star_targets 'in' ~ b=disjunction c[asdl_expr_seq*]=('if' z=disjunction { z })* { - _Py_comprehension(a, b, c, 0, p->arena) } + _PyAST_comprehension(a, b, c, 0, p->arena) } | invalid_for_target yield_expr[expr_ty]: @@ -660,10 +668,10 @@ | invalid_for_target yield_expr[expr_ty]: - | 'yield' 'from' a=expression { _Py_YieldFrom(a, EXTRA) } - | 'yield' a=[star_expressions] { _Py_Yield(a, EXTRA) } + | 'yield' 'from' a=expression { _PyAST_YieldFrom(a, EXTRA) } + | 'yield' a=[star_expressions] { _PyAST_Yield(a, EXTRA) } arguments[expr_ty] (memo): | a=args [','] &')' { a } | invalid_arguments args[expr_ty]: @@ -665,10 +673,10 @@ arguments[expr_ty] (memo): | a=args [','] &')' { a } | invalid_arguments args[expr_ty]: - | a[asdl_expr_seq*]=','.(starred_expression | named_expression !'=')+ b=[',' k=kwargs {k}] { _PyPegen_collect_call_seqs(p, a, b, EXTRA) } - | a=kwargs { _Py_Call(_PyPegen_dummy_name(p), + | a[asdl_expr_seq*]=','.(starred_expression | direct_named_expression !'=')+ b=[',' k=kwargs {k}] { _PyPegen_collect_call_seqs(p, a, b, EXTRA) } + | a=kwargs { _PyAST_Call(_PyPegen_dummy_name(p), CHECK_NULL_ALLOWED(asdl_expr_seq*, _PyPegen_seq_extract_starred_exprs(p, a)), CHECK_NULL_ALLOWED(asdl_keyword_seq*, _PyPegen_seq_delete_starred_exprs(p, a)), EXTRA) } @@ -677,6 +685,6 @@ | ','.kwarg_or_starred+ | ','.kwarg_or_double_starred+ starred_expression[expr_ty]: - | '*' a=expression { _Py_Starred(a, Load, EXTRA) } + | '*' a=expression { _PyAST_Starred(a, Load, EXTRA) } kwarg_or_starred[KeywordOrStarred*]: | a=NAME '=' b=expression { @@ -681,7 +689,7 @@ kwarg_or_starred[KeywordOrStarred*]: | a=NAME '=' b=expression { - _PyPegen_keyword_or_starred(p, CHECK(keyword_ty, _Py_keyword(a->v.Name.id, b, EXTRA)), 1) } + _PyPegen_keyword_or_starred(p, CHECK(keyword_ty, _PyAST_keyword(a->v.Name.id, b, EXTRA)), 1) } | a=starred_expression { _PyPegen_keyword_or_starred(p, a, 0) } | invalid_kwarg kwarg_or_double_starred[KeywordOrStarred*]: | a=NAME '=' b=expression { @@ -684,12 +692,12 @@ | a=starred_expression { _PyPegen_keyword_or_starred(p, a, 0) } | invalid_kwarg kwarg_or_double_starred[KeywordOrStarred*]: | a=NAME '=' b=expression { - _PyPegen_keyword_or_starred(p, CHECK(keyword_ty, _Py_keyword(a->v.Name.id, b, EXTRA)), 1) } - | '**' a=expression { _PyPegen_keyword_or_starred(p, CHECK(keyword_ty, _Py_keyword(NULL, a, EXTRA)), 1) } + _PyPegen_keyword_or_starred(p, CHECK(keyword_ty, _PyAST_keyword(a->v.Name.id, b, EXTRA)), 1) } + | '**' a=expression { _PyPegen_keyword_or_starred(p, CHECK(keyword_ty, _PyAST_keyword(NULL, a, EXTRA)), 1) } | invalid_kwarg # NOTE: star_targets may contain *bitwise_or, targets may not. star_targets[expr_ty]: | a=star_target !',' { a } | a=star_target b=(',' c=star_target { c })* [','] { @@ -690,13 +698,13 @@ | invalid_kwarg # NOTE: star_targets may contain *bitwise_or, targets may not. star_targets[expr_ty]: | a=star_target !',' { a } | a=star_target b=(',' c=star_target { c })* [','] { - _Py_Tuple(CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, a, b)), Store, EXTRA) } + _PyAST_Tuple(CHECK(asdl_expr_seq*, _PyPegen_seq_insert_in_front(p, a, b)), Store, EXTRA) } star_targets_list_seq[asdl_expr_seq*]: a[asdl_expr_seq*]=','.star_target+ [','] { a } star_targets_tuple_seq[asdl_expr_seq*]: | a=star_target b=(',' c=star_target { c })+ [','] { (asdl_expr_seq*) _PyPegen_seq_insert_in_front(p, a, b) } | a=star_target ',' { (asdl_expr_seq*) _PyPegen_singleton_seq(p, a) } star_target[expr_ty] (memo): | '*' a=(!'*' star_target) { @@ -697,9 +705,9 @@ star_targets_list_seq[asdl_expr_seq*]: a[asdl_expr_seq*]=','.star_target+ [','] { a } star_targets_tuple_seq[asdl_expr_seq*]: | a=star_target b=(',' c=star_target { c })+ [','] { (asdl_expr_seq*) _PyPegen_seq_insert_in_front(p, a, b) } | a=star_target ',' { (asdl_expr_seq*) _PyPegen_singleton_seq(p, a) } star_target[expr_ty] (memo): | '*' a=(!'*' star_target) { - _Py_Starred(CHECK(expr_ty, _PyPegen_set_expr_context(p, a, Store)), Store, EXTRA) } + _PyAST_Starred(CHECK(expr_ty, _PyPegen_set_expr_context(p, a, Store)), Store, EXTRA) } | target_with_star_atom target_with_star_atom[expr_ty] (memo): @@ -704,8 +712,8 @@ | target_with_star_atom target_with_star_atom[expr_ty] (memo): - | a=t_primary '.' b=NAME !t_lookahead { _Py_Attribute(a, b->v.Name.id, Store, EXTRA) } - | a=t_primary '[' b=slices ']' !t_lookahead { _Py_Subscript(a, b, Store, EXTRA) } + | a=t_primary '.' b=NAME !t_lookahead { _PyAST_Attribute(a, b->v.Name.id, Store, EXTRA) } + | a=t_primary '[' b=slices ']' !t_lookahead { _PyAST_Subscript(a, b, Store, EXTRA) } | star_atom star_atom[expr_ty]: | a=NAME { _PyPegen_set_expr_context(p, a, Store) } | '(' a=target_with_star_atom ')' { _PyPegen_set_expr_context(p, a, Store) } @@ -708,12 +716,12 @@ | star_atom star_atom[expr_ty]: | a=NAME { _PyPegen_set_expr_context(p, a, Store) } | '(' a=target_with_star_atom ')' { _PyPegen_set_expr_context(p, a, Store) } - | '(' a=[star_targets_tuple_seq] ')' { _Py_Tuple(a, Store, EXTRA) } - | '[' a=[star_targets_list_seq] ']' { _Py_List(a, Store, EXTRA) } + | '(' a=[star_targets_tuple_seq] ')' { _PyAST_Tuple(a, Store, EXTRA) } + | '[' a=[star_targets_list_seq] ']' { _PyAST_List(a, Store, EXTRA) } single_target[expr_ty]: | single_subscript_attribute_target | a=NAME { _PyPegen_set_expr_context(p, a, Store) } | '(' a=single_target ')' { a } single_subscript_attribute_target[expr_ty]: @@ -714,11 +722,11 @@ single_target[expr_ty]: | single_subscript_attribute_target | a=NAME { _PyPegen_set_expr_context(p, a, Store) } | '(' a=single_target ')' { a } single_subscript_attribute_target[expr_ty]: - | a=t_primary '.' b=NAME !t_lookahead { _Py_Attribute(a, b->v.Name.id, Store, EXTRA) } - | a=t_primary '[' b=slices ']' !t_lookahead { _Py_Subscript(a, b, Store, EXTRA) } + | a=t_primary '.' b=NAME !t_lookahead { _PyAST_Attribute(a, b->v.Name.id, Store, EXTRA) } + | a=t_primary '[' b=slices ']' !t_lookahead { _PyAST_Subscript(a, b, Store, EXTRA) } del_targets[asdl_expr_seq*]: a[asdl_expr_seq*]=','.del_target+ [','] { a } del_target[expr_ty] (memo): @@ -722,9 +730,9 @@ del_targets[asdl_expr_seq*]: a[asdl_expr_seq*]=','.del_target+ [','] { a } del_target[expr_ty] (memo): - | a=t_primary '.' b=NAME !t_lookahead { _Py_Attribute(a, b->v.Name.id, Del, EXTRA) } - | a=t_primary '[' b=slices ']' !t_lookahead { _Py_Subscript(a, b, Del, EXTRA) } + | a=t_primary '.' b=NAME !t_lookahead { _PyAST_Attribute(a, b->v.Name.id, Del, EXTRA) } + | a=t_primary '[' b=slices ']' !t_lookahead { _PyAST_Subscript(a, b, Del, EXTRA) } | del_t_atom del_t_atom[expr_ty]: | a=NAME { _PyPegen_set_expr_context(p, a, Del) } | '(' a=del_target ')' { _PyPegen_set_expr_context(p, a, Del) } @@ -727,9 +735,9 @@ | del_t_atom del_t_atom[expr_ty]: | a=NAME { _PyPegen_set_expr_context(p, a, Del) } | '(' a=del_target ')' { _PyPegen_set_expr_context(p, a, Del) } - | '(' a=[del_targets] ')' { _Py_Tuple(a, Del, EXTRA) } - | '[' a=[del_targets] ']' { _Py_List(a, Del, EXTRA) } + | '(' a=[del_targets] ')' { _PyAST_Tuple(a, Del, EXTRA) } + | '[' a=[del_targets] ']' { _PyAST_List(a, Del, EXTRA) } targets[asdl_expr_seq*]: a[asdl_expr_seq*]=','.target+ [','] { a } target[expr_ty] (memo): @@ -733,7 +741,7 @@ targets[asdl_expr_seq*]: a[asdl_expr_seq*]=','.target+ [','] { a } target[expr_ty] (memo): - | a=t_primary '.' b=NAME !t_lookahead { _Py_Attribute(a, b->v.Name.id, Store, EXTRA) } - | a=t_primary '[' b=slices ']' !t_lookahead { _Py_Subscript(a, b, Store, EXTRA) } + | a=t_primary '.' b=NAME !t_lookahead { _PyAST_Attribute(a, b->v.Name.id, Store, EXTRA) } + | a=t_primary '[' b=slices ']' !t_lookahead { _PyAST_Subscript(a, b, Store, EXTRA) } | t_atom t_primary[expr_ty]: @@ -738,5 +746,5 @@ | t_atom t_primary[expr_ty]: - | a=t_primary '.' b=NAME &t_lookahead { _Py_Attribute(a, b->v.Name.id, Load, EXTRA) } - | a=t_primary '[' b=slices ']' &t_lookahead { _Py_Subscript(a, b, Load, EXTRA) } + | a=t_primary '.' b=NAME &t_lookahead { _PyAST_Attribute(a, b->v.Name.id, Load, EXTRA) } + | a=t_primary '[' b=slices ']' &t_lookahead { _PyAST_Subscript(a, b, Load, EXTRA) } | a=t_primary b=genexp &t_lookahead { @@ -742,3 +750,3 @@ | a=t_primary b=genexp &t_lookahead { - _Py_Call(a, CHECK(asdl_expr_seq*, (asdl_expr_seq*)_PyPegen_singleton_seq(p, b)), NULL, EXTRA) } + _PyAST_Call(a, CHECK(asdl_expr_seq*, (asdl_expr_seq*)_PyPegen_singleton_seq(p, b)), NULL, EXTRA) } | a=t_primary '(' b=[arguments] ')' &t_lookahead { @@ -744,5 +752,5 @@ | a=t_primary '(' b=[arguments] ')' &t_lookahead { - _Py_Call(a, + _PyAST_Call(a, (b) ? ((expr_ty) b)->v.Call.args : NULL, (b) ? ((expr_ty) b)->v.Call.keywords : NULL, EXTRA) } @@ -751,8 +759,8 @@ t_atom[expr_ty]: | a=NAME { _PyPegen_set_expr_context(p, a, Store) } | '(' a=target ')' { _PyPegen_set_expr_context(p, a, Store) } - | '(' b=[targets] ')' { _Py_Tuple(b, Store, EXTRA) } - | '[' b=[targets] ']' { _Py_List(b, Store, EXTRA) } + | '(' b=[targets] ')' { _PyAST_Tuple(b, Store, EXTRA) } + | '[' b=[targets] ']' { _PyAST_List(b, Store, EXTRA) } # From here on, there are rules for invalid syntax with specialised error messages @@ -772,6 +780,12 @@ | a=expression ':=' expression { RAISE_SYNTAX_ERROR_KNOWN_LOCATION( a, "cannot use assignment expressions with %s", _PyPegen_get_expr_name(a)) } + | a=NAME b='=' bitwise_or !('='|':='|',') { + RAISE_SYNTAX_ERROR_KNOWN_LOCATION(b, "invalid syntax. Maybe you meant '==' or ':=' instead of '='?") } + | !(list|tuple|genexp|'True'|'None'|'False') a=bitwise_or b='=' bitwise_or !('='|':='|',') { + RAISE_SYNTAX_ERROR_KNOWN_LOCATION(b, "cannot assign to %s here. Maybe you meant '==' instead of '='?", + _PyPegen_get_expr_name(a)) } + invalid_assignment: | a=invalid_ann_assign_target ':' expression { RAISE_SYNTAX_ERROR_KNOWN_LOCATION( @@ -841,7 +855,9 @@ invalid_group: | '(' a=starred_expression ')' { - RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "can't use starred expression here") } + RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "cannot use starred expression here") } + | '(' a='**' expression ')' { + RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "cannot use double starred expression here") } invalid_import_from_targets: | import_from_as_names ',' { RAISE_SYNTAX_ERROR("trailing comma not allowed without surrounding parentheses") } @@ -854,7 +870,7 @@ | 'except' a=expression ',' expressions ['as' NAME ] ':' { RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "exception group must be parenthesized") } | 'except' expression ['as' NAME ] &&':' - | 'except' &&':' + | 'except' &&':' invalid_match_stmt: | "match" subject_expr !':' { CHECK_VERSION(void*, 10, "Pattern matching is", RAISE_SYNTAX_ERROR("expected ':'") ) } @@ -858,6 +874,5 @@ invalid_match_stmt: | "match" subject_expr !':' { CHECK_VERSION(void*, 10, "Pattern matching is", RAISE_SYNTAX_ERROR("expected ':'") ) } - invalid_case_block: | "case" patterns guard? !':' { RAISE_SYNTAX_ERROR("expected ':'") } @@ -862,2 +877,8 @@ invalid_case_block: | "case" patterns guard? !':' { RAISE_SYNTAX_ERROR("expected ':'") } +invalid_if_stmt: + | 'if' named_expression NEWLINE { RAISE_SYNTAX_ERROR("expected ':'") } +invalid_elif_stmt: + | 'elif' named_expression NEWLINE { RAISE_SYNTAX_ERROR("expected ':'") } +invalid_while_stmt: + | 'while' named_expression NEWLINE { RAISE_SYNTAX_ERROR("expected ':'") } diff --git a/Include/Python-ast.h b/Include/Python-ast.h deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9QeXRob24tYXN0Lmg=..0000000000000000000000000000000000000000 --- a/Include/Python-ast.h +++ /dev/null @@ -1,828 +0,0 @@ -// File automatically generated by Parser/asdl_c.py. - -#ifndef Py_PYTHON_AST_H -#define Py_PYTHON_AST_H -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef Py_LIMITED_API -#include "asdl.h" - -#undef Yield /* undefine macro conflicting with <winbase.h> */ - -typedef struct _mod *mod_ty; - -typedef struct _stmt *stmt_ty; - -typedef struct _expr *expr_ty; - -typedef enum _expr_context { Load=1, Store=2, Del=3 } expr_context_ty; - -typedef enum _boolop { And=1, Or=2 } boolop_ty; - -typedef enum _operator { Add=1, Sub=2, Mult=3, MatMult=4, Div=5, Mod=6, Pow=7, - LShift=8, RShift=9, BitOr=10, BitXor=11, BitAnd=12, - FloorDiv=13 } operator_ty; - -typedef enum _unaryop { Invert=1, Not=2, UAdd=3, USub=4 } unaryop_ty; - -typedef enum _cmpop { Eq=1, NotEq=2, Lt=3, LtE=4, Gt=5, GtE=6, Is=7, IsNot=8, - In=9, NotIn=10 } cmpop_ty; - -typedef struct _comprehension *comprehension_ty; - -typedef struct _excepthandler *excepthandler_ty; - -typedef struct _arguments *arguments_ty; - -typedef struct _arg *arg_ty; - -typedef struct _keyword *keyword_ty; - -typedef struct _alias *alias_ty; - -typedef struct _withitem *withitem_ty; - -typedef struct _match_case *match_case_ty; - -typedef struct _type_ignore *type_ignore_ty; - - -typedef struct { - _ASDL_SEQ_HEAD - mod_ty typed_elements[1]; -} asdl_mod_seq; - -asdl_mod_seq *_Py_asdl_mod_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - stmt_ty typed_elements[1]; -} asdl_stmt_seq; - -asdl_stmt_seq *_Py_asdl_stmt_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - expr_ty typed_elements[1]; -} asdl_expr_seq; - -asdl_expr_seq *_Py_asdl_expr_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - comprehension_ty typed_elements[1]; -} asdl_comprehension_seq; - -asdl_comprehension_seq *_Py_asdl_comprehension_seq_new(Py_ssize_t size, PyArena - *arena); - -typedef struct { - _ASDL_SEQ_HEAD - excepthandler_ty typed_elements[1]; -} asdl_excepthandler_seq; - -asdl_excepthandler_seq *_Py_asdl_excepthandler_seq_new(Py_ssize_t size, PyArena - *arena); - -typedef struct { - _ASDL_SEQ_HEAD - arguments_ty typed_elements[1]; -} asdl_arguments_seq; - -asdl_arguments_seq *_Py_asdl_arguments_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - arg_ty typed_elements[1]; -} asdl_arg_seq; - -asdl_arg_seq *_Py_asdl_arg_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - keyword_ty typed_elements[1]; -} asdl_keyword_seq; - -asdl_keyword_seq *_Py_asdl_keyword_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - alias_ty typed_elements[1]; -} asdl_alias_seq; - -asdl_alias_seq *_Py_asdl_alias_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - withitem_ty typed_elements[1]; -} asdl_withitem_seq; - -asdl_withitem_seq *_Py_asdl_withitem_seq_new(Py_ssize_t size, PyArena *arena); - -typedef struct { - _ASDL_SEQ_HEAD - match_case_ty typed_elements[1]; -} asdl_match_case_seq; - -asdl_match_case_seq *_Py_asdl_match_case_seq_new(Py_ssize_t size, PyArena - *arena); - -typedef struct { - _ASDL_SEQ_HEAD - type_ignore_ty typed_elements[1]; -} asdl_type_ignore_seq; - -asdl_type_ignore_seq *_Py_asdl_type_ignore_seq_new(Py_ssize_t size, PyArena - *arena); - - -enum _mod_kind {Module_kind=1, Interactive_kind=2, Expression_kind=3, - FunctionType_kind=4}; -struct _mod { - enum _mod_kind kind; - union { - struct { - asdl_stmt_seq *body; - asdl_type_ignore_seq *type_ignores; - } Module; - - struct { - asdl_stmt_seq *body; - } Interactive; - - struct { - expr_ty body; - } Expression; - - struct { - asdl_expr_seq *argtypes; - expr_ty returns; - } FunctionType; - - } v; -}; - -enum _stmt_kind {FunctionDef_kind=1, AsyncFunctionDef_kind=2, ClassDef_kind=3, - Return_kind=4, Delete_kind=5, Assign_kind=6, - AugAssign_kind=7, AnnAssign_kind=8, For_kind=9, - AsyncFor_kind=10, While_kind=11, If_kind=12, With_kind=13, - AsyncWith_kind=14, Match_kind=15, Raise_kind=16, Try_kind=17, - Assert_kind=18, Import_kind=19, ImportFrom_kind=20, - Global_kind=21, Nonlocal_kind=22, Expr_kind=23, Pass_kind=24, - Break_kind=25, Continue_kind=26}; -struct _stmt { - enum _stmt_kind kind; - union { - struct { - identifier name; - arguments_ty args; - asdl_stmt_seq *body; - asdl_expr_seq *decorator_list; - expr_ty returns; - string type_comment; - } FunctionDef; - - struct { - identifier name; - arguments_ty args; - asdl_stmt_seq *body; - asdl_expr_seq *decorator_list; - expr_ty returns; - string type_comment; - } AsyncFunctionDef; - - struct { - identifier name; - asdl_expr_seq *bases; - asdl_keyword_seq *keywords; - asdl_stmt_seq *body; - asdl_expr_seq *decorator_list; - } ClassDef; - - struct { - expr_ty value; - } Return; - - struct { - asdl_expr_seq *targets; - } Delete; - - struct { - asdl_expr_seq *targets; - expr_ty value; - string type_comment; - } Assign; - - struct { - expr_ty target; - operator_ty op; - expr_ty value; - } AugAssign; - - struct { - expr_ty target; - expr_ty annotation; - expr_ty value; - int simple; - } AnnAssign; - - struct { - expr_ty target; - expr_ty iter; - asdl_stmt_seq *body; - asdl_stmt_seq *orelse; - string type_comment; - } For; - - struct { - expr_ty target; - expr_ty iter; - asdl_stmt_seq *body; - asdl_stmt_seq *orelse; - string type_comment; - } AsyncFor; - - struct { - expr_ty test; - asdl_stmt_seq *body; - asdl_stmt_seq *orelse; - } While; - - struct { - expr_ty test; - asdl_stmt_seq *body; - asdl_stmt_seq *orelse; - } If; - - struct { - asdl_withitem_seq *items; - asdl_stmt_seq *body; - string type_comment; - } With; - - struct { - asdl_withitem_seq *items; - asdl_stmt_seq *body; - string type_comment; - } AsyncWith; - - struct { - expr_ty subject; - asdl_match_case_seq *cases; - } Match; - - struct { - expr_ty exc; - expr_ty cause; - } Raise; - - struct { - asdl_stmt_seq *body; - asdl_excepthandler_seq *handlers; - asdl_stmt_seq *orelse; - asdl_stmt_seq *finalbody; - } Try; - - struct { - expr_ty test; - expr_ty msg; - } Assert; - - struct { - asdl_alias_seq *names; - } Import; - - struct { - identifier module; - asdl_alias_seq *names; - int level; - } ImportFrom; - - struct { - asdl_identifier_seq *names; - } Global; - - struct { - asdl_identifier_seq *names; - } Nonlocal; - - struct { - expr_ty value; - } Expr; - - } v; - int lineno; - int col_offset; - int end_lineno; - int end_col_offset; -}; - -enum _expr_kind {BoolOp_kind=1, NamedExpr_kind=2, BinOp_kind=3, UnaryOp_kind=4, - Lambda_kind=5, IfExp_kind=6, Dict_kind=7, Set_kind=8, - ListComp_kind=9, SetComp_kind=10, DictComp_kind=11, - GeneratorExp_kind=12, Await_kind=13, Yield_kind=14, - YieldFrom_kind=15, Compare_kind=16, Call_kind=17, - FormattedValue_kind=18, JoinedStr_kind=19, Constant_kind=20, - Attribute_kind=21, Subscript_kind=22, Starred_kind=23, - Name_kind=24, List_kind=25, Tuple_kind=26, Slice_kind=27, - MatchAs_kind=28, MatchOr_kind=29}; -struct _expr { - enum _expr_kind kind; - union { - struct { - boolop_ty op; - asdl_expr_seq *values; - } BoolOp; - - struct { - expr_ty target; - expr_ty value; - } NamedExpr; - - struct { - expr_ty left; - operator_ty op; - expr_ty right; - } BinOp; - - struct { - unaryop_ty op; - expr_ty operand; - } UnaryOp; - - struct { - arguments_ty args; - expr_ty body; - } Lambda; - - struct { - expr_ty test; - expr_ty body; - expr_ty orelse; - } IfExp; - - struct { - asdl_expr_seq *keys; - asdl_expr_seq *values; - } Dict; - - struct { - asdl_expr_seq *elts; - } Set; - - struct { - expr_ty elt; - asdl_comprehension_seq *generators; - } ListComp; - - struct { - expr_ty elt; - asdl_comprehension_seq *generators; - } SetComp; - - struct { - expr_ty key; - expr_ty value; - asdl_comprehension_seq *generators; - } DictComp; - - struct { - expr_ty elt; - asdl_comprehension_seq *generators; - } GeneratorExp; - - struct { - expr_ty value; - } Await; - - struct { - expr_ty value; - } Yield; - - struct { - expr_ty value; - } YieldFrom; - - struct { - expr_ty left; - asdl_int_seq *ops; - asdl_expr_seq *comparators; - } Compare; - - struct { - expr_ty func; - asdl_expr_seq *args; - asdl_keyword_seq *keywords; - } Call; - - struct { - expr_ty value; - int conversion; - expr_ty format_spec; - } FormattedValue; - - struct { - asdl_expr_seq *values; - } JoinedStr; - - struct { - constant value; - string kind; - } Constant; - - struct { - expr_ty value; - identifier attr; - expr_context_ty ctx; - } Attribute; - - struct { - expr_ty value; - expr_ty slice; - expr_context_ty ctx; - } Subscript; - - struct { - expr_ty value; - expr_context_ty ctx; - } Starred; - - struct { - identifier id; - expr_context_ty ctx; - } Name; - - struct { - asdl_expr_seq *elts; - expr_context_ty ctx; - } List; - - struct { - asdl_expr_seq *elts; - expr_context_ty ctx; - } Tuple; - - struct { - expr_ty lower; - expr_ty upper; - expr_ty step; - } Slice; - - struct { - expr_ty pattern; - identifier name; - } MatchAs; - - struct { - asdl_expr_seq *patterns; - } MatchOr; - - } v; - int lineno; - int col_offset; - int end_lineno; - int end_col_offset; -}; - -struct _comprehension { - expr_ty target; - expr_ty iter; - asdl_expr_seq *ifs; - int is_async; -}; - -enum _excepthandler_kind {ExceptHandler_kind=1}; -struct _excepthandler { - enum _excepthandler_kind kind; - union { - struct { - expr_ty type; - identifier name; - asdl_stmt_seq *body; - } ExceptHandler; - - } v; - int lineno; - int col_offset; - int end_lineno; - int end_col_offset; -}; - -struct _arguments { - asdl_arg_seq *posonlyargs; - asdl_arg_seq *args; - arg_ty vararg; - asdl_arg_seq *kwonlyargs; - asdl_expr_seq *kw_defaults; - arg_ty kwarg; - asdl_expr_seq *defaults; -}; - -struct _arg { - identifier arg; - expr_ty annotation; - string type_comment; - int lineno; - int col_offset; - int end_lineno; - int end_col_offset; -}; - -struct _keyword { - identifier arg; - expr_ty value; - int lineno; - int col_offset; - int end_lineno; - int end_col_offset; -}; - -struct _alias { - identifier name; - identifier asname; -}; - -struct _withitem { - expr_ty context_expr; - expr_ty optional_vars; -}; - -struct _match_case { - expr_ty pattern; - expr_ty guard; - asdl_stmt_seq *body; -}; - -enum _type_ignore_kind {TypeIgnore_kind=1}; -struct _type_ignore { - enum _type_ignore_kind kind; - union { - struct { - int lineno; - string tag; - } TypeIgnore; - - } v; -}; - - -// Note: these macros affect function definitions, not only call sites. -#define Module(a0, a1, a2) _Py_Module(a0, a1, a2) -mod_ty _Py_Module(asdl_stmt_seq * body, asdl_type_ignore_seq * type_ignores, - PyArena *arena); -#define Interactive(a0, a1) _Py_Interactive(a0, a1) -mod_ty _Py_Interactive(asdl_stmt_seq * body, PyArena *arena); -#define Expression(a0, a1) _Py_Expression(a0, a1) -mod_ty _Py_Expression(expr_ty body, PyArena *arena); -#define FunctionType(a0, a1, a2) _Py_FunctionType(a0, a1, a2) -mod_ty _Py_FunctionType(asdl_expr_seq * argtypes, expr_ty returns, PyArena - *arena); -#define FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) _Py_FunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) -stmt_ty _Py_FunctionDef(identifier name, arguments_ty args, asdl_stmt_seq * - body, asdl_expr_seq * decorator_list, expr_ty returns, - string type_comment, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) _Py_AsyncFunctionDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) -stmt_ty _Py_AsyncFunctionDef(identifier name, arguments_ty args, asdl_stmt_seq - * body, asdl_expr_seq * decorator_list, expr_ty - returns, string type_comment, int lineno, int - col_offset, int end_lineno, int end_col_offset, - PyArena *arena); -#define ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) -stmt_ty _Py_ClassDef(identifier name, asdl_expr_seq * bases, asdl_keyword_seq * - keywords, asdl_stmt_seq * body, asdl_expr_seq * - decorator_list, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define Return(a0, a1, a2, a3, a4, a5) _Py_Return(a0, a1, a2, a3, a4, a5) -stmt_ty _Py_Return(expr_ty value, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena); -#define Delete(a0, a1, a2, a3, a4, a5) _Py_Delete(a0, a1, a2, a3, a4, a5) -stmt_ty _Py_Delete(asdl_expr_seq * targets, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define Assign(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Assign(a0, a1, a2, a3, a4, a5, a6, a7) -stmt_ty _Py_Assign(asdl_expr_seq * targets, expr_ty value, string type_comment, - int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define AugAssign(a0, a1, a2, a3, a4, a5, a6, a7) _Py_AugAssign(a0, a1, a2, a3, a4, a5, a6, a7) -stmt_ty _Py_AugAssign(expr_ty target, operator_ty op, expr_ty value, int - lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define AnnAssign(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_AnnAssign(a0, a1, a2, a3, a4, a5, a6, a7, a8) -stmt_ty _Py_AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int - simple, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define For(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_For(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) -stmt_ty _Py_For(expr_ty target, expr_ty iter, asdl_stmt_seq * body, - asdl_stmt_seq * orelse, string type_comment, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena); -#define AsyncFor(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_AsyncFor(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) -stmt_ty _Py_AsyncFor(expr_ty target, expr_ty iter, asdl_stmt_seq * body, - asdl_stmt_seq * orelse, string type_comment, int lineno, - int col_offset, int end_lineno, int end_col_offset, - PyArena *arena); -#define While(a0, a1, a2, a3, a4, a5, a6, a7) _Py_While(a0, a1, a2, a3, a4, a5, a6, a7) -stmt_ty _Py_While(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, - int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define If(a0, a1, a2, a3, a4, a5, a6, a7) _Py_If(a0, a1, a2, a3, a4, a5, a6, a7) -stmt_ty _Py_If(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, int - lineno, int col_offset, int end_lineno, int end_col_offset, - PyArena *arena); -#define With(a0, a1, a2, a3, a4, a5, a6, a7) _Py_With(a0, a1, a2, a3, a4, a5, a6, a7) -stmt_ty _Py_With(asdl_withitem_seq * items, asdl_stmt_seq * body, string - type_comment, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define AsyncWith(a0, a1, a2, a3, a4, a5, a6, a7) _Py_AsyncWith(a0, a1, a2, a3, a4, a5, a6, a7) -stmt_ty _Py_AsyncWith(asdl_withitem_seq * items, asdl_stmt_seq * body, string - type_comment, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena); -#define Match(a0, a1, a2, a3, a4, a5, a6) _Py_Match(a0, a1, a2, a3, a4, a5, a6) -stmt_ty _Py_Match(expr_ty subject, asdl_match_case_seq * cases, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define Raise(a0, a1, a2, a3, a4, a5, a6) _Py_Raise(a0, a1, a2, a3, a4, a5, a6) -stmt_ty _Py_Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define Try(a0, a1, a2, a3, a4, a5, a6, a7, a8) _Py_Try(a0, a1, a2, a3, a4, a5, a6, a7, a8) -stmt_ty _Py_Try(asdl_stmt_seq * body, asdl_excepthandler_seq * handlers, - asdl_stmt_seq * orelse, asdl_stmt_seq * finalbody, int lineno, - int col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define Assert(a0, a1, a2, a3, a4, a5, a6) _Py_Assert(a0, a1, a2, a3, a4, a5, a6) -stmt_ty _Py_Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define Import(a0, a1, a2, a3, a4, a5) _Py_Import(a0, a1, a2, a3, a4, a5) -stmt_ty _Py_Import(asdl_alias_seq * names, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define ImportFrom(a0, a1, a2, a3, a4, a5, a6, a7) _Py_ImportFrom(a0, a1, a2, a3, a4, a5, a6, a7) -stmt_ty _Py_ImportFrom(identifier module, asdl_alias_seq * names, int level, - int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define Global(a0, a1, a2, a3, a4, a5) _Py_Global(a0, a1, a2, a3, a4, a5) -stmt_ty _Py_Global(asdl_identifier_seq * names, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define Nonlocal(a0, a1, a2, a3, a4, a5) _Py_Nonlocal(a0, a1, a2, a3, a4, a5) -stmt_ty _Py_Nonlocal(asdl_identifier_seq * names, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena); -#define Expr(a0, a1, a2, a3, a4, a5) _Py_Expr(a0, a1, a2, a3, a4, a5) -stmt_ty _Py_Expr(expr_ty value, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define Pass(a0, a1, a2, a3, a4) _Py_Pass(a0, a1, a2, a3, a4) -stmt_ty _Py_Pass(int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define Break(a0, a1, a2, a3, a4) _Py_Break(a0, a1, a2, a3, a4) -stmt_ty _Py_Break(int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define Continue(a0, a1, a2, a3, a4) _Py_Continue(a0, a1, a2, a3, a4) -stmt_ty _Py_Continue(int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define BoolOp(a0, a1, a2, a3, a4, a5, a6) _Py_BoolOp(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_BoolOp(boolop_ty op, asdl_expr_seq * values, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define NamedExpr(a0, a1, a2, a3, a4, a5, a6) _Py_NamedExpr(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_NamedExpr(expr_ty target, expr_ty value, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define BinOp(a0, a1, a2, a3, a4, a5, a6, a7) _Py_BinOp(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define UnaryOp(a0, a1, a2, a3, a4, a5, a6) _Py_UnaryOp(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena); -#define Lambda(a0, a1, a2, a3, a4, a5, a6) _Py_Lambda(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_Lambda(arguments_ty args, expr_ty body, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena); -#define IfExp(a0, a1, a2, a3, a4, a5, a6, a7) _Py_IfExp(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define Dict(a0, a1, a2, a3, a4, a5, a6) _Py_Dict(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_Dict(asdl_expr_seq * keys, asdl_expr_seq * values, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define Set(a0, a1, a2, a3, a4, a5) _Py_Set(a0, a1, a2, a3, a4, a5) -expr_ty _Py_Set(asdl_expr_seq * elts, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define ListComp(a0, a1, a2, a3, a4, a5, a6) _Py_ListComp(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_ListComp(expr_ty elt, asdl_comprehension_seq * generators, int - lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define SetComp(a0, a1, a2, a3, a4, a5, a6) _Py_SetComp(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_SetComp(expr_ty elt, asdl_comprehension_seq * generators, int - lineno, int col_offset, int end_lineno, int end_col_offset, - PyArena *arena); -#define DictComp(a0, a1, a2, a3, a4, a5, a6, a7) _Py_DictComp(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_DictComp(expr_ty key, expr_ty value, asdl_comprehension_seq * - generators, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena); -#define GeneratorExp(a0, a1, a2, a3, a4, a5, a6) _Py_GeneratorExp(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_GeneratorExp(expr_ty elt, asdl_comprehension_seq * generators, int - lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define Await(a0, a1, a2, a3, a4, a5) _Py_Await(a0, a1, a2, a3, a4, a5) -expr_ty _Py_Await(expr_ty value, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena); -#define Yield(a0, a1, a2, a3, a4, a5) _Py_Yield(a0, a1, a2, a3, a4, a5) -expr_ty _Py_Yield(expr_ty value, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena); -#define YieldFrom(a0, a1, a2, a3, a4, a5) _Py_YieldFrom(a0, a1, a2, a3, a4, a5) -expr_ty _Py_YieldFrom(expr_ty value, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define Compare(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Compare(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_Compare(expr_ty left, asdl_int_seq * ops, asdl_expr_seq * - comparators, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena); -#define Call(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Call(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_Call(expr_ty func, asdl_expr_seq * args, asdl_keyword_seq * - keywords, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define FormattedValue(a0, a1, a2, a3, a4, a5, a6, a7) _Py_FormattedValue(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_FormattedValue(expr_ty value, int conversion, expr_ty format_spec, - int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define JoinedStr(a0, a1, a2, a3, a4, a5) _Py_JoinedStr(a0, a1, a2, a3, a4, a5) -expr_ty _Py_JoinedStr(asdl_expr_seq * values, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define Constant(a0, a1, a2, a3, a4, a5, a6) _Py_Constant(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_Constant(constant value, string kind, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena); -#define Attribute(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Attribute(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int - lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define Subscript(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Subscript(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_Subscript(expr_ty value, expr_ty slice, expr_context_ty ctx, int - lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena); -#define Starred(a0, a1, a2, a3, a4, a5, a6) _Py_Starred(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_Starred(expr_ty value, expr_context_ty ctx, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define Name(a0, a1, a2, a3, a4, a5, a6) _Py_Name(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_Name(identifier id, expr_context_ty ctx, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define List(a0, a1, a2, a3, a4, a5, a6) _Py_List(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_List(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define Tuple(a0, a1, a2, a3, a4, a5, a6) _Py_Tuple(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_Tuple(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define Slice(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Slice(a0, a1, a2, a3, a4, a5, a6, a7) -expr_ty _Py_Slice(expr_ty lower, expr_ty upper, expr_ty step, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define MatchAs(a0, a1, a2, a3, a4, a5, a6) _Py_MatchAs(a0, a1, a2, a3, a4, a5, a6) -expr_ty _Py_MatchAs(expr_ty pattern, identifier name, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define MatchOr(a0, a1, a2, a3, a4, a5) _Py_MatchOr(a0, a1, a2, a3, a4, a5) -expr_ty _Py_MatchOr(asdl_expr_seq * patterns, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena); -#define comprehension(a0, a1, a2, a3, a4) _Py_comprehension(a0, a1, a2, a3, a4) -comprehension_ty _Py_comprehension(expr_ty target, expr_ty iter, asdl_expr_seq - * ifs, int is_async, PyArena *arena); -#define ExceptHandler(a0, a1, a2, a3, a4, a5, a6, a7) _Py_ExceptHandler(a0, a1, a2, a3, a4, a5, a6, a7) -excepthandler_ty _Py_ExceptHandler(expr_ty type, identifier name, asdl_stmt_seq - * body, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena - *arena); -#define arguments(a0, a1, a2, a3, a4, a5, a6, a7) _Py_arguments(a0, a1, a2, a3, a4, a5, a6, a7) -arguments_ty _Py_arguments(asdl_arg_seq * posonlyargs, asdl_arg_seq * args, - arg_ty vararg, asdl_arg_seq * kwonlyargs, - asdl_expr_seq * kw_defaults, arg_ty kwarg, - asdl_expr_seq * defaults, PyArena *arena); -#define arg(a0, a1, a2, a3, a4, a5, a6, a7) _Py_arg(a0, a1, a2, a3, a4, a5, a6, a7) -arg_ty _Py_arg(identifier arg, expr_ty annotation, string type_comment, int - lineno, int col_offset, int end_lineno, int end_col_offset, - PyArena *arena); -#define keyword(a0, a1, a2, a3, a4, a5, a6) _Py_keyword(a0, a1, a2, a3, a4, a5, a6) -keyword_ty _Py_keyword(identifier arg, expr_ty value, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena - *arena); -#define alias(a0, a1, a2) _Py_alias(a0, a1, a2) -alias_ty _Py_alias(identifier name, identifier asname, PyArena *arena); -#define withitem(a0, a1, a2) _Py_withitem(a0, a1, a2) -withitem_ty _Py_withitem(expr_ty context_expr, expr_ty optional_vars, PyArena - *arena); -#define match_case(a0, a1, a2, a3) _Py_match_case(a0, a1, a2, a3) -match_case_ty _Py_match_case(expr_ty pattern, expr_ty guard, asdl_stmt_seq * - body, PyArena *arena); -#define TypeIgnore(a0, a1, a2) _Py_TypeIgnore(a0, a1, a2) -type_ignore_ty _Py_TypeIgnore(int lineno, string tag, PyArena *arena); - -PyObject* PyAST_mod2obj(mod_ty t); -mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode); -int PyAST_Check(PyObject* obj); -#endif /* !Py_LIMITED_API */ - -#ifdef __cplusplus -} -#endif -#endif /* !Py_PYTHON_AST_H */ diff --git a/Include/Python.h b/Include/Python.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9QeXRob24uaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9QeXRob24uaA== 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -137,7 +137,6 @@ #include "pystate.h" #include "context.h" -#include "cpython/pyarena.h" #include "modsupport.h" #include "compile.h" #include "pythonrun.h" @@ -141,7 +140,6 @@ #include "modsupport.h" #include "compile.h" #include "pythonrun.h" -#include "cpython/parser_interface.h" #include "pylifecycle.h" #include "ceval.h" #include "sysmodule.h" diff --git a/Include/README.rst b/Include/README.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9SRUFETUUucnN0 --- /dev/null +++ b/Include/README.rst @@ -0,0 +1,68 @@ +The Python C API +================ + +The C API is divided into three sections: + +1. ``Include/`` +2. ``Include/cpython/`` +3. ``Include/internal/`` + + +Include: Limited API +==================== + +``Include/``, excluding the ``cpython`` and ``internal`` subdirectories, +contains the public Limited API (Application Programming Interface). +The Limited API is a subset of the C API, designed to guarantee ABI +stability across Python 3 versions, and is defined in :pep:`384`. + +Guidelines for expanding the Limited API: + +- Functions *must not* steal references +- Functions *must not* return borrowed references +- Functions returning references *must* return a strong reference +- Macros should not expose implementation details +- Please start a public discussion before expanding the API +- Functions or macros with a ``_Py`` prefix do not belong in ``Include/``. + +It is possible to add a function or macro to the Limited API from a +given Python version. For example, to add a function to the Limited API +from Python 3.10 and onwards, wrap it with +``#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000``. + + +Include/cpython: CPython implementation details +=============================================== + +``Include/cpython/`` contains the public API that is excluded from the +Limited API and the Stable ABI. + +Guidelines for expanding the public API: + +- Functions *must not* steal references +- Functions *must not* return borrowed references +- Functions returning references *must* return a strong reference + + +Include/internal: The internal API +================================== + + +With PyAPI_FUNC or PyAPI_DATA +----------------------------- + +Functions or structures in ``Include/internal/`` defined with +``PyAPI_FUNC`` or ``PyAPI_DATA`` are internal functions which are +exposed only for specific use cases like debuggers and profilers. + + +With the extern keyword +----------------------- + +Functions in ``Include/internal/`` defined with the ``extern`` keyword +*must not and can not* be used outside the CPython code base. Only +built-in stdlib extensions (built with the ``Py_BUILD_CORE_BUILTIN`` +macro defined) can use such functions. + +When in doubt, new internal C functions should be defined in +``Include/internal`` using the ``extern`` keyword. diff --git a/Include/abstract.h b/Include/abstract.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9hYnN0cmFjdC5o..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9hYnN0cmFjdC5o 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -324,8 +324,13 @@ returns itself. */ PyAPI_FUNC(PyObject *) PyObject_GetIter(PyObject *); +/* Takes an AsyncIterable object and returns an AsyncIterator for it. + This is typically a new iterator but if the argument is an AsyncIterator, + this returns itself. */ +PyAPI_FUNC(PyObject *) PyObject_GetAiter(PyObject *); + /* Returns non-zero if the object 'obj' provides iterator protocols, and 0 otherwise. This function always succeeds. */ PyAPI_FUNC(int) PyIter_Check(PyObject *); @@ -327,8 +332,13 @@ /* Returns non-zero if the object 'obj' provides iterator protocols, and 0 otherwise. This function always succeeds. */ PyAPI_FUNC(int) PyIter_Check(PyObject *); +/* Returns non-zero if the object 'obj' provides AsyncIterator protocols, and 0 otherwise. + + This function always succeeds. */ +PyAPI_FUNC(int) PyAiter_Check(PyObject *); + /* Takes an iterator object and calls its tp_iternext slot, returning the next value. diff --git a/Include/asdl.h b/Include/asdl.h deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9hc2RsLmg=..0000000000000000000000000000000000000000 --- a/Include/asdl.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef Py_LIMITED_API -#ifndef Py_ASDL_H -#define Py_ASDL_H - -typedef PyObject * identifier; -typedef PyObject * string; -typedef PyObject * object; -typedef PyObject * constant; - -/* It would be nice if the code generated by asdl_c.py was completely - independent of Python, but it is a goal the requires too much work - at this stage. So, for example, I'll represent identifiers as - interned Python strings. -*/ - -#define _ASDL_SEQ_HEAD \ - Py_ssize_t size; \ - void **elements; - -typedef struct { - _ASDL_SEQ_HEAD -} asdl_seq; - -typedef struct { - _ASDL_SEQ_HEAD - void *typed_elements[1]; -} asdl_generic_seq; - -typedef struct { - _ASDL_SEQ_HEAD - PyObject *typed_elements[1]; -} asdl_identifier_seq; - -typedef struct { - _ASDL_SEQ_HEAD - int typed_elements[1]; -} asdl_int_seq; - -asdl_generic_seq *_Py_asdl_generic_seq_new(Py_ssize_t size, PyArena *arena); -asdl_identifier_seq *_Py_asdl_identifier_seq_new(Py_ssize_t size, PyArena *arena); -asdl_int_seq *_Py_asdl_int_seq_new(Py_ssize_t size, PyArena *arena); - - -#define GENERATE_ASDL_SEQ_CONSTRUCTOR(NAME, TYPE) \ -asdl_ ## NAME ## _seq *_Py_asdl_ ## NAME ## _seq_new(Py_ssize_t size, PyArena *arena) \ -{ \ - asdl_ ## NAME ## _seq *seq = NULL; \ - size_t n; \ - /* check size is sane */ \ - if (size < 0 || \ - (size && (((size_t)size - 1) > (SIZE_MAX / sizeof(void *))))) { \ - PyErr_NoMemory(); \ - return NULL; \ - } \ - n = (size ? (sizeof(TYPE *) * (size - 1)) : 0); \ - /* check if size can be added safely */ \ - if (n > SIZE_MAX - sizeof(asdl_ ## NAME ## _seq)) { \ - PyErr_NoMemory(); \ - return NULL; \ - } \ - n += sizeof(asdl_ ## NAME ## _seq); \ - seq = (asdl_ ## NAME ## _seq *)PyArena_Malloc(arena, n); \ - if (!seq) { \ - PyErr_NoMemory(); \ - return NULL; \ - } \ - memset(seq, 0, n); \ - seq->size = size; \ - seq->elements = (void**)seq->typed_elements; \ - return seq; \ -} - -#define asdl_seq_GET_UNTYPED(S, I) (S)->elements[(I)] -#define asdl_seq_GET(S, I) (S)->typed_elements[(I)] -#define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size) -#ifdef Py_DEBUG -#define asdl_seq_SET(S, I, V) \ - do { \ - Py_ssize_t _asdl_i = (I); \ - assert((S) != NULL); \ - assert(0 <= _asdl_i && _asdl_i < (S)->size); \ - (S)->typed_elements[_asdl_i] = (V); \ - } while (0) -#else -#define asdl_seq_SET(S, I, V) (S)->typed_elements[I] = (V) -#endif - -#ifdef Py_DEBUG -#define asdl_seq_SET_UNTYPED(S, I, V) \ - do { \ - Py_ssize_t _asdl_i = (I); \ - assert((S) != NULL); \ - assert(0 <= _asdl_i && _asdl_i < (S)->size); \ - (S)->elements[_asdl_i] = (V); \ - } while (0) -#else -#define asdl_seq_SET_UNTYPED(S, I, V) (S)->elements[I] = (V) -#endif - -#endif /* !Py_ASDL_H */ -#endif /* Py_LIMITED_API */ diff --git a/Include/ast.h b/Include/ast.h deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9hc3QuaA==..0000000000000000000000000000000000000000 --- a/Include/ast.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef Py_LIMITED_API -#ifndef Py_AST_H -#define Py_AST_H -#ifdef __cplusplus -extern "C" { -#endif - -#include "Python-ast.h" /* mod_ty */ - -#ifdef __cplusplus -} -#endif -#endif /* !Py_AST_H */ -#endif /* !Py_LIMITED_API */ diff --git a/Include/boolobject.h b/Include/boolobject.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9ib29sb2JqZWN0Lmg=..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9ib29sb2JqZWN0Lmg= 100644 --- a/Include/boolobject.h +++ b/Include/boolobject.h @@ -21,6 +21,14 @@ #define Py_False ((PyObject *) &_Py_FalseStruct) #define Py_True ((PyObject *) &_Py_TrueStruct) +// Test if an object is the True singleton, the same as "x is True" in Python. +PyAPI_FUNC(int) Py_IsTrue(PyObject *x); +#define Py_IsTrue(x) Py_Is((x), Py_True) + +// Test if an object is the False singleton, the same as "x is False" in Python. +PyAPI_FUNC(int) Py_IsFalse(PyObject *x); +#define Py_IsFalse(x) Py_Is((x), Py_False) + /* Macros for returning Py_True or Py_False, respectively */ #define Py_RETURN_TRUE return Py_NewRef(Py_True) #define Py_RETURN_FALSE return Py_NewRef(Py_False) diff --git a/Include/compile.h b/Include/compile.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9jb21waWxlLmg=..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9jb21waWxlLmg= 100644 --- a/Include/compile.h +++ b/Include/compile.h @@ -1,9 +1,6 @@ #ifndef Py_COMPILE_H #define Py_COMPILE_H - -#ifndef Py_LIMITED_API - #ifdef __cplusplus extern "C" { #endif @@ -6,97 +3,7 @@ #ifdef __cplusplus extern "C" { #endif -/* Public interface */ -#define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \ - CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \ - CO_FUTURE_UNICODE_LITERALS | CO_FUTURE_BARRY_AS_BDFL | \ - CO_FUTURE_GENERATOR_STOP | CO_FUTURE_ANNOTATIONS) -#define PyCF_MASK_OBSOLETE (CO_NESTED) - -/* bpo-39562: CO_FUTURE_ and PyCF_ constants must be kept unique. - PyCF_ constants can use bits from 0x0100 to 0x10000. - CO_FUTURE_ constants use bits starting at 0x20000. */ -#define PyCF_SOURCE_IS_UTF8 0x0100 -#define PyCF_DONT_IMPLY_DEDENT 0x0200 -#define PyCF_ONLY_AST 0x0400 -#define PyCF_IGNORE_COOKIE 0x0800 -#define PyCF_TYPE_COMMENTS 0x1000 -#define PyCF_ALLOW_TOP_LEVEL_AWAIT 0x2000 -#define PyCF_COMPILE_MASK (PyCF_ONLY_AST | PyCF_ALLOW_TOP_LEVEL_AWAIT | \ - PyCF_TYPE_COMMENTS | PyCF_DONT_IMPLY_DEDENT) - -#ifndef Py_LIMITED_API -typedef struct { - int cf_flags; /* bitmask of CO_xxx flags relevant to future */ - int cf_feature_version; /* minor Python version (PyCF_ONLY_AST) */ -} PyCompilerFlags; - -#define _PyCompilerFlags_INIT \ - (PyCompilerFlags){.cf_flags = 0, .cf_feature_version = PY_MINOR_VERSION} -#endif - -/* Future feature support */ - -typedef struct { - int ff_features; /* flags set by future statements */ - int ff_lineno; /* line number of last future statement */ -} PyFutureFeatures; - -#define FUTURE_NESTED_SCOPES "nested_scopes" -#define FUTURE_GENERATORS "generators" -#define FUTURE_DIVISION "division" -#define FUTURE_ABSOLUTE_IMPORT "absolute_import" -#define FUTURE_WITH_STATEMENT "with_statement" -#define FUTURE_PRINT_FUNCTION "print_function" -#define FUTURE_UNICODE_LITERALS "unicode_literals" -#define FUTURE_BARRY_AS_BDFL "barry_as_FLUFL" -#define FUTURE_GENERATOR_STOP "generator_stop" -#define FUTURE_ANNOTATIONS "annotations" - -struct _mod; /* Declare the existence of this type */ -#define PyAST_Compile(mod, s, f, ar) PyAST_CompileEx(mod, s, f, -1, ar) -PyAPI_FUNC(PyCodeObject *) PyAST_CompileEx( - struct _mod *mod, - const char *filename, /* decoded from the filesystem encoding */ - PyCompilerFlags *flags, - int optimize, - PyArena *arena); -PyAPI_FUNC(PyCodeObject *) PyAST_CompileObject( - struct _mod *mod, - PyObject *filename, - PyCompilerFlags *flags, - int optimize, - PyArena *arena); -PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST( - struct _mod * mod, - const char *filename /* decoded from the filesystem encoding */ - ); -PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromASTObject( - struct _mod * mod, - PyObject *filename - ); - -/* _Py_Mangle is defined in compile.c */ -PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name); - -#define PY_INVALID_STACK_EFFECT INT_MAX -PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg); -PyAPI_FUNC(int) PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump); - -typedef struct { - int optimize; - int ff_features; -} _PyASTOptimizeState; - -PyAPI_FUNC(int) _PyAST_Optimize(struct _mod *, PyArena *arena, _PyASTOptimizeState *state); - -#ifdef __cplusplus -} -#endif - -#endif /* !Py_LIMITED_API */ - /* These definitions must match corresponding definitions in graminit.h. */ #define Py_single_input 256 #define Py_file_input 257 @@ -106,4 +13,13 @@ /* This doesn't need to match anything */ #define Py_fstring_input 800 +#ifndef Py_LIMITED_API +# define Py_CPYTHON_COMPILE_H +# include "cpython/compile.h" +# undef Py_CPYTHON_COMPILE_H +#endif + +#ifdef __cplusplus +} +#endif #endif /* !Py_COMPILE_H */ diff --git a/Include/cpython/compile.h b/Include/cpython/compile.h new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9jcHl0aG9uL2NvbXBpbGUuaA== --- /dev/null +++ b/Include/cpython/compile.h @@ -0,0 +1,52 @@ +#ifndef Py_CPYTHON_COMPILE_H +# error "this header file must not be included directly" +#endif + +/* Public interface */ +#define PyCF_MASK (CO_FUTURE_DIVISION | CO_FUTURE_ABSOLUTE_IMPORT | \ + CO_FUTURE_WITH_STATEMENT | CO_FUTURE_PRINT_FUNCTION | \ + CO_FUTURE_UNICODE_LITERALS | CO_FUTURE_BARRY_AS_BDFL | \ + CO_FUTURE_GENERATOR_STOP | CO_FUTURE_ANNOTATIONS) +#define PyCF_MASK_OBSOLETE (CO_NESTED) + +/* bpo-39562: CO_FUTURE_ and PyCF_ constants must be kept unique. + PyCF_ constants can use bits from 0x0100 to 0x10000. + CO_FUTURE_ constants use bits starting at 0x20000. */ +#define PyCF_SOURCE_IS_UTF8 0x0100 +#define PyCF_DONT_IMPLY_DEDENT 0x0200 +#define PyCF_ONLY_AST 0x0400 +#define PyCF_IGNORE_COOKIE 0x0800 +#define PyCF_TYPE_COMMENTS 0x1000 +#define PyCF_ALLOW_TOP_LEVEL_AWAIT 0x2000 +#define PyCF_COMPILE_MASK (PyCF_ONLY_AST | PyCF_ALLOW_TOP_LEVEL_AWAIT | \ + PyCF_TYPE_COMMENTS | PyCF_DONT_IMPLY_DEDENT) + +typedef struct { + int cf_flags; /* bitmask of CO_xxx flags relevant to future */ + int cf_feature_version; /* minor Python version (PyCF_ONLY_AST) */ +} PyCompilerFlags; + +#define _PyCompilerFlags_INIT \ + (PyCompilerFlags){.cf_flags = 0, .cf_feature_version = PY_MINOR_VERSION} + +/* Future feature support */ + +typedef struct { + int ff_features; /* flags set by future statements */ + int ff_lineno; /* line number of last future statement */ +} PyFutureFeatures; + +#define FUTURE_NESTED_SCOPES "nested_scopes" +#define FUTURE_GENERATORS "generators" +#define FUTURE_DIVISION "division" +#define FUTURE_ABSOLUTE_IMPORT "absolute_import" +#define FUTURE_WITH_STATEMENT "with_statement" +#define FUTURE_PRINT_FUNCTION "print_function" +#define FUTURE_UNICODE_LITERALS "unicode_literals" +#define FUTURE_BARRY_AS_BDFL "barry_as_FLUFL" +#define FUTURE_GENERATOR_STOP "generator_stop" +#define FUTURE_ANNOTATIONS "annotations" + +#define PY_INVALID_STACK_EFFECT INT_MAX +PyAPI_FUNC(int) PyCompile_OpcodeStackEffect(int opcode, int oparg); +PyAPI_FUNC(int) PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump); diff --git a/Include/cpython/initconfig.h b/Include/cpython/initconfig.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9jcHl0aG9uL2luaXRjb25maWcuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9jcHl0aG9uL2luaXRjb25maWcuaA== 100644 --- a/Include/cpython/initconfig.h +++ b/Include/cpython/initconfig.h @@ -153,6 +153,7 @@ PyWideStringList warnoptions; int site_import; int bytes_warning; + int warn_default_encoding; int inspect; int interactive; int optimization_level; diff --git a/Include/cpython/parser_interface.h b/Include/cpython/parser_interface.h deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9jcHl0aG9uL3BhcnNlcl9pbnRlcmZhY2UuaA==..0000000000000000000000000000000000000000 --- a/Include/cpython/parser_interface.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef Py_PEGENINTERFACE -#define Py_PEGENINTERFACE -#ifdef __cplusplus -extern "C" { -#endif - -#include "Python.h" - -#ifndef Py_LIMITED_API -PyAPI_FUNC(struct _mod *) PyParser_ASTFromString( - const char *str, - const char *filename, - int mode, - PyCompilerFlags *flags, - PyArena *arena); -PyAPI_FUNC(struct _mod *) PyParser_ASTFromStringObject( - const char *str, - PyObject* filename, - int mode, - PyCompilerFlags *flags, - PyArena *arena); -PyAPI_FUNC(struct _mod *) PyParser_ASTFromFile( - FILE *fp, - const char *filename, - const char* enc, - int mode, - const char *ps1, - const char *ps2, - PyCompilerFlags *flags, - int *errcode, - PyArena *arena); -PyAPI_FUNC(struct _mod *) PyParser_ASTFromFileObject( - FILE *fp, - PyObject *filename_ob, - const char *enc, - int mode, - const char *ps1, - const char *ps2, - PyCompilerFlags *flags, - int *errcode, - PyArena *arena); -PyAPI_FUNC(struct _mod *) PyParser_ASTFromFilename( - const char *filename, - int mode, - PyCompilerFlags *flags, - PyArena *arena); -#endif /* !Py_LIMITED_API */ - -#ifdef __cplusplus -} -#endif -#endif /* !Py_PEGENINTERFACE */ diff --git a/Include/cpython/pyarena.h b/Include/cpython/pyarena.h deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9jcHl0aG9uL3B5YXJlbmEuaA==..0000000000000000000000000000000000000000 --- a/Include/cpython/pyarena.h +++ /dev/null @@ -1,64 +0,0 @@ -/* An arena-like memory interface for the compiler. - */ - -#ifndef Py_LIMITED_API -#ifndef Py_PYARENA_H -#define Py_PYARENA_H - -#ifdef __cplusplus -extern "C" { -#endif - - typedef struct _arena PyArena; - - /* PyArena_New() and PyArena_Free() create a new arena and free it, - respectively. Once an arena has been created, it can be used - to allocate memory via PyArena_Malloc(). Pointers to PyObject can - also be registered with the arena via PyArena_AddPyObject(), and the - arena will ensure that the PyObjects stay alive at least until - PyArena_Free() is called. When an arena is freed, all the memory it - allocated is freed, the arena releases internal references to registered - PyObject*, and none of its pointers are valid. - XXX (tim) What does "none of its pointers are valid" mean? Does it - XXX mean that pointers previously obtained via PyArena_Malloc() are - XXX no longer valid? (That's clearly true, but not sure that's what - XXX the text is trying to say.) - - PyArena_New() returns an arena pointer. On error, it - returns a negative number and sets an exception. - XXX (tim): Not true. On error, PyArena_New() actually returns NULL, - XXX and looks like it may or may not set an exception (e.g., if the - XXX internal PyList_New(0) returns NULL, PyArena_New() passes that on - XXX and an exception is set; OTOH, if the internal - XXX block_new(DEFAULT_BLOCK_SIZE) returns NULL, that's passed on but - XXX an exception is not set in that case). - */ - PyAPI_FUNC(PyArena *) PyArena_New(void); - PyAPI_FUNC(void) PyArena_Free(PyArena *); - - /* Mostly like malloc(), return the address of a block of memory spanning - * `size` bytes, or return NULL (without setting an exception) if enough - * new memory can't be obtained. Unlike malloc(0), PyArena_Malloc() with - * size=0 does not guarantee to return a unique pointer (the pointer - * returned may equal one or more other pointers obtained from - * PyArena_Malloc()). - * Note that pointers obtained via PyArena_Malloc() must never be passed to - * the system free() or realloc(), or to any of Python's similar memory- - * management functions. PyArena_Malloc()-obtained pointers remain valid - * until PyArena_Free(ar) is called, at which point all pointers obtained - * from the arena `ar` become invalid simultaneously. - */ - PyAPI_FUNC(void *) PyArena_Malloc(PyArena *, size_t size); - - /* This routine isn't a proper arena allocation routine. It takes - * a PyObject* and records it so that it can be DECREFed when the - * arena is freed. - */ - PyAPI_FUNC(int) PyArena_AddPyObject(PyArena *, PyObject *); - -#ifdef __cplusplus -} -#endif - -#endif /* !Py_PYARENA_H */ -#endif /* Py_LIMITED_API */ diff --git a/Include/cpython/pyctype.h b/Include/cpython/pyctype.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9jcHl0aG9uL3B5Y3R5cGUuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9jcHl0aG9uL3B5Y3R5cGUuaA== 100644 --- a/Include/cpython/pyctype.h +++ b/Include/cpython/pyctype.h @@ -1,6 +1,9 @@ #ifndef Py_LIMITED_API #ifndef PYCTYPE_H #define PYCTYPE_H +#ifdef __cplusplus +extern "C" { +#endif #define PY_CTF_LOWER 0x01 #define PY_CTF_UPPER 0x02 @@ -29,5 +32,8 @@ #define Py_TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)]) #define Py_TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)]) +#ifdef __cplusplus +} +#endif #endif /* !PYCTYPE_H */ #endif /* !Py_LIMITED_API */ diff --git a/Include/cpython/pyerrors.h b/Include/cpython/pyerrors.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9jcHl0aG9uL3B5ZXJyb3JzLmg=..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9jcHl0aG9uL3B5ZXJyb3JzLmg= 100644 --- a/Include/cpython/pyerrors.h +++ b/Include/cpython/pyerrors.h @@ -62,6 +62,12 @@ PyObject *value; } PyStopIterationObject; +typedef struct { + PyException_HEAD + PyObject *obj; + PyObject *name; +} PyAttributeErrorObject; + /* Compatibility typedefs */ typedef PyOSErrorObject PyEnvironmentErrorObject; #ifdef MS_WINDOWS diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9jcHl0aG9uL3B5c3RhdGUuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9jcHl0aG9uL3B5c3RhdGUuaA== 100644 --- a/Include/cpython/pystate.h +++ b/Include/cpython/pystate.h @@ -29,6 +29,21 @@ #define PyTrace_OPCODE 7 +typedef struct _cframe { + /* This struct will be threaded through the C stack + * allowing fast access to per-thread state that needs + * to be accessed quickly by the interpreter, but can + * be modified outside of the interpreter. + * + * WARNING: This makes data on the C stack accessible from + * heap objects. Care must be taken to maintain stack + * discipline and make sure that instances of this struct cannot + * accessed outside of their lifetime. + */ + int use_tracing; + struct _cframe *previous; +} CFrame; + typedef struct _err_stackitem { /* This struct represents an entry on the exception stack, which is a * per-coroutine state. (Coroutine in the computer science sense, @@ -61,7 +76,10 @@ This is to prevent the actual trace/profile code from being recorded in the trace/profile. */ int tracing; - int use_tracing; + + /* Pointer to current CFrame in the C stack frame of the currently, + * or most recently, executing _PyEval_EvalFrameDefault. */ + CFrame *cframe; Py_tracefunc c_profilefunc; Py_tracefunc c_tracefunc; @@ -129,6 +147,8 @@ /* Unique thread state id. */ uint64_t id; + CFrame root_cframe; + /* XXX signal handlers should also be here */ }; diff --git a/Include/internal/pycore_asdl.h b/Include/internal/pycore_asdl.h new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfYXNkbC5o --- /dev/null +++ b/Include/internal/pycore_asdl.h @@ -0,0 +1,112 @@ +#ifndef Py_INTERNAL_ASDL_H +#define Py_INTERNAL_ASDL_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "pycore_pyarena.h" // _PyArena_Malloc() + +typedef PyObject * identifier; +typedef PyObject * string; +typedef PyObject * object; +typedef PyObject * constant; + +/* It would be nice if the code generated by asdl_c.py was completely + independent of Python, but it is a goal the requires too much work + at this stage. So, for example, I'll represent identifiers as + interned Python strings. +*/ + +#define _ASDL_SEQ_HEAD \ + Py_ssize_t size; \ + void **elements; + +typedef struct { + _ASDL_SEQ_HEAD +} asdl_seq; + +typedef struct { + _ASDL_SEQ_HEAD + void *typed_elements[1]; +} asdl_generic_seq; + +typedef struct { + _ASDL_SEQ_HEAD + PyObject *typed_elements[1]; +} asdl_identifier_seq; + +typedef struct { + _ASDL_SEQ_HEAD + int typed_elements[1]; +} asdl_int_seq; + +asdl_generic_seq *_Py_asdl_generic_seq_new(Py_ssize_t size, PyArena *arena); +asdl_identifier_seq *_Py_asdl_identifier_seq_new(Py_ssize_t size, PyArena *arena); +asdl_int_seq *_Py_asdl_int_seq_new(Py_ssize_t size, PyArena *arena); + + +#define GENERATE_ASDL_SEQ_CONSTRUCTOR(NAME, TYPE) \ +asdl_ ## NAME ## _seq *_Py_asdl_ ## NAME ## _seq_new(Py_ssize_t size, PyArena *arena) \ +{ \ + asdl_ ## NAME ## _seq *seq = NULL; \ + size_t n; \ + /* check size is sane */ \ + if (size < 0 || \ + (size && (((size_t)size - 1) > (SIZE_MAX / sizeof(void *))))) { \ + PyErr_NoMemory(); \ + return NULL; \ + } \ + n = (size ? (sizeof(TYPE *) * (size - 1)) : 0); \ + /* check if size can be added safely */ \ + if (n > SIZE_MAX - sizeof(asdl_ ## NAME ## _seq)) { \ + PyErr_NoMemory(); \ + return NULL; \ + } \ + n += sizeof(asdl_ ## NAME ## _seq); \ + seq = (asdl_ ## NAME ## _seq *)_PyArena_Malloc(arena, n); \ + if (!seq) { \ + PyErr_NoMemory(); \ + return NULL; \ + } \ + memset(seq, 0, n); \ + seq->size = size; \ + seq->elements = (void**)seq->typed_elements; \ + return seq; \ +} + +#define asdl_seq_GET_UNTYPED(S, I) (S)->elements[(I)] +#define asdl_seq_GET(S, I) (S)->typed_elements[(I)] +#define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size) + +#ifdef Py_DEBUG +# define asdl_seq_SET(S, I, V) \ + do { \ + Py_ssize_t _asdl_i = (I); \ + assert((S) != NULL); \ + assert(0 <= _asdl_i && _asdl_i < (S)->size); \ + (S)->typed_elements[_asdl_i] = (V); \ + } while (0) +#else +# define asdl_seq_SET(S, I, V) (S)->typed_elements[I] = (V) +#endif + +#ifdef Py_DEBUG +# define asdl_seq_SET_UNTYPED(S, I, V) \ + do { \ + Py_ssize_t _asdl_i = (I); \ + assert((S) != NULL); \ + assert(0 <= _asdl_i && _asdl_i < (S)->size); \ + (S)->elements[_asdl_i] = (V); \ + } while (0) +#else +# define asdl_seq_SET_UNTYPED(S, I, V) (S)->elements[I] = (V) +#endif + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_ASDL_H */ diff --git a/Include/internal/pycore_ast.h b/Include/internal/pycore_ast.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfYXN0Lmg=..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfYXN0Lmg= 100644 --- a/Include/internal/pycore_ast.h +++ b/Include/internal/pycore_ast.h @@ -1,3 +1,5 @@ +// File automatically generated by Parser/asdl_c.py. + #ifndef Py_INTERNAL_AST_H #define Py_INTERNAL_AST_H #ifdef __cplusplus @@ -8,7 +10,764 @@ # error "this header requires Py_BUILD_CORE define" #endif -#include "Python-ast.h" // expr_ty +#include "pycore_asdl.h" + +typedef struct _mod *mod_ty; + +typedef struct _stmt *stmt_ty; + +typedef struct _expr *expr_ty; + +typedef enum _expr_context { Load=1, Store=2, Del=3 } expr_context_ty; + +typedef enum _boolop { And=1, Or=2 } boolop_ty; + +typedef enum _operator { Add=1, Sub=2, Mult=3, MatMult=4, Div=5, Mod=6, Pow=7, + LShift=8, RShift=9, BitOr=10, BitXor=11, BitAnd=12, + FloorDiv=13 } operator_ty; + +typedef enum _unaryop { Invert=1, Not=2, UAdd=3, USub=4 } unaryop_ty; + +typedef enum _cmpop { Eq=1, NotEq=2, Lt=3, LtE=4, Gt=5, GtE=6, Is=7, IsNot=8, + In=9, NotIn=10 } cmpop_ty; + +typedef struct _comprehension *comprehension_ty; + +typedef struct _excepthandler *excepthandler_ty; + +typedef struct _arguments *arguments_ty; + +typedef struct _arg *arg_ty; + +typedef struct _keyword *keyword_ty; + +typedef struct _alias *alias_ty; + +typedef struct _withitem *withitem_ty; + +typedef struct _match_case *match_case_ty; + +typedef struct _type_ignore *type_ignore_ty; + + +typedef struct { + _ASDL_SEQ_HEAD + mod_ty typed_elements[1]; +} asdl_mod_seq; + +asdl_mod_seq *_Py_asdl_mod_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + stmt_ty typed_elements[1]; +} asdl_stmt_seq; + +asdl_stmt_seq *_Py_asdl_stmt_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + expr_ty typed_elements[1]; +} asdl_expr_seq; + +asdl_expr_seq *_Py_asdl_expr_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + comprehension_ty typed_elements[1]; +} asdl_comprehension_seq; + +asdl_comprehension_seq *_Py_asdl_comprehension_seq_new(Py_ssize_t size, PyArena + *arena); + +typedef struct { + _ASDL_SEQ_HEAD + excepthandler_ty typed_elements[1]; +} asdl_excepthandler_seq; + +asdl_excepthandler_seq *_Py_asdl_excepthandler_seq_new(Py_ssize_t size, PyArena + *arena); + +typedef struct { + _ASDL_SEQ_HEAD + arguments_ty typed_elements[1]; +} asdl_arguments_seq; + +asdl_arguments_seq *_Py_asdl_arguments_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + arg_ty typed_elements[1]; +} asdl_arg_seq; + +asdl_arg_seq *_Py_asdl_arg_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + keyword_ty typed_elements[1]; +} asdl_keyword_seq; + +asdl_keyword_seq *_Py_asdl_keyword_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + alias_ty typed_elements[1]; +} asdl_alias_seq; + +asdl_alias_seq *_Py_asdl_alias_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + withitem_ty typed_elements[1]; +} asdl_withitem_seq; + +asdl_withitem_seq *_Py_asdl_withitem_seq_new(Py_ssize_t size, PyArena *arena); + +typedef struct { + _ASDL_SEQ_HEAD + match_case_ty typed_elements[1]; +} asdl_match_case_seq; + +asdl_match_case_seq *_Py_asdl_match_case_seq_new(Py_ssize_t size, PyArena + *arena); + +typedef struct { + _ASDL_SEQ_HEAD + type_ignore_ty typed_elements[1]; +} asdl_type_ignore_seq; + +asdl_type_ignore_seq *_Py_asdl_type_ignore_seq_new(Py_ssize_t size, PyArena + *arena); + + +enum _mod_kind {Module_kind=1, Interactive_kind=2, Expression_kind=3, + FunctionType_kind=4}; +struct _mod { + enum _mod_kind kind; + union { + struct { + asdl_stmt_seq *body; + asdl_type_ignore_seq *type_ignores; + } Module; + + struct { + asdl_stmt_seq *body; + } Interactive; + + struct { + expr_ty body; + } Expression; + + struct { + asdl_expr_seq *argtypes; + expr_ty returns; + } FunctionType; + + } v; +}; + +enum _stmt_kind {FunctionDef_kind=1, AsyncFunctionDef_kind=2, ClassDef_kind=3, + Return_kind=4, Delete_kind=5, Assign_kind=6, + AugAssign_kind=7, AnnAssign_kind=8, For_kind=9, + AsyncFor_kind=10, While_kind=11, If_kind=12, With_kind=13, + AsyncWith_kind=14, Match_kind=15, Raise_kind=16, Try_kind=17, + Assert_kind=18, Import_kind=19, ImportFrom_kind=20, + Global_kind=21, Nonlocal_kind=22, Expr_kind=23, Pass_kind=24, + Break_kind=25, Continue_kind=26}; +struct _stmt { + enum _stmt_kind kind; + union { + struct { + identifier name; + arguments_ty args; + asdl_stmt_seq *body; + asdl_expr_seq *decorator_list; + expr_ty returns; + string type_comment; + } FunctionDef; + + struct { + identifier name; + arguments_ty args; + asdl_stmt_seq *body; + asdl_expr_seq *decorator_list; + expr_ty returns; + string type_comment; + } AsyncFunctionDef; + + struct { + identifier name; + asdl_expr_seq *bases; + asdl_keyword_seq *keywords; + asdl_stmt_seq *body; + asdl_expr_seq *decorator_list; + } ClassDef; + + struct { + expr_ty value; + } Return; + + struct { + asdl_expr_seq *targets; + } Delete; + + struct { + asdl_expr_seq *targets; + expr_ty value; + string type_comment; + } Assign; + + struct { + expr_ty target; + operator_ty op; + expr_ty value; + } AugAssign; + + struct { + expr_ty target; + expr_ty annotation; + expr_ty value; + int simple; + } AnnAssign; + + struct { + expr_ty target; + expr_ty iter; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + string type_comment; + } For; + + struct { + expr_ty target; + expr_ty iter; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + string type_comment; + } AsyncFor; + + struct { + expr_ty test; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + } While; + + struct { + expr_ty test; + asdl_stmt_seq *body; + asdl_stmt_seq *orelse; + } If; + + struct { + asdl_withitem_seq *items; + asdl_stmt_seq *body; + string type_comment; + } With; + + struct { + asdl_withitem_seq *items; + asdl_stmt_seq *body; + string type_comment; + } AsyncWith; + + struct { + expr_ty subject; + asdl_match_case_seq *cases; + } Match; + + struct { + expr_ty exc; + expr_ty cause; + } Raise; + + struct { + asdl_stmt_seq *body; + asdl_excepthandler_seq *handlers; + asdl_stmt_seq *orelse; + asdl_stmt_seq *finalbody; + } Try; + + struct { + expr_ty test; + expr_ty msg; + } Assert; + + struct { + asdl_alias_seq *names; + } Import; + + struct { + identifier module; + asdl_alias_seq *names; + int level; + } ImportFrom; + + struct { + asdl_identifier_seq *names; + } Global; + + struct { + asdl_identifier_seq *names; + } Nonlocal; + + struct { + expr_ty value; + } Expr; + + } v; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +enum _expr_kind {BoolOp_kind=1, NamedExpr_kind=2, BinOp_kind=3, UnaryOp_kind=4, + Lambda_kind=5, IfExp_kind=6, Dict_kind=7, Set_kind=8, + ListComp_kind=9, SetComp_kind=10, DictComp_kind=11, + GeneratorExp_kind=12, Await_kind=13, Yield_kind=14, + YieldFrom_kind=15, Compare_kind=16, Call_kind=17, + FormattedValue_kind=18, JoinedStr_kind=19, Constant_kind=20, + Attribute_kind=21, Subscript_kind=22, Starred_kind=23, + Name_kind=24, List_kind=25, Tuple_kind=26, Slice_kind=27, + MatchAs_kind=28, MatchOr_kind=29}; +struct _expr { + enum _expr_kind kind; + union { + struct { + boolop_ty op; + asdl_expr_seq *values; + } BoolOp; + + struct { + expr_ty target; + expr_ty value; + } NamedExpr; + + struct { + expr_ty left; + operator_ty op; + expr_ty right; + } BinOp; + + struct { + unaryop_ty op; + expr_ty operand; + } UnaryOp; + + struct { + arguments_ty args; + expr_ty body; + } Lambda; + + struct { + expr_ty test; + expr_ty body; + expr_ty orelse; + } IfExp; + + struct { + asdl_expr_seq *keys; + asdl_expr_seq *values; + } Dict; + + struct { + asdl_expr_seq *elts; + } Set; + + struct { + expr_ty elt; + asdl_comprehension_seq *generators; + } ListComp; + + struct { + expr_ty elt; + asdl_comprehension_seq *generators; + } SetComp; + + struct { + expr_ty key; + expr_ty value; + asdl_comprehension_seq *generators; + } DictComp; + + struct { + expr_ty elt; + asdl_comprehension_seq *generators; + } GeneratorExp; + + struct { + expr_ty value; + } Await; + + struct { + expr_ty value; + } Yield; + + struct { + expr_ty value; + } YieldFrom; + + struct { + expr_ty left; + asdl_int_seq *ops; + asdl_expr_seq *comparators; + } Compare; + + struct { + expr_ty func; + asdl_expr_seq *args; + asdl_keyword_seq *keywords; + } Call; + + struct { + expr_ty value; + int conversion; + expr_ty format_spec; + } FormattedValue; + + struct { + asdl_expr_seq *values; + } JoinedStr; + + struct { + constant value; + string kind; + } Constant; + + struct { + expr_ty value; + identifier attr; + expr_context_ty ctx; + } Attribute; + + struct { + expr_ty value; + expr_ty slice; + expr_context_ty ctx; + } Subscript; + + struct { + expr_ty value; + expr_context_ty ctx; + } Starred; + + struct { + identifier id; + expr_context_ty ctx; + } Name; + + struct { + asdl_expr_seq *elts; + expr_context_ty ctx; + } List; + + struct { + asdl_expr_seq *elts; + expr_context_ty ctx; + } Tuple; + + struct { + expr_ty lower; + expr_ty upper; + expr_ty step; + } Slice; + + struct { + expr_ty pattern; + identifier name; + } MatchAs; + + struct { + asdl_expr_seq *patterns; + } MatchOr; + + } v; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _comprehension { + expr_ty target; + expr_ty iter; + asdl_expr_seq *ifs; + int is_async; +}; + +enum _excepthandler_kind {ExceptHandler_kind=1}; +struct _excepthandler { + enum _excepthandler_kind kind; + union { + struct { + expr_ty type; + identifier name; + asdl_stmt_seq *body; + } ExceptHandler; + + } v; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _arguments { + asdl_arg_seq *posonlyargs; + asdl_arg_seq *args; + arg_ty vararg; + asdl_arg_seq *kwonlyargs; + asdl_expr_seq *kw_defaults; + arg_ty kwarg; + asdl_expr_seq *defaults; +}; + +struct _arg { + identifier arg; + expr_ty annotation; + string type_comment; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _keyword { + identifier arg; + expr_ty value; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _alias { + identifier name; + identifier asname; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; +}; + +struct _withitem { + expr_ty context_expr; + expr_ty optional_vars; +}; + +struct _match_case { + expr_ty pattern; + expr_ty guard; + asdl_stmt_seq *body; +}; + +enum _type_ignore_kind {TypeIgnore_kind=1}; +struct _type_ignore { + enum _type_ignore_kind kind; + union { + struct { + int lineno; + string tag; + } TypeIgnore; + + } v; +}; + + +// Note: these macros affect function definitions, not only call sites. +mod_ty _PyAST_Module(asdl_stmt_seq * body, asdl_type_ignore_seq * type_ignores, + PyArena *arena); +mod_ty _PyAST_Interactive(asdl_stmt_seq * body, PyArena *arena); +mod_ty _PyAST_Expression(expr_ty body, PyArena *arena); +mod_ty _PyAST_FunctionType(asdl_expr_seq * argtypes, expr_ty returns, PyArena + *arena); +stmt_ty _PyAST_FunctionDef(identifier name, arguments_ty args, asdl_stmt_seq * + body, asdl_expr_seq * decorator_list, expr_ty + returns, string type_comment, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +stmt_ty _PyAST_AsyncFunctionDef(identifier name, arguments_ty args, + asdl_stmt_seq * body, asdl_expr_seq * + decorator_list, expr_ty returns, string + type_comment, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_ClassDef(identifier name, asdl_expr_seq * bases, + asdl_keyword_seq * keywords, asdl_stmt_seq * body, + asdl_expr_seq * decorator_list, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +stmt_ty _PyAST_Return(expr_ty value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Delete(asdl_expr_seq * targets, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Assign(asdl_expr_seq * targets, expr_ty value, string + type_comment, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +stmt_ty _PyAST_AugAssign(expr_ty target, operator_ty op, expr_ty value, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int + simple, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +stmt_ty _PyAST_For(expr_ty target, expr_ty iter, asdl_stmt_seq * body, + asdl_stmt_seq * orelse, string type_comment, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +stmt_ty _PyAST_AsyncFor(expr_ty target, expr_ty iter, asdl_stmt_seq * body, + asdl_stmt_seq * orelse, string type_comment, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_While(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * + orelse, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_If(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_With(asdl_withitem_seq * items, asdl_stmt_seq * body, string + type_comment, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +stmt_ty _PyAST_AsyncWith(asdl_withitem_seq * items, asdl_stmt_seq * body, + string type_comment, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Match(expr_ty subject, asdl_match_case_seq * cases, int lineno, + int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +stmt_ty _PyAST_Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Try(asdl_stmt_seq * body, asdl_excepthandler_seq * handlers, + asdl_stmt_seq * orelse, asdl_stmt_seq * finalbody, int + lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +stmt_ty _PyAST_Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Import(asdl_alias_seq * names, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_ImportFrom(identifier module, asdl_alias_seq * names, int level, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_Global(asdl_identifier_seq * names, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Nonlocal(asdl_identifier_seq * names, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +stmt_ty _PyAST_Expr(expr_ty value, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +stmt_ty _PyAST_Pass(int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_Break(int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +stmt_ty _PyAST_Continue(int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_BoolOp(boolop_ty op, asdl_expr_seq * values, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_NamedExpr(expr_ty target, expr_ty value, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +expr_ty _PyAST_BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, + int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +expr_ty _PyAST_UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Lambda(arguments_ty args, expr_ty body, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, + int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +expr_ty _PyAST_Dict(asdl_expr_seq * keys, asdl_expr_seq * values, int lineno, + int col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Set(asdl_expr_seq * elts, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +expr_ty _PyAST_ListComp(expr_ty elt, asdl_comprehension_seq * generators, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_SetComp(expr_ty elt, asdl_comprehension_seq * generators, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_DictComp(expr_ty key, expr_ty value, asdl_comprehension_seq * + generators, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +expr_ty _PyAST_GeneratorExp(expr_ty elt, asdl_comprehension_seq * generators, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_Await(expr_ty value, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +expr_ty _PyAST_Yield(expr_ty value, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +expr_ty _PyAST_YieldFrom(expr_ty value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +expr_ty _PyAST_Compare(expr_ty left, asdl_int_seq * ops, asdl_expr_seq * + comparators, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena); +expr_ty _PyAST_Call(expr_ty func, asdl_expr_seq * args, asdl_keyword_seq * + keywords, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_FormattedValue(expr_ty value, int conversion, expr_ty + format_spec, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena); +expr_ty _PyAST_JoinedStr(asdl_expr_seq * values, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +expr_ty _PyAST_Constant(constant value, string kind, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Attribute(expr_ty value, identifier attr, expr_context_ty ctx, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_Subscript(expr_ty value, expr_ty slice, expr_context_ty ctx, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +expr_ty _PyAST_Starred(expr_ty value, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Name(identifier id, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_List(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Tuple(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_Slice(expr_ty lower, expr_ty upper, expr_ty step, int lineno, + int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +expr_ty _PyAST_MatchAs(expr_ty pattern, identifier name, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +expr_ty _PyAST_MatchOr(asdl_expr_seq * patterns, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena); +comprehension_ty _PyAST_comprehension(expr_ty target, expr_ty iter, + asdl_expr_seq * ifs, int is_async, + PyArena *arena); +excepthandler_ty _PyAST_ExceptHandler(expr_ty type, identifier name, + asdl_stmt_seq * body, int lineno, int + col_offset, int end_lineno, int + end_col_offset, PyArena *arena); +arguments_ty _PyAST_arguments(asdl_arg_seq * posonlyargs, asdl_arg_seq * args, + arg_ty vararg, asdl_arg_seq * kwonlyargs, + asdl_expr_seq * kw_defaults, arg_ty kwarg, + asdl_expr_seq * defaults, PyArena *arena); +arg_ty _PyAST_arg(identifier arg, expr_ty annotation, string type_comment, int + lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +keyword_ty _PyAST_keyword(identifier arg, expr_ty value, int lineno, int + col_offset, int end_lineno, int end_col_offset, + PyArena *arena); +alias_ty _PyAST_alias(identifier name, identifier asname, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena + *arena); +withitem_ty _PyAST_withitem(expr_ty context_expr, expr_ty optional_vars, + PyArena *arena); +match_case_ty _PyAST_match_case(expr_ty pattern, expr_ty guard, asdl_stmt_seq * + body, PyArena *arena); +type_ignore_ty _PyAST_TypeIgnore(int lineno, string tag, PyArena *arena); + + +PyObject* PyAST_mod2obj(mod_ty t); +mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode); +int PyAST_Check(PyObject* obj); extern int _PyAST_Validate(mod_ty); @@ -24,4 +783,3 @@ } #endif #endif /* !Py_INTERNAL_AST_H */ - diff --git a/Include/internal/pycore_compile.h b/Include/internal/pycore_compile.h new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfY29tcGlsZS5o --- /dev/null +++ b/Include/internal/pycore_compile.h @@ -0,0 +1,41 @@ +#ifndef Py_INTERNAL_COMPILE_H +#define Py_INTERNAL_COMPILE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +struct _arena; // Type defined in pycore_pyarena.h +struct _mod; // Type defined in pycore_ast.h + +// Export the symbol for test_peg_generator (built as a library) +PyAPI_FUNC(PyCodeObject*) _PyAST_Compile( + struct _mod *mod, + PyObject *filename, + PyCompilerFlags *flags, + int optimize, + struct _arena *arena); +extern PyFutureFeatures* _PyFuture_FromAST( + struct _mod * mod, + PyObject *filename + ); + +extern PyObject* _Py_Mangle(PyObject *p, PyObject *name); + +typedef struct { + int optimize; + int ff_features; +} _PyASTOptimizeState; + +extern int _PyAST_Optimize( + struct _mod *, + struct _arena *arena, + _PyASTOptimizeState *state); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_COMPILE_H */ diff --git a/Include/internal/pycore_dtoa.h b/Include/internal/pycore_dtoa.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfZHRvYS5o..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfZHRvYS5o 100644 --- a/Include/internal/pycore_dtoa.h +++ b/Include/internal/pycore_dtoa.h @@ -1,6 +1,4 @@ #ifndef PY_NO_SHORT_FLOAT_REPR -#ifndef Py_INTERNAL_DTOA_H -#define Py_INTERNAL_DTOA_H #ifdef __cplusplus extern "C" { #endif @@ -19,19 +17,6 @@ PyAPI_FUNC(double) _Py_dg_stdnan(int sign); PyAPI_FUNC(double) _Py_dg_infinity(int sign); -#define _PyDtoa_Kmax 7 - -typedef uint32_t _PyDtoa_ULong; -typedef int32_t _PyDtoa_Long; -typedef uint64_t _PyDtoa_ULLong; - -struct -_PyDtoa_Bigint { - struct _PyDtoa_Bigint *next; - int k, maxwds, sign, wds; - _PyDtoa_ULong x[1]; -}; - #ifdef __cplusplus } #endif @@ -35,5 +20,4 @@ #ifdef __cplusplus } #endif -#endif /* !Py_INTERNAL_DTOA_H */ #endif /* !PY_NO_SHORT_FLOAT_REPR */ diff --git a/Include/internal/pycore_initconfig.h b/Include/internal/pycore_initconfig.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfaW5pdGNvbmZpZy5o..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfaW5pdGNvbmZpZy5o 100644 --- a/Include/internal/pycore_initconfig.h +++ b/Include/internal/pycore_initconfig.h @@ -102,6 +102,7 @@ int isolated; /* -I option */ int use_environment; /* -E option */ int dev_mode; /* -X dev and PYTHONDEVMODE */ + int warn_default_encoding; /* -X warn_default_encoding and PYTHONWARNDEFAULTENCODING */ } _PyPreCmdline; #define _PyPreCmdline_INIT \ diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfaW50ZXJwLmg=..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfaW50ZXJwLmg= 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -13,7 +13,6 @@ #include "pycore_gil.h" // struct _gil_runtime_state #include "pycore_gc.h" // struct _gc_runtime_state #include "pycore_warnings.h" // struct _warnings_runtime_state -#include "pycore_dtoa.h" struct _pending_calls { PyThread_type_lock lock; @@ -34,12 +33,6 @@ struct _ceval_state { int recursion_limit; - /* Records whether tracing is on for any thread. Counts the number - of threads for which tstate->c_tracefunc is non-NULL, so if the - value is 0, we know we don't have to check this thread's - c_tracefunc. This speeds up the if statement in - _PyEval_EvalFrameDefault() after fast_next_opcode. */ - int tracing_possible; /* This single variable consolidates all requests to break out of the fast path in the eval loop. */ _Py_atomic_int eval_breaker; @@ -322,9 +315,6 @@ struct ast_state ast; struct type_cache type_cache; -#ifndef PY_NO_SHORT_FLOAT_REPR - struct _PyDtoa_Bigint *dtoa_freelist[_PyDtoa_Kmax + 1]; -#endif }; extern void _PyInterpreterState_ClearModules(PyInterpreterState *interp); diff --git a/Include/internal/pycore_long.h b/Include/internal/pycore_long.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfbG9uZy5o..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfbG9uZy5o 100644 --- a/Include/internal/pycore_long.h +++ b/Include/internal/pycore_long.h @@ -18,8 +18,8 @@ assert(-_PY_NSMALLNEGINTS <= value && value < _PY_NSMALLPOSINTS); size_t index = _PY_NSMALLNEGINTS + value; PyObject *obj = (PyObject*)interp->small_ints[index]; - // _PyLong_GetZero() and _PyLong_GetOne() must not be called - // before _PyLong_Init() nor after _PyLong_Fini() + // _PyLong_GetZero(), _PyLong_GetOne() and get_small_int() must not be + // called before _PyLong_Init() nor after _PyLong_Fini(). assert(obj != NULL); return obj; } diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfb2JqZWN0Lmg=..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfb2JqZWN0Lmg= 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -174,6 +174,10 @@ const char *slot_name, int success); +// PyType_Ready() must be called if _PyType_IsReady() is false. +// See also the Py_TPFLAGS_READY flag. +#define _PyType_IsReady(type) ((type)->tp_dict != NULL) + #ifdef __cplusplus } #endif diff --git a/Include/internal/pycore_parser.h b/Include/internal/pycore_parser.h new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfcGFyc2VyLmg= --- /dev/null +++ b/Include/internal/pycore_parser.h @@ -0,0 +1,31 @@ +#ifndef Py_INTERNAL_PARSER_H +#define Py_INTERNAL_PARSER_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +extern struct _mod* _PyParser_ASTFromString( + const char *str, + PyObject* filename, + int mode, + PyCompilerFlags *flags, + PyArena *arena); +extern struct _mod* _PyParser_ASTFromFile( + FILE *fp, + PyObject *filename_ob, + const char *enc, + int mode, + const char *ps1, + const char *ps2, + PyCompilerFlags *flags, + int *errcode, + PyArena *arena); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_PARSER_H */ diff --git a/Include/internal/pycore_pyarena.h b/Include/internal/pycore_pyarena.h new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfcHlhcmVuYS5o --- /dev/null +++ b/Include/internal/pycore_pyarena.h @@ -0,0 +1,64 @@ +/* An arena-like memory interface for the compiler. + */ + +#ifndef Py_INTERNAL_PYARENA_H +#define Py_INTERNAL_PYARENA_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +typedef struct _arena PyArena; + +/* _PyArena_New() and _PyArena_Free() create a new arena and free it, + respectively. Once an arena has been created, it can be used + to allocate memory via _PyArena_Malloc(). Pointers to PyObject can + also be registered with the arena via _PyArena_AddPyObject(), and the + arena will ensure that the PyObjects stay alive at least until + _PyArena_Free() is called. When an arena is freed, all the memory it + allocated is freed, the arena releases internal references to registered + PyObject*, and none of its pointers are valid. + XXX (tim) What does "none of its pointers are valid" mean? Does it + XXX mean that pointers previously obtained via _PyArena_Malloc() are + XXX no longer valid? (That's clearly true, but not sure that's what + XXX the text is trying to say.) + + _PyArena_New() returns an arena pointer. On error, it + returns a negative number and sets an exception. + XXX (tim): Not true. On error, _PyArena_New() actually returns NULL, + XXX and looks like it may or may not set an exception (e.g., if the + XXX internal PyList_New(0) returns NULL, _PyArena_New() passes that on + XXX and an exception is set; OTOH, if the internal + XXX block_new(DEFAULT_BLOCK_SIZE) returns NULL, that's passed on but + XXX an exception is not set in that case). +*/ +PyAPI_FUNC(PyArena*) _PyArena_New(void); +PyAPI_FUNC(void) _PyArena_Free(PyArena *); + +/* Mostly like malloc(), return the address of a block of memory spanning + * `size` bytes, or return NULL (without setting an exception) if enough + * new memory can't be obtained. Unlike malloc(0), _PyArena_Malloc() with + * size=0 does not guarantee to return a unique pointer (the pointer + * returned may equal one or more other pointers obtained from + * _PyArena_Malloc()). + * Note that pointers obtained via _PyArena_Malloc() must never be passed to + * the system free() or realloc(), or to any of Python's similar memory- + * management functions. _PyArena_Malloc()-obtained pointers remain valid + * until _PyArena_Free(ar) is called, at which point all pointers obtained + * from the arena `ar` become invalid simultaneously. + */ +PyAPI_FUNC(void*) _PyArena_Malloc(PyArena *, size_t size); + +/* This routine isn't a proper arena allocation routine. It takes + * a PyObject* and records it so that it can be DECREFed when the + * arena is freed. + */ +PyAPI_FUNC(int) _PyArena_AddPyObject(PyArena *, PyObject *); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_PYARENA_H */ diff --git a/Include/internal/pycore_pyerrors.h b/Include/internal/pycore_pyerrors.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfcHllcnJvcnMuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfcHllcnJvcnMuaA== 100644 --- a/Include/internal/pycore_pyerrors.h +++ b/Include/internal/pycore_pyerrors.h @@ -86,6 +86,8 @@ PyAPI_FUNC(void) _Py_DumpExtensionModules(int fd, PyInterpreterState *interp); +extern PyObject* _Py_Offer_Suggestions(PyObject* exception); + #ifdef __cplusplus } #endif diff --git a/Include/internal/pycore_pylifecycle.h b/Include/internal/pycore_pylifecycle.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfcHlsaWZlY3ljbGUuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfcHlsaWZlY3ljbGUuaA== 100644 --- a/Include/internal/pycore_pylifecycle.h +++ b/Include/internal/pycore_pylifecycle.h @@ -50,6 +50,7 @@ /* Various one-time initializers */ extern PyStatus _PyUnicode_Init(PyInterpreterState *interp); +extern PyStatus _PyUnicode_InitTypes(void); extern PyStatus _PyBytes_Init(PyInterpreterState *interp); extern int _PyStructSequence_Init(void); extern int _PyLong_Init(PyInterpreterState *interp); @@ -53,6 +54,7 @@ extern PyStatus _PyBytes_Init(PyInterpreterState *interp); extern int _PyStructSequence_Init(void); extern int _PyLong_Init(PyInterpreterState *interp); +extern int _PyLong_InitTypes(void); extern PyStatus _PyTuple_Init(PyInterpreterState *interp); extern PyStatus _PyFaulthandler_Init(int enable); extern int _PyTraceMalloc_Init(int enable); @@ -64,5 +66,5 @@ extern PyStatus _PySys_ReadPreinitXOptions(PyConfig *config); extern int _PySys_UpdateConfig(PyThreadState *tstate); extern PyStatus _PyExc_Init(PyInterpreterState *interp); -extern PyStatus _PyErr_Init(void); +extern PyStatus _PyErr_InitTypes(void); extern PyStatus _PyBuiltins_AddExceptions(PyObject * bltinmod); @@ -68,5 +70,6 @@ extern PyStatus _PyBuiltins_AddExceptions(PyObject * bltinmod); -extern int _PyFloat_Init(void); +extern void _PyFloat_Init(void); +extern int _PyFloat_InitTypes(void); extern PyStatus _Py_HashRandomization_Init(const PyConfig *); extern PyStatus _PyTypes_Init(void); diff --git a/Include/internal/pycore_symtable.h b/Include/internal/pycore_symtable.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfc3ltdGFibGUuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9pbnRlcm5hbC9weWNvcmVfc3ltdGFibGUuaA== 100644 --- a/Include/internal/pycore_symtable.h +++ b/Include/internal/pycore_symtable.h @@ -8,7 +8,7 @@ # error "this header requires Py_BUILD_CORE define" #endif -#include "Python-ast.h" /* mod_ty */ +struct _mod; // Type defined in pycore_ast.h typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock } _Py_block_ty; @@ -74,7 +74,7 @@ extern int _PyST_GetScope(PySTEntryObject *, PyObject *); extern struct symtable* _PySymtable_Build( - mod_ty mod, + struct _mod *mod, PyObject *filename, PyFutureFeatures *future); PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *); diff --git a/Include/iterobject.h b/Include/iterobject.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9pdGVyb2JqZWN0Lmg=..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9pdGVyb2JqZWN0Lmg= 100644 --- a/Include/iterobject.h +++ b/Include/iterobject.h @@ -7,6 +7,9 @@ PyAPI_DATA(PyTypeObject) PySeqIter_Type; PyAPI_DATA(PyTypeObject) PyCallIter_Type; +#ifdef Py_BUILD_CORE +extern PyTypeObject _PyAnextAwaitable_Type; +#endif #define PySeqIter_Check(op) Py_IS_TYPE(op, &PySeqIter_Type) diff --git a/Include/methodobject.h b/Include/methodobject.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9tZXRob2RvYmplY3QuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9tZXRob2RvYmplY3QuaA== 100644 --- a/Include/methodobject.h +++ b/Include/methodobject.h @@ -79,9 +79,9 @@ #define METH_COEXIST 0x0040 -#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03100000 -#define METH_FASTCALL 0x0080 +#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030a0000 +# define METH_FASTCALL 0x0080 #endif /* This bit is preserved for Stackless Python */ #ifdef STACKLESS @@ -84,6 +84,6 @@ #endif /* This bit is preserved for Stackless Python */ #ifdef STACKLESS -#define METH_STACKLESS 0x0100 +# define METH_STACKLESS 0x0100 #else @@ -89,5 +89,5 @@ #else -#define METH_STACKLESS 0x0000 +# define METH_STACKLESS 0x0000 #endif /* METH_METHOD means the function stores an diff --git a/Include/object.h b/Include/object.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9vYmplY3QuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9vYmplY3QuaA== 100644 --- a/Include/object.h +++ b/Include/object.h @@ -54,6 +54,6 @@ /* Py_DEBUG implies Py_REF_DEBUG. */ #if defined(Py_DEBUG) && !defined(Py_REF_DEBUG) -#define Py_REF_DEBUG +# define Py_REF_DEBUG #endif @@ -58,7 +58,7 @@ #endif -#if defined(Py_LIMITED_API) && defined(Py_REF_DEBUG) -#error Py_LIMITED_API is incompatible with Py_DEBUG, Py_TRACE_REFS, and Py_REF_DEBUG +#if defined(Py_LIMITED_API) && defined(Py_TRACE_REFS) +# error Py_LIMITED_API is incompatible with Py_TRACE_REFS #endif /* PyTypeObject structure is defined in cpython/object.h. @@ -74,8 +74,8 @@ #define _PyObject_EXTRA_INIT 0, 0, #else -#define _PyObject_HEAD_EXTRA -#define _PyObject_EXTRA_INIT +# define _PyObject_HEAD_EXTRA +# define _PyObject_EXTRA_INIT #endif /* PyObject_HEAD defines the initial segment of every PyObject. */ @@ -122,6 +122,11 @@ #define _PyVarObject_CAST_CONST(op) ((const PyVarObject*)(op)) +// Test if the 'x' object is the 'y' object, the same as "x is y" in Python. +PyAPI_FUNC(int) Py_Is(PyObject *x, PyObject *y); +#define Py_Is(x, y) ((x) == (y)) + + static inline Py_ssize_t _Py_REFCNT(const PyObject *ob) { return ob->ob_refcnt; } @@ -427,5 +432,17 @@ PyAPI_FUNC(void) _Py_Dealloc(PyObject *); +/* +These are provided as conveniences to Python runtime embedders, so that +they can have object code that is not dependent on Python compilation flags. +*/ +PyAPI_FUNC(void) Py_IncRef(PyObject *); +PyAPI_FUNC(void) Py_DecRef(PyObject *); + +// Similar to Py_IncRef() and Py_DecRef() but the argument must be non-NULL. +// Private functions used by Py_INCREF() and Py_DECREF(). +PyAPI_FUNC(void) _Py_IncRef(PyObject *); +PyAPI_FUNC(void) _Py_DecRef(PyObject *); + static inline void _Py_INCREF(PyObject *op) { @@ -430,6 +447,12 @@ static inline void _Py_INCREF(PyObject *op) { +#if defined(Py_REF_DEBUG) && defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030A0000 + // Stable ABI for Python 3.10 built in debug mode. + _Py_IncRef(op); +#else + // Non-limited C API and limited C API for Python 3.9 and older access + // directly PyObject.ob_refcnt. #ifdef Py_REF_DEBUG _Py_RefTotal++; #endif op->ob_refcnt++; @@ -432,8 +455,9 @@ #ifdef Py_REF_DEBUG _Py_RefTotal++; #endif op->ob_refcnt++; +#endif } #define Py_INCREF(op) _Py_INCREF(_PyObject_CAST(op)) static inline void _Py_DECREF( @@ -436,9 +460,9 @@ } #define Py_INCREF(op) _Py_INCREF(_PyObject_CAST(op)) static inline void _Py_DECREF( -#ifdef Py_REF_DEBUG +#if defined(Py_REF_DEBUG) && !(defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030A0000) const char *filename, int lineno, #endif PyObject *op) { @@ -441,7 +465,13 @@ const char *filename, int lineno, #endif PyObject *op) { +#if defined(Py_REF_DEBUG) && defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030A0000 + // Stable ABI for Python 3.10 built in debug mode. + _Py_DecRef(op); +#else + // Non-limited C API and limited C API for Python 3.9 and older access + // directly PyObject.ob_refcnt. #ifdef Py_REF_DEBUG _Py_RefTotal--; #endif @@ -455,4 +485,5 @@ else { _Py_Dealloc(op); } +#endif } @@ -458,5 +489,5 @@ } -#ifdef Py_REF_DEBUG +#if defined(Py_REF_DEBUG) && !(defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030A0000) # define Py_DECREF(op) _Py_DECREF(__FILE__, __LINE__, _PyObject_CAST(op)) #else # define Py_DECREF(op) _Py_DECREF(_PyObject_CAST(op)) @@ -525,13 +556,6 @@ #define Py_XDECREF(op) _Py_XDECREF(_PyObject_CAST(op)) -/* -These are provided as conveniences to Python runtime embedders, so that -they can have object code that is not dependent on Python compilation flags. -*/ -PyAPI_FUNC(void) Py_IncRef(PyObject *); -PyAPI_FUNC(void) Py_DecRef(PyObject *); - // Create a new strong reference to an object: // increment the reference count of the object and return the object. PyAPI_FUNC(PyObject*) Py_NewRef(PyObject *obj); @@ -567,6 +591,10 @@ PyAPI_DATA(PyObject) _Py_NoneStruct; /* Don't use this directly */ #define Py_None (&_Py_NoneStruct) +// Test if an object is the None singleton, the same as "x is None" in Python. +PyAPI_FUNC(int) Py_IsNone(PyObject *x); +#define Py_IsNone(x) Py_Is((x), Py_None) + /* Macro for returning Py_None from a function */ #define Py_RETURN_NONE return Py_NewRef(Py_None) diff --git a/Include/opcode.h b/Include/opcode.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9vcGNvZGUuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9vcGNvZGUuaA== 100644 --- a/Include/opcode.h +++ b/Include/opcode.h @@ -106,6 +106,7 @@ #define LOAD_FAST 124 #define STORE_FAST 125 #define DELETE_FAST 126 +#define GEN_START 129 #define RAISE_VARARGS 130 #define CALL_FUNCTION 131 #define MAKE_FUNCTION 132 diff --git a/Include/patchlevel.h b/Include/patchlevel.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9wYXRjaGxldmVsLmg=..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9wYXRjaGxldmVsLmg= 100644 --- a/Include/patchlevel.h +++ b/Include/patchlevel.h @@ -20,6 +20,6 @@ #define PY_MINOR_VERSION 10 #define PY_MICRO_VERSION 0 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA -#define PY_RELEASE_SERIAL 6 +#define PY_RELEASE_SERIAL 7 /* Version as a string */ @@ -24,6 +24,6 @@ /* Version as a string */ -#define PY_VERSION "3.10.0a6+" +#define PY_VERSION "3.10.0a7+" /*--end constants--*/ /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. diff --git a/Include/pydecimal.h b/Include/pydecimal.h deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9weWRlY2ltYWwuaA==..0000000000000000000000000000000000000000 --- a/Include/pydecimal.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (c) 2020 Stefan Krah. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - - -#ifndef CPYTHON_DECIMAL_H_ -#define CPYTHON_DECIMAL_H_ - - -#include <Python.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/****************************************************************************/ -/* Libmpdec API */ -/****************************************************************************/ - -#ifndef LIBMPDEC_MPDECIMAL_H_ -struct mpd_t; /* ABI-stable in the libmpdec-2.x series */ - -/* status cases for getting a triple */ -enum mpd_triple_class { - MPD_TRIPLE_NORMAL, - MPD_TRIPLE_INF, - MPD_TRIPLE_QNAN, - MPD_TRIPLE_SNAN, - MPD_TRIPLE_ERROR, -}; - -typedef struct { - enum mpd_triple_class tag; - uint8_t sign; - uint64_t hi; - uint64_t lo; - int64_t exp; -} mpd_uint128_triple_t; -#endif - - -/****************************************************************************/ -/* Capsule API */ -/****************************************************************************/ - -#define PyDec_CAPSULE_NAME "_decimal._API" - -/* Simple API */ -#define PyDec_TypeCheck_INDEX 0 -#define PyDec_TypeCheck_RETURN int -#define PyDec_TypeCheck_ARGS (const PyObject *) - -#define PyDec_IsSpecial_INDEX 1 -#define PyDec_IsSpecial_RETURN int -#define PyDec_IsSpecial_ARGS (const PyObject *) - -#define PyDec_IsNaN_INDEX 2 -#define PyDec_IsNaN_RETURN int -#define PyDec_IsNaN_ARGS (const PyObject *) - -#define PyDec_IsInfinite_INDEX 3 -#define PyDec_IsInfinite_RETURN int -#define PyDec_IsInfinite_ARGS (const PyObject *) - -#define PyDec_GetDigits_INDEX 4 -#define PyDec_GetDigits_RETURN int64_t -#define PyDec_GetDigits_ARGS (const PyObject *) - -#define PyDec_AsUint128Triple_INDEX 5 -#define PyDec_AsUint128Triple_RETURN mpd_uint128_triple_t -#define PyDec_AsUint128Triple_ARGS (const PyObject *) - -#define PyDec_FromUint128Triple_INDEX 6 -#define PyDec_FromUint128Triple_RETURN PyObject * -#define PyDec_FromUint128Triple_ARGS (const mpd_uint128_triple_t *triple) - -/* Advanced API */ -#define PyDec_Alloc_INDEX 7 -#define PyDec_Alloc_RETURN PyObject * -#define PyDec_Alloc_ARGS (void) - -#define PyDec_Get_INDEX 8 -#define PyDec_Get_RETURN mpd_t * -#define PyDec_Get_ARGS (PyObject *) - -#define PyDec_GetConst_INDEX 9 -#define PyDec_GetConst_RETURN const mpd_t * -#define PyDec_GetConst_ARGS (const PyObject *) - -#define CPYTHON_DECIMAL_MAX_API 10 - - -#ifdef CPYTHON_DECIMAL_MODULE -/* Simple API */ -static PyDec_TypeCheck_RETURN PyDec_TypeCheck PyDec_TypeCheck_ARGS; -static PyDec_IsSpecial_RETURN PyDec_IsSpecial PyDec_IsSpecial_ARGS; -static PyDec_IsNaN_RETURN PyDec_IsNaN PyDec_IsNaN_ARGS; -static PyDec_IsInfinite_RETURN PyDec_IsInfinite PyDec_IsInfinite_ARGS; -static PyDec_GetDigits_RETURN PyDec_GetDigits PyDec_GetDigits_ARGS; -static PyDec_AsUint128Triple_RETURN PyDec_AsUint128Triple PyDec_AsUint128Triple_ARGS; -static PyDec_FromUint128Triple_RETURN PyDec_FromUint128Triple PyDec_FromUint128Triple_ARGS; - -/* Advanced API */ -static PyDec_Alloc_RETURN PyDec_Alloc PyDec_Alloc_ARGS; -static PyDec_Get_RETURN PyDec_Get PyDec_Get_ARGS; -static PyDec_GetConst_RETURN PyDec_GetConst PyDec_GetConst_ARGS; -#else -static void **_decimal_api; - -/* Simple API */ -#define PyDec_TypeCheck \ - (*(PyDec_TypeCheck_RETURN (*)PyDec_TypeCheck_ARGS) _decimal_api[PyDec_TypeCheck_INDEX]) - -#define PyDec_IsSpecial \ - (*(PyDec_IsSpecial_RETURN (*)PyDec_IsSpecial_ARGS) _decimal_api[PyDec_IsSpecial_INDEX]) - -#define PyDec_IsNaN \ - (*(PyDec_IsNaN_RETURN (*)PyDec_IsNaN_ARGS) _decimal_api[PyDec_IsNaN_INDEX]) - -#define PyDec_IsInfinite \ - (*(PyDec_IsInfinite_RETURN (*)PyDec_IsInfinite_ARGS) _decimal_api[PyDec_IsInfinite_INDEX]) - -#define PyDec_GetDigits \ - (*(PyDec_GetDigits_RETURN (*)PyDec_GetDigits_ARGS) _decimal_api[PyDec_GetDigits_INDEX]) - -#define PyDec_AsUint128Triple \ - (*(PyDec_AsUint128Triple_RETURN (*)PyDec_AsUint128Triple_ARGS) _decimal_api[PyDec_AsUint128Triple_INDEX]) - -#define PyDec_FromUint128Triple \ - (*(PyDec_FromUint128Triple_RETURN (*)PyDec_FromUint128Triple_ARGS) _decimal_api[PyDec_FromUint128Triple_INDEX]) - -/* Advanced API */ -#define PyDec_Alloc \ - (*(PyDec_Alloc_RETURN (*)PyDec_Alloc_ARGS) _decimal_api[PyDec_Alloc_INDEX]) - -#define PyDec_Get \ - (*(PyDec_Get_RETURN (*)PyDec_Get_ARGS) _decimal_api[PyDec_Get_INDEX]) - -#define PyDec_GetConst \ - (*(PyDec_GetConst_RETURN (*)PyDec_GetConst_ARGS) _decimal_api[PyDec_GetConst_INDEX]) - - -static int -import_decimal(void) -{ - _decimal_api = (void **)PyCapsule_Import(PyDec_CAPSULE_NAME, 0); - if (_decimal_api == NULL) { - return -1; - } - - return 0; -} -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* CPYTHON_DECIMAL_H_ */ diff --git a/Include/pyerrors.h b/Include/pyerrors.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_SW5jbHVkZS9weWVycm9ycy5o..8dd72af26abae4c1395bdd7572059de8fccc8d87_SW5jbHVkZS9weWVycm9ycy5o 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -149,6 +149,7 @@ PyAPI_DATA(PyObject *) PyExc_ImportWarning; PyAPI_DATA(PyObject *) PyExc_UnicodeWarning; PyAPI_DATA(PyObject *) PyExc_BytesWarning; +PyAPI_DATA(PyObject *) PyExc_EncodingWarning; PyAPI_DATA(PyObject *) PyExc_ResourceWarning; diff --git a/Lib/__future__.py b/Lib/__future__.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL19fZnV0dXJlX18ucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL19fZnV0dXJlX18ucHk= 100644 --- a/Lib/__future__.py +++ b/Lib/__future__.py @@ -42,7 +42,7 @@ argument to the builtin function compile() to enable the feature in dynamically compiled code. This flag is stored in the .compiler_flag attribute on _Future instances. These values must match the appropriate -#defines of CO_xxx flags in Include/compile.h. +#defines of CO_xxx flags in Include/cpython/compile.h. No feature line is ever to be deleted from this file. """ diff --git a/Lib/_osx_support.py b/Lib/_osx_support.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL19vc3hfc3VwcG9ydC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL19vc3hfc3VwcG9ydC5weQ== 100644 --- a/Lib/_osx_support.py +++ b/Lib/_osx_support.py @@ -96,7 +96,7 @@ if _SYSTEM_VERSION is None: _SYSTEM_VERSION = '' try: - f = open('/System/Library/CoreServices/SystemVersion.plist') + f = open('/System/Library/CoreServices/SystemVersion.plist', encoding="utf-8") except OSError: # We're on a plain darwin box, fall back to the default # behaviour. @@ -156,5 +156,5 @@ if _cache_default_sysroot is not None: return _cache_default_sysroot - + contents = _read_output('%s -c -E -v - </dev/null' % (cc,), True) @@ -160,5 +160,5 @@ contents = _read_output('%s -c -E -v - </dev/null' % (cc,), True) - in_incdirs = False + in_incdirs = False for line in contents.splitlines(): if line.startswith("#include <...>"): in_incdirs = True diff --git a/Lib/_pyio.py b/Lib/_pyio.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL19weWlvLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL19weWlvLnB5 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -40,6 +40,36 @@ _CHECK_ERRORS = _IOBASE_EMITS_UNRAISABLE +def text_encoding(encoding, stacklevel=2): + """ + A helper function to choose the text encoding. + + When encoding is not None, just return it. + Otherwise, return the default text encoding (i.e. "locale"). + + This function emits an EncodingWarning if *encoding* is None and + sys.flags.warn_default_encoding is true. + + This can be used in APIs with an encoding=None parameter + that pass it to TextIOWrapper or open. + However, please consider using encoding="utf-8" for new APIs. + """ + if encoding is None: + encoding = "locale" + if sys.flags.warn_default_encoding: + import warnings + warnings.warn("'encoding' argument not specified.", + EncodingWarning, stacklevel + 1) + return encoding + + +# Wrapper for builtins.open +# +# Trick so that open() won't become a bound method when stored +# as a class variable (as dbm.dumb does). +# +# See init_set_builtins_open() in Python/pylifecycle.c. +@staticmethod def open(file, mode="r", buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None): @@ -248,6 +278,7 @@ result = buffer if binary: return result + encoding = text_encoding(encoding) text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering) result = text text.mode = mode @@ -280,27 +311,20 @@ open_code = _open_code_with_warning -class DocDescriptor: - """Helper for builtins.open.__doc__ - """ - def __get__(self, obj, typ=None): - return ( - "open(file, mode='r', buffering=-1, encoding=None, " - "errors=None, newline=None, closefd=True)\n\n" + - open.__doc__) - -class OpenWrapper: - """Wrapper for builtins.open - - Trick so that open won't become a bound method when stored - as a class variable (as dbm.dumb does). - - See initstdio() in Python/pylifecycle.c. - """ - __doc__ = DocDescriptor() - - def __new__(cls, *args, **kwargs): - return open(*args, **kwargs) +def __getattr__(name): + if name == "OpenWrapper": + # bpo-43680: Until Python 3.9, _pyio.open was not a static method and + # builtins.open was set to OpenWrapper to not become a bound method + # when set to a class variable. _io.open is a built-in function whereas + # _pyio.open is a Python function. In Python 3.10, _pyio.open() is now + # a static method, and builtins.open() is now io.open(). + import warnings + warnings.warn('OpenWrapper is deprecated, use open instead', + DeprecationWarning, stacklevel=2) + global OpenWrapper + OpenWrapper = open + return OpenWrapper + raise AttributeError(name) # In normal operation, both `UnsupportedOperation`s should be bound to the @@ -2004,5 +2028,7 @@ def __init__(self, buffer, encoding=None, errors=None, newline=None, line_buffering=False, write_through=False): self._check_newline(newline) - if encoding is None: + encoding = text_encoding(encoding) + + if encoding == "locale": try: @@ -2008,4 +2034,4 @@ try: - encoding = os.device_encoding(buffer.fileno()) + encoding = os.device_encoding(buffer.fileno()) or "locale" except (AttributeError, UnsupportedOperation): pass @@ -2010,13 +2036,14 @@ except (AttributeError, UnsupportedOperation): pass - if encoding is None: - try: - import locale - except ImportError: - # Importing locale may fail if Python is being built - encoding = "ascii" - else: - encoding = locale.getpreferredencoding(False) + + if encoding == "locale": + try: + import locale + except ImportError: + # Importing locale may fail if Python is being built + encoding = "utf-8" + else: + encoding = locale.getpreferredencoding(False) if not isinstance(encoding, str): raise ValueError("invalid encoding: %r" % encoding) diff --git a/Lib/_sitebuiltins.py b/Lib/_sitebuiltins.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL19zaXRlYnVpbHRpbnMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL19zaXRlYnVpbHRpbnMucHk= 100644 --- a/Lib/_sitebuiltins.py +++ b/Lib/_sitebuiltins.py @@ -47,7 +47,7 @@ data = None for filename in self.__filenames: try: - with open(filename, "r") as fp: + with open(filename, encoding='utf-8') as fp: data = fp.read() break except OSError: diff --git a/Lib/bdb.py b/Lib/bdb.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2JkYi5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2JkYi5weQ== 100644 --- a/Lib/bdb.py +++ b/Lib/bdb.py @@ -34,6 +34,8 @@ self.fncache = {} self.frame_returning = None + self._load_breaks() + def canonic(self, filename): """Return canonical form of filename. @@ -365,6 +367,12 @@ # Call self.get_*break*() to see the breakpoints or better # for bp in Breakpoint.bpbynumber: if bp: bp.bpprint(). + def _add_to_breaks(self, filename, lineno): + """Add breakpoint to breaks, if not already there.""" + bp_linenos = self.breaks.setdefault(filename, []) + if lineno not in bp_linenos: + bp_linenos.append(lineno) + def set_break(self, filename, lineno, temporary=False, cond=None, funcname=None): """Set a new breakpoint for filename:lineno. @@ -377,9 +385,7 @@ line = linecache.getline(filename, lineno) if not line: return 'Line %s:%d does not exist' % (filename, lineno) - list = self.breaks.setdefault(filename, []) - if lineno not in list: - list.append(lineno) + self._add_to_breaks(filename, lineno) bp = Breakpoint(filename, lineno, temporary, cond, funcname) return None @@ -383,6 +389,17 @@ bp = Breakpoint(filename, lineno, temporary, cond, funcname) return None + def _load_breaks(self): + """Apply all breakpoints (set in other instances) to this one. + + Populates this instance's breaks list from the Breakpoint class's + list, which can have breakpoints set by another Bdb instance. This + is necessary for interactive sessions to keep the breakpoints + active across multiple calls to run(). + """ + for (filename, lineno) in Breakpoint.bplist.keys(): + self._add_to_breaks(filename, lineno) + def _prune_breaks(self, filename, lineno): """Prune breakpoints for filename:lineno. @@ -681,6 +698,12 @@ else: self.bplist[file, line] = [self] + @staticmethod + def clearBreakpoints(): + Breakpoint.next = 1 + Breakpoint.bplist = {} + Breakpoint.bpbynumber = [None] + def deleteMe(self): """Delete the breakpoint from the list associated to a file:line. diff --git a/Lib/bz2.py b/Lib/bz2.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2J6Mi5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2J6Mi5weQ== 100644 --- a/Lib/bz2.py +++ b/Lib/bz2.py @@ -13,7 +13,6 @@ import io import os import _compression -from threading import RLock from _bz2 import BZ2Compressor, BZ2Decompressor @@ -53,9 +52,6 @@ If mode is 'r', the input file may be the concatenation of multiple compressed streams. """ - # This lock must be recursive, so that BufferedIOBase's - # writelines() does not deadlock. - self._lock = RLock() self._fp = None self._closefp = False self._mode = _MODE_CLOSED @@ -104,7 +100,13 @@ May be called more than once without error. Once the file is closed, any other operation on it will raise a ValueError. """ - with self._lock: - if self._mode == _MODE_CLOSED: - return + if self._mode == _MODE_CLOSED: + return + try: + if self._mode == _MODE_READ: + self._buffer.close() + elif self._mode == _MODE_WRITE: + self._fp.write(self._compressor.flush()) + self._compressor = None + finally: try: @@ -110,7 +112,4 @@ try: - if self._mode == _MODE_READ: - self._buffer.close() - elif self._mode == _MODE_WRITE: - self._fp.write(self._compressor.flush()) - self._compressor = None + if self._closefp: + self._fp.close() finally: @@ -116,12 +115,8 @@ finally: - try: - if self._closefp: - self._fp.close() - finally: - self._fp = None - self._closefp = False - self._mode = _MODE_CLOSED - self._buffer = None + self._fp = None + self._closefp = False + self._mode = _MODE_CLOSED + self._buffer = None @property def closed(self): @@ -153,12 +148,11 @@ Always returns at least one byte of data, unless at EOF. The exact number of bytes returned is unspecified. """ - with self._lock: - self._check_can_read() - # Relies on the undocumented fact that BufferedReader.peek() - # always returns at least one byte (except at EOF), independent - # of the value of n - return self._buffer.peek(n) + self._check_can_read() + # Relies on the undocumented fact that BufferedReader.peek() + # always returns at least one byte (except at EOF), independent + # of the value of n + return self._buffer.peek(n) def read(self, size=-1): """Read up to size uncompressed bytes from the file. @@ -166,9 +160,8 @@ If size is negative or omitted, read until EOF is reached. Returns b'' if the file is already at EOF. """ - with self._lock: - self._check_can_read() - return self._buffer.read(size) + self._check_can_read() + return self._buffer.read(size) def read1(self, size=-1): """Read up to size uncompressed bytes, while trying to avoid @@ -177,14 +170,13 @@ Returns b'' if the file is at EOF. """ - with self._lock: - self._check_can_read() - if size < 0: - size = io.DEFAULT_BUFFER_SIZE - return self._buffer.read1(size) + self._check_can_read() + if size < 0: + size = io.DEFAULT_BUFFER_SIZE + return self._buffer.read1(size) def readinto(self, b): """Read bytes into b. Returns the number of bytes read (0 for EOF). """ @@ -185,12 +177,11 @@ def readinto(self, b): """Read bytes into b. Returns the number of bytes read (0 for EOF). """ - with self._lock: - self._check_can_read() - return self._buffer.readinto(b) + self._check_can_read() + return self._buffer.readinto(b) def readline(self, size=-1): """Read a line of uncompressed bytes from the file. @@ -203,9 +194,12 @@ if not hasattr(size, "__index__"): raise TypeError("Integer argument expected") size = size.__index__() - with self._lock: - self._check_can_read() - return self._buffer.readline(size) + self._check_can_read() + return self._buffer.readline(size) + + def __iter__(self): + self._check_can_read() + return self._buffer.__iter__() def readlines(self, size=-1): """Read a list of lines of uncompressed bytes from the file. @@ -218,9 +212,8 @@ if not hasattr(size, "__index__"): raise TypeError("Integer argument expected") size = size.__index__() - with self._lock: - self._check_can_read() - return self._buffer.readlines(size) + self._check_can_read() + return self._buffer.readlines(size) def write(self, data): """Write a byte string to the file. @@ -229,12 +222,11 @@ always len(data). Note that due to buffering, the file on disk may not reflect the data written until close() is called. """ - with self._lock: - self._check_can_write() - compressed = self._compressor.compress(data) - self._fp.write(compressed) - self._pos += len(data) - return len(data) + self._check_can_write() + compressed = self._compressor.compress(data) + self._fp.write(compressed) + self._pos += len(data) + return len(data) def writelines(self, seq): """Write a sequence of byte strings to the file. @@ -244,8 +236,7 @@ Line separators are not added between the written byte strings. """ - with self._lock: - return _compression.BaseStream.writelines(self, seq) + return _compression.BaseStream.writelines(self, seq) def seek(self, offset, whence=io.SEEK_SET): """Change the file position. @@ -262,9 +253,8 @@ Note that seeking is emulated, so depending on the parameters, this operation may be extremely slow. """ - with self._lock: - self._check_can_seek() - return self._buffer.seek(offset, whence) + self._check_can_seek() + return self._buffer.seek(offset, whence) def tell(self): """Return the current file position.""" @@ -268,11 +258,10 @@ def tell(self): """Return the current file position.""" - with self._lock: - self._check_not_closed() - if self._mode == _MODE_READ: - return self._buffer.tell() - return self._pos + self._check_not_closed() + if self._mode == _MODE_READ: + return self._buffer.tell() + return self._pos def open(filename, mode="rb", compresslevel=9, @@ -311,6 +300,7 @@ binary_file = BZ2File(filename, bz_mode, compresslevel=compresslevel) if "t" in mode: + encoding = io.text_encoding(encoding) return io.TextIOWrapper(binary_file, encoding, errors, newline) else: return binary_file diff --git a/Lib/compileall.py b/Lib/compileall.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2NvbXBpbGVhbGwucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2NvbXBpbGVhbGwucHk= 100644 --- a/Lib/compileall.py +++ b/Lib/compileall.py @@ -407,7 +407,8 @@ # if flist is provided then load it if args.flist: try: - with (sys.stdin if args.flist=='-' else open(args.flist)) as f: + with (sys.stdin if args.flist=='-' else + open(args.flist, encoding="utf-8")) as f: for line in f: compile_dests.append(line.strip()) except OSError: diff --git a/Lib/concurrent/futures/_base.py b/Lib/concurrent/futures/_base.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2NvbmN1cnJlbnQvZnV0dXJlcy9fYmFzZS5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2NvbmN1cnJlbnQvZnV0dXJlcy9fYmFzZS5weQ== 100644 --- a/Lib/concurrent/futures/_base.py +++ b/Lib/concurrent/futures/_base.py @@ -386,7 +386,11 @@ def __get_result(self): if self._exception: - raise self._exception + try: + raise self._exception + finally: + # Break a reference cycle with the exception in self._exception + self = None else: return self._result @@ -426,9 +430,12 @@ timeout. Exception: If the call raised then that exception will be raised. """ - with self._condition: - if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: - raise CancelledError() - elif self._state == FINISHED: - return self.__get_result() + try: + with self._condition: + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self.__get_result() + + self._condition.wait(timeout) @@ -434,12 +441,13 @@ - self._condition.wait(timeout) - - if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: - raise CancelledError() - elif self._state == FINISHED: - return self.__get_result() - else: - raise TimeoutError() + if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]: + raise CancelledError() + elif self._state == FINISHED: + return self.__get_result() + else: + raise TimeoutError() + finally: + # Break a reference cycle with the exception in self._exception + self = None def exception(self, timeout=None): """Return the exception raised by the call that the future represents. diff --git a/Lib/configparser.py b/Lib/configparser.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2NvbmZpZ3BhcnNlci5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2NvbmZpZ3BhcnNlci5weQ== 100644 --- a/Lib/configparser.py +++ b/Lib/configparser.py @@ -690,6 +690,7 @@ """ if isinstance(filenames, (str, bytes, os.PathLike)): filenames = [filenames] + encoding = io.text_encoding(encoding) read_ok = [] for filename in filenames: try: diff --git a/Lib/ctypes/test/test_find.py b/Lib/ctypes/test/test_find.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2N0eXBlcy90ZXN0L3Rlc3RfZmluZC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2N0eXBlcy90ZXN0L3Rlc3RfZmluZC5weQ== 100644 --- a/Lib/ctypes/test/test_find.py +++ b/Lib/ctypes/test/test_find.py @@ -90,7 +90,7 @@ srcname = os.path.join(d, 'dummy.c') libname = 'py_ctypes_test_dummy' dstname = os.path.join(d, 'lib%s.so' % libname) - with open(srcname, 'w') as f: + with open(srcname, 'wb') as f: pass self.assertTrue(os.path.exists(srcname)) # compile the file to a shared library diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2RhdGFjbGFzc2VzLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2RhdGFjbGFzc2VzLnB5 100644 --- a/Lib/dataclasses.py +++ b/Lib/dataclasses.py @@ -154,12 +154,17 @@ # __match_args__ # -# | no | yes | <--- class has __match_args__ in __dict__? -# +=======+=======+ -# | add | | <- the default -# +=======+=======+ -# __match_args__ is always added unless the class already defines it. It is a -# tuple of __init__ parameter names; non-init fields must be matched by keyword. +# +--- match_args= parameter +# | +# v | | | +# | no | yes | <--- class has __match_args__ in __dict__? +# +=======+=======+=======+ +# | False | | | +# +-------+-------+-------+ +# | True | add | | <- the default +# +=======+=======+=======+ +# __match_args__ is a tuple of __init__ parameter names; non-init fields must +# be matched by keyword. # Raised when an attempt is made to modify a frozen class. @@ -830,7 +835,8 @@ # version of this table. -def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen): +def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen, + match_args): # Now that dicts retain insertion order, there's no reason to use # an ordered dict. I am leveraging that ordering here, because # derived class fields overwrite base class fields, but the order @@ -860,7 +866,7 @@ # Only process classes that have been processed by our # decorator. That is, they have a _FIELDS attribute. base_fields = getattr(b, _FIELDS, None) - if base_fields: + if base_fields is not None: has_dataclass_bases = True for f in base_fields.values(): fields[f.name] = f @@ -1016,8 +1022,9 @@ cls.__doc__ = (cls.__name__ + str(inspect.signature(cls)).replace(' -> NoneType', '')) - if '__match_args__' not in cls.__dict__: - cls.__match_args__ = tuple(f.name for f in flds if f.init) + if match_args: + _set_new_attribute(cls, '__match_args__', + tuple(f.name for f in field_list if f.init)) abc.update_abstractmethods(cls) @@ -1025,7 +1032,7 @@ def dataclass(cls=None, /, *, init=True, repr=True, eq=True, order=False, - unsafe_hash=False, frozen=False): + unsafe_hash=False, frozen=False, match_args=True): """Returns the same class as was passed in, with dunder methods added based on the fields defined in the class. @@ -1035,7 +1042,8 @@ repr is true, a __repr__() method is added. If order is true, rich comparison dunder methods are added. If unsafe_hash is true, a __hash__() method function is added. If frozen is true, fields may - not be assigned to after instance creation. + not be assigned to after instance creation. If match_args is true, + the __match_args__ tuple is added. """ def wrap(cls): @@ -1039,7 +1047,8 @@ """ def wrap(cls): - return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen) + return _process_class(cls, init, repr, eq, order, unsafe_hash, + frozen, match_args) # See if we're being called as @dataclass or @dataclass(). if cls is None: @@ -1198,7 +1207,7 @@ def make_dataclass(cls_name, fields, *, bases=(), namespace=None, init=True, repr=True, eq=True, order=False, unsafe_hash=False, - frozen=False): + frozen=False, match_args=True): """Return a new dynamically created dataclass. The dataclass name will be 'cls_name'. 'fields' is an iterable @@ -1224,10 +1233,7 @@ if namespace is None: namespace = {} - else: - # Copy namespace since we're going to mutate it. - namespace = namespace.copy() # While we're looking through the field names, validate that they # are identifiers, are not keywords, and not duplicates. seen = set() @@ -1230,8 +1236,9 @@ # While we're looking through the field names, validate that they # are identifiers, are not keywords, and not duplicates. seen = set() - anns = {} + annotations = {} + defaults = {} for item in fields: if isinstance(item, str): name = item @@ -1240,7 +1247,7 @@ name, tp, = item elif len(item) == 3: name, tp, spec = item - namespace[name] = spec + defaults[name] = spec else: raise TypeError(f'Invalid field: {item!r}') @@ -1252,5 +1259,5 @@ raise TypeError(f'Field name duplicated: {name!r}') seen.add(name) - anns[name] = tp + annotations[name] = tp @@ -1256,4 +1263,9 @@ - namespace['__annotations__'] = anns + # Update 'ns' with the user-supplied namespace plus our calculated values. + def exec_body_callback(ns): + ns.update(namespace) + ns.update(defaults) + ns['__annotations__'] = annotations + # We use `types.new_class()` instead of simply `type()` to allow dynamic creation # of generic dataclassses. @@ -1258,4 +1270,6 @@ # We use `types.new_class()` instead of simply `type()` to allow dynamic creation # of generic dataclassses. - cls = types.new_class(cls_name, bases, {}, lambda ns: ns.update(namespace)) + cls = types.new_class(cls_name, bases, {}, exec_body_callback) + + # Apply the normal decorator. return dataclass(cls, init=init, repr=repr, eq=eq, order=order, @@ -1261,5 +1275,6 @@ return dataclass(cls, init=init, repr=repr, eq=eq, order=order, - unsafe_hash=unsafe_hash, frozen=frozen) + unsafe_hash=unsafe_hash, frozen=frozen, + match_args=match_args) def replace(obj, /, **changes): @@ -1300,7 +1315,7 @@ continue if f.name not in changes: - if f._field_type is _FIELD_INITVAR: + if f._field_type is _FIELD_INITVAR and f.default is MISSING: raise ValueError(f"InitVar {f.name!r} " 'must be specified with replace()') changes[f.name] = getattr(obj, f.name) diff --git a/Lib/dis.py b/Lib/dis.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2Rpcy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2Rpcy5weQ== 100644 --- a/Lib/dis.py +++ b/Lib/dis.py @@ -338,4 +338,7 @@ argval, argrepr = _get_const_info(arg, constants) elif op in hasname: argval, argrepr = _get_name_info(arg, names) + elif op in hasjabs: + argval = arg*2 + argrepr = "to " + repr(argval) elif op in hasjrel: @@ -341,5 +344,5 @@ elif op in hasjrel: - argval = offset + 2 + arg + argval = offset + 2 + arg*2 argrepr = "to " + repr(argval) elif op in haslocal: argval, argrepr = _get_name_info(arg, varnames) @@ -437,5 +440,5 @@ for offset, op, arg in _unpack_opargs(code): if arg is not None: if op in hasjrel: - label = offset + 2 + arg + label = offset + 2 + arg*2 elif op in hasjabs: @@ -441,5 +444,5 @@ elif op in hasjabs: - label = arg + label = arg*2 else: continue if label not in labels: diff --git a/Lib/email/base64mime.py b/Lib/email/base64mime.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2VtYWlsL2Jhc2U2NG1pbWUucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2VtYWlsL2Jhc2U2NG1pbWUucHk= 100644 --- a/Lib/email/base64mime.py +++ b/Lib/email/base64mime.py @@ -84,7 +84,7 @@ in an email. """ if not s: - return s + return "" encvec = [] max_unencoded = maxlinelen * 3 // 4 diff --git a/Lib/enum.py b/Lib/enum.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2VudW0ucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2VudW0ucHk= 100644 --- a/Lib/enum.py +++ b/Lib/enum.py @@ -4,8 +4,8 @@ __all__ = [ - 'EnumMeta', + 'EnumType', 'EnumMeta', 'Enum', 'IntEnum', 'StrEnum', 'Flag', 'IntFlag', 'auto', 'unique', 'property', 'FlagBoundary', 'STRICT', 'CONFORM', 'EJECT', 'KEEP', @@ -8,9 +8,10 @@ 'Enum', 'IntEnum', 'StrEnum', 'Flag', 'IntFlag', 'auto', 'unique', 'property', 'FlagBoundary', 'STRICT', 'CONFORM', 'EJECT', 'KEEP', + 'global_flag_repr', 'global_enum_repr', 'global_enum', ] # Dummy value for Enum and Flag as there are explicit checks for them # before they have been created. @@ -12,9 +13,9 @@ ] # Dummy value for Enum and Flag as there are explicit checks for them # before they have been created. -# This is also why there are checks in EnumMeta like `if Enum is not None` +# This is also why there are checks in EnumType like `if Enum is not None` Enum = Flag = EJECT = None def _is_descriptor(obj): @@ -285,7 +286,7 @@ """ Track enum member order and ensure member names are not reused. - EnumMeta will use the names found in self._member_names as the + EnumType will use the names found in self._member_names as the enumeration member names. """ def __init__(self): @@ -321,7 +322,8 @@ # check if members already defined as auto() if self._auto_called: raise TypeError("_generate_next_value_ must be defined before members") - setattr(self, '_generate_next_value', value) + _gnv = value.__func__ if isinstance(value, staticmethod) else value + setattr(self, '_generate_next_value', _gnv) elif key == '_ignore_': if isinstance(value, str): value = value.replace(',',' ').split() @@ -368,7 +370,7 @@ self[name] = value -class EnumMeta(type): +class EnumType(type): """ Metaclass for Enum """ @@ -756,5 +758,5 @@ # module; # also, replace the __reduce_ex__ method so unpickling works in # previous Python versions - module_globals = vars(sys.modules[module]) + module_globals = sys.modules[module].__dict__ if source: @@ -760,5 +762,5 @@ if source: - source = vars(source) + source = source.__dict__ else: source = module_globals # _value2member_map_ is populated in the same order every time @@ -776,7 +778,7 @@ members.sort(key=lambda t: t[0]) cls = cls(name, members, module=module, boundary=boundary or KEEP) cls.__reduce_ex__ = _reduce_ex_by_name - module_globals.update(cls.__members__) + global_enum(cls) module_globals[name] = cls return cls @@ -881,5 +883,6 @@ else: use_args = True return __new__, save_new, use_args +EnumMeta = EnumType @@ -884,6 +887,6 @@ -class Enum(metaclass=EnumMeta): +class Enum(metaclass=EnumType): """ Generic enumeration. @@ -916,25 +919,30 @@ except Exception as e: exc = e result = None - if isinstance(result, cls): - return result - elif ( - Flag is not None and issubclass(cls, Flag) - and cls._boundary_ is EJECT and isinstance(result, int) - ): - return result - else: - ve_exc = ValueError("%r is not a valid %s" % (value, cls.__qualname__)) - if result is None and exc is None: - raise ve_exc - elif exc is None: - exc = TypeError( - 'error in %s._missing_: returned %r instead of None or a valid member' - % (cls.__name__, result) - ) - if not isinstance(exc, ValueError): - exc.__context__ = ve_exc - raise exc + try: + if isinstance(result, cls): + return result + elif ( + Flag is not None and issubclass(cls, Flag) + and cls._boundary_ is EJECT and isinstance(result, int) + ): + return result + else: + ve_exc = ValueError("%r is not a valid %s" % (value, cls.__qualname__)) + if result is None and exc is None: + raise ve_exc + elif exc is None: + exc = TypeError( + 'error in %s._missing_: returned %r instead of None or a valid member' + % (cls.__name__, result) + ) + if not isinstance(exc, ValueError): + exc.__context__ = ve_exc + raise exc + finally: + # ensure all variables that could hold an exception are destroyed + exc = None + ve_exc = None def _generate_next_value_(name, start, count, last_values): """ @@ -958,7 +966,6 @@ return None def __repr__(self): - return "<%s.%s: %r>" % ( - self.__class__.__name__, self._name_, self._value_) + return "%s.%s" % ( self.__class__.__name__, self._name_) def __str__(self): @@ -963,6 +970,6 @@ def __str__(self): - return "%s.%s" % (self.__class__.__name__, self._name_) + return "%s" % (self._name_, ) def __dir__(self): """ @@ -1220,7 +1227,11 @@ return self._value_.bit_count() def __repr__(self): - cls = self.__class__ - if self._name_ is not None: - return '<%s.%s: %r>' % (cls.__name__, self._name_, self._value_) + cls_name = self.__class__.__name__ + if self._name_ is None: + return "0x%x" % (self._value_, ) + if _is_single_bit(self._value_): + return '%s.%s' % (cls_name, self._name_) + if self._boundary_ is not FlagBoundary.KEEP: + return '%s.' % cls_name + ('|%s.' % cls_name).join(self.name.split('|')) else: @@ -1226,6 +1237,11 @@ else: - # only zero is unnamed by default - return '<%s: %r>' % (cls.__name__, self._value_) + name = [] + for n in self._name_.split('|'): + if n.startswith('0'): + name.append(n) + else: + name.append('%s.%s' % (cls_name, n)) + return '|'.join(name) def __str__(self): cls = self.__class__ @@ -1229,6 +1245,6 @@ def __str__(self): cls = self.__class__ - if self._name_ is not None: - return '%s.%s' % (cls.__name__, self._name_) + if self._name_ is None: + return '%s(%x)' % (cls.__name__, self._value_) else: @@ -1234,5 +1250,5 @@ else: - return '%s(%s)' % (cls.__name__, self._value_) + return self._name_ def __bool__(self): return bool(self._value_) @@ -1329,3 +1345,38 @@ if value < 1: return False return value == 2 ** _high_bit(value) + +def global_enum_repr(self): + return '%s.%s' % (self.__class__.__module__, self._name_) + +def global_flag_repr(self): + module = self.__class__.__module__ + cls_name = self.__class__.__name__ + if self._name_ is None: + return "%x" % (module, cls_name, self._value_) + if _is_single_bit(self): + return '%s.%s' % (module, self._name_) + if self._boundary_ is not FlagBoundary.KEEP: + return module + module.join(self.name.split('|')) + else: + name = [] + for n in self._name_.split('|'): + if n.startswith('0'): + name.append(n) + else: + name.append('%s.%s' % (module, n)) + return '|'.join(name) + + +def global_enum(cls): + """ + decorator that makes the repr() of an enum member reference its module + instead of its class; also exports all members to the enum's module's + global namespace + """ + if issubclass(cls, Flag): + cls.__repr__ = global_flag_repr + else: + cls.__repr__ = global_enum_repr + sys.modules[cls.__module__].__dict__.update(cls.__members__) + return cls diff --git a/Lib/fileinput.py b/Lib/fileinput.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2ZpbGVpbnB1dC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2ZpbGVpbnB1dC5weQ== 100644 --- a/Lib/fileinput.py +++ b/Lib/fileinput.py @@ -3,7 +3,7 @@ Typical use is: import fileinput - for line in fileinput.input(): + for line in fileinput.input(encoding="utf-8"): process(line) This iterates over the lines of all files listed in sys.argv[1:], @@ -63,12 +63,5 @@ deleted when the output file is closed. In-place filtering is disabled when standard input is read. XXX The current implementation does not work for MS-DOS 8+3 filesystems. - -XXX Possible additions: - -- optional getopt argument processing -- isatty() -- read(), read(size), even readlines() - """ @@ -73,5 +66,6 @@ """ +import io import sys, os from types import GenericAlias @@ -81,7 +75,8 @@ _state = None -def input(files=None, inplace=False, backup="", *, mode="r", openhook=None): +def input(files=None, inplace=False, backup="", *, mode="r", openhook=None, + encoding=None, errors=None): """Return an instance of the FileInput class, which can be iterated. The parameters are passed to the constructor of the FileInput class. @@ -91,7 +86,8 @@ global _state if _state and _state._file: raise RuntimeError("input() already active") - _state = FileInput(files, inplace, backup, mode=mode, openhook=openhook) + _state = FileInput(files, inplace, backup, mode=mode, openhook=openhook, + encoding=encoding, errors=errors) return _state def close(): @@ -186,7 +182,7 @@ """ def __init__(self, files=None, inplace=False, backup="", *, - mode="r", openhook=None): + mode="r", openhook=None, encoding=None, errors=None): if isinstance(files, str): files = (files,) elif isinstance(files, os.PathLike): @@ -209,6 +205,16 @@ self._file = None self._isstdin = False self._backupfilename = None + self._encoding = encoding + self._errors = errors + + # We can not use io.text_encoding() here because old openhook doesn't + # take encoding parameter. + if "b" not in mode and encoding is None and sys.flags.warn_default_encoding: + import warnings + warnings.warn("'encoding' argument not specified.", + EncodingWarning, 2) + # restrict mode argument to reading modes if mode not in ('r', 'rU', 'U', 'rb'): raise ValueError("FileInput opening mode must be one of " @@ -362,5 +368,11 @@ else: # This may raise OSError if self._openhook: - self._file = self._openhook(self._filename, self._mode) + # Custom hooks made previous to Python 3.10 didn't have + # encoding argument + if self._encoding is None: + self._file = self._openhook(self._filename, self._mode) + else: + self._file = self._openhook( + self._filename, self._mode, encoding=self._encoding, errors=self._errors) else: @@ -366,5 +378,10 @@ else: - self._file = open(self._filename, self._mode) + # EncodingWarning is emitted in __init__() already + if "b" not in self._mode: + encoding = self._encoding or "locale" + else: + encoding = None + self._file = open(self._filename, self._mode, encoding=encoding, errors=self._errors) self._readline = self._file.readline # hide FileInput._readline return self._readline() @@ -395,7 +412,9 @@ __class_getitem__ = classmethod(GenericAlias) -def hook_compressed(filename, mode): +def hook_compressed(filename, mode, *, encoding=None, errors=None): + if encoding is None: # EncodingWarning is emitted in FileInput() already. + encoding = "locale" ext = os.path.splitext(filename)[1] if ext == '.gz': import gzip @@ -399,6 +418,6 @@ ext = os.path.splitext(filename)[1] if ext == '.gz': import gzip - return gzip.open(filename, mode) + stream = gzip.open(filename, mode) elif ext == '.bz2': import bz2 @@ -403,4 +422,4 @@ elif ext == '.bz2': import bz2 - return bz2.BZ2File(filename, mode) + stream = bz2.BZ2File(filename, mode) else: @@ -406,5 +425,10 @@ else: - return open(filename, mode) + return open(filename, mode, encoding=encoding, errors=errors) + + # gzip and bz2 are binary mode by default. + if "b" not in mode: + stream = io.TextIOWrapper(stream, encoding=encoding, errors=errors) + return stream def hook_encoded(encoding, errors=None): diff --git a/Lib/fractions.py b/Lib/fractions.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2ZyYWN0aW9ucy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2ZyYWN0aW9ucy5weQ== 100644 --- a/Lib/fractions.py +++ b/Lib/fractions.py @@ -380,5 +380,73 @@ return forward, reverse + # Rational arithmetic algorithms: Knuth, TAOCP, Volume 2, 4.5.1. + # + # Assume input fractions a and b are normalized. + # + # 1) Consider addition/subtraction. + # + # Let g = gcd(da, db). Then + # + # na nb na*db ± nb*da + # a ± b == -- ± -- == ------------- == + # da db da*db + # + # na*(db//g) ± nb*(da//g) t + # == ----------------------- == - + # (da*db)//g d + # + # Now, if g > 1, we're working with smaller integers. + # + # Note, that t, (da//g) and (db//g) are pairwise coprime. + # + # Indeed, (da//g) and (db//g) share no common factors (they were + # removed) and da is coprime with na (since input fractions are + # normalized), hence (da//g) and na are coprime. By symmetry, + # (db//g) and nb are coprime too. Then, + # + # gcd(t, da//g) == gcd(na*(db//g), da//g) == 1 + # gcd(t, db//g) == gcd(nb*(da//g), db//g) == 1 + # + # Above allows us optimize reduction of the result to lowest + # terms. Indeed, + # + # g2 = gcd(t, d) == gcd(t, (da//g)*(db//g)*g) == gcd(t, g) + # + # t//g2 t//g2 + # a ± b == ----------------------- == ---------------- + # (da//g)*(db//g)*(g//g2) (da//g)*(db//g2) + # + # is a normalized fraction. This is useful because the unnormalized + # denominator d could be much larger than g. + # + # We should special-case g == 1 (and g2 == 1), since 60.8% of + # randomly-chosen integers are coprime: + # https://en.wikipedia.org/wiki/Coprime_integers#Probability_of_coprimality + # Note, that g2 == 1 always for fractions, obtained from floats: here + # g is a power of 2 and the unnormalized numerator t is an odd integer. + # + # 2) Consider multiplication + # + # Let g1 = gcd(na, db) and g2 = gcd(nb, da), then + # + # na*nb na*nb (na//g1)*(nb//g2) + # a*b == ----- == ----- == ----------------- + # da*db db*da (db//g1)*(da//g2) + # + # Note, that after divisions we're multiplying smaller integers. + # + # Also, the resulting fraction is normalized, because each of + # two factors in the numerator is coprime to each of the two factors + # in the denominator. + # + # Indeed, pick (na//g1). It's coprime with (da//g2), because input + # fractions are normalized. It's also coprime with (db//g1), because + # common factors are removed by g1 == gcd(na, db). + # + # As for addition/subtraction, we should special-case g1 == 1 + # and g2 == 1 for same reason. That happens also for multiplying + # rationals, obtained from floats. + def _add(a, b): """a + b""" @@ -383,10 +451,18 @@ def _add(a, b): """a + b""" - da, db = a.denominator, b.denominator - return Fraction(a.numerator * db + b.numerator * da, - da * db) + na, da = a.numerator, a.denominator + nb, db = b.numerator, b.denominator + g = math.gcd(da, db) + if g == 1: + return Fraction(na * db + da * nb, da * db, _normalize=False) + s = da // g + t = na * (db // g) + nb * s + g2 = math.gcd(t, g) + if g2 == 1: + return Fraction(t, s * db, _normalize=False) + return Fraction(t // g2, s * (db // g2), _normalize=False) __add__, __radd__ = _operator_fallbacks(_add, operator.add) def _sub(a, b): """a - b""" @@ -388,13 +464,21 @@ __add__, __radd__ = _operator_fallbacks(_add, operator.add) def _sub(a, b): """a - b""" - da, db = a.denominator, b.denominator - return Fraction(a.numerator * db - b.numerator * da, - da * db) + na, da = a.numerator, a.denominator + nb, db = b.numerator, b.denominator + g = math.gcd(da, db) + if g == 1: + return Fraction(na * db - da * nb, da * db, _normalize=False) + s = da // g + t = na * (db // g) - nb * s + g2 = math.gcd(t, g) + if g2 == 1: + return Fraction(t, s * db, _normalize=False) + return Fraction(t // g2, s * (db // g2), _normalize=False) __sub__, __rsub__ = _operator_fallbacks(_sub, operator.sub) def _mul(a, b): """a * b""" @@ -396,11 +480,21 @@ __sub__, __rsub__ = _operator_fallbacks(_sub, operator.sub) def _mul(a, b): """a * b""" - return Fraction(a.numerator * b.numerator, a.denominator * b.denominator) + na, da = a.numerator, a.denominator + nb, db = b.numerator, b.denominator + g1 = math.gcd(na, db) + if g1 > 1: + na //= g1 + db //= g1 + g2 = math.gcd(nb, da) + if g2 > 1: + nb //= g2 + da //= g2 + return Fraction(na * nb, db * da, _normalize=False) __mul__, __rmul__ = _operator_fallbacks(_mul, operator.mul) def _div(a, b): """a / b""" @@ -402,10 +496,23 @@ __mul__, __rmul__ = _operator_fallbacks(_mul, operator.mul) def _div(a, b): """a / b""" - return Fraction(a.numerator * b.denominator, - a.denominator * b.numerator) + # Same as _mul(), with inversed b. + na, da = a.numerator, a.denominator + nb, db = b.numerator, b.denominator + g1 = math.gcd(na, nb) + if g1 > 1: + na //= g1 + nb //= g1 + g2 = math.gcd(db, da) + if g2 > 1: + da //= g2 + db //= g2 + n, d = na * db, nb * da + if d < 0: + n, d = -n, -d + return Fraction(n, d, _normalize=False) __truediv__, __rtruediv__ = _operator_fallbacks(_div, operator.truediv) diff --git a/Lib/gzip.py b/Lib/gzip.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2d6aXAucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2d6aXAucHk= 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -62,6 +62,7 @@ raise TypeError("filename must be a str or bytes object, or a file") if "t" in mode: + encoding = io.text_encoding(encoding) return io.TextIOWrapper(binary_file, encoding, errors, newline) else: return binary_file @@ -397,6 +398,10 @@ self._check_not_closed() return self._buffer.readline(size) + def __iter__(self): + self._check_not_closed() + return self._buffer.__iter__() + class _GzipReader(_compression.DecompressReader): def __init__(self, fp): diff --git a/Lib/hashlib.py b/Lib/hashlib.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2hhc2hsaWIucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2hhc2hsaWIucHk= 100644 --- a/Lib/hashlib.py +++ b/Lib/hashlib.py @@ -173,6 +173,7 @@ algorithms_available = algorithms_available.union( _hashlib.openssl_md_meth_names) except ImportError: + _hashlib = None new = __py_new __get_hash = __get_builtin_constructor diff --git a/Lib/hmac.py b/Lib/hmac.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2htYWMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2htYWMucHk= 100644 --- a/Lib/hmac.py +++ b/Lib/hmac.py @@ -8,6 +8,6 @@ import _hashlib as _hashopenssl except ImportError: _hashopenssl = None - _openssl_md_meths = None + _functype = None from _operator import _compare_digest as compare_digest else: @@ -12,4 +12,3 @@ from _operator import _compare_digest as compare_digest else: - _openssl_md_meths = frozenset(_hashopenssl.openssl_md_meth_names) compare_digest = _hashopenssl.compare_digest @@ -15,4 +14,6 @@ compare_digest = _hashopenssl.compare_digest + _functype = type(_hashopenssl.openssl_sha256) # builtin type + import hashlib as _hashlib trans_5C = bytes((x ^ 0x5C) for x in range(256)) @@ -23,7 +24,6 @@ digest_size = None - class HMAC: """RFC 2104 HMAC class. Also complies with RFC 4231. @@ -32,7 +32,7 @@ blocksize = 64 # 512-bit HMAC; can be changed in subclasses. __slots__ = ( - "_digest_cons", "_inner", "_outer", "block_size", "digest_size" + "_hmac", "_inner", "_outer", "block_size", "digest_size" ) def __init__(self, key, msg=None, digestmod=''): @@ -55,8 +55,9 @@ if not digestmod: raise TypeError("Missing required parameter 'digestmod'.") - if callable(digestmod): - self._digest_cons = digestmod - elif isinstance(digestmod, str): - self._digest_cons = lambda d=b'': _hashlib.new(digestmod, d) + if _hashopenssl and isinstance(digestmod, (str, _functype)): + try: + self._init_hmac(key, msg, digestmod) + except _hashopenssl.UnsupportedDigestmodError: + self._init_old(key, msg, digestmod) else: @@ -62,3 +63,8 @@ else: - self._digest_cons = lambda d=b'': digestmod.new(d) + self._init_old(key, msg, digestmod) + + def _init_hmac(self, key, msg, digestmod): + self._hmac = _hashopenssl.hmac_new(key, msg, digestmod=digestmod) + self.digest_size = self._hmac.digest_size + self.block_size = self._hmac.block_size @@ -64,6 +70,15 @@ - self._outer = self._digest_cons() - self._inner = self._digest_cons() + def _init_old(self, key, msg, digestmod): + if callable(digestmod): + digest_cons = digestmod + elif isinstance(digestmod, str): + digest_cons = lambda d=b'': _hashlib.new(digestmod, d) + else: + digest_cons = lambda d=b'': digestmod.new(d) + + self._hmac = None + self._outer = digest_cons() + self._inner = digest_cons() self.digest_size = self._inner.digest_size if hasattr(self._inner, 'block_size'): @@ -79,7 +94,10 @@ RuntimeWarning, 2) blocksize = self.blocksize + if len(key) > blocksize: + key = digest_cons(key).digest() + # self.blocksize is the default blocksize. self.block_size is # effective block size as well as the public API attribute. self.block_size = blocksize @@ -82,10 +100,7 @@ # self.blocksize is the default blocksize. self.block_size is # effective block size as well as the public API attribute. self.block_size = blocksize - if len(key) > blocksize: - key = self._digest_cons(key).digest() - key = key.ljust(blocksize, b'\0') self._outer.update(key.translate(trans_5C)) self._inner.update(key.translate(trans_36)) @@ -94,19 +109,10 @@ @property def name(self): - return "hmac-" + self._inner.name - - @property - def digest_cons(self): - return self._digest_cons - - @property - def inner(self): - return self._inner - - @property - def outer(self): - return self._outer + if self._hmac: + return self._hmac.name + else: + return f"hmac-{self._inner.name}" def update(self, msg): """Feed data from msg into this hashing object.""" @@ -110,7 +116,8 @@ def update(self, msg): """Feed data from msg into this hashing object.""" - self._inner.update(msg) + inst = self._hmac or self._inner + inst.update(msg) def copy(self): """Return a separate copy of this hashing object. @@ -119,5 +126,4 @@ """ # Call __new__ directly to avoid the expensive __init__. other = self.__class__.__new__(self.__class__) - other._digest_cons = self._digest_cons other.digest_size = self.digest_size @@ -123,6 +129,11 @@ other.digest_size = self.digest_size - other._inner = self._inner.copy() - other._outer = self._outer.copy() + if self._hmac: + other._hmac = self._hmac.copy() + other._inner = other._outer = None + else: + other._hmac = None + other._inner = self._inner.copy() + other._outer = self._outer.copy() return other def _current(self): @@ -130,9 +141,12 @@ To be used only internally with digest() and hexdigest(). """ - h = self._outer.copy() - h.update(self._inner.digest()) - return h + if self._hmac: + return self._hmac + else: + h = self._outer.copy() + h.update(self._inner.digest()) + return h def digest(self): """Return the hash value of this hashing object. @@ -179,9 +193,11 @@ A hashlib constructor returning a new hash object. *OR* A module supporting PEP 247. """ - if (_hashopenssl is not None and - isinstance(digest, str) and digest in _openssl_md_meths): - return _hashopenssl.hmac_digest(key, msg, digest) + if _hashopenssl is not None and isinstance(digest, (str, _functype)): + try: + return _hashopenssl.hmac_digest(key, msg, digest) + except _hashopenssl.UnsupportedDigestmodError: + pass if callable(digest): digest_cons = digest diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2lkbGVsaWIvaGVscC5odG1s..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2lkbGVsaWIvaGVscC5odG1s 100644 --- a/Lib/idlelib/help.html +++ b/Lib/idlelib/help.html @@ -5,7 +5,7 @@ <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> - <title>IDLE — Python 3.10.0a5 documentation</title> + <title>IDLE — Python 3.10.0a6 documentation</title> <link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> @@ -18,7 +18,7 @@ <script src="../_static/sidebar.js"></script> <link rel="search" type="application/opensearchdescription+xml" - title="Search within Python 3.10.0a5 documentation" + title="Search within Python 3.10.0a6 documentation" href="../_static/opensearch.xml"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="index" title="Index" href="../genindex.html" /> @@ -71,7 +71,7 @@ <li id="cpython-language-and-version"> - <a href="../index.html">3.10.0a5 Documentation</a> » + <a href="../index.html">3.10.0a6 Documentation</a> » </li> <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li> @@ -632,8 +632,15 @@ code execution process. A connection must be established whenever the Shell starts or restarts. (The latter is indicated by a divider line that says ‘RESTART’). If the user process fails to connect to the GUI process, it -displays a <code class="docutils literal notranslate"><span class="pre">Tk</span></code> error box with a ‘cannot connect’ message that directs the -user here. It then exits.</p> +usually displays a <code class="docutils literal notranslate"><span class="pre">Tk</span></code> error box with a ‘cannot connect’ message +that directs the user here. It then exits.</p> +<p>One specific connection failure on Unix systems results from +misconfigured masquerading rules somewhere in a system’s network setup. +When IDLE is started from a terminal, one will see a message starting +with <code class="docutils literal notranslate"><span class="pre">**</span> <span class="pre">Invalid</span> <span class="pre">host:</span></code>. +The valid value is <code class="docutils literal notranslate"><span class="pre">127.0.0.1</span> <span class="pre">(idlelib.rpc.LOCALHOST)</span></code>. +One can diagnose with <code class="docutils literal notranslate"><span class="pre">tcpconnect</span> <span class="pre">-irv</span> <span class="pre">127.0.0.1</span> <span class="pre">6543</span></code> in one +terminal window and <code class="docutils literal notranslate"><span class="pre">tcplisten</span> <span class="pre"><same</span> <span class="pre">args></span></code> in another.</p> <p>A common cause of failure is a user-written file with the same name as a standard library module, such as <em>random.py</em> and <em>tkinter.py</em>. When such a file is located in the same directory as a file that is about to be run, @@ -664,6 +671,12 @@ <p>If IDLE quits with no message, and it was not started from a console, try starting it from a console or terminal (<code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">idlelib</span></code>) and see if this results in an error message.</p> +<p>On Unix-based systems with tcl/tk older than <code class="docutils literal notranslate"><span class="pre">8.6.11</span></code> (see +<code class="docutils literal notranslate"><span class="pre">About</span> <span class="pre">IDLE</span></code>) certain characters of certain fonts can cause +a tk failure with a message to the terminal. This can happen either +if one starts IDLE to edit a file with such a character or later +when entering such a character. If one cannot upgrade tcl/tk, +then re-configure IDLE to use a font that works better.</p> </div> <div class="section" id="running-user-code"> <h3>Running user code<a class="headerlink" href="#running-user-code" title="Permalink to this headline">¶</a></h3> @@ -958,7 +971,7 @@ <li id="cpython-language-and-version"> - <a href="../index.html">3.10.0a5 Documentation</a> » + <a href="../index.html">3.10.0a6 Documentation</a> » </li> <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li> @@ -990,7 +1003,7 @@ <br /> <br /> - Last updated on Feb 23, 2021. + Last updated on Mar 29, 2021. <a href="https://docs.python.org/3/bugs.html">Found a bug</a>? <br /> diff --git a/Lib/imp.py b/Lib/imp.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2ltcC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2ltcC5weQ== 100644 --- a/Lib/imp.py +++ b/Lib/imp.py @@ -28,7 +28,8 @@ import types import warnings -warnings.warn("the imp module is deprecated in favour of importlib; " +warnings.warn("the imp module is deprecated in favour of importlib and slated " + "for removal in Python 3.12; " "see the module's documentation for alternative uses", DeprecationWarning, stacklevel=2) diff --git a/Lib/importlib/__init__.py b/Lib/importlib/__init__.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2ltcG9ydGxpYi9fX2luaXRfXy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2ltcG9ydGxpYi9fX2luaXRfXy5weQ== 100644 --- a/Lib/importlib/__init__.py +++ b/Lib/importlib/__init__.py @@ -78,8 +78,8 @@ This function is deprecated in favor of importlib.util.find_spec(). """ - warnings.warn('Deprecated since Python 3.4. ' - 'Use importlib.util.find_spec() instead.', + warnings.warn('Deprecated since Python 3.4 and slated for removal in ' + 'Python 3.10; use importlib.util.find_spec() instead', DeprecationWarning, stacklevel=2) try: loader = sys.modules[name].__loader__ diff --git a/Lib/importlib/_abc.py b/Lib/importlib/_abc.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2ltcG9ydGxpYi9fYWJjLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2ltcG9ydGxpYi9fYWJjLnB5 100644 --- a/Lib/importlib/_abc.py +++ b/Lib/importlib/_abc.py @@ -1,6 +1,7 @@ """Subset of importlib.abc used to reduce importlib.util imports.""" from . import _bootstrap import abc +import warnings class Loader(metaclass=abc.ABCMeta): @@ -47,5 +48,7 @@ This method is deprecated. """ + warnings.warn("importlib.abc.Loader.module_repr() is deprecated and " + "slated for removal in Python 3.12", DeprecationWarning) # The exception will cause ModuleType.__repr__ to ignore this method. raise NotImplementedError diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2ltcG9ydGxpYi9fYm9vdHN0cmFwLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2ltcG9ydGxpYi9fYm9vdHN0cmFwLnB5 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -275,7 +275,7 @@ def _load_module_shim(self, fullname): """Load the specified module into sys.modules and return it. - This method is deprecated. Use loader.exec_module instead. + This method is deprecated. Use loader.exec_module() instead. """ msg = ("the load_module() method is deprecated and slated for removal in " @@ -292,5 +292,5 @@ # Module specifications ####################################################### def _module_repr(module): - # The implementation of ModuleType.__repr__(). + """The implementation of ModuleType.__repr__().""" loader = getattr(module, '__loader__', None) @@ -296,9 +296,8 @@ loader = getattr(module, '__loader__', None) - if hasattr(loader, 'module_repr'): - # As soon as BuiltinImporter, FrozenImporter, and NamespaceLoader - # drop their implementations for module_repr. we can add a - # deprecation warning here. + if spec := getattr(module, "__spec__", None): + return _module_repr_from_spec(spec) + elif hasattr(loader, 'module_repr'): try: return loader.module_repr(module) except Exception: pass @@ -301,17 +300,8 @@ try: return loader.module_repr(module) except Exception: pass - try: - spec = module.__spec__ - except AttributeError: - pass - else: - if spec is not None: - return _module_repr_from_spec(spec) - - # We could use module.__class__.__name__ instead of 'module' in the - # various repr permutations. + # Fall through to a catch-all which always succeeds. try: name = module.__name__ except AttributeError: @@ -749,6 +739,8 @@ The method is deprecated. The import machinery does the job itself. """ + _warnings.warn("BuiltinImporter.module_repr() is deprecated and " + "slated for removal in Python 3.12", DeprecationWarning) return f'<module {module.__name__!r} ({BuiltinImporter._ORIGIN})>' @classmethod @@ -769,6 +761,9 @@ This method is deprecated. Use find_spec() instead. """ + _warnings.warn("BuiltinImporter.find_module() is deprecated and " + "slated for removal in Python 3.12; use find_spec() instead", + DeprecationWarning) spec = cls.find_spec(fullname, path) return spec.loader if spec is not None else None @@ -824,6 +819,8 @@ The method is deprecated. The import machinery does the job itself. """ + _warnings.warn("FrozenImporter.module_repr() is deprecated and " + "slated for removal in Python 3.12", DeprecationWarning) return '<module {!r} ({})>'.format(m.__name__, FrozenImporter._ORIGIN) @classmethod @@ -840,6 +837,9 @@ This method is deprecated. Use find_spec() instead. """ + _warnings.warn("FrozenImporter.find_module() is deprecated and " + "slated for removal in Python 3.12; use find_spec() instead", + DeprecationWarning) return cls if _imp.is_frozen(fullname) else None @staticmethod @@ -909,8 +909,9 @@ def _find_spec_legacy(finder, name, path): - # This would be a good place for a DeprecationWarning if - # we ended up going that route. + msg = (f"{_object_name(finder)}.find_spec() not found; " + "falling back to find_module()") + _warnings.warn(msg, ImportWarning) loader = finder.find_module(name, path) if loader is None: return None diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2ltcG9ydGxpYi9fYm9vdHN0cmFwX2V4dGVybmFsLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2ltcG9ydGxpYi9fYm9vdHN0cmFwX2V4dGVybmFsLnB5 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -45,6 +45,7 @@ # Assumption made in _path_join() assert all(len(sep) == 1 for sep in path_separators) path_sep = path_separators[0] +path_sep_tuple = tuple(path_separators) path_separators = ''.join(path_separators) _pathseps_with_colon = {f':{s}' for s in path_separators} @@ -91,11 +92,42 @@ return int.from_bytes(data, 'little') -def _path_join(*path_parts): - """Replacement for os.path.join().""" - return path_sep.join([part.rstrip(path_separators) - for part in path_parts if part]) +if _MS_WINDOWS: + def _path_join(*path_parts): + """Replacement for os.path.join().""" + if not path_parts: + return "" + if len(path_parts) == 1: + return path_parts[0] + root = "" + path = [] + for new_root, tail in map(_os._path_splitroot, path_parts): + if new_root.startswith(path_sep_tuple) or new_root.endswith(path_sep_tuple): + root = new_root.rstrip(path_separators) or root + path = [path_sep + tail] + elif new_root.endswith(':'): + if root.casefold() != new_root.casefold(): + # Drive relative paths have to be resolved by the OS, so we reset the + # tail but do not add a path_sep prefix. + root = new_root + path = [tail] + else: + path.append(tail) + else: + root = new_root or root + path.append(tail) + path = [p.rstrip(path_separators) for p in path if p] + if len(path) == 1 and not path[0]: + # Avoid losing the root's trailing separator when joining with nothing + return root + path_sep + return root + path_sep.join(path) + +else: + def _path_join(*path_parts): + """Replacement for os.path.join().""" + return path_sep.join([part.rstrip(path_separators) + for part in path_parts if part]) def _path_split(path): """Replacement for os.path.split().""" @@ -98,15 +130,11 @@ def _path_split(path): """Replacement for os.path.split().""" - if len(path_separators) == 1: - front, _, tail = path.rpartition(path_sep) - return front, tail - for x in reversed(path): - if x in path_separators: - front, tail = path.rsplit(x, maxsplit=1) - return front, tail - return '', path + i = max(path.rfind(p) for p in path_separators) + if i < 0: + return '', path + return path[:i], path[i + 1:] def _path_stat(path): @@ -140,6 +168,11 @@ return _path_is_mode_type(path, 0o040000) -def _path_isabs(path): - """Replacement for os.path.isabs. +if _MS_WINDOWS: + def _path_isabs(path): + """Replacement for os.path.isabs.""" + if not path: + return False + root = _os._path_splitroot(path)[0].replace('/', '\\') + return len(root) > 1 and (root.startswith('\\\\') or root.endswith('\\')) @@ -145,8 +178,8 @@ - Considers a Windows drive-relative path (no drive, but starts with slash) to - still be "absolute". - """ - return path.startswith(path_separators) or path[1:3] in _pathseps_with_colon +else: + def _path_isabs(path): + """Replacement for os.path.isabs.""" + return path.startswith(path_separators) def _write_atomic(path, data, mode=0o666): @@ -317,6 +350,8 @@ # Python 3.10a2 3432 (Function annotation for MAKE_FUNCTION is changed from dict to tuple bpo-42202) # Python 3.10a2 3433 (RERAISE restores f_lasti if oparg != 0) # Python 3.10a6 3434 (PEP 634: Structural Pattern Matching) +# Python 3.10a7 3435 Use instruction offsets (as opposed to byte offsets). +# Python 3.10b1 3436 (Add GEN_START bytecode #43683) # # MAGIC must change whenever the bytecode emitted by the compiler may no @@ -326,7 +361,7 @@ # Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array # in PC/launcher.c must also be updated. -MAGIC_NUMBER = (3434).to_bytes(2, 'little') + b'\r\n' +MAGIC_NUMBER = (3436).to_bytes(2, 'little') + b'\r\n' _RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c _PYCACHE = '__pycache__' @@ -534,6 +569,9 @@ This method is deprecated in favor of finder.find_spec(). """ + _warnings.warn("find_module() is deprecated and " + "slated for removal in Python 3.12; use find_spec() instead", + DeprecationWarning) # Call find_loader(). If it returns a string (indicating this # is a namespace package portion), generate a warning and # return None. @@ -705,6 +743,11 @@ pass else: location = _os.fspath(location) + if not _path_isabs(location): + try: + location = _path_join(_os.getcwd(), location) + except OSError: + pass # If the location is on the filesystem, but doesn't actually exist, # we could return None here, indicating that the location is not @@ -802,6 +845,6 @@ def find_module(cls, fullname, path=None): """Find module named in the registry. - This method is deprecated. Use exec_module() instead. + This method is deprecated. Use find_spec() instead. """ @@ -806,5 +849,8 @@ """ + _warnings.warn("WindowsRegistryFinder.find_module() is deprecated and " + "slated for removal in Python 3.12; use find_spec() instead", + DeprecationWarning) spec = cls.find_spec(fullname, path) if spec is not None: return spec.loader @@ -1233,6 +1279,8 @@ The method is deprecated. The import machinery does the job itself. """ + _warnings.warn("_NamespaceLoader.module_repr() is deprecated and " + "slated for removal in Python 3.12", DeprecationWarning) return '<module {!r} (namespace)>'.format(module.__name__) def is_package(self, fullname): @@ -1323,5 +1371,8 @@ # This would be a good place for a DeprecationWarning if # we ended up going that route. if hasattr(finder, 'find_loader'): + msg = (f"{_bootstrap._object_name(finder)}.find_spec() not found; " + "falling back to find_loader()") + _warnings.warn(msg, ImportWarning) loader, portions = finder.find_loader(fullname) else: @@ -1326,5 +1377,8 @@ loader, portions = finder.find_loader(fullname) else: + msg = (f"{_bootstrap._object_name(finder)}.find_spec() not found; " + "falling back to find_module()") + _warnings.warn(msg, ImportWarning) loader = finder.find_module(fullname) portions = [] if loader is not None: @@ -1397,6 +1451,9 @@ This method is deprecated. Use find_spec() instead. """ + _warnings.warn("PathFinder.find_module() is deprecated and " + "slated for removal in Python 3.12; use find_spec() instead", + DeprecationWarning) spec = cls.find_spec(fullname, path) if spec is None: return None @@ -1435,6 +1492,8 @@ self._loaders = loaders # Base (directory) path self.path = path or '.' + if not _path_isabs(self.path): + self.path = _path_join(_os.getcwd(), self.path) self._path_mtime = -1 self._path_cache = set() self._relaxed_path_cache = set() @@ -1452,6 +1511,9 @@ This method is deprecated. Use find_spec() instead. """ + _warnings.warn("FileFinder.find_loader() is deprecated and " + "slated for removal in Python 3.12; use find_spec() instead", + DeprecationWarning) spec = self.find_spec(fullname) if spec is None: return None, [] @@ -1497,7 +1559,10 @@ is_namespace = _path_isdir(base_path) # Check for a file w/ a proper suffix exists. for suffix, loader_class in self._loaders: - full_path = _path_join(self.path, tail_module + suffix) + try: + full_path = _path_join(self.path, tail_module + suffix) + except ValueError: + return None _bootstrap._verbose_message('trying {}', full_path, verbosity=2) if cache_module + suffix in cache: if _path_isfile(full_path): diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2ltcG9ydGxpYi9hYmMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2ltcG9ydGxpYi9hYmMucHk= 100644 --- a/Lib/importlib/abc.py +++ b/Lib/importlib/abc.py @@ -41,9 +41,15 @@ Deprecated since Python 3.3 """ + def __init__(self): + warnings.warn("the Finder ABC is deprecated and " + "slated for removal in Python 3.12; use MetaPathFinder " + "or PathEntryFinder instead", + DeprecationWarning) + @abc.abstractmethod def find_module(self, fullname, path=None): """An abstract method that should find a module. The fullname is a str and the optional path is a str or None. Returns a Loader object or None. """ @@ -44,8 +50,14 @@ @abc.abstractmethod def find_module(self, fullname, path=None): """An abstract method that should find a module. The fullname is a str and the optional path is a str or None. Returns a Loader object or None. """ + warnings.warn("importlib.abc.Finder along with its find_module() " + "method are deprecated and " + "slated for removal in Python 3.12; use " + "MetaPathFinder.find_spec() or " + "PathEntryFinder.find_spec() instead", + DeprecationWarning) @@ -50,6 +62,6 @@ -class MetaPathFinder(Finder): +class MetaPathFinder(metaclass=abc.ABCMeta): """Abstract base class for import finders on sys.meta_path.""" @@ -68,8 +80,8 @@ """ warnings.warn("MetaPathFinder.find_module() is deprecated since Python " - "3.4 in favor of MetaPathFinder.find_spec() " - "(available since 3.4)", + "3.4 in favor of MetaPathFinder.find_spec() and is " + "slated for removal in Python 3.12", DeprecationWarning, stacklevel=2) if not hasattr(self, 'find_spec'): @@ -86,7 +98,7 @@ machinery.PathFinder, machinery.WindowsRegistryFinder) -class PathEntryFinder(Finder): +class PathEntryFinder(metaclass=abc.ABCMeta): """Abstract base class for path entry finders used by PathFinder.""" diff --git a/Lib/importlib/util.py b/Lib/importlib/util.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2ltcG9ydGxpYi91dGlsLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2ltcG9ydGxpYi91dGlsLnB5 100644 --- a/Lib/importlib/util.py +++ b/Lib/importlib/util.py @@ -149,7 +149,8 @@ """ @functools.wraps(fxn) def set_package_wrapper(*args, **kwargs): - warnings.warn('The import system now takes care of this automatically.', + warnings.warn('The import system now takes care of this automatically; ' + 'this decorator is slated for removal in Python 3.12', DeprecationWarning, stacklevel=2) module = fxn(*args, **kwargs) if getattr(module, '__package__', None) is None: @@ -168,7 +169,8 @@ """ @functools.wraps(fxn) def set_loader_wrapper(self, *args, **kwargs): - warnings.warn('The import system now takes care of this automatically.', + warnings.warn('The import system now takes care of this automatically; ' + 'this decorator is slated for removal in Python 3.12', DeprecationWarning, stacklevel=2) module = fxn(self, *args, **kwargs) if getattr(module, '__loader__', None) is None: @@ -195,7 +197,8 @@ the second argument. """ - warnings.warn('The import system now takes care of this automatically.', + warnings.warn('The import system now takes care of this automatically; ' + 'this decorator is slated for removal in Python 3.12', DeprecationWarning, stacklevel=2) @functools.wraps(fxn) def module_for_loader_wrapper(self, fullname, *args, **kwargs): diff --git a/Lib/inspect.py b/Lib/inspect.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2luc3BlY3QucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2luc3BlY3QucHk= 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -2455,9 +2455,6 @@ KEYWORD_ONLY = 3 VAR_KEYWORD = 4 - def __str__(self): - return self._name_ - @property def description(self): return _PARAM_NAME_MAPPING[self] diff --git a/Lib/io.py b/Lib/io.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2lvLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2lvLnB5 100644 --- a/Lib/io.py +++ b/Lib/io.py @@ -54,5 +54,6 @@ from _io import (DEFAULT_BUFFER_SIZE, BlockingIOError, UnsupportedOperation, open, open_code, FileIO, BytesIO, StringIO, BufferedReader, BufferedWriter, BufferedRWPair, BufferedRandom, - IncrementalNewlineDecoder, TextIOWrapper) + IncrementalNewlineDecoder, text_encoding, TextIOWrapper) + @@ -58,5 +59,19 @@ -OpenWrapper = _io.open # for compatibility with _pyio +def __getattr__(name): + if name == "OpenWrapper": + # bpo-43680: Until Python 3.9, _pyio.open was not a static method and + # builtins.open was set to OpenWrapper to not become a bound method + # when set to a class variable. _io.open is a built-in function whereas + # _pyio.open is a Python function. In Python 3.10, _pyio.open() is now + # a static method, and builtins.open() is now io.open(). + import warnings + warnings.warn('OpenWrapper is deprecated, use open instead', + DeprecationWarning, stacklevel=2) + global OpenWrapper + OpenWrapper = open + return OpenWrapper + raise AttributeError(name) + # Pretend this exception was created here. UnsupportedOperation.__module__ = "io" diff --git a/Lib/lib2to3/pgen2/pgen.py b/Lib/lib2to3/pgen2/pgen.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2xpYjJ0bzMvcGdlbjIvcGdlbi5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2xpYjJ0bzMvcGdlbjIvcGdlbi5weQ== 100644 --- a/Lib/lib2to3/pgen2/pgen.py +++ b/Lib/lib2to3/pgen2/pgen.py @@ -12,7 +12,7 @@ def __init__(self, filename, stream=None): close_stream = None if stream is None: - stream = open(filename) + stream = open(filename, encoding="utf-8") close_stream = stream.close self.filename = filename self.stream = stream diff --git a/Lib/locale.py b/Lib/locale.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2xvY2FsZS5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2xvY2FsZS5weQ== 100644 --- a/Lib/locale.py +++ b/Lib/locale.py @@ -185,4 +185,10 @@ formatted = percent % ((value,) + additional) else: formatted = percent % value + if percent[-1] in 'eEfFgGdiu': + formatted = _localize(formatted, grouping, monetary) + return formatted + +# Transform formatted as locale number according to the locale settings +def _localize(formatted, grouping=False, monetary=False): # floats and decimal ints need special action! @@ -188,5 +194,5 @@ # floats and decimal ints need special action! - if percent[-1] in 'eEfFgG': + if '.' in formatted: seps = 0 parts = formatted.split('.') if grouping: @@ -196,7 +202,7 @@ formatted = decimal_point.join(parts) if seps: formatted = _strip_padding(formatted, seps) - elif percent[-1] in 'diu': + else: seps = 0 if grouping: formatted, seps = _group(formatted, monetary=monetary) @@ -267,7 +273,7 @@ raise ValueError("Currency formatting is not possible using " "the 'C' locale.") - s = _format('%%.%if' % digits, abs(val), grouping, monetary=True) + s = _localize(f'{abs(val):.{digits}f}', grouping, monetary=True) # '<' and '>' are markers if the sign must be inserted between symbol and value s = '<' + s + '>' @@ -323,6 +329,10 @@ string = string.replace(dd, '.') return string +def localize(string, grouping=False, monetary=False): + """Parses a string as locale number according to the locale settings.""" + return _localize(string, grouping, monetary) + def atof(string, func=float): "Parses a string as a float according to the locale settings." return func(delocalize(string)) diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2xvZ2dpbmcvX19pbml0X18ucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2xvZ2dpbmcvX19pbml0X18ucHk= 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -1150,6 +1150,8 @@ self.baseFilename = os.path.abspath(filename) self.mode = mode self.encoding = encoding + if "b" not in mode: + self.encoding = io.text_encoding(encoding) self.errors = errors self.delay = delay # bpo-26789: FileHandler keeps a reference to the builtin open() @@ -2022,5 +2024,5 @@ filename = kwargs.pop("filename", None) mode = kwargs.pop("filemode", 'a') if filename: - if 'b'in mode: + if 'b' in mode: errors = None @@ -2026,4 +2028,6 @@ errors = None + else: + encoding = io.text_encoding(encoding) h = FileHandler(filename, mode, encoding=encoding, errors=errors) else: diff --git a/Lib/logging/config.py b/Lib/logging/config.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2xvZ2dpbmcvY29uZmlnLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2xvZ2dpbmcvY29uZmlnLnB5 100644 --- a/Lib/logging/config.py +++ b/Lib/logging/config.py @@ -48,7 +48,7 @@ # _listener holds the server object doing the listening _listener = None -def fileConfig(fname, defaults=None, disable_existing_loggers=True): +def fileConfig(fname, defaults=None, disable_existing_loggers=True, encoding=None): """ Read the logging configuration from a ConfigParser-format file. @@ -66,7 +66,8 @@ if hasattr(fname, 'readline'): cp.read_file(fname) else: - cp.read(fname) + encoding = io.text_encoding(encoding) + cp.read(fname, encoding=encoding) formatters = _create_formatters(cp) diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2xvZ2dpbmcvaGFuZGxlcnMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2xvZ2dpbmcvaGFuZGxlcnMucHk= 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -23,7 +23,7 @@ To use, simply 'import logging.handlers' and log away! """ -import logging, socket, os, pickle, struct, time, re +import io, logging, socket, os, pickle, struct, time, re from stat import ST_DEV, ST_INO, ST_MTIME import queue import threading @@ -150,6 +150,8 @@ # on each run. if maxBytes > 0: mode = 'a' + if "b" not in mode: + encoding = io.text_encoding(encoding) BaseRotatingHandler.__init__(self, filename, mode, encoding=encoding, delay=delay, errors=errors) self.maxBytes = maxBytes @@ -205,6 +207,7 @@ def __init__(self, filename, when='h', interval=1, backupCount=0, encoding=None, delay=False, utc=False, atTime=None, errors=None): + encoding = io.text_encoding(encoding) BaseRotatingHandler.__init__(self, filename, 'a', encoding=encoding, delay=delay, errors=errors) self.when = when.upper() @@ -442,6 +445,8 @@ """ def __init__(self, filename, mode='a', encoding=None, delay=False, errors=None): + if "b" not in mode: + encoding = io.text_encoding(encoding) logging.FileHandler.__init__(self, filename, mode=mode, encoding=encoding, delay=delay, errors=errors) diff --git a/Lib/lzma.py b/Lib/lzma.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL2x6bWEucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL2x6bWEucHk= 100644 --- a/Lib/lzma.py +++ b/Lib/lzma.py @@ -221,6 +221,10 @@ self._check_can_read() return self._buffer.readline(size) + def __iter__(self): + self._check_can_read() + return self._buffer.__iter__() + def write(self, data): """Write a bytes object to the file. @@ -302,6 +306,7 @@ preset=preset, filters=filters) if "t" in mode: + encoding = io.text_encoding(encoding) return io.TextIOWrapper(binary_file, encoding, errors, newline) else: return binary_file diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL21pbWV0eXBlcy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL21pbWV0eXBlcy5weQ== 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -505,6 +505,8 @@ '.jpg' : 'image/jpeg', '.jpe' : 'image/jpeg', '.jpeg' : 'image/jpeg', + '.heic' : 'image/heic', + '.heif' : 'image/heif', '.png' : 'image/png', '.svg' : 'image/svg+xml', '.tiff' : 'image/tiff', diff --git a/Lib/multiprocessing/util.py b/Lib/multiprocessing/util.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL211bHRpcHJvY2Vzc2luZy91dGlsLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL211bHRpcHJvY2Vzc2luZy91dGlsLnB5 100644 --- a/Lib/multiprocessing/util.py +++ b/Lib/multiprocessing/util.py @@ -419,7 +419,7 @@ try: fd = os.open(os.devnull, os.O_RDONLY) try: - sys.stdin = open(fd, closefd=False) + sys.stdin = open(fd, encoding="utf-8", closefd=False) except: os.close(fd) raise diff --git a/Lib/ntpath.py b/Lib/ntpath.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL250cGF0aC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL250cGF0aC5weQ== 100644 --- a/Lib/ntpath.py +++ b/Lib/ntpath.py @@ -312,6 +312,22 @@ drive = '' userhome = join(drive, os.environ['HOMEPATH']) + if i != 1: #~user + target_user = path[1:i] + if isinstance(target_user, bytes): + target_user = os.fsdecode(target_user) + current_user = os.environ.get('USERNAME') + + if target_user != current_user: + # Try to guess user home directory. By default all user + # profile directories are located in the same place and are + # named by corresponding usernames. If userhome isn't a + # normal profile directory, this guess is likely wrong, + # so we bail out. + if current_user != basename(userhome): + return path + userhome = join(dirname(userhome), target_user) + if isinstance(path, bytes): userhome = os.fsencode(userhome) @@ -315,9 +331,6 @@ if isinstance(path, bytes): userhome = os.fsencode(userhome) - if i != 1: #~user - userhome = join(dirname(userhome), path[1:i]) - return userhome + path[i:] diff --git a/Lib/opcode.py b/Lib/opcode.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL29wY29kZS5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL29wY29kZS5weQ== 100644 --- a/Lib/opcode.py +++ b/Lib/opcode.py @@ -173,6 +173,7 @@ def_op('DELETE_FAST', 126) # Local variable number haslocal.append(126) +def_op('GEN_START', 129) # Kind of generator/coroutine def_op('RAISE_VARARGS', 130) # Number of raise arguments (1, 2, or 3) def_op('CALL_FUNCTION', 131) # #args def_op('MAKE_FUNCTION', 132) # Flags diff --git a/Lib/os.py b/Lib/os.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL29zLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL29zLnB5 100644 --- a/Lib/os.py +++ b/Lib/os.py @@ -1051,7 +1051,7 @@ __all__.append("popen") # Supply os.fdopen() -def fdopen(fd, *args, **kwargs): +def fdopen(fd, mode="r", buffering=-1, encoding=None, *args, **kwargs): if not isinstance(fd, int): raise TypeError("invalid fd type (%s, expected integer)" % type(fd)) import io @@ -1055,7 +1055,9 @@ if not isinstance(fd, int): raise TypeError("invalid fd type (%s, expected integer)" % type(fd)) import io - return io.open(fd, *args, **kwargs) + if "b" not in mode: + encoding = io.text_encoding(encoding) + return io.open(fd, mode, buffering, encoding, *args, **kwargs) # For testing purposes, make sure the function is available when the C diff --git a/Lib/pathlib.py b/Lib/pathlib.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3BhdGhsaWIucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3BhdGhsaWIucHk= 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -15,5 +15,4 @@ from errno import EPERM -supports_symlinks = True if os.name == 'nt': @@ -19,8 +18,3 @@ if os.name == 'nt': - import nt - if sys.getwindowsversion()[:2] >= (6, 0): - from nt import _getfinalpathname - else: - supports_symlinks = False - _getfinalpathname = None + from nt import _getfinalpathname else: @@ -26,5 +20,5 @@ else: - nt = None + _getfinalpathname = None __all__ = [ @@ -195,7 +189,7 @@ def resolve(self, path, strict=False): s = str(path) if not s: - return os.getcwd() + return path._accessor.getcwd() previous_s = None if _getfinalpathname is not None: if strict: @@ -254,34 +248,6 @@ # It's a path on a network drive => 'file://host/share/a/b' return 'file:' + urlquote_from_bytes(path.as_posix().encode('utf-8')) - def gethomedir(self, username): - if 'USERPROFILE' in os.environ: - userhome = os.environ['USERPROFILE'] - elif 'HOMEPATH' in os.environ: - try: - drv = os.environ['HOMEDRIVE'] - except KeyError: - drv = '' - userhome = drv + os.environ['HOMEPATH'] - else: - raise RuntimeError("Can't determine home directory") - - if username: - # Try to guess user home directory. By default all users - # directories are located in the same place and are named by - # corresponding usernames. If current user home directory points - # to nonstandard place, this guess is likely wrong. - if os.environ['USERNAME'] != username: - drv, root, parts = self.parse_parts((userhome,)) - if parts[-1] != os.environ['USERNAME']: - raise RuntimeError("Can't determine home directory " - "for %r" % username) - parts[-1] = username - if drv or root: - userhome = drv + root + self.join(parts[1:]) - else: - userhome = self.join(parts) - return userhome class _PosixFlavour(_Flavour): sep = '/' @@ -364,7 +330,7 @@ return path # NOTE: according to POSIX, getcwd() cannot contain path components # which are symlinks. - base = '' if path.is_absolute() else os.getcwd() + base = '' if path.is_absolute() else accessor.getcwd() return _resolve(base, str(path)) or sep def is_reserved(self, parts): @@ -376,21 +342,6 @@ bpath = bytes(path) return 'file://' + urlquote_from_bytes(bpath) - def gethomedir(self, username): - if not username: - try: - return os.environ['HOME'] - except KeyError: - import pwd - return pwd.getpwuid(os.getuid()).pw_dir - else: - import pwd - try: - return pwd.getpwnam(username).pw_dir - except KeyError: - raise RuntimeError("Can't determine home directory " - "for %r" % username) - _windows_flavour = _WindowsFlavour() _posix_flavour = _PosixFlavour() @@ -405,9 +356,7 @@ stat = os.stat - lstat = os.lstat - - open = os.open + open = io.open listdir = os.listdir @@ -415,14 +364,8 @@ chmod = os.chmod - if hasattr(os, "lchmod"): - lchmod = os.lchmod - else: - def lchmod(self, pathobj, mode): - raise NotImplementedError("lchmod() not available on this system") - mkdir = os.mkdir unlink = os.unlink if hasattr(os, "link"): @@ -424,7 +367,7 @@ mkdir = os.mkdir unlink = os.unlink if hasattr(os, "link"): - link_to = os.link + link = os.link else: @@ -430,6 +373,5 @@ else: - @staticmethod - def link_to(self, target): + def link(self, src, dst): raise NotImplementedError("os.link() not available on this system") rmdir = os.rmdir @@ -438,10 +380,6 @@ replace = os.replace - if nt: - if supports_symlinks: - symlink = os.symlink - else: - def symlink(a, b, target_is_directory): - raise NotImplementedError("symlink() not available on this system") + if hasattr(os, "symlink"): + symlink = os.symlink else: @@ -447,6 +385,4 @@ else: - # Under POSIX, os.symlink() takes two args - @staticmethod - def symlink(a, b, target_is_directory): - return os.symlink(a, b) + def symlink(self, src, dst, target_is_directory=False): + raise NotImplementedError("os.symlink() not available on this system") @@ -452,3 +388,19 @@ - utime = os.utime + def touch(self, path, mode=0o666, exist_ok=True): + if exist_ok: + # First try to bump modification time + # Implementation note: GNU touch uses the UTIME_NOW option of + # the utimensat() / futimens() functions. + try: + os.utime(path, None) + except OSError: + # Avoid exception chaining + pass + else: + return + flags = os.O_CREAT | os.O_WRONLY + if not exist_ok: + flags |= os.O_EXCL + fd = os.open(path, flags, mode) + os.close(fd) @@ -454,7 +406,9 @@ - # Helper for resolve() - def readlink(self, path): - return os.readlink(path) + if hasattr(os, "readlink"): + readlink = os.readlink + else: + def readlink(self, path): + raise NotImplementedError("os.readlink() not available on this system") def owner(self, path): try: @@ -470,6 +424,10 @@ except ImportError: raise NotImplementedError("Path.group() is unsupported on this system") + getcwd = os.getcwd + + expanduser = staticmethod(os.path.expanduser) + _normal_accessor = _NormalAccessor() @@ -698,7 +656,7 @@ return cls._flavour.parse_parts(parts) @classmethod - def _from_parts(cls, args, init=True): + def _from_parts(cls, args): # We need to call _parse_args on the instance, so as to get the # right flavour. self = object.__new__(cls) @@ -706,8 +664,6 @@ self._drv = drv self._root = root self._parts = parts - if init: - self._init() return self @classmethod @@ -711,8 +667,8 @@ return self @classmethod - def _from_parsed_parts(cls, drv, root, parts, init=True): + def _from_parsed_parts(cls, drv, root, parts): self = object.__new__(cls) self._drv = drv self._root = root self._parts = parts @@ -715,9 +671,7 @@ self = object.__new__(cls) self._drv = drv self._root = root self._parts = parts - if init: - self._init() return self @classmethod @@ -727,10 +681,6 @@ else: return cls._flavour.join(parts) - def _init(self): - # Overridden in concrete Path - pass - def _make_child(self, args): drv, root, parts = self._parse_args(args) drv, root, parts = self._flavour.join_parsed_parts( @@ -1070,10 +1020,9 @@ object. You can also instantiate a PosixPath or WindowsPath directly, but cannot instantiate a WindowsPath on a POSIX system or vice versa. """ - __slots__ = ( - '_accessor', - ) + _accessor = _normal_accessor + __slots__ = () def __new__(cls, *args, **kwargs): if cls is Path: cls = WindowsPath if os.name == 'nt' else PosixPath @@ -1076,8 +1025,8 @@ def __new__(cls, *args, **kwargs): if cls is Path: cls = WindowsPath if os.name == 'nt' else PosixPath - self = cls._from_parts(args, init=False) + self = cls._from_parts(args) if not self._flavour.is_supported: raise NotImplementedError("cannot instantiate %r on your system" % (cls.__name__,)) @@ -1081,6 +1030,5 @@ if not self._flavour.is_supported: raise NotImplementedError("cannot instantiate %r on your system" % (cls.__name__,)) - self._init() return self @@ -1085,14 +1033,5 @@ return self - def _init(self, - # Private non-constructor arguments - template=None, - ): - if template is not None: - self._accessor = template._accessor - else: - self._accessor = _normal_accessor - def _make_child_relpath(self, part): # This is an optimization used for dir walking. `part` must be # a single part relative to this path. @@ -1113,17 +1052,6 @@ # removed in the future. pass - def _opener(self, name, flags, mode=0o666): - # A stub for the opener argument to built-in open() - return self._accessor.open(self, flags, mode) - - def _raw_open(self, flags, mode=0o777): - """ - Open the file pointed by this path and return a file descriptor, - as os.open() does. - """ - return self._accessor.open(self, flags, mode) - # Public API @classmethod @@ -1131,10 +1059,10 @@ """Return a new path pointing to the current working directory (as returned by os.getcwd()). """ - return cls(os.getcwd()) + return cls(cls()._accessor.getcwd()) @classmethod def home(cls): """Return a new path pointing to the user's home directory (as returned by os.path.expanduser('~')). """ @@ -1135,10 +1063,10 @@ @classmethod def home(cls): """Return a new path pointing to the user's home directory (as returned by os.path.expanduser('~')). """ - return cls(cls()._flavour.gethomedir(None)) + return cls("~").expanduser() def samefile(self, other_path): """Return whether other_path is the same or not as this file @@ -1200,9 +1128,7 @@ return self # FIXME this must defer to the specific flavour (and, under Windows, # use nt._getfullpathname()) - obj = self._from_parts([os.getcwd()] + self._parts, init=False) - obj._init(template=self) - return obj + return self._from_parts([self._accessor.getcwd()] + self._parts) def resolve(self, strict=False): """ @@ -1218,7 +1144,5 @@ s = str(self.absolute()) # Now we have no symlinks in the path, it's safe to normalize it. normed = self._flavour.pathmod.normpath(s) - obj = self._from_parts((normed,), init=False) - obj._init(template=self) - return obj + return self._from_parts((normed,)) @@ -1224,6 +1148,6 @@ - def stat(self): + def stat(self, *, follow_symlinks=True): """ Return the result of the stat() system call on this path, like os.stat() does. """ @@ -1226,8 +1150,8 @@ """ Return the result of the stat() system call on this path, like os.stat() does. """ - return self._accessor.stat(self) + return self._accessor.stat(self, follow_symlinks=follow_symlinks) def owner(self): """ @@ -1247,8 +1171,10 @@ Open the file pointed by this path and return a file object, as the built-in open() function does. """ - return io.open(self, mode, buffering, encoding, errors, newline, - opener=self._opener) + if "b" not in mode: + encoding = io.text_encoding(encoding) + return self._accessor.open(self, mode, buffering, encoding, errors, + newline) def read_bytes(self): """ @@ -1261,6 +1187,7 @@ """ Open the file in text mode, read it, and close the file. """ + encoding = io.text_encoding(encoding) with self.open(mode='r', encoding=encoding, errors=errors) as f: return f.read() @@ -1280,6 +1207,7 @@ if not isinstance(data, str): raise TypeError('data must be str, not %s' % data.__class__.__name__) + encoding = io.text_encoding(encoding) with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f: return f.write(data) @@ -1288,11 +1216,9 @@ Return the path to which the symbolic link points. """ path = self._accessor.readlink(self) - obj = self._from_parts((path,), init=False) - obj._init(template=self) - return obj + return self._from_parts((path,)) def touch(self, mode=0o666, exist_ok=True): """ Create this file with the given access mode, if it doesn't exist. """ @@ -1294,24 +1220,9 @@ def touch(self, mode=0o666, exist_ok=True): """ Create this file with the given access mode, if it doesn't exist. """ - if exist_ok: - # First try to bump modification time - # Implementation note: GNU touch uses the UTIME_NOW option of - # the utimensat() / futimens() functions. - try: - self._accessor.utime(self, None) - except OSError: - # Avoid exception chaining - pass - else: - return - flags = os.O_CREAT | os.O_WRONLY - if not exist_ok: - flags |= os.O_EXCL - fd = self._raw_open(flags, mode) - os.close(fd) + self._accessor.touch(self, mode, exist_ok) def mkdir(self, mode=0o777, parents=False, exist_ok=False): """ @@ -1330,7 +1241,7 @@ if not exist_ok or not self.is_dir(): raise - def chmod(self, mode): + def chmod(self, mode, *, follow_symlinks=True): """ Change the permissions of the path, like os.chmod(). """ @@ -1334,10 +1245,10 @@ """ Change the permissions of the path, like os.chmod(). """ - self._accessor.chmod(self, mode) + self._accessor.chmod(self, mode, follow_symlinks=follow_symlinks) def lchmod(self, mode): """ Like chmod(), except if the path points to a symlink, the symlink's permissions are changed, rather than its target's. """ @@ -1338,10 +1249,10 @@ def lchmod(self, mode): """ Like chmod(), except if the path points to a symlink, the symlink's permissions are changed, rather than its target's. """ - self._accessor.lchmod(self, mode) + self.chmod(mode, follow_symlinks=False) def unlink(self, missing_ok=False): """ @@ -1365,13 +1276,7 @@ Like stat(), except if the path points to a symlink, the symlink's status information is returned, rather than its target's. """ - return self._accessor.lstat(self) - - def link_to(self, target): - """ - Create a hard link pointing to a path named target. - """ - self._accessor.link_to(self, target) + return self.stat(follow_symlinks=False) def rename(self, target): """ @@ -1401,8 +1306,8 @@ def symlink_to(self, target, target_is_directory=False): """ - Make this path a symlink pointing to the given path. - Note the order of arguments (self, target) is the reverse of os.symlink's. + Make this path a symlink pointing to the target path. + Note the order of arguments (link, target) is the reverse of os.symlink. """ self._accessor.symlink(target, self, target_is_directory) @@ -1406,6 +1311,18 @@ """ self._accessor.symlink(target, self, target_is_directory) + def link_to(self, target): + """ + Make the target path a hard link pointing to this path. + + Note this function does not make this path a hard link to *target*, + despite the implication of the function and argument names. The order + of arguments (target, link) is the reverse of Path.symlink_to, but + matches that of os.link. + + """ + self._accessor.link(self, target) + # Convenience functions for querying the stat results def exists(self): @@ -1561,7 +1478,9 @@ """ if (not (self._drv or self._root) and self._parts and self._parts[0][:1] == '~'): - homedir = self._flavour.gethomedir(self._parts[0][1:]) + homedir = self._accessor.expanduser(self._parts[0]) + if homedir[:1] == "~": + raise RuntimeError("Could not determine home directory.") return self._from_parts([homedir] + self._parts[1:]) return self diff --git a/Lib/pdb.py b/Lib/pdb.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3BkYi5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3BkYi5weQ== 100755 --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -1708,7 +1708,7 @@ print("The program finished and will be restarted") except Restart: print("Restarting", mainpyfile, "with arguments:") - print("\t" + " ".join(args)) + print("\t" + " ".join(sys.argv[1:])) except SystemExit: # In most cases SystemExit does not warrant a post-mortem session. print("The program exited via sys.exit(). Exit status:", end=' ') diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3BrZ3V0aWwucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3BrZ3V0aWwucHk= 100644 --- a/Lib/pkgutil.py +++ b/Lib/pkgutil.py @@ -204,7 +204,8 @@ def __init__(self, path=None): global imp - warnings.warn("This emulation is deprecated, use 'importlib' instead", + warnings.warn("This emulation is deprecated and slated for removal " + "in Python 3.12; use 'importlib' instead", DeprecationWarning) _import_imp() self.path = path @@ -271,7 +272,8 @@ code = source = None def __init__(self, fullname, file, filename, etc): - warnings.warn("This emulation is deprecated, use 'importlib' instead", + warnings.warn("This emulation is deprecated and slated for removal in " + "Python 3.12; use 'importlib' instead", DeprecationWarning) _import_imp() self.file = file diff --git a/Lib/plistlib.py b/Lib/plistlib.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3BsaXN0bGliLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3BsaXN0bGliLnB5 100644 --- a/Lib/plistlib.py +++ b/Lib/plistlib.py @@ -61,8 +61,7 @@ from xml.parsers.expat import ParserCreate -PlistFormat = enum.Enum('PlistFormat', 'FMT_XML FMT_BINARY', module=__name__) -globals().update(PlistFormat.__members__) +PlistFormat = enum.global_enum(enum.Enum('PlistFormat', 'FMT_XML FMT_BINARY', module=__name__)) class UID: diff --git a/Lib/pprint.py b/Lib/pprint.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3BwcmludC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3BwcmludC5weQ== 100644 --- a/Lib/pprint.py +++ b/Lib/pprint.py @@ -35,6 +35,7 @@ """ import collections as _collections +import dataclasses as _dataclasses import re import sys as _sys import types as _types @@ -45,7 +46,7 @@ def pprint(object, stream=None, indent=1, width=80, depth=None, *, - compact=False, sort_dicts=True): + compact=False, sort_dicts=True, underscore_numbers=False): """Pretty-print a Python object to a stream [default is sys.stdout].""" printer = PrettyPrinter( stream=stream, indent=indent, width=width, depth=depth, @@ -49,7 +50,7 @@ """Pretty-print a Python object to a stream [default is sys.stdout].""" printer = PrettyPrinter( stream=stream, indent=indent, width=width, depth=depth, - compact=compact, sort_dicts=sort_dicts) + compact=compact, sort_dicts=sort_dicts, underscore_numbers=False) printer.pprint(object) def pformat(object, indent=1, width=80, depth=None, *, @@ -53,6 +54,6 @@ printer.pprint(object) def pformat(object, indent=1, width=80, depth=None, *, - compact=False, sort_dicts=True): + compact=False, sort_dicts=True, underscore_numbers=False): """Format a Python object into a pretty-printed representation.""" return PrettyPrinter(indent=indent, width=width, depth=depth, @@ -57,6 +58,7 @@ """Format a Python object into a pretty-printed representation.""" return PrettyPrinter(indent=indent, width=width, depth=depth, - compact=compact, sort_dicts=sort_dicts).pformat(object) + compact=compact, sort_dicts=sort_dicts, + underscore_numbers=underscore_numbers).pformat(object) def pp(object, *args, sort_dicts=False, **kwargs): """Pretty-print a Python object""" @@ -102,7 +104,7 @@ class PrettyPrinter: def __init__(self, indent=1, width=80, depth=None, stream=None, *, - compact=False, sort_dicts=True): + compact=False, sort_dicts=True, underscore_numbers=False): """Handle pretty printing operations onto a stream using a set of configured parameters. @@ -143,6 +145,7 @@ self._stream = _sys.stdout self._compact = bool(compact) self._sort_dicts = sort_dicts + self._underscore_numbers = underscore_numbers def pprint(self, object): self._format(object, self._stream, 0, 0, {}, 0) @@ -176,5 +179,15 @@ p(self, object, stream, indent, allowance, context, level + 1) del context[objid] return + elif (_dataclasses.is_dataclass(object) and + not isinstance(object, type) and + object.__dataclass_params__.repr and + # Check dataclass has generated repr method. + hasattr(object.__repr__, "__wrapped__") and + "__create_fn__" in object.__repr__.__wrapped__.__qualname__): + context[objid] = 1 + self._pprint_dataclass(object, stream, indent, allowance, context, level + 1) + del context[objid] + return stream.write(rep) @@ -179,5 +192,13 @@ stream.write(rep) + def _pprint_dataclass(self, object, stream, indent, allowance, context, level): + cls_name = object.__class__.__name__ + indent += len(cls_name) + 1 + items = [(f.name, getattr(object, f.name)) for f in _dataclasses.fields(object) if f.repr] + stream.write(cls_name + '(') + self._format_namespace_items(items, stream, indent, allowance, context, level) + stream.write(')') + _dispatch = {} def _pprint_dict(self, object, stream, indent, allowance, context, level): @@ -344,5 +365,4 @@ else: cls_name = object.__class__.__name__ indent += len(cls_name) + 1 - delimnl = ',\n' + ' ' * indent items = object.__dict__.items() @@ -348,4 +368,2 @@ items = object.__dict__.items() - last_index = len(items) - 1 - stream.write(cls_name + '(') @@ -351,14 +369,5 @@ stream.write(cls_name + '(') - for i, (key, ent) in enumerate(items): - stream.write(key) - stream.write('=') - - last = i == last_index - self._format(ent, stream, indent + len(key) + 1, - allowance if last else 1, - context, level) - if not last: - stream.write(delimnl) + self._format_namespace_items(items, stream, indent, allowance, context, level) stream.write(')') _dispatch[_types.SimpleNamespace.__repr__] = _pprint_simplenamespace @@ -380,6 +389,25 @@ if not last: write(delimnl) + def _format_namespace_items(self, items, stream, indent, allowance, context, level): + write = stream.write + delimnl = ',\n' + ' ' * indent + last_index = len(items) - 1 + for i, (key, ent) in enumerate(items): + last = i == last_index + write(key) + write('=') + if id(ent) in context: + # Special-case representation of recursion to match standard + # recursive dataclass repr. + write("...") + else: + self._format(ent, stream, indent + len(key) + 1, + allowance if last else 1, + context, level) + if not last: + write(delimnl) + def _format_items(self, items, stream, indent, allowance, context, level): write = stream.write indent += self._indent_per_level @@ -525,6 +553,13 @@ return repr(object), True, False r = getattr(typ, "__repr__", None) + + if issubclass(typ, int) and r is int.__repr__: + if self._underscore_numbers: + return f"{object:_d}", True, False + else: + return repr(object), True, False + if issubclass(typ, dict) and r is dict.__repr__: if not object: return "{}", True, False @@ -592,7 +627,7 @@ rep = repr(object) return rep, (rep and not rep.startswith('<')), False -_builtin_scalars = frozenset({str, bytes, bytearray, int, float, complex, +_builtin_scalars = frozenset({str, bytes, bytearray, float, complex, bool, type(None)}) def _recursion(object): diff --git a/Lib/pydoc.py b/Lib/pydoc.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3B5ZG9jLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3B5ZG9jLnB5 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -2461,9 +2461,6 @@ %s</head><body bgcolor="#f0f0f8">%s<div style="clear:both;padding-top:.5em;">%s</div> </body></html>''' % (title, css_link, html_navbar(), contents) - def filelink(self, url, path): - return '<a href="getfile?key=%s">%s</a>' % (url, path) - html = _HTMLDoc() @@ -2549,19 +2546,6 @@ 'key = %s' % key, '#ffffff', '#ee77aa', '<br>'.join(results)) return 'Search Results', contents - def html_getfile(path): - """Get and display a source file listing safely.""" - path = urllib.parse.unquote(path) - with tokenize.open(path) as fp: - lines = html.escape(fp.read()) - body = '<pre>%s</pre>' % lines - heading = html.heading( - '<big><big><strong>File Listing</strong></big></big>', - '#ffffff', '#7799ee') - contents = heading + html.bigsection( - 'File: %s' % path, '#ffffff', '#ee77aa', body) - return 'getfile %s' % path, contents - def html_topics(): """Index of topic texts available.""" @@ -2653,8 +2637,6 @@ op, _, url = url.partition('=') if op == "search?key": title, content = html_search(url) - elif op == "getfile?key": - title, content = html_getfile(url) elif op == "topic?key": # try topics first, then objects. try: diff --git a/Lib/pydoc_data/topics.py b/Lib/pydoc_data/topics.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3B5ZG9jX2RhdGEvdG9waWNzLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3B5ZG9jX2RhdGEvdG9waWNzLnB5 100644 --- a/Lib/pydoc_data/topics.py +++ b/Lib/pydoc_data/topics.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Autogenerated by Sphinx on Mon Mar 1 16:48:51 2021 +# Autogenerated by Sphinx on Mon Apr 5 17:39:41 2021 topics = {'assert': 'The "assert" statement\n' '**********************\n' '\n' @@ -5782,9 +5782,11 @@ '"Formatter",\n' 'subclasses can define their own format string syntax). The ' 'syntax is\n' - 'related to that of formatted string literals, but there ' - 'are\n' - 'differences.\n' + 'related to that of formatted string literals, but it is ' + 'less\n' + 'sophisticated and, in particular, does not support ' + 'arbitrary\n' + 'expressions.\n' '\n' 'Format strings contain “replacement fields” surrounded by ' 'curly braces\n' @@ -5978,7 +5980,7 @@ 'character that can be any character and defaults to a space ' 'if\n' 'omitted. It is not possible to use a literal curly brace ' - '(“"{"” or\n' + '(”"{"” or\n' '“"}"”) as the *fill* character in a formatted string ' 'literal or when\n' 'using the "str.format()" method. However, it is possible ' @@ -7676,7 +7678,7 @@ '\n' 'Note that numeric literals do not include a sign; a phrase like ' '"-1"\n' - 'is actually an expression composed of the unary operator ‘"-"‘ ' + 'is actually an expression composed of the unary operator ‘"-"’ ' 'and the\n' 'literal "1".\n', 'numeric-types': 'Emulating numeric types\n' @@ -13956,5 +13958,5 @@ '| "s + t" | the concatenation of *s* and *t* ' '| (6)(7) |\n' '+----------------------------+----------------------------------+------------+\n' - '| "s * n" or "n * s" | equivalent to *n* copies of the ' + '| "s * n" or "n * s" | equivalent to adding *s* to ' '| (2)(7) |\n' @@ -13960,5 +13962,5 @@ '| (2)(7) |\n' - '| | *s* sequence ' + '| | itself *n* times ' '| |\n' '+----------------------------+----------------------------------+------------+\n' '| "s[i]" | *i*th item of *s*, origin 0 ' diff --git a/Lib/re.py b/Lib/re.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3JlLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3JlLnB5 100644 --- a/Lib/re.py +++ b/Lib/re.py @@ -142,6 +142,7 @@ __version__ = "2.2.1" +@enum.global_enum class RegexFlag(enum.IntFlag, boundary=enum.KEEP): ASCII = A = sre_compile.SRE_FLAG_ASCII # assume ascii "locale" IGNORECASE = I = sre_compile.SRE_FLAG_IGNORECASE # ignore case @@ -154,22 +155,6 @@ TEMPLATE = T = sre_compile.SRE_FLAG_TEMPLATE # disable backtracking DEBUG = sre_compile.SRE_FLAG_DEBUG # dump pattern after compilation - def __repr__(self): - res = '' - if self._name_: - member_names = self._name_.split('|') - constant = None - if member_names[-1].startswith('0x'): - constant = member_names.pop() - res = 're.' + '|re.'.join(member_names) - if constant: - res += '|%s' % constant - return res - - __str__ = object.__str__ - -globals().update(RegexFlag.__members__) - # sre exception error = sre_compile.error diff --git a/Lib/runpy.py b/Lib/runpy.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3J1bnB5LnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3J1bnB5LnB5 100644 --- a/Lib/runpy.py +++ b/Lib/runpy.py @@ -16,7 +16,6 @@ import io import types import os -from pkgutil import read_code, get_importer __all__ = [ "run_module", "run_path", @@ -233,6 +232,7 @@ def _get_code_from_file(run_name, fname): # Check for a compiled file first + from pkgutil import read_code decoded_path = os.path.abspath(os.fsdecode(fname)) with io.open_code(decoded_path) as f: code = read_code(f) @@ -255,6 +255,7 @@ if run_name is None: run_name = "<run_path>" pkg_name = run_name.rpartition(".")[0] + from pkgutil import get_importer importer = get_importer(path_name) # Trying to avoid importing imp so as to not consume the deprecation warning. is_NullImporter = False diff --git a/Lib/shutil.py b/Lib/shutil.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3NodXRpbC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3NodXRpbC5weQ== 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -32,16 +32,6 @@ except ImportError: _LZMA_SUPPORTED = False -try: - from pwd import getpwnam -except ImportError: - getpwnam = None - -try: - from grp import getgrnam -except ImportError: - getgrnam = None - _WINDOWS = os.name == 'nt' posix = nt = None if os.name == 'posix': @@ -852,5 +842,5 @@ def _get_gid(name): """Returns a gid, given a group name.""" - if getgrnam is None or name is None: + if name is None: return None @@ -856,4 +846,10 @@ return None + + try: + from grp import getgrnam + except ImportError: + return None + try: result = getgrnam(name) except KeyError: @@ -864,5 +860,5 @@ def _get_uid(name): """Returns an uid, given a user name.""" - if getpwnam is None or name is None: + if name is None: return None @@ -868,4 +864,10 @@ return None + + try: + from pwd import getpwnam + except ImportError: + return None + try: result = getpwnam(name) except KeyError: diff --git a/Lib/site.py b/Lib/site.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3NpdGUucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3NpdGUucHk= 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -170,7 +170,9 @@ fullname = os.path.join(sitedir, name) _trace(f"Processing .pth file: {fullname!r}") try: - f = io.TextIOWrapper(io.open_code(fullname)) + # locale encoding is not ideal especially on Windows. But we have used + # it for a long time. setuptools uses the locale encoding too. + f = io.TextIOWrapper(io.open_code(fullname), encoding="locale") except OSError: return with f: diff --git a/Lib/subprocess.py b/Lib/subprocess.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3N1YnByb2Nlc3MucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3N1YnByb2Nlc3MucHk= 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -54,14 +54,6 @@ import types try: - import pwd -except ImportError: - pwd = None -try: - import grp -except ImportError: - grp = None -try: import fcntl except ImportError: fcntl = None @@ -701,7 +693,7 @@ _USE_POSIX_SPAWN = _use_posix_spawn() -class Popen(object): +class Popen: """ Execute a child program in a new process. For a complete description of the arguments see the Python documentation. @@ -852,6 +844,13 @@ self.text_mode = encoding or errors or text or universal_newlines + # PEP 597: We suppress the EncodingWarning in subprocess module + # for now (at Python 3.10), because we focus on files for now. + # This will be changed to encoding = io.text_encoding(encoding) + # in the future. + if self.text_mode and encoding is None: + self.encoding = encoding = "locale" + # How long to resume waiting on a child after the first ^C. # There is no right value for this. The purpose is to be polite # yet remain good for interactive users trying to exit a tool. @@ -875,7 +874,9 @@ "current platform") elif isinstance(group, str): - if grp is None: + try: + import grp + except ImportError: raise ValueError("The group parameter cannot be a string " "on systems without the grp module") @@ -901,7 +902,9 @@ gids = [] for extra_group in extra_groups: if isinstance(extra_group, str): - if grp is None: + try: + import grp + except ImportError: raise ValueError("Items in extra_groups cannot be " "strings on systems without the " "grp module") @@ -927,6 +930,8 @@ "the current platform") elif isinstance(user, str): - if pwd is None: + try: + import pwd + except ImportError: raise ValueError("The user parameter cannot be a string " "on systems without the pwd module") @@ -931,6 +936,5 @@ raise ValueError("The user parameter cannot be a string " "on systems without the pwd module") - uid = pwd.getpwnam(user).pw_uid elif isinstance(user, int): uid = user diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3N5c2NvbmZpZy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3N5c2NvbmZpZy5weQ== 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -240,7 +240,8 @@ done = {} notdone = {} - with open(filename, errors="surrogateescape") as f: + with open(filename, encoding=sys.getfilesystemencoding(), + errors="surrogateescape") as f: lines = f.readlines() for line in lines: @@ -388,7 +389,7 @@ # load the installed pyconfig.h: config_h = get_config_h_filename() try: - with open(config_h) as f: + with open(config_h, encoding="utf-8") as f: parse_config_h(f, vars) except OSError as e: msg = "invalid Python installation: unable to open %s" % config_h diff --git a/Lib/tempfile.py b/Lib/tempfile.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3RlbXBmaWxlLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3RlbXBmaWxlLnB5 100644 --- a/Lib/tempfile.py +++ b/Lib/tempfile.py @@ -566,6 +566,9 @@ if _os.name == 'nt' and delete: flags |= _os.O_TEMPORARY + if "b" not in mode: + encoding = _io.text_encoding(encoding) + (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type) try: file = _io.open(fd, mode, buffering=buffering, @@ -606,6 +609,9 @@ """ global _O_TMPFILE_WORKS + if "b" not in mode: + encoding = _io.text_encoding(encoding) + prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir) flags = _bin_openflags @@ -661,6 +667,7 @@ if 'b' in mode: self._file = _io.BytesIO() else: + encoding = _io.text_encoding(encoding) self._file = _io.TextIOWrapper(_io.BytesIO(), encoding=encoding, errors=errors, newline=newline) diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvX3Rlc3RfbXVsdGlwcm9jZXNzaW5nLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvX3Rlc3RfbXVsdGlwcm9jZXNzaW5nLnB5 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -826,7 +826,7 @@ proc = self.Process(target=self._test_stderr_flush, args=(testfn,)) proc.start() proc.join() - with open(testfn, 'r') as f: + with open(testfn, encoding="utf-8") as f: err = f.read() # The whole traceback was printed self.assertIn("ZeroDivisionError", err) @@ -836,10 +836,10 @@ @classmethod def _test_stderr_flush(cls, testfn): fd = os.open(testfn, os.O_WRONLY | os.O_CREAT | os.O_EXCL) - sys.stderr = open(fd, 'w', closefd=False) + sys.stderr = open(fd, 'w', encoding="utf-8", closefd=False) 1/0 # MARKER @classmethod def _test_sys_exit(cls, reason, testfn): fd = os.open(testfn, os.O_WRONLY | os.O_CREAT | os.O_EXCL) @@ -840,10 +840,10 @@ 1/0 # MARKER @classmethod def _test_sys_exit(cls, reason, testfn): fd = os.open(testfn, os.O_WRONLY | os.O_CREAT | os.O_EXCL) - sys.stderr = open(fd, 'w', closefd=False) + sys.stderr = open(fd, 'w', encoding="utf-8", closefd=False) sys.exit(reason) def test_sys_exit(self): @@ -864,7 +864,7 @@ join_process(p) self.assertEqual(p.exitcode, 1) - with open(testfn, 'r') as f: + with open(testfn, encoding="utf-8") as f: content = f.read() self.assertEqual(content.rstrip(), str(reason)) @@ -1118,7 +1118,7 @@ def test_no_import_lock_contention(self): with os_helper.temp_cwd(): module_name = 'imported_by_an_imported_module' - with open(module_name + '.py', 'w') as f: + with open(module_name + '.py', 'w', encoding="utf-8") as f: f.write("""if 1: import multiprocessing diff --git a/Lib/test/exception_hierarchy.txt b/Lib/test/exception_hierarchy.txt index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvZXhjZXB0aW9uX2hpZXJhcmNoeS50eHQ=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvZXhjZXB0aW9uX2hpZXJhcmNoeS50eHQ= 100644 --- a/Lib/test/exception_hierarchy.txt +++ b/Lib/test/exception_hierarchy.txt @@ -61,4 +61,5 @@ +-- ImportWarning +-- UnicodeWarning +-- BytesWarning + +-- EncodingWarning +-- ResourceWarning diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvbGlicmVncnRlc3QvbWFpbi5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvbGlicmVncnRlc3QvbWFpbi5weQ== 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -1,4 +1,3 @@ -import datetime import faulthandler import locale import os @@ -150,5 +149,9 @@ # add the timestamp prefix: "0:01:05 " test_time = time.monotonic() - self.start_time - test_time = datetime.timedelta(seconds=int(test_time)) + + mins, secs = divmod(int(test_time), 60) + hours, mins = divmod(mins, 60) + test_time = "%d:%02d:%02d" % (hours, mins, secs) + line = f"{test_time} {line}" @@ -154,5 +157,4 @@ line = f"{test_time} {line}" - if empty: line = line[:-1] diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvbGlicmVncnRlc3QvcmVmbGVhay5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvbGlicmVncnRlc3QvcmVmbGVhay5weQ== 100644 --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -5,6 +5,7 @@ from inspect import isabstract from test import support from test.support import os_helper +from test.libregrtest.utils import clear_caches try: from _abc import _get_dump @@ -181,102 +182,6 @@ clear_caches() -def clear_caches(): - # Clear the warnings registry, so they can be displayed again - for mod in sys.modules.values(): - if hasattr(mod, '__warningregistry__'): - del mod.__warningregistry__ - - # Flush standard output, so that buffered data is sent to the OS and - # associated Python objects are reclaimed. - for stream in (sys.stdout, sys.stderr, sys.__stdout__, sys.__stderr__): - if stream is not None: - stream.flush() - - # Clear assorted module caches. - # Don't worry about resetting the cache if the module is not loaded - try: - distutils_dir_util = sys.modules['distutils.dir_util'] - except KeyError: - pass - else: - distutils_dir_util._path_created.clear() - re.purge() - - try: - _strptime = sys.modules['_strptime'] - except KeyError: - pass - else: - _strptime._regex_cache.clear() - - try: - urllib_parse = sys.modules['urllib.parse'] - except KeyError: - pass - else: - urllib_parse.clear_cache() - - try: - urllib_request = sys.modules['urllib.request'] - except KeyError: - pass - else: - urllib_request.urlcleanup() - - try: - linecache = sys.modules['linecache'] - except KeyError: - pass - else: - linecache.clearcache() - - try: - mimetypes = sys.modules['mimetypes'] - except KeyError: - pass - else: - mimetypes._default_mime_types() - - try: - filecmp = sys.modules['filecmp'] - except KeyError: - pass - else: - filecmp._cache.clear() - - try: - struct = sys.modules['struct'] - except KeyError: - pass - else: - struct._clearcache() - - try: - doctest = sys.modules['doctest'] - except KeyError: - pass - else: - doctest.master = None - - try: - ctypes = sys.modules['ctypes'] - except KeyError: - pass - else: - ctypes._reset_cache() - - try: - typing = sys.modules['typing'] - except KeyError: - pass - else: - for f in typing._cleanups: - f() - - support.gc_collect() - - def warm_caches(): # char cache s = bytes(range(256)) diff --git a/Lib/test/libregrtest/runtest.py b/Lib/test/libregrtest/runtest.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvbGlicmVncnRlc3QvcnVudGVzdC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvbGlicmVncnRlc3QvcnVudGVzdC5weQ== 100644 --- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -11,5 +11,4 @@ import unittest from test import support -from test.support import import_helper from test.support import os_helper @@ -15,5 +14,5 @@ from test.support import os_helper -from test.libregrtest.refleak import dash_R, clear_caches +from test.libregrtest.utils import clear_caches from test.libregrtest.save_env import saved_test_environment from test.libregrtest.utils import format_duration, print_warning @@ -211,6 +210,10 @@ support.run_unittest(tests) +def save_env(ns, test_name): + return saved_test_environment(test_name, ns.verbose, ns.quiet, pgo=ns.pgo) + + def _runtest_inner2(ns, test_name): # Load the test function, run the test function, handle huntrleaks # and findleaks to detect leaks @@ -218,7 +221,10 @@ abstest = get_abs_module(ns, test_name) # remove the module from sys.module to reload it if it was already imported - import_helper.unload(abstest) + try: + del sys.modules[abstest] + except KeyError: + pass the_module = importlib.import_module(abstest) @@ -222,6 +228,9 @@ the_module = importlib.import_module(abstest) + if ns.huntrleaks: + from test.libregrtest.refleak import dash_R + # If the test has a test_main, that will run the appropriate # tests. If not, use normal unittest test loading. test_runner = getattr(the_module, "test_main", None) @@ -229,12 +238,13 @@ test_runner = functools.partial(_test_module, the_module) try: - if ns.huntrleaks: - # Return True if the test leaked references - refleak = dash_R(ns, test_name, test_runner) - else: - test_runner() - refleak = False + with save_env(ns, test_name): + if ns.huntrleaks: + # Return True if the test leaked references + refleak = dash_R(ns, test_name, test_runner) + else: + test_runner() + refleak = False finally: cleanup_test_droppings(test_name, ns.verbose) @@ -268,7 +278,7 @@ try: clear_caches() - with saved_test_environment(test_name, ns.verbose, ns.quiet, pgo=ns.pgo) as environment: + with save_env(ns, test_name): refleak = _runtest_inner2(ns, test_name) except support.ResourceDenied as msg: if not ns.quiet and not ns.pgo: @@ -298,7 +308,7 @@ if refleak: return FAILED - if environment.changed: + if support.environment_altered: return ENV_CHANGED return PASSED diff --git a/Lib/test/libregrtest/save_env.py b/Lib/test/libregrtest/save_env.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvbGlicmVncnRlc3Qvc2F2ZV9lbnYucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvbGlicmVncnRlc3Qvc2F2ZV9lbnYucHk= 100644 --- a/Lib/test/libregrtest/save_env.py +++ b/Lib/test/libregrtest/save_env.py @@ -1,3 +1,2 @@ -import asyncio import builtins import locale @@ -2,4 +1,3 @@ import builtins import locale -import logging import os @@ -5,3 +3,2 @@ import os -import shutil import sys @@ -7,3 +4,2 @@ import sys -import sysconfig import threading @@ -9,6 +5,4 @@ import threading -import urllib.request -import warnings from test import support from test.support import os_helper from test.libregrtest.utils import print_warning @@ -12,10 +6,10 @@ from test import support from test.support import os_helper from test.libregrtest.utils import print_warning -try: - import _multiprocessing, multiprocessing.process -except ImportError: - multiprocessing = None + + +class SkipTestEnvironment(Exception): + pass # Unit tests are supposed to leave the execution environment unchanged @@ -33,10 +27,10 @@ #stuff Unless quiet is True, a warning is printed to stderr if any of - the saved items was changed by the test. The attribute 'changed' - is initially False, but is set to True if a change is detected. + the saved items was changed by the test. The support.environment_altered + attribute is set to True if a change is detected. If verbose is more than 1, the before and after state of changed items is also printed. """ @@ -38,10 +32,8 @@ If verbose is more than 1, the before and after state of changed items is also printed. """ - changed = False - def __init__(self, testname, verbose=0, quiet=False, *, pgo=False): self.testname = testname self.verbose = verbose @@ -73,4 +65,15 @@ 'urllib.requests._url_tempfiles', 'urllib.requests._opener', ) + def get_module(self, name): + # function for restore() methods + return sys.modules[name] + + def try_get_module(self, name): + # function for get() methods + try: + return self.get_module(name) + except KeyError: + raise SkipTestEnvironment + def get_urllib_requests__url_tempfiles(self): @@ -76,7 +79,8 @@ def get_urllib_requests__url_tempfiles(self): - return list(urllib.request._url_tempfiles) + urllib_request = self.try_get_module('urllib.request') + return list(urllib_request._url_tempfiles) def restore_urllib_requests__url_tempfiles(self, tempfiles): for filename in tempfiles: os_helper.unlink(filename) def get_urllib_requests__opener(self): @@ -78,7 +82,8 @@ def restore_urllib_requests__url_tempfiles(self, tempfiles): for filename in tempfiles: os_helper.unlink(filename) def get_urllib_requests__opener(self): - return urllib.request._opener + urllib_request = self.try_get_module('urllib.request') + return urllib_request._opener def restore_urllib_requests__opener(self, opener): @@ -84,4 +89,5 @@ def restore_urllib_requests__opener(self, opener): - urllib.request._opener = opener + urllib_request = self.get_module('urllib.request') + urllib_request._opener = opener def get_asyncio_events__event_loop_policy(self): @@ -86,4 +92,5 @@ def get_asyncio_events__event_loop_policy(self): + self.try_get_module('asyncio') return support.maybe_get_event_loop_policy() def restore_asyncio_events__event_loop_policy(self, policy): @@ -88,5 +95,6 @@ return support.maybe_get_event_loop_policy() def restore_asyncio_events__event_loop_policy(self, policy): + asyncio = self.get_module('asyncio') asyncio.set_event_loop_policy(policy) def get_sys_argv(self): @@ -145,5 +153,6 @@ builtins.__import__ = import_ def get_warnings_filters(self): + warnings = self.try_get_module('warnings') return id(warnings.filters), warnings.filters, warnings.filters[:] def restore_warnings_filters(self, saved_filters): @@ -148,5 +157,6 @@ return id(warnings.filters), warnings.filters, warnings.filters[:] def restore_warnings_filters(self, saved_filters): + warnings = self.get_module('warnings') warnings.filters = saved_filters[1] warnings.filters[:] = saved_filters[2] @@ -161,8 +171,9 @@ asyncore.socket_map.update(saved_map) def get_shutil_archive_formats(self): + shutil = self.try_get_module('shutil') # we could call get_archives_formats() but that only returns the # registry keys; we want to check the values too (the functions that # are registered) return shutil._ARCHIVE_FORMATS, shutil._ARCHIVE_FORMATS.copy() def restore_shutil_archive_formats(self, saved): @@ -164,10 +175,11 @@ # we could call get_archives_formats() but that only returns the # registry keys; we want to check the values too (the functions that # are registered) return shutil._ARCHIVE_FORMATS, shutil._ARCHIVE_FORMATS.copy() def restore_shutil_archive_formats(self, saved): + shutil = self.get_module('shutil') shutil._ARCHIVE_FORMATS = saved[0] shutil._ARCHIVE_FORMATS.clear() shutil._ARCHIVE_FORMATS.update(saved[1]) def get_shutil_unpack_formats(self): @@ -169,7 +181,8 @@ shutil._ARCHIVE_FORMATS = saved[0] shutil._ARCHIVE_FORMATS.clear() shutil._ARCHIVE_FORMATS.update(saved[1]) def get_shutil_unpack_formats(self): + shutil = self.try_get_module('shutil') return shutil._UNPACK_FORMATS, shutil._UNPACK_FORMATS.copy() def restore_shutil_unpack_formats(self, saved): @@ -174,7 +187,8 @@ return shutil._UNPACK_FORMATS, shutil._UNPACK_FORMATS.copy() def restore_shutil_unpack_formats(self, saved): + shutil = self.get_module('shutil') shutil._UNPACK_FORMATS = saved[0] shutil._UNPACK_FORMATS.clear() shutil._UNPACK_FORMATS.update(saved[1]) def get_logging__handlers(self): @@ -176,8 +190,9 @@ shutil._UNPACK_FORMATS = saved[0] shutil._UNPACK_FORMATS.clear() shutil._UNPACK_FORMATS.update(saved[1]) def get_logging__handlers(self): + logging = self.try_get_module('logging') # _handlers is a WeakValueDictionary return id(logging._handlers), logging._handlers, logging._handlers.copy() def restore_logging__handlers(self, saved_handlers): @@ -185,6 +200,7 @@ pass def get_logging__handlerList(self): + logging = self.try_get_module('logging') # _handlerList is a list of weakrefs to handlers return id(logging._handlerList), logging._handlerList, logging._handlerList[:] def restore_logging__handlerList(self, saved_handlerList): @@ -208,6 +224,5 @@ # Same for Process objects def get_multiprocessing_process__dangling(self): - if not multiprocessing: - return None + multiprocessing_process = self.try_get_module('multiprocessing.process') # Unjoined process objects can survive after process exits @@ -213,3 +228,3 @@ # Unjoined process objects can survive after process exits - multiprocessing.process._cleanup() + multiprocessing_process._cleanup() # This copies the weakrefs without making any strong reference @@ -215,3 +230,3 @@ # This copies the weakrefs without making any strong reference - return multiprocessing.process._dangling.copy() + return multiprocessing_process._dangling.copy() def restore_multiprocessing_process__dangling(self, saved): @@ -217,8 +232,7 @@ def restore_multiprocessing_process__dangling(self, saved): - if not multiprocessing: - return - multiprocessing.process._dangling.clear() - multiprocessing.process._dangling.update(saved) + multiprocessing_process = self.get_module('multiprocessing.process') + multiprocessing_process._dangling.clear() + multiprocessing_process._dangling.update(saved) def get_sysconfig__CONFIG_VARS(self): # make sure the dict is initialized @@ -222,7 +236,8 @@ def get_sysconfig__CONFIG_VARS(self): # make sure the dict is initialized + sysconfig = self.try_get_module('sysconfig') sysconfig.get_config_var('prefix') return (id(sysconfig._CONFIG_VARS), sysconfig._CONFIG_VARS, dict(sysconfig._CONFIG_VARS)) def restore_sysconfig__CONFIG_VARS(self, saved): @@ -225,9 +240,10 @@ sysconfig.get_config_var('prefix') return (id(sysconfig._CONFIG_VARS), sysconfig._CONFIG_VARS, dict(sysconfig._CONFIG_VARS)) def restore_sysconfig__CONFIG_VARS(self, saved): + sysconfig = self.get_module('sysconfig') sysconfig._CONFIG_VARS = saved[1] sysconfig._CONFIG_VARS.clear() sysconfig._CONFIG_VARS.update(saved[2]) def get_sysconfig__INSTALL_SCHEMES(self): @@ -229,8 +245,9 @@ sysconfig._CONFIG_VARS = saved[1] sysconfig._CONFIG_VARS.clear() sysconfig._CONFIG_VARS.update(saved[2]) def get_sysconfig__INSTALL_SCHEMES(self): + sysconfig = self.try_get_module('sysconfig') return (id(sysconfig._INSTALL_SCHEMES), sysconfig._INSTALL_SCHEMES, sysconfig._INSTALL_SCHEMES.copy()) def restore_sysconfig__INSTALL_SCHEMES(self, saved): @@ -234,6 +251,7 @@ return (id(sysconfig._INSTALL_SCHEMES), sysconfig._INSTALL_SCHEMES, sysconfig._INSTALL_SCHEMES.copy()) def restore_sysconfig__INSTALL_SCHEMES(self, saved): + sysconfig = self.get_module('sysconfig') sysconfig._INSTALL_SCHEMES = saved[1] sysconfig._INSTALL_SCHEMES.clear() sysconfig._INSTALL_SCHEMES.update(saved[2]) @@ -264,5 +282,6 @@ locale.setlocale(lc, setting) def get_warnings_showwarning(self): + warnings = self.try_get_module('warnings') return warnings.showwarning def restore_warnings_showwarning(self, fxn): @@ -267,5 +286,6 @@ return warnings.showwarning def restore_warnings_showwarning(self, fxn): + warnings = self.get_module('warnings') warnings.showwarning = fxn def resource_info(self): @@ -276,9 +296,15 @@ yield name, getattr(self, get_name), getattr(self, restore_name) def __enter__(self): - self.saved_values = dict((name, get()) for name, get, restore - in self.resource_info()) + self.saved_values = [] + for name, get, restore in self.resource_info(): + try: + original = get() + except SkipTestEnvironment: + continue + + self.saved_values.append((name, get, restore, original)) return self def __exit__(self, exc_type, exc_val, exc_tb): saved_values = self.saved_values @@ -281,9 +307,9 @@ return self def __exit__(self, exc_type, exc_val, exc_tb): saved_values = self.saved_values - del self.saved_values + self.saved_values = None # Some resources use weak references support.gc_collect() @@ -286,9 +312,6 @@ # Some resources use weak references support.gc_collect() - # Read support.environment_altered, set by support helper functions - self.changed |= support.environment_altered - - for name, get, restore in self.resource_info(): + for name, get, restore, original in saved_values: current = get() @@ -294,4 +317,3 @@ current = get() - original = saved_values.pop(name) # Check for changes to the resource's value if current != original: @@ -296,6 +318,6 @@ # Check for changes to the resource's value if current != original: - self.changed = True + support.environment_altered = True restore(original) if not self.quiet and not self.pgo: print_warning(f"{name} was modified by {self.testname}") diff --git a/Lib/test/libregrtest/setup.py b/Lib/test/libregrtest/setup.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvbGlicmVncnRlc3Qvc2V0dXAucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvbGlicmVncnRlc3Qvc2V0dXAucHk= 100644 --- a/Lib/test/libregrtest/setup.py +++ b/Lib/test/libregrtest/setup.py @@ -93,6 +93,10 @@ support.SHORT_TIMEOUT = min(support.SHORT_TIMEOUT, ns.timeout) support.LONG_TIMEOUT = min(support.LONG_TIMEOUT, ns.timeout) + if ns.xmlpath: + from test.support.testresult import RegressionTestResult + RegressionTestResult.USE_XML = True + def replace_stdout(): """Set stdout encoder error handler to backslashreplace (as stderr error diff --git a/Lib/test/libregrtest/utils.py b/Lib/test/libregrtest/utils.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvbGlicmVncnRlc3QvdXRpbHMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvbGlicmVncnRlc3QvdXRpbHMucHk= 100644 --- a/Lib/test/libregrtest/utils.py +++ b/Lib/test/libregrtest/utils.py @@ -84,3 +84,105 @@ global orig_unraisablehook orig_unraisablehook = sys.unraisablehook sys.unraisablehook = regrtest_unraisable_hook + + +def clear_caches(): + # Clear the warnings registry, so they can be displayed again + for mod in sys.modules.values(): + if hasattr(mod, '__warningregistry__'): + del mod.__warningregistry__ + + # Flush standard output, so that buffered data is sent to the OS and + # associated Python objects are reclaimed. + for stream in (sys.stdout, sys.stderr, sys.__stdout__, sys.__stderr__): + if stream is not None: + stream.flush() + + # Clear assorted module caches. + # Don't worry about resetting the cache if the module is not loaded + try: + distutils_dir_util = sys.modules['distutils.dir_util'] + except KeyError: + pass + else: + distutils_dir_util._path_created.clear() + + try: + re = sys.modules['re'] + except KeyError: + pass + else: + re.purge() + + try: + _strptime = sys.modules['_strptime'] + except KeyError: + pass + else: + _strptime._regex_cache.clear() + + try: + urllib_parse = sys.modules['urllib.parse'] + except KeyError: + pass + else: + urllib_parse.clear_cache() + + try: + urllib_request = sys.modules['urllib.request'] + except KeyError: + pass + else: + urllib_request.urlcleanup() + + try: + linecache = sys.modules['linecache'] + except KeyError: + pass + else: + linecache.clearcache() + + try: + mimetypes = sys.modules['mimetypes'] + except KeyError: + pass + else: + mimetypes._default_mime_types() + + try: + filecmp = sys.modules['filecmp'] + except KeyError: + pass + else: + filecmp._cache.clear() + + try: + struct = sys.modules['struct'] + except KeyError: + pass + else: + struct._clearcache() + + try: + doctest = sys.modules['doctest'] + except KeyError: + pass + else: + doctest.master = None + + try: + ctypes = sys.modules['ctypes'] + except KeyError: + pass + else: + ctypes._reset_cache() + + try: + typing = sys.modules['typing'] + except KeyError: + pass + else: + for f in typing._cleanups: + f() + + support.gc_collect() diff --git a/Lib/test/multibytecodec_support.py b/Lib/test/multibytecodec_support.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvbXVsdGlieXRlY29kZWNfc3VwcG9ydC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvbXVsdGlieXRlY29kZWNfc3VwcG9ydC5weQ== 100644 --- a/Lib/test/multibytecodec_support.py +++ b/Lib/test/multibytecodec_support.py @@ -296,7 +296,7 @@ self.skipTest("Could not retrieve "+self.mapfileurl) def open_mapping_file(self): - return support.open_urlresource(self.mapfileurl) + return support.open_urlresource(self.mapfileurl, encoding="utf-8") def test_mapping_file(self): if self.mapfileurl.endswith('.xml'): diff --git a/Lib/test/support/testresult.py b/Lib/test/support/testresult.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3Qvc3VwcG9ydC90ZXN0cmVzdWx0LnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3Qvc3VwcG9ydC90ZXN0cmVzdWx0LnB5 100644 --- a/Lib/test/support/testresult.py +++ b/Lib/test/support/testresult.py @@ -9,10 +9,6 @@ import traceback import unittest -import xml.etree.ElementTree as ET - -from datetime import datetime - class RegressionTestResult(unittest.TextTestResult): separator1 = '=' * 70 + '\n' separator2 = '-' * 70 + '\n' @@ -16,7 +12,8 @@ class RegressionTestResult(unittest.TextTestResult): separator1 = '=' * 70 + '\n' separator2 = '-' * 70 + '\n' + USE_XML = False def __init__(self, stream, descriptions, verbosity): super().__init__(stream=stream, descriptions=descriptions, verbosity=0) self.buffer = True @@ -19,11 +16,14 @@ def __init__(self, stream, descriptions, verbosity): super().__init__(stream=stream, descriptions=descriptions, verbosity=0) self.buffer = True - self.__suite = ET.Element('testsuite') - self.__suite.set('start', datetime.utcnow().isoformat(' ')) - - self.__e = None + if self.USE_XML: + from xml.etree import ElementTree as ET + from datetime import datetime + self.__ET = ET + self.__suite = ET.Element('testsuite') + self.__suite.set('start', datetime.utcnow().isoformat(' ')) + self.__e = None self.__start_time = None self.__results = [] self.__verbose = bool(verbosity) @@ -42,10 +42,11 @@ def startTest(self, test): super().startTest(test) - self.__e = e = ET.SubElement(self.__suite, 'testcase') + if self.USE_XML: + self.__e = e = self.__ET.SubElement(self.__suite, 'testcase') self.__start_time = time.perf_counter() if self.__verbose: self.stream.write(f'{self.getDescription(test)} ... ') self.stream.flush() def _add_result(self, test, capture=False, **args): @@ -46,10 +47,12 @@ self.__start_time = time.perf_counter() if self.__verbose: self.stream.write(f'{self.getDescription(test)} ... ') self.stream.flush() def _add_result(self, test, capture=False, **args): + if not self.USE_XML: + return e = self.__e self.__e = None if e is None: return @@ -52,7 +55,9 @@ e = self.__e self.__e = None if e is None: return + ET = self.__ET + e.set('name', args.pop('name', self.__getId(test))) e.set('status', args.pop('status', 'run')) e.set('result', args.pop('result', 'completed')) @@ -147,6 +152,8 @@ self.stream.write('%s\n' % err) def get_xml_element(self): + if not self.USE_XML: + raise ValueError("USE_XML is false") e = self.__suite e.set('tests', str(self.testsRun)) e.set('errors', str(len(self.errors))) @@ -174,6 +181,9 @@ return get_test_runner_class(verbosity, capture_output)(stream) if __name__ == '__main__': + import xml.etree.ElementTree as ET + RegressionTestResult.USE_XML = True + class TestTests(unittest.TestCase): def test_pass(self): pass diff --git a/Lib/test/test__xxsubinterpreters.py b/Lib/test/test__xxsubinterpreters.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9feHhzdWJpbnRlcnByZXRlcnMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9feHhzdWJpbnRlcnByZXRlcnMucHk= 100644 --- a/Lib/test/test__xxsubinterpreters.py +++ b/Lib/test/test__xxsubinterpreters.py @@ -25,7 +25,7 @@ indented = script.replace('\n', '\n ') wrapped = dedent(f""" import contextlib - with open({w}, 'w') as spipe: + with open({w}, 'w', encoding="utf-8") as spipe: with contextlib.redirect_stdout(spipe): {indented} """) @@ -29,7 +29,7 @@ with contextlib.redirect_stdout(spipe): {indented} """) - return wrapped, open(r) + return wrapped, open(r, encoding="utf-8") def _run_output(interp, request, shared=None): @@ -45,7 +45,7 @@ def run(): interpreters.run_string(interp, dedent(f""" # wait for "signal" - with open({r}) as rpipe: + with open({r}, encoding="utf-8") as rpipe: rpipe.read() """)) @@ -54,7 +54,7 @@ yield - with open(w, 'w') as spipe: + with open(w, 'w', encoding="utf-8") as spipe: spipe.write('done') t.join() @@ -806,7 +806,7 @@ @unittest.skipUnless(hasattr(os, 'fork'), "test needs os.fork()") def test_fork(self): import tempfile - with tempfile.NamedTemporaryFile('w+') as file: + with tempfile.NamedTemporaryFile('w+', encoding="utf-8") as file: file.write('') file.flush() @@ -816,7 +816,7 @@ try: os.fork() except RuntimeError: - with open('{file.name}', 'w') as out: + with open('{file.name}', 'w', encoding='utf-8') as out: out.write('{expected}') """) interpreters.run_string(self.id, script) diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9hcmdwYXJzZS5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9hcmdwYXJzZS5weQ== 100644 --- a/Lib/test/test_argparse.py +++ b/Lib/test/test_argparse.py @@ -45,7 +45,7 @@ def create_readonly_file(self, filename): file_path = os.path.join(self.temp_dir, filename) - with open(file_path, 'w') as file: + with open(file_path, 'w', encoding="utf-8") as file: file.write(filename) os.chmod(file_path, stat.S_IREAD) @@ -1468,7 +1468,7 @@ ('invalid', '@no-such-path\n'), ] for path, text in file_texts: - with open(path, 'w') as file: + with open(path, 'w', encoding="utf-8") as file: file.write(text) parser_signature = Sig(fromfile_prefix_chars='@') @@ -1498,7 +1498,7 @@ ('hello', 'hello world!\n'), ] for path, text in file_texts: - with open(path, 'w') as file: + with open(path, 'w', encoding="utf-8") as file: file.write(text) class FromFileConverterArgumentParser(ErrorRaisingArgumentParser): @@ -1580,7 +1580,8 @@ def setUp(self): super(TestFileTypeR, self).setUp() for file_name in ['foo', 'bar']: - with open(os.path.join(self.temp_dir, file_name), 'w') as file: + with open(os.path.join(self.temp_dir, file_name), + 'w', encoding="utf-8") as file: file.write(file_name) self.create_readonly_file('readonly') @@ -1601,7 +1602,7 @@ """Test that a file is not created unless the default is needed""" def setUp(self): super(TestFileTypeDefaults, self).setUp() - file = open(os.path.join(self.temp_dir, 'good'), 'w') + file = open(os.path.join(self.temp_dir, 'good'), 'w', encoding="utf-8") file.write('good') file.close() @@ -1620,7 +1621,8 @@ def setUp(self): super(TestFileTypeRB, self).setUp() for file_name in ['foo', 'bar']: - with open(os.path.join(self.temp_dir, file_name), 'w') as file: + with open(os.path.join(self.temp_dir, file_name), + 'w', encoding="utf-8") as file: file.write(file_name) argument_signatures = [ diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9hcnJheS5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9hcnJheS5weQ== 100644 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -918,6 +918,17 @@ self.assertRaises(ValueError, a.index, None) self.assertRaises(ValueError, a.index, self.outside) + a = array.array('i', [-2, -1, 0, 0, 1, 2]) + self.assertEqual(a.index(0), 2) + self.assertEqual(a.index(0, 2), 2) + self.assertEqual(a.index(0, -4), 2) + self.assertEqual(a.index(-2, -10), 0) + self.assertEqual(a.index(0, 3), 3) + self.assertEqual(a.index(0, -3), 3) + self.assertEqual(a.index(0, 3, 4), 3) + self.assertEqual(a.index(0, -3, -2), 3) + self.assertRaises(ValueError, a.index, 2, 0, -10) + def test_count(self): example = 2*self.example a = array.array(self.typecode, example) diff --git a/Lib/test/test_asdl_parser.py b/Lib/test/test_asdl_parser.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9hc2RsX3BhcnNlci5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9hc2RsX3BhcnNlci5weQ== 100644 --- a/Lib/test/test_asdl_parser.py +++ b/Lib/test/test_asdl_parser.py @@ -62,7 +62,9 @@ alias = self.types['alias'] self.assertEqual( str(alias), - 'Product([Field(identifier, name), Field(identifier, asname, opt=True)])') + 'Product([Field(identifier, name), Field(identifier, asname, opt=True)], ' + '[Field(int, lineno), Field(int, col_offset), ' + 'Field(int, end_lineno, opt=True), Field(int, end_col_offset, opt=True)])') def test_attributes(self): stmt = self.types['stmt'] diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9hc3QucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9hc3QucHk= 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -335,6 +335,26 @@ mod.body[0].module = " __future__ ".strip() compile(mod, "<test>", "exec") + def test_alias(self): + im = ast.parse("from bar import y").body[0] + self.assertEqual(len(im.names), 1) + alias = im.names[0] + self.assertEqual(alias.name, 'y') + self.assertIsNone(alias.asname) + self.assertEqual(alias.lineno, 1) + self.assertEqual(alias.end_lineno, 1) + self.assertEqual(alias.col_offset, 16) + self.assertEqual(alias.end_col_offset, 17) + + im = ast.parse("from bar import *").body[0] + alias = im.names[0] + self.assertEqual(alias.name, '*') + self.assertIsNone(alias.asname) + self.assertEqual(alias.lineno, 1) + self.assertEqual(alias.end_lineno, 1) + self.assertEqual(alias.col_offset, 16) + self.assertEqual(alias.end_col_offset, 17) + def test_base_classes(self): self.assertTrue(issubclass(ast.For, ast.stmt)) self.assertTrue(issubclass(ast.Name, ast.expr)) @@ -1037,7 +1057,8 @@ def test_level_as_none(self): body = [ast.ImportFrom(module='time', - names=[ast.alias(name='sleep')], + names=[ast.alias(name='sleep', + lineno=0, col_offset=0)], level=None, lineno=0, col_offset=0)] mod = ast.Module(body, []) @@ -1735,6 +1756,7 @@ ''').strip() imp = ast.parse(s).body[0] self._check_end_pos(imp, 3, 1) + self._check_end_pos(imp.names[2], 2, 16) def test_slices(self): s1 = 'f()[1, 2] [0]' @@ -2095,8 +2117,8 @@ ('Module', [('Try', (1, 0, 4, 6), [('Pass', (2, 2, 2, 6))], [('ExceptHandler', (3, 0, 4, 6), ('Name', (3, 7, 3, 16), 'Exception', ('Load',)), None, [('Pass', (4, 2, 4, 6))])], [], [])], []), ('Module', [('Try', (1, 0, 4, 6), [('Pass', (2, 2, 2, 6))], [], [], [('Pass', (4, 2, 4, 6))])], []), ('Module', [('Assert', (1, 0, 1, 8), ('Name', (1, 7, 1, 8), 'v', ('Load',)), None)], []), -('Module', [('Import', (1, 0, 1, 10), [('alias', 'sys', None)])], []), -('Module', [('ImportFrom', (1, 0, 1, 17), 'sys', [('alias', 'v', None)], 0)], []), +('Module', [('Import', (1, 0, 1, 10), [('alias', (1, 7, 1, 10), 'sys', None)])], []), +('Module', [('ImportFrom', (1, 0, 1, 17), 'sys', [('alias', (1, 16, 1, 17), 'v', None)], 0)], []), ('Module', [('Global', (1, 0, 1, 8), ['v'])], []), ('Module', [('Expr', (1, 0, 1, 1), ('Constant', (1, 0, 1, 1), 1, None))], []), ('Module', [('Pass', (1, 0, 1, 4))], []), diff --git a/Lib/test/test_asyncgen.py b/Lib/test/test_asyncgen.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9hc3luY2dlbi5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9hc3luY2dlbi5weQ== 100644 --- a/Lib/test/test_asyncgen.py +++ b/Lib/test/test_asyncgen.py @@ -372,6 +372,218 @@ self.loop = None asyncio.set_event_loop_policy(None) + def check_async_iterator_anext(self, ait_class): + g = ait_class() + async def consume(): + results = [] + results.append(await anext(g)) + results.append(await anext(g)) + results.append(await anext(g, 'buckle my shoe')) + return results + res = self.loop.run_until_complete(consume()) + self.assertEqual(res, [1, 2, 'buckle my shoe']) + with self.assertRaises(StopAsyncIteration): + self.loop.run_until_complete(consume()) + + async def test_2(): + g1 = ait_class() + self.assertEqual(await anext(g1), 1) + self.assertEqual(await anext(g1), 2) + with self.assertRaises(StopAsyncIteration): + await anext(g1) + with self.assertRaises(StopAsyncIteration): + await anext(g1) + + g2 = ait_class() + self.assertEqual(await anext(g2, "default"), 1) + self.assertEqual(await anext(g2, "default"), 2) + self.assertEqual(await anext(g2, "default"), "default") + self.assertEqual(await anext(g2, "default"), "default") + + return "completed" + + result = self.loop.run_until_complete(test_2()) + self.assertEqual(result, "completed") + + def test_async_generator_anext(self): + async def agen(): + yield 1 + yield 2 + self.check_async_iterator_anext(agen) + + def test_python_async_iterator_anext(self): + class MyAsyncIter: + """Asynchronously yield 1, then 2.""" + def __init__(self): + self.yielded = 0 + def __aiter__(self): + return self + async def __anext__(self): + if self.yielded >= 2: + raise StopAsyncIteration() + else: + self.yielded += 1 + return self.yielded + self.check_async_iterator_anext(MyAsyncIter) + + def test_python_async_iterator_types_coroutine_anext(self): + import types + class MyAsyncIterWithTypesCoro: + """Asynchronously yield 1, then 2.""" + def __init__(self): + self.yielded = 0 + def __aiter__(self): + return self + @types.coroutine + def __anext__(self): + if False: + yield "this is a generator-based coroutine" + if self.yielded >= 2: + raise StopAsyncIteration() + else: + self.yielded += 1 + return self.yielded + self.check_async_iterator_anext(MyAsyncIterWithTypesCoro) + + def test_async_gen_aiter(self): + async def gen(): + yield 1 + yield 2 + g = gen() + async def consume(): + return [i async for i in aiter(g)] + res = self.loop.run_until_complete(consume()) + self.assertEqual(res, [1, 2]) + + def test_async_gen_aiter_class(self): + results = [] + class Gen: + async def __aiter__(self): + yield 1 + yield 2 + g = Gen() + async def consume(): + ait = aiter(g) + while True: + try: + results.append(await anext(ait)) + except StopAsyncIteration: + break + self.loop.run_until_complete(consume()) + self.assertEqual(results, [1, 2]) + + def test_aiter_idempotent(self): + async def gen(): + yield 1 + applied_once = aiter(gen()) + applied_twice = aiter(applied_once) + self.assertIs(applied_once, applied_twice) + + def test_anext_bad_args(self): + async def gen(): + yield 1 + async def call_with_too_few_args(): + await anext() + async def call_with_too_many_args(): + await anext(gen(), 1, 3) + async def call_with_wrong_type_args(): + await anext(1, gen()) + async def call_with_kwarg(): + await anext(aiterator=gen()) + with self.assertRaises(TypeError): + self.loop.run_until_complete(call_with_too_few_args()) + with self.assertRaises(TypeError): + self.loop.run_until_complete(call_with_too_many_args()) + with self.assertRaises(TypeError): + self.loop.run_until_complete(call_with_wrong_type_args()) + with self.assertRaises(TypeError): + self.loop.run_until_complete(call_with_kwarg()) + + def test_anext_bad_await(self): + async def bad_awaitable(): + class BadAwaitable: + def __await__(self): + return 42 + class MyAsyncIter: + def __aiter__(self): + return self + def __anext__(self): + return BadAwaitable() + regex = r"__await__.*iterator" + awaitable = anext(MyAsyncIter(), "default") + with self.assertRaisesRegex(TypeError, regex): + await awaitable + awaitable = anext(MyAsyncIter()) + with self.assertRaisesRegex(TypeError, regex): + await awaitable + return "completed" + result = self.loop.run_until_complete(bad_awaitable()) + self.assertEqual(result, "completed") + + async def check_anext_returning_iterator(self, aiter_class): + awaitable = anext(aiter_class(), "default") + with self.assertRaises(TypeError): + await awaitable + awaitable = anext(aiter_class()) + with self.assertRaises(TypeError): + await awaitable + return "completed" + + def test_anext_return_iterator(self): + class WithIterAnext: + def __aiter__(self): + return self + def __anext__(self): + return iter("abc") + result = self.loop.run_until_complete(self.check_anext_returning_iterator(WithIterAnext)) + self.assertEqual(result, "completed") + + def test_anext_return_generator(self): + class WithGenAnext: + def __aiter__(self): + return self + def __anext__(self): + yield + result = self.loop.run_until_complete(self.check_anext_returning_iterator(WithGenAnext)) + self.assertEqual(result, "completed") + + def test_anext_await_raises(self): + class RaisingAwaitable: + def __await__(self): + raise ZeroDivisionError() + yield + class WithRaisingAwaitableAnext: + def __aiter__(self): + return self + def __anext__(self): + return RaisingAwaitable() + async def do_test(): + awaitable = anext(WithRaisingAwaitableAnext()) + with self.assertRaises(ZeroDivisionError): + await awaitable + awaitable = anext(WithRaisingAwaitableAnext(), "default") + with self.assertRaises(ZeroDivisionError): + await awaitable + return "completed" + result = self.loop.run_until_complete(do_test()) + self.assertEqual(result, "completed") + + def test_aiter_bad_args(self): + async def gen(): + yield 1 + async def call_with_too_few_args(): + await aiter() + async def call_with_too_many_args(): + await aiter(gen(), 1) + async def call_with_wrong_type_arg(): + await aiter(1) + with self.assertRaises(TypeError): + self.loop.run_until_complete(call_with_too_few_args()) + with self.assertRaises(TypeError): + self.loop.run_until_complete(call_with_too_many_args()) + with self.assertRaises(TypeError): + self.loop.run_until_complete(call_with_wrong_type_arg()) + async def to_list(self, gen): res = [] async for i in gen: diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9hc3luY2lvL3Rlc3RfYmFzZV9ldmVudHMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9hc3luY2lvL3Rlc3RfYmFzZV9ldmVudHMucHk= 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -2096,7 +2096,7 @@ def test_nonbinary_file(self): sock = self.make_socket() - with open(os_helper.TESTFN, 'r') as f: + with open(os_helper.TESTFN, encoding="utf-8") as f: with self.assertRaisesRegex(ValueError, "binary mode"): self.run_loop(self.loop.sock_sendfile(sock, f)) diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9hc3luY2lvL3Rlc3RfZXZlbnRzLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9hc3luY2lvL3Rlc3RfZXZlbnRzLnB5 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -1349,7 +1349,7 @@ rpipe, wpipe = os.pipe() rpipeobj = io.open(rpipe, 'rb', 1024) - wpipeobj = io.open(wpipe, 'w', 1024) + wpipeobj = io.open(wpipe, 'w', 1024, encoding="utf-8") async def connect(): read_transport, _ = await loop.connect_read_pipe( diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9hc3luY2lvL3Rlc3Rfc3RyZWFtcy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9hc3luY2lvL3Rlc3Rfc3RyZWFtcy5weQ== 100644 --- a/Lib/test/test_asyncio/test_streams.py +++ b/Lib/test/test_asyncio/test_streams.py @@ -799,7 +799,7 @@ # Start the server thread and wait for it to be listening. thread = threading.Thread(target=server) - thread.setDaemon(True) + thread.daemon = True thread.start() addr = q.get() diff --git a/Lib/test/test_baseexception.py b/Lib/test/test_baseexception.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9iYXNlZXhjZXB0aW9uLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9iYXNlZXhjZXB0aW9uLnB5 100644 --- a/Lib/test/test_baseexception.py +++ b/Lib/test/test_baseexception.py @@ -28,8 +28,9 @@ except TypeError: pass - inheritance_tree = open(os.path.join(os.path.split(__file__)[0], - 'exception_hierarchy.txt')) + inheritance_tree = open( + os.path.join(os.path.split(__file__)[0], 'exception_hierarchy.txt'), + encoding="utf-8") try: superclass_name = inheritance_tree.readline().rstrip() try: diff --git a/Lib/test/test_bdb.py b/Lib/test/test_bdb.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9iZGIucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9iZGIucHk= 100644 --- a/Lib/test/test_bdb.py +++ b/Lib/test/test_bdb.py @@ -74,9 +74,7 @@ dry_run = 0 def reset_Breakpoint(): - _bdb.Breakpoint.next = 1 - _bdb.Breakpoint.bplist = {} - _bdb.Breakpoint.bpbynumber = [None] + _bdb.Breakpoint.clearBreakpoints() def info_breakpoints(): bp_list = [bp for bp in _bdb.Breakpoint.bpbynumber if bp] @@ -539,7 +537,7 @@ try: for m in modules: fname = m + '.py' - with open(fname, 'w') as f: + with open(fname, 'w', encoding="utf-8") as f: f.write(textwrap.dedent(modules[m])) linecache.checkcache(fname) importlib.invalidate_caches() @@ -951,6 +949,49 @@ with TracerRun(self) as tracer: self.assertRaises(BdbError, tracer.runcall, tfunc_import) + def test_load_bps_from_previous_Bdb_instance(self): + reset_Breakpoint() + db1 = Bdb() + fname = db1.canonic(__file__) + db1.set_break(__file__, 1) + self.assertEqual(db1.get_all_breaks(), {fname: [1]}) + + db2 = Bdb() + db2.set_break(__file__, 2) + db2.set_break(__file__, 3) + db2.set_break(__file__, 4) + self.assertEqual(db1.get_all_breaks(), {fname: [1]}) + self.assertEqual(db2.get_all_breaks(), {fname: [1, 2, 3, 4]}) + db2.clear_break(__file__, 1) + self.assertEqual(db1.get_all_breaks(), {fname: [1]}) + self.assertEqual(db2.get_all_breaks(), {fname: [2, 3, 4]}) + + db3 = Bdb() + self.assertEqual(db1.get_all_breaks(), {fname: [1]}) + self.assertEqual(db2.get_all_breaks(), {fname: [2, 3, 4]}) + self.assertEqual(db3.get_all_breaks(), {fname: [2, 3, 4]}) + db2.clear_break(__file__, 2) + self.assertEqual(db1.get_all_breaks(), {fname: [1]}) + self.assertEqual(db2.get_all_breaks(), {fname: [3, 4]}) + self.assertEqual(db3.get_all_breaks(), {fname: [2, 3, 4]}) + + db4 = Bdb() + db4.set_break(__file__, 5) + self.assertEqual(db1.get_all_breaks(), {fname: [1]}) + self.assertEqual(db2.get_all_breaks(), {fname: [3, 4]}) + self.assertEqual(db3.get_all_breaks(), {fname: [2, 3, 4]}) + self.assertEqual(db4.get_all_breaks(), {fname: [3, 4, 5]}) + reset_Breakpoint() + + db5 = Bdb() + db5.set_break(__file__, 6) + self.assertEqual(db1.get_all_breaks(), {fname: [1]}) + self.assertEqual(db2.get_all_breaks(), {fname: [3, 4]}) + self.assertEqual(db3.get_all_breaks(), {fname: [2, 3, 4]}) + self.assertEqual(db4.get_all_breaks(), {fname: [3, 4, 5]}) + self.assertEqual(db5.get_all_breaks(), {fname: [6]}) + + class RunTestCase(BaseTestCase): """Test run, runeval and set_trace.""" diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9ib29sLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9ib29sLnB5 100644 --- a/Lib/test/test_bool.py +++ b/Lib/test/test_bool.py @@ -235,7 +235,7 @@ def test_fileclosed(self): try: - with open(os_helper.TESTFN, "w") as f: + with open(os_helper.TESTFN, "w", encoding="utf-8") as f: self.assertIs(f.closed, False) self.assertIs(f.closed, True) finally: diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9idWlsdGluLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9idWlsdGluLnB5 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -1159,7 +1159,7 @@ def write_testfile(self): # NB the first 4 lines are also used to test input, below - fp = open(TESTFN, 'w') + fp = open(TESTFN, 'w', encoding="utf-8") self.addCleanup(unlink, TESTFN) with fp: fp.write('1+1\n') @@ -1171,7 +1171,7 @@ def test_open(self): self.write_testfile() - fp = open(TESTFN, 'r') + fp = open(TESTFN, encoding="utf-8") with fp: self.assertEqual(fp.readline(4), '1+1\n') self.assertEqual(fp.readline(), 'The quick brown fox jumps over the lazy dog.\n') @@ -1197,7 +1197,9 @@ self.write_testfile() current_locale_encoding = locale.getpreferredencoding(False) - fp = open(TESTFN, 'w') + with warnings.catch_warnings(): + warnings.simplefilter("ignore", EncodingWarning) + fp = open(TESTFN, 'w') with fp: self.assertEqual(fp.encoding, current_locale_encoding) finally: @@ -1205,7 +1207,7 @@ os.environ.update(old_environ) def test_open_non_inheritable(self): - fileobj = open(__file__) + fileobj = open(__file__, encoding="utf-8") with fileobj: self.assertFalse(os.get_inheritable(fileobj.fileno())) @@ -1300,7 +1302,7 @@ def test_input(self): self.write_testfile() - fp = open(TESTFN, 'r') + fp = open(TESTFN, encoding="utf-8") savestdin = sys.stdin savestdout = sys.stdout # Eats the echo try: @@ -2022,7 +2024,7 @@ os.write(fd, terminal_input) # Get results from the pipe - with open(r, "r") as rpipe: + with open(r, encoding="utf-8") as rpipe: lines = [] while True: line = rpipe.readline().strip() diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9iejIucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9iejIucHk= 100644 --- a/Lib/test/test_bz2.py +++ b/Lib/test/test_bz2.py @@ -922,8 +922,8 @@ for mode in ("wt", "xt"): if mode == "xt": unlink(self.filename) - with self.open(self.filename, mode) as f: + with self.open(self.filename, mode, encoding="ascii") as f: f.write(text) with open(self.filename, "rb") as f: file_data = ext_decompress(f.read()).decode("ascii") self.assertEqual(file_data, text_native_eol) @@ -926,6 +926,6 @@ f.write(text) with open(self.filename, "rb") as f: file_data = ext_decompress(f.read()).decode("ascii") self.assertEqual(file_data, text_native_eol) - with self.open(self.filename, "rt") as f: + with self.open(self.filename, "rt", encoding="ascii") as f: self.assertEqual(f.read(), text) @@ -931,5 +931,5 @@ self.assertEqual(f.read(), text) - with self.open(self.filename, "at") as f: + with self.open(self.filename, "at", encoding="ascii") as f: f.write(text) with open(self.filename, "rb") as f: file_data = ext_decompress(f.read()).decode("ascii") @@ -938,7 +938,8 @@ def test_x_mode(self): for mode in ("x", "xb", "xt"): unlink(self.filename) - with self.open(self.filename, mode) as f: + encoding = "utf-8" if "t" in mode else None + with self.open(self.filename, mode, encoding=encoding) as f: pass with self.assertRaises(FileExistsError): with self.open(self.filename, mode) as f: @@ -950,7 +951,7 @@ with self.open(BytesIO(self.DATA), "rb") as f: self.assertEqual(f.read(), self.TEXT) text = self.TEXT.decode("ascii") - with self.open(BytesIO(self.DATA), "rt") as f: + with self.open(BytesIO(self.DATA), "rt", encoding="utf-8") as f: self.assertEqual(f.read(), text) def test_bad_params(self): @@ -989,5 +990,5 @@ def test_newline(self): # Test with explicit newline (universal newline mode disabled). text = self.TEXT.decode("ascii") - with self.open(self.filename, "wt", newline="\n") as f: + with self.open(self.filename, "wt", encoding="utf-8", newline="\n") as f: f.write(text) @@ -993,5 +994,5 @@ f.write(text) - with self.open(self.filename, "rt", newline="\r") as f: + with self.open(self.filename, "rt", encoding="utf-8", newline="\r") as f: self.assertEqual(f.readlines(), [text]) diff --git a/Lib/test/test_cmath.py b/Lib/test/test_cmath.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9jbWF0aC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9jbWF0aC5weQ== 100644 --- a/Lib/test/test_cmath.py +++ b/Lib/test/test_cmath.py @@ -60,7 +60,7 @@ test_functions.append(lambda x : cmath.log(14.-27j, x)) def setUp(self): - self.test_values = open(test_file) + self.test_values = open(test_file, encoding="utf-8") def tearDown(self): self.test_values.close() diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9jbWRfbGluZS5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9jbWRfbGluZS5weQ== 100644 --- a/Lib/test/test_cmd_line.py +++ b/Lib/test/test_cmd_line.py @@ -526,7 +526,7 @@ # the dict whereas the module was destroyed filename = os_helper.TESTFN self.addCleanup(os_helper.unlink, filename) - with open(filename, "w") as script: + with open(filename, "w", encoding="utf-8") as script: print("import sys", file=script) print("del sys.modules['__main__']", file=script) assert_python_ok(filename) @@ -563,5 +563,5 @@ with os_helper.temp_cwd() as tmpdir: fake = os.path.join(tmpdir, "uuid.py") main = os.path.join(tmpdir, "main.py") - with open(fake, "w") as f: + with open(fake, "w", encoding="utf-8") as f: f.write("raise RuntimeError('isolated mode test')\n") @@ -567,5 +567,5 @@ f.write("raise RuntimeError('isolated mode test')\n") - with open(main, "w") as f: + with open(main, "w", encoding="utf-8") as f: f.write("import uuid\n") f.write("print('ok')\n") self.assertRaises(subprocess.CalledProcessError, @@ -865,10 +865,10 @@ ) class SyntaxErrorTests(unittest.TestCase): - def test_tokenizer_error_with_stdin(self): - proc = subprocess.run([sys.executable, "-"], input = b"(1+2+3", + def check_string(self, code): + proc = subprocess.run([sys.executable, "-"], input=code, stdout=subprocess.PIPE, stderr=subprocess.PIPE) self.assertNotEqual(proc.returncode, 0) self.assertNotEqual(proc.stderr, None) self.assertIn(b"\nSyntaxError", proc.stderr) @@ -870,8 +870,14 @@ stdout=subprocess.PIPE, stderr=subprocess.PIPE) self.assertNotEqual(proc.returncode, 0) self.assertNotEqual(proc.stderr, None) self.assertIn(b"\nSyntaxError", proc.stderr) + def test_tokenizer_error_with_stdin(self): + self.check_string(b"(1+2+3") + + def test_decoding_error_at_the_end_of_the_line(self): + self.check_string(b"'\u1f'") + def test_main(): support.run_unittest(CmdLineTest, IgnoreEnvironmentTest, SyntaxErrorTests) support.reap_children() diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9jbWRfbGluZV9zY3JpcHQucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9jbWRfbGluZV9zY3JpcHQucHk= 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -414,7 +414,7 @@ # does not alter the value of sys.path[0] with os_helper.temp_dir() as script_dir: with os_helper.change_cwd(path=script_dir): - with open("-c", "w") as f: + with open("-c", "w", encoding="utf-8") as f: f.write("data") rc, out, err = assert_python_ok('-c', 'import sys; print("sys.path[0]==%r" % sys.path[0])', @@ -430,7 +430,7 @@ with os_helper.temp_dir() as script_dir: script_name = _make_test_script(script_dir, 'other') with os_helper.change_cwd(path=script_dir): - with open("-m", "w") as f: + with open("-m", "w", encoding="utf-8") as f: f.write("data") rc, out, err = assert_python_ok('-m', 'other', *example_args, __isolated=False) @@ -443,7 +443,7 @@ # will be failed. with os_helper.temp_dir() as script_dir: script_name = os.path.join(script_dir, "issue20884.py") - with open(script_name, "w", newline='\n') as f: + with open(script_name, "w", encoding="latin1", newline='\n') as f: f.write("#coding: iso-8859-1\n") f.write('"""\n') for _ in range(30): @@ -614,8 +614,8 @@ script_name = _make_test_script(script_dir, 'script', script) exitcode, stdout, stderr = assert_python_failure(script_name) text = io.TextIOWrapper(io.BytesIO(stderr), 'ascii').read() - # Confirm that the caret is located under the first 1 character - self.assertIn("\n 1 + 1 = 2\n ^", text) + # Confirm that the caret is located under the '=' sign + self.assertIn("\n 1 + 1 = 2\n ^\n", text) def test_syntaxerror_indented_caret_position(self): script = textwrap.dedent("""\ @@ -627,7 +627,7 @@ exitcode, stdout, stderr = assert_python_failure(script_name) text = io.TextIOWrapper(io.BytesIO(stderr), 'ascii').read() # Confirm that the caret is located under the first 1 character - self.assertIn("\n 1 + 1 = 2\n ^", text) + self.assertIn("\n 1 + 1 = 2\n ^\n", text) # Try the same with a form feed at the start of the indented line script = ( @@ -638,7 +638,7 @@ exitcode, stdout, stderr = assert_python_failure(script_name) text = io.TextIOWrapper(io.BytesIO(stderr), "ascii").read() self.assertNotIn("\f", text) - self.assertIn("\n 1 + 1 = 2\n ^", text) + self.assertIn("\n 1 + 1 = 2\n ^\n", text) def test_syntaxerror_multi_line_fstring(self): script = 'foo = f"""{}\nfoo"""\n' diff --git a/Lib/test/test_codeop.py b/Lib/test/test_codeop.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9jb2Rlb3AucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9jb2Rlb3AucHk= 100644 --- a/Lib/test/test_codeop.py +++ b/Lib/test/test_codeop.py @@ -275,7 +275,6 @@ ai("a = 'a\\\n") ai("a = 1","eval") - ai("a = (","eval") ai("]","eval") ai("())","eval") ai("[}","eval") diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9jb2xsZWN0aW9ucy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9jb2xsZWN0aW9ucy5weQ== 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -1512,8 +1512,12 @@ return result def __repr__(self): return "MySet(%s)" % repr(list(self)) - s = MySet([5,43,2,1]) - self.assertEqual(s.pop(), 1) + items = [5,43,2,1] + s = MySet(items) + r = s.pop() + self.assertEquals(len(s), len(items) - 1) + self.assertNotIn(r, s) + self.assertIn(r, items) def test_issue8750(self): empty = WithSet() diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9jb21waWxlLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9jb21waWxlLnB5 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -427,7 +427,7 @@ fname = __file__ if fname.lower().endswith('pyc'): fname = fname[:-1] - with open(fname, 'r') as f: + with open(fname, encoding='utf-8') as f: fcontents = f.read() sample_code = [ ['<assign>', 'x = 5'], diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9jb21waWxlYWxsLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9jb21waWxlYWxsLnB5 100644 --- a/Lib/test/test_compileall.py +++ b/Lib/test/test_compileall.py @@ -58,7 +58,7 @@ self.directory = tempfile.mkdtemp() self.source_path = os.path.join(self.directory, '_test.py') self.bc_path = importlib.util.cache_from_source(self.source_path) - with open(self.source_path, 'w') as file: + with open(self.source_path, 'w', encoding="utf-8") as file: file.write('x = 123\n') self.source_path2 = os.path.join(self.directory, '_test2.py') self.bc_path2 = importlib.util.cache_from_source(self.source_path2) @@ -73,7 +73,7 @@ def add_bad_source_file(self): self.bad_source_path = os.path.join(self.directory, '_test_bad.py') - with open(self.bad_source_path, 'w') as file: + with open(self.bad_source_path, 'w', encoding="utf-8") as file: file.write('x (\n') def timestamp_metadata(self): @@ -164,7 +164,7 @@ data_file = os.path.join(data_dir, 'file') os.mkdir(data_dir) # touch data/file - with open(data_file, 'w'): + with open(data_file, 'wb'): pass compileall.compile_file(data_file) self.assertFalse(os.path.exists(os.path.join(data_dir, '__pycache__'))) @@ -440,8 +440,7 @@ if not directory.is_dir(): directory.mkdir() directory_created = True - with path.open('w') as file: - file.write('# for test_compileall') + path.write_text('# for test_compileall', encoding="utf-8") except OSError: sys_path_writable = False break @@ -704,7 +703,7 @@ f2 = script_helper.make_script(self.pkgdir, 'f2', '') f3 = script_helper.make_script(self.pkgdir, 'f3', '') f4 = script_helper.make_script(self.pkgdir, 'f4', '') - with open(os.path.join(self.directory, 'l1'), 'w') as l1: + with open(os.path.join(self.directory, 'l1'), 'w', encoding="utf-8") as l1: l1.write(os.path.join(self.pkgdir, 'f1.py')+os.linesep) l1.write(os.path.join(self.pkgdir, 'f2.py')+os.linesep) self.assertRunOK('-i', os.path.join(self.directory, 'l1'), f4) @@ -718,7 +717,7 @@ f2 = script_helper.make_script(self.pkgdir, 'f2', '') f3 = script_helper.make_script(self.pkgdir, 'f3', '') f4 = script_helper.make_script(self.pkgdir, 'f4', '') - with open(os.path.join(self.directory, 'l1'), 'w') as l1: + with open(os.path.join(self.directory, 'l1'), 'w', encoding="utf-8") as l1: l1.write(os.path.join(self.pkgdir, 'f2.py')+os.linesep) self.assertRunOK('-i', os.path.join(self.directory, 'l1')) self.assertNotCompiled(f1) diff --git a/Lib/test/test_configparser.py b/Lib/test/test_configparser.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9jb25maWdwYXJzZXIucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9jb25maWdwYXJzZXIucHk= 100644 --- a/Lib/test/test_configparser.py +++ b/Lib/test/test_configparser.py @@ -714,8 +714,8 @@ file1 = support.findfile("cfgparser.1") # check when we pass a mix of readable and non-readable files: cf = self.newconfig() - parsed_files = cf.read([file1, "nonexistent-file"]) + parsed_files = cf.read([file1, "nonexistent-file"], encoding="utf-8") self.assertEqual(parsed_files, [file1]) self.assertEqual(cf.get("Foo Bar", "foo"), "newbar") # check when we pass only a filename: cf = self.newconfig() @@ -718,9 +718,9 @@ self.assertEqual(parsed_files, [file1]) self.assertEqual(cf.get("Foo Bar", "foo"), "newbar") # check when we pass only a filename: cf = self.newconfig() - parsed_files = cf.read(file1) + parsed_files = cf.read(file1, encoding="utf-8") self.assertEqual(parsed_files, [file1]) self.assertEqual(cf.get("Foo Bar", "foo"), "newbar") # check when we pass only a Path object: cf = self.newconfig() @@ -723,9 +723,9 @@ self.assertEqual(parsed_files, [file1]) self.assertEqual(cf.get("Foo Bar", "foo"), "newbar") # check when we pass only a Path object: cf = self.newconfig() - parsed_files = cf.read(pathlib.Path(file1)) + parsed_files = cf.read(pathlib.Path(file1), encoding="utf-8") self.assertEqual(parsed_files, [file1]) self.assertEqual(cf.get("Foo Bar", "foo"), "newbar") # check when we passed both a filename and a Path object: cf = self.newconfig() @@ -728,9 +728,9 @@ self.assertEqual(parsed_files, [file1]) self.assertEqual(cf.get("Foo Bar", "foo"), "newbar") # check when we passed both a filename and a Path object: cf = self.newconfig() - parsed_files = cf.read([pathlib.Path(file1), file1]) + parsed_files = cf.read([pathlib.Path(file1), file1], encoding="utf-8") self.assertEqual(parsed_files, [file1, file1]) self.assertEqual(cf.get("Foo Bar", "foo"), "newbar") # check when we pass only missing files: cf = self.newconfig() @@ -733,8 +733,8 @@ self.assertEqual(parsed_files, [file1, file1]) self.assertEqual(cf.get("Foo Bar", "foo"), "newbar") # check when we pass only missing files: cf = self.newconfig() - parsed_files = cf.read(["nonexistent-file"]) + parsed_files = cf.read(["nonexistent-file"], encoding="utf-8") self.assertEqual(parsed_files, []) # check when we pass no files: cf = self.newconfig() @@ -738,7 +738,7 @@ self.assertEqual(parsed_files, []) # check when we pass no files: cf = self.newconfig() - parsed_files = cf.read([]) + parsed_files = cf.read([], encoding="utf-8") self.assertEqual(parsed_files, []) def test_read_returns_file_list_with_bytestring_path(self): @@ -747,7 +747,7 @@ file1_bytestring = support.findfile("cfgparser.1").encode() # check when passing an existing bytestring path cf = self.newconfig() - parsed_files = cf.read(file1_bytestring) + parsed_files = cf.read(file1_bytestring, encoding="utf-8") self.assertEqual(parsed_files, [file1_bytestring]) # check when passing an non-existing bytestring path cf = self.newconfig() @@ -751,7 +751,7 @@ self.assertEqual(parsed_files, [file1_bytestring]) # check when passing an non-existing bytestring path cf = self.newconfig() - parsed_files = cf.read(b'nonexistent-file') + parsed_files = cf.read(b'nonexistent-file', encoding="utf-8") self.assertEqual(parsed_files, []) # check when passing both an existing and non-existing bytestring path cf = self.newconfig() @@ -755,7 +755,7 @@ self.assertEqual(parsed_files, []) # check when passing both an existing and non-existing bytestring path cf = self.newconfig() - parsed_files = cf.read([file1_bytestring, b'nonexistent-file']) + parsed_files = cf.read([file1_bytestring, b'nonexistent-file'], encoding="utf-8") self.assertEqual(parsed_files, [file1_bytestring]) # shared by subclasses @@ -1064,7 +1064,7 @@ cf.add_section(s) for j in range(10): cf.set(s, 'lovely_spam{}'.format(j), self.wonderful_spam) - with open(os_helper.TESTFN, 'w') as f: + with open(os_helper.TESTFN, 'w', encoding="utf-8") as f: cf.write(f) def tearDown(self): @@ -1074,7 +1074,7 @@ # We're reading from file because this is where the code changed # during performance updates in Python 3.2 cf_from_file = self.newconfig() - with open(os_helper.TESTFN) as f: + with open(os_helper.TESTFN, encoding="utf-8") as f: cf_from_file.read_file(f) self.assertEqual(cf_from_file.get('section8', 'lovely_spam4'), self.wonderful_spam.replace('\t\n', '\n')) @@ -1473,7 +1473,7 @@ class FakeFile: def __init__(self): file_path = support.findfile("cfgparser.1") - with open(file_path) as f: + with open(file_path, encoding="utf-8") as f: self.lines = f.readlines() self.lines.reverse() @@ -1500,7 +1500,7 @@ pass # unfortunately we can't test bytes on this path for file_path in file_paths: parser = configparser.ConfigParser() - with open(file_path) as f: + with open(file_path, encoding="utf-8") as f: parser.read_file(f) self.assertIn("Foo Bar", parser) self.assertIn("foo", parser["Foo Bar"]) diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9jb250ZXh0bGliLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9jb250ZXh0bGliLnB5 100644 --- a/Lib/test/test_contextlib.py +++ b/Lib/test/test_contextlib.py @@ -316,9 +316,9 @@ tfn = tempfile.mktemp() try: f = None - with open(tfn, "w") as f: + with open(tfn, "w", encoding="utf-8") as f: self.assertFalse(f.closed) f.write("Booh\n") self.assertTrue(f.closed) f = None with self.assertRaises(ZeroDivisionError): @@ -320,9 +320,9 @@ self.assertFalse(f.closed) f.write("Booh\n") self.assertTrue(f.closed) f = None with self.assertRaises(ZeroDivisionError): - with open(tfn, "r") as f: + with open(tfn, "r", encoding="utf-8") as f: self.assertFalse(f.closed) self.assertEqual(f.read(), "Booh\n") 1 / 0 diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9jc3YucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9jc3YucHk= 100644 --- a/Lib/test/test_csv.py +++ b/Lib/test/test_csv.py @@ -133,7 +133,7 @@ def _write_test(self, fields, expect, **kwargs): - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.writer(fileobj, **kwargs) writer.writerow(fields) fileobj.seek(0) @@ -141,7 +141,7 @@ expect + writer.dialect.lineterminator) def _write_error_test(self, exc, fields, **kwargs): - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.writer(fileobj, **kwargs) with self.assertRaises(exc): writer.writerow(fields) @@ -232,7 +232,7 @@ writer = csv.writer(BrokenFile()) self.assertRaises(OSError, writer.writerows, [['a']]) - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.writer(fileobj) self.assertRaises(TypeError, writer.writerows, None) writer.writerows([['a', 'b'], ['c', 'd']]) @@ -240,9 +240,9 @@ self.assertEqual(fileobj.read(), "a,b\r\nc,d\r\n") def test_writerows_with_none(self): - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.writer(fileobj) writer.writerows([['a', None], [None, 'd']]) fileobj.seek(0) self.assertEqual(fileobj.read(), "a,\r\n,d\r\n") @@ -244,11 +244,11 @@ writer = csv.writer(fileobj) writer.writerows([['a', None], [None, 'd']]) fileobj.seek(0) self.assertEqual(fileobj.read(), "a,\r\n,d\r\n") - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.writer(fileobj) writer.writerows([[None], ['a']]) fileobj.seek(0) self.assertEqual(fileobj.read(), '""\r\na\r\n') @@ -250,12 +250,12 @@ writer = csv.writer(fileobj) writer.writerows([[None], ['a']]) fileobj.seek(0) self.assertEqual(fileobj.read(), '""\r\na\r\n') - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.writer(fileobj) writer.writerows([['a'], [None]]) fileobj.seek(0) self.assertEqual(fileobj.read(), 'a\r\n""\r\n') def test_writerows_errors(self): @@ -256,10 +256,10 @@ writer = csv.writer(fileobj) writer.writerows([['a'], [None]]) fileobj.seek(0) self.assertEqual(fileobj.read(), 'a\r\n""\r\n') def test_writerows_errors(self): - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.writer(fileobj) self.assertRaises(TypeError, writer.writerows, None) self.assertRaises(OSError, writer.writerows, BadIterable()) @@ -270,7 +270,7 @@ def test_writerows_legacy_strings(self): import _testcapi c = _testcapi.unicode_legacy_string('a') - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.writer(fileobj) writer.writerows([[c]]) fileobj.seek(0) @@ -367,7 +367,7 @@ self.assertEqual(r.line_num, 3) def test_roundtrip_quoteed_newlines(self): - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.writer(fileobj) rows = [['a\nb','b'],['c','x\r\nd']] writer.writerows(rows) @@ -376,7 +376,7 @@ self.assertEqual(row, rows[i]) def test_roundtrip_escaped_unquoted_newlines(self): - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.writer(fileobj,quoting=csv.QUOTE_NONE,escapechar="\\") rows = [['a\nb','b'],['c','x\r\nd']] writer.writerows(rows) @@ -432,7 +432,7 @@ quoting = csv.QUOTE_NONE escapechar = "\\" - with TemporaryFile("w+") as fileobj: + with TemporaryFile("w+", encoding="utf-8") as fileobj: fileobj.write("abc def\nc1ccccc1 benzene\n") fileobj.seek(0) reader = csv.reader(fileobj, dialect=space()) @@ -493,7 +493,7 @@ class TestCsvBase(unittest.TestCase): def readerAssertEqual(self, input, expected_result): - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: fileobj.write(input) fileobj.seek(0) reader = csv.reader(fileobj, dialect = self.dialect) @@ -501,7 +501,7 @@ self.assertEqual(fields, expected_result) def writerAssertEqual(self, input, expected_result): - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.writer(fileobj, dialect = self.dialect) writer.writerows(input) fileobj.seek(0) @@ -643,9 +643,9 @@ ### "long" means the row is longer than the number of fieldnames ### "short" means there are fewer elements in the row than fieldnames def test_writeheader_return_value(self): - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.DictWriter(fileobj, fieldnames = ["f1", "f2", "f3"]) writeheader_return_value = writer.writeheader() self.assertEqual(writeheader_return_value, 10) def test_write_simple_dict(self): @@ -647,9 +647,9 @@ writer = csv.DictWriter(fileobj, fieldnames = ["f1", "f2", "f3"]) writeheader_return_value = writer.writeheader() self.assertEqual(writeheader_return_value, 10) def test_write_simple_dict(self): - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.DictWriter(fileobj, fieldnames = ["f1", "f2", "f3"]) writer.writeheader() fileobj.seek(0) @@ -674,7 +674,7 @@ self.assertRaises(TypeError, csv.DictWriter, fileobj) def test_write_fields_not_in_fieldnames(self): - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.DictWriter(fileobj, fieldnames = ["f1", "f2", "f3"]) # Of special note is the non-string key (issue 19449) with self.assertRaises(ValueError) as cx: @@ -704,7 +704,7 @@ self.assertEqual(fileobj.getvalue(), "1,2\r\n") def test_read_dict_fields(self): - with TemporaryFile("w+") as fileobj: + with TemporaryFile("w+", encoding="utf-8") as fileobj: fileobj.write("1,2,abc\r\n") fileobj.seek(0) reader = csv.DictReader(fileobj, @@ -712,7 +712,7 @@ self.assertEqual(next(reader), {"f1": '1', "f2": '2', "f3": 'abc'}) def test_read_dict_no_fieldnames(self): - with TemporaryFile("w+") as fileobj: + with TemporaryFile("w+", encoding="utf-8") as fileobj: fileobj.write("f1,f2,f3\r\n1,2,abc\r\n") fileobj.seek(0) reader = csv.DictReader(fileobj) @@ -722,7 +722,7 @@ # Two test cases to make sure existing ways of implicitly setting # fieldnames continue to work. Both arise from discussion in issue3436. def test_read_dict_fieldnames_from_file(self): - with TemporaryFile("w+") as fileobj: + with TemporaryFile("w+", encoding="utf-8") as fileobj: fileobj.write("f1,f2,f3\r\n1,2,abc\r\n") fileobj.seek(0) reader = csv.DictReader(fileobj, @@ -732,7 +732,7 @@ def test_read_dict_fieldnames_chain(self): import itertools - with TemporaryFile("w+") as fileobj: + with TemporaryFile("w+", encoding="utf-8") as fileobj: fileobj.write("f1,f2,f3\r\n1,2,abc\r\n") fileobj.seek(0) reader = csv.DictReader(fileobj) @@ -742,7 +742,7 @@ self.assertEqual(row, {"f1": '1', "f2": '2', "f3": 'abc'}) def test_read_long(self): - with TemporaryFile("w+") as fileobj: + with TemporaryFile("w+", encoding="utf-8") as fileobj: fileobj.write("1,2,abc,4,5,6\r\n") fileobj.seek(0) reader = csv.DictReader(fileobj, @@ -751,7 +751,7 @@ None: ["abc", "4", "5", "6"]}) def test_read_long_with_rest(self): - with TemporaryFile("w+") as fileobj: + with TemporaryFile("w+", encoding="utf-8") as fileobj: fileobj.write("1,2,abc,4,5,6\r\n") fileobj.seek(0) reader = csv.DictReader(fileobj, @@ -760,7 +760,7 @@ "_rest": ["abc", "4", "5", "6"]}) def test_read_long_with_rest_no_fieldnames(self): - with TemporaryFile("w+") as fileobj: + with TemporaryFile("w+", encoding="utf-8") as fileobj: fileobj.write("f1,f2\r\n1,2,abc,4,5,6\r\n") fileobj.seek(0) reader = csv.DictReader(fileobj, restkey="_rest") @@ -769,7 +769,7 @@ "_rest": ["abc", "4", "5", "6"]}) def test_read_short(self): - with TemporaryFile("w+") as fileobj: + with TemporaryFile("w+", encoding="utf-8") as fileobj: fileobj.write("1,2,abc,4,5,6\r\n1,2,abc\r\n") fileobj.seek(0) reader = csv.DictReader(fileobj, @@ -818,7 +818,7 @@ contents = [(20-i) for i in range(20)] a = array.array('i', contents) - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.writer(fileobj, dialect="excel") writer.writerow(a) expected = ",".join([str(i) for i in a])+"\r\n" @@ -829,7 +829,7 @@ import array contents = [(20-i)*0.1 for i in range(20)] a = array.array('d', contents) - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.writer(fileobj, dialect="excel") writer.writerow(a) expected = ",".join([str(i) for i in a])+"\r\n" @@ -840,7 +840,7 @@ import array contents = [(20-i)*0.1 for i in range(20)] a = array.array('f', contents) - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.writer(fileobj, dialect="excel") writer.writerow(a) expected = ",".join([str(i) for i in a])+"\r\n" @@ -851,7 +851,7 @@ import array, string a = array.array('u', string.ascii_letters) - with TemporaryFile("w+", newline='') as fileobj: + with TemporaryFile("w+", encoding="utf-8", newline='') as fileobj: writer = csv.writer(fileobj, dialect="excel") writer.writerow(a) expected = ",".join(a)+"\r\n" diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9jdXJzZXMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9jdXJzZXMucHk= 100644 --- a/Lib/test/test_curses.py +++ b/Lib/test/test_curses.py @@ -568,13 +568,12 @@ @requires_curses_window_meth('enclose') def test_enclose(self): win = curses.newwin(5, 15, 2, 5) - # TODO: Return bool instead of 1/0 - self.assertTrue(win.enclose(2, 5)) - self.assertFalse(win.enclose(1, 5)) - self.assertFalse(win.enclose(2, 4)) - self.assertTrue(win.enclose(6, 19)) - self.assertFalse(win.enclose(7, 19)) - self.assertFalse(win.enclose(6, 20)) + self.assertIs(win.enclose(2, 5), True) + self.assertIs(win.enclose(1, 5), False) + self.assertIs(win.enclose(2, 4), False) + self.assertIs(win.enclose(6, 19), True) + self.assertIs(win.enclose(7, 19), False) + self.assertIs(win.enclose(6, 20), False) def test_putwin(self): win = curses.newwin(5, 12, 1, 2) @@ -1176,6 +1175,7 @@ class MiscTests(unittest.TestCase): + @requires_curses_func('update_lines_cols') def test_update_lines_cols(self): curses.update_lines_cols() lines, cols = curses.LINES, curses.COLS diff --git a/Lib/test/test_dataclasses.py b/Lib/test/test_dataclasses.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9kYXRhY2xhc3Nlcy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9kYXRhY2xhc3Nlcy5weQ== 100644 --- a/Lib/test/test_dataclasses.py +++ b/Lib/test/test_dataclasses.py @@ -2594,6 +2594,30 @@ self.assertEqual(d.i, 0) self.assertEqual(d.j, 10) + def test_inherit_nonfrozen_from_empty_frozen(self): + @dataclass(frozen=True) + class C: + pass + + with self.assertRaisesRegex(TypeError, + 'cannot inherit non-frozen dataclass from a frozen one'): + @dataclass + class D(C): + j: int + + def test_inherit_nonfrozen_from_empty(self): + @dataclass + class C: + pass + + @dataclass + class D(C): + j: int + + d = D(3) + self.assertEqual(d.j, 3) + self.assertIsInstance(d, C) + # Test both ways: with an intermediate normal (non-dataclass) # class and without an intermediate class. def test_inherit_nonfrozen_from_frozen(self): @@ -3251,6 +3275,24 @@ c = replace(c, x=3, y=5) self.assertEqual(c.x, 15) + def test_initvar_with_default_value(self): + @dataclass + class C: + x: int + y: InitVar[int] = None + z: InitVar[int] = 42 + + def __post_init__(self, y, z): + if y is not None: + self.x += y + if z is not None: + self.x += z + + c = C(x=1, y=10, z=1) + self.assertEqual(replace(c), C(x=12)) + self.assertEqual(replace(c, y=4), C(x=12, y=4, z=42)) + self.assertEqual(replace(c, y=4, z=1), C(x=12, y=4, z=1)) + def test_recursive_repr(self): @dataclass class C: @@ -3383,10 +3425,10 @@ self.assertEqual(C(42).__match_args__, ('a',)) def test_explicit_match_args(self): - ma = [] + ma = () @dataclass class C: a: int __match_args__ = ma self.assertIs(C(42).__match_args__, ma) @@ -3387,9 +3429,58 @@ @dataclass class C: a: int __match_args__ = ma self.assertIs(C(42).__match_args__, ma) + def test_bpo_43764(self): + @dataclass(repr=False, eq=False, init=False) + class X: + a: int + b: int + c: int + self.assertEqual(X.__match_args__, ("a", "b", "c")) + + def test_match_args_argument(self): + @dataclass(match_args=False) + class X: + a: int + self.assertNotIn('__match_args__', X.__dict__) + + @dataclass(match_args=False) + class Y: + a: int + __match_args__ = ('b',) + self.assertEqual(Y.__match_args__, ('b',)) + + @dataclass(match_args=False) + class Z(Y): + z: int + self.assertEqual(Z.__match_args__, ('b',)) + + # Ensure parent dataclass __match_args__ is seen, if child class + # specifies match_args=False. + @dataclass + class A: + a: int + z: int + @dataclass(match_args=False) + class B(A): + b: int + self.assertEqual(B.__match_args__, ('a', 'z')) + + def test_make_dataclasses(self): + C = make_dataclass('C', [('x', int), ('y', int)]) + self.assertEqual(C.__match_args__, ('x', 'y')) + + C = make_dataclass('C', [('x', int), ('y', int)], match_args=True) + self.assertEqual(C.__match_args__, ('x', 'y')) + + C = make_dataclass('C', [('x', int), ('y', int)], match_args=False) + self.assertNotIn('__match__args__', C.__dict__) + + C = make_dataclass('C', [('x', int), ('y', int)], namespace={'__match_args__': ('z',)}) + self.assertEqual(C.__match_args__, ('z',)) + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_dbm_dumb.py b/Lib/test/test_dbm_dumb.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9kYm1fZHVtYi5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9kYm1fZHVtYi5weQ== 100644 --- a/Lib/test/test_dbm_dumb.py +++ b/Lib/test/test_dbm_dumb.py @@ -232,7 +232,7 @@ self.assertEqual(f.keys(), []) def test_eval(self): - with open(_fname + '.dir', 'w') as stream: + with open(_fname + '.dir', 'w', encoding="utf-8") as stream: stream.write("str(print('Hacked!')), 0\n") with support.captured_stdout() as stdout: with self.assertRaises(ValueError): diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9kZWNpbWFsLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9kZWNpbWFsLnB5 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -43,13 +43,6 @@ import inspect import threading -from _testcapi import decimal_is_special -from _testcapi import decimal_is_nan -from _testcapi import decimal_is_infinite -from _testcapi import decimal_get_digits -from _testcapi import decimal_as_triple -from _testcapi import decimal_from_triple - C = import_fresh_module('decimal', fresh=['_decimal']) P = import_fresh_module('decimal', blocked=['_decimal']) @@ -296,7 +289,7 @@ global skip_expected if skip_expected: raise unittest.SkipTest - with open(file) as f: + with open(file, encoding="utf-8") as f: for line in f: line = line.replace('\r\n', '').replace('\n', '') #print line @@ -4758,175 +4751,6 @@ self.assertEqual(C.DecTraps, C.DecErrors|C.DecOverflow|C.DecUnderflow) - def test_decimal_api_predicates(self): - # Capsule API - - d = C.Decimal("0") - self.assertFalse(decimal_is_special(d)) - self.assertFalse(decimal_is_nan(d)) - self.assertFalse(decimal_is_infinite(d)) - - d = C.Decimal("NaN") - self.assertTrue(decimal_is_special(d)) - self.assertTrue(decimal_is_nan(d)) - self.assertFalse(decimal_is_infinite(d)) - - d = C.Decimal("sNaN") - self.assertTrue(decimal_is_special(d)) - self.assertTrue(decimal_is_nan(d)) - self.assertFalse(decimal_is_infinite(d)) - - d = C.Decimal("inf") - self.assertTrue(decimal_is_special(d)) - self.assertFalse(decimal_is_nan(d)) - self.assertTrue(decimal_is_infinite(d)) - - def test_decimal_api_get_digits(self): - # Capsule API - - d = C.Decimal("0") - self.assertEqual(decimal_get_digits(d), 1) - - d = C.Decimal("1234567890") - self.assertEqual(decimal_get_digits(d), 10) - - d = C.Decimal("inf") - self.assertEqual(decimal_get_digits(d), 0) - - d = C.Decimal("NaN") - self.assertEqual(decimal_get_digits(d), 0) - - d = C.Decimal("sNaN") - self.assertEqual(decimal_get_digits(d), 0) - - d = C.Decimal("NaN1234567890") - self.assertEqual(decimal_get_digits(d), 10) - - d = C.Decimal("sNaN1234567890") - self.assertEqual(decimal_get_digits(d), 10) - - def test_decimal_api_triple(self): - # Capsule API - - def as_triple(d): - """Convert a decimal to a decimal triple with a split uint128_t - coefficient: - - (sign, hi, lo, exp) - - It is called 'triple' because (hi, lo) are regarded as a single - uint128_t that is split because not all compilers support uint128_t. - """ - sign, digits, exp = d.as_tuple() - - s = "".join(str(d) for d in digits) - coeff = int(s) if s else 0 - - if coeff < 0 or coeff >= 2**128: - raise ValueError("value out of bounds for a uint128 triple"); - - hi, lo = divmod(coeff, 2**64) - return (sign, hi, lo, exp) - - def from_triple(triple): - """Convert a decimal triple with a split uint128_t coefficient to a string. - """ - sign, hi, lo, exp = triple - coeff = hi * 2**64 + lo - - if coeff < 0 or coeff >= 2**128: - raise ValueError("value out of bounds for a uint128 triple"); - - digits = tuple(int(c) for c in str(coeff)) - - return P.Decimal((sign, digits, exp)) - - signs = ["", "-"] - - coefficients = [ - "000000000000000000000000000000000000000", - - "299999999999999999999999999999999999999", - "299999999999999999990000000000000000000", - "200000000000000000009999999999999999999", - "000000000000000000009999999999999999999", - - "299999999999999999999999999999000000000", - "299999999999999999999000000000999999999", - "299999999999000000000999999999999999999", - "299000000000999999999999999999999999999", - "000999999999999999999999999999999999999", - - "300000000000000000000000000000000000000", - "310000000000000000001000000000000000000", - "310000000000000000000000000000000000000", - "300000000000000000001000000000000000000", - - "340100000000100000000100000000100000000", - "340100000000100000000100000000000000000", - "340100000000100000000000000000100000000", - "340100000000000000000100000000100000000", - "340000000000100000000100000000100000000", - - "340282366920938463463374607431768211455", - ] - - exponents = [ - "E+0", "E+1", "E-1", - "E+%s" % str(C.MAX_EMAX-38), - "E-%s" % str(C.MIN_ETINY+38), - ] - - for sign in signs: - for coeff in coefficients: - for exp in exponents: - s = sign + coeff + exp - - ctriple = decimal_as_triple(C.Decimal(s)) - ptriple = as_triple(P.Decimal(s)) - self.assertEqual(ctriple, ptriple) - - c = decimal_from_triple(ctriple) - p = decimal_from_triple(ptriple) - self.assertEqual(str(c), str(p)) - - for s in ["NaN", "-NaN", "sNaN", "-sNaN", "NaN123", "sNaN123", "inf", "-inf"]: - ctriple = decimal_as_triple(C.Decimal(s)) - ptriple = as_triple(P.Decimal(s)) - self.assertEqual(ctriple, ptriple) - - c = decimal_from_triple(ctriple) - p = decimal_from_triple(ptriple) - self.assertEqual(str(c), str(p)) - - def test_decimal_api_errors(self): - # Capsule API - - self.assertRaises(TypeError, decimal_as_triple, "X") - self.assertRaises(ValueError, decimal_as_triple, C.Decimal(2**128)) - self.assertRaises(ValueError, decimal_as_triple, C.Decimal(-2**128)) - - self.assertRaises(TypeError, decimal_from_triple, "X") - self.assertRaises(ValueError, decimal_from_triple, ()) - self.assertRaises(ValueError, decimal_from_triple, (1, 2, 3, 4, 5)) - self.assertRaises(ValueError, decimal_from_triple, (2**8, 0, 0, 0)) - self.assertRaises(OverflowError, decimal_from_triple, (0, 2**64, 0, 0)) - self.assertRaises(OverflowError, decimal_from_triple, (0, 0, 2**64, 0)) - self.assertRaises(OverflowError, decimal_from_triple, (0, 0, 0, 2**63)) - self.assertRaises(OverflowError, decimal_from_triple, (0, 0, 0, -2**63-1)) - self.assertRaises(ValueError, decimal_from_triple, (0, 0, 0, "X")) - self.assertRaises(TypeError, decimal_from_triple, (0, 0, 0, ())) - - with C.localcontext(C.Context()): - self.assertRaises(C.InvalidOperation, decimal_from_triple, (2, 0, 0, 0)) - self.assertRaises(C.InvalidOperation, decimal_from_triple, (0, 0, 0, 2**63-1)) - self.assertRaises(C.InvalidOperation, decimal_from_triple, (0, 0, 0, -2**63)) - - self.assertRaises(TypeError, decimal_is_special, "X") - self.assertRaises(TypeError, decimal_is_nan, "X") - self.assertRaises(TypeError, decimal_is_infinite, "X") - self.assertRaises(TypeError, decimal_get_digits, "X") - class CWhitebox(unittest.TestCase): """Whitebox testing for _decimal""" diff --git a/Lib/test/test_decorators.py b/Lib/test/test_decorators.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9kZWNvcmF0b3JzLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9kZWNvcmF0b3JzLnB5 100644 --- a/Lib/test/test_decorators.py +++ b/Lib/test/test_decorators.py @@ -1,3 +1,4 @@ +from test import support import unittest def funcattrs(**kwds): @@ -76,7 +77,6 @@ self.assertEqual(C.foo(), 42) self.assertEqual(C().foo(), 42) - def test_staticmethod_function(self): - @staticmethod - def notamethod(x): + def check_wrapper_attrs(self, method_wrapper, format_str): + def func(x): return x @@ -82,5 +82,27 @@ return x - self.assertRaises(TypeError, notamethod, 1) + wrapper = method_wrapper(func) + + self.assertIs(wrapper.__func__, func) + self.assertIs(wrapper.__wrapped__, func) + + for attr in ('__module__', '__qualname__', '__name__', + '__doc__', '__annotations__'): + self.assertIs(getattr(wrapper, attr), + getattr(func, attr)) + + self.assertEqual(repr(wrapper), format_str.format(func)) + return wrapper + + def test_staticmethod(self): + wrapper = self.check_wrapper_attrs(staticmethod, '<staticmethod({!r})>') + + # bpo-43682: Static methods are callable since Python 3.10 + self.assertEqual(wrapper(1), 1) + + def test_classmethod(self): + wrapper = self.check_wrapper_attrs(classmethod, '<classmethod({!r})>') + + self.assertRaises(TypeError, wrapper, 1) def test_dotted(self): decorators = MiscDecorators() diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9kZXNjci5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9kZXNjci5weQ== 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1545,7 +1545,9 @@ self.assertEqual(d.foo(1), (d, 1)) self.assertEqual(D.foo(d, 1), (d, 1)) # Test for a specific crash (SF bug 528132) - def f(cls, arg): return (cls, arg) + def f(cls, arg): + "f docstring" + return (cls, arg) ff = classmethod(f) self.assertEqual(ff.__get__(0, int)(42), (int, 42)) self.assertEqual(ff.__get__(0)(42), (int, 42)) @@ -1571,6 +1573,12 @@ self.fail("classmethod shouldn't accept keyword args") cm = classmethod(f) - self.assertEqual(cm.__dict__, {}) + cm_dict = {'__annotations__': {}, + '__doc__': "f docstring", + '__module__': __name__, + '__name__': 'f', + '__qualname__': f.__qualname__} + self.assertEqual(cm.__dict__, cm_dict) + cm.x = 42 self.assertEqual(cm.x, 42) @@ -1575,6 +1583,6 @@ cm.x = 42 self.assertEqual(cm.x, 42) - self.assertEqual(cm.__dict__, {"x" : 42}) + self.assertEqual(cm.__dict__, {"x" : 42, **cm_dict}) del cm.x self.assertNotHasAttr(cm, "x") @@ -1654,6 +1662,6 @@ self.assertEqual(d.foo(1), (d, 1)) self.assertEqual(D.foo(d, 1), (d, 1)) sm = staticmethod(None) - self.assertEqual(sm.__dict__, {}) + self.assertEqual(sm.__dict__, {'__doc__': None}) sm.x = 42 self.assertEqual(sm.x, 42) @@ -1658,6 +1666,6 @@ sm.x = 42 self.assertEqual(sm.x, 42) - self.assertEqual(sm.__dict__, {"x" : 42}) + self.assertEqual(sm.__dict__, {"x" : 42, '__doc__': None}) del sm.x self.assertNotHasAttr(sm, "x") diff --git a/Lib/test/test_difflib.py b/Lib/test/test_difflib.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9kaWZmbGliLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9kaWZmbGliLnB5 100644 --- a/Lib/test/test_difflib.py +++ b/Lib/test/test_difflib.py @@ -241,7 +241,7 @@ #with open('test_difflib_expect.html','w') as fp: # fp.write(actual) - with open(findfile('test_difflib_expect.html')) as fp: + with open(findfile('test_difflib_expect.html'), encoding="utf-8") as fp: self.assertEqual(actual, fp.read()) def test_recursion_limit(self): diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9kaXMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9kaXMucHk= 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -127,6 +127,6 @@ %3d 6 CALL_FUNCTION 2 8 GET_ITER - >> 10 FOR_ITER 4 (to 16) + >> 10 FOR_ITER 2 (to 16) 12 STORE_FAST 0 (res) @@ -131,6 +131,6 @@ 12 STORE_FAST 0 (res) -%3d 14 JUMP_ABSOLUTE 10 +%3d 14 JUMP_ABSOLUTE 5 (to 10) %3d >> 16 LOAD_CONST 0 (None) 18 RETURN_VALUE @@ -276,7 +276,7 @@ 10 INPLACE_ADD 12 STORE_NAME 0 (x) - 2 14 JUMP_ABSOLUTE 6 + 2 14 JUMP_ABSOLUTE 3 (to 6) """ dis_traceback = """\ @@ -280,7 +280,7 @@ """ dis_traceback = """\ -%3d 0 SETUP_FINALLY 14 (to 16) +%3d 0 SETUP_FINALLY 7 (to 16) %3d 2 LOAD_CONST 1 (1) 4 LOAD_CONST 2 (0) @@ -293,7 +293,7 @@ %3d >> 16 DUP_TOP 18 LOAD_GLOBAL 0 (Exception) - 20 JUMP_IF_NOT_EXC_MATCH 58 + 20 JUMP_IF_NOT_EXC_MATCH 29 (to 58) 22 POP_TOP 24 STORE_FAST 0 (e) 26 POP_TOP @@ -297,7 +297,7 @@ 22 POP_TOP 24 STORE_FAST 0 (e) 26 POP_TOP - 28 SETUP_FINALLY 20 (to 50) + 28 SETUP_FINALLY 10 (to 50) %3d 30 LOAD_FAST 0 (e) 32 LOAD_ATTR 1 (__traceback__) @@ -358,7 +358,7 @@ b() dis_tryfinally = """\ -%3d 0 SETUP_FINALLY 12 (to 14) +%3d 0 SETUP_FINALLY 6 (to 14) %3d 2 LOAD_FAST 0 (a) 4 POP_BLOCK @@ -377,7 +377,7 @@ ) dis_tryfinallyconst = """\ -%3d 0 SETUP_FINALLY 12 (to 14) +%3d 0 SETUP_FINALLY 6 (to 14) %3d 2 POP_BLOCK @@ -450,9 +450,9 @@ Disassembly of <code object <listcomp> at 0x..., file "%s", line %d>: %3d 0 BUILD_LIST 0 2 LOAD_FAST 0 (.0) - >> 4 FOR_ITER 12 (to 18) + >> 4 FOR_ITER 6 (to 18) 6 STORE_FAST 1 (z) 8 LOAD_DEREF 0 (x) 10 LOAD_FAST 1 (z) 12 BINARY_ADD 14 LIST_APPEND 2 @@ -454,9 +454,9 @@ 6 STORE_FAST 1 (z) 8 LOAD_DEREF 0 (x) 10 LOAD_FAST 1 (z) 12 BINARY_ADD 14 LIST_APPEND 2 - 16 JUMP_ABSOLUTE 4 + 16 JUMP_ABSOLUTE 2 (to 4) >> 18 RETURN_VALUE """ % (dis_nested_1, __file__, @@ -1009,7 +1009,7 @@ Instruction(opname='LOAD_CONST', opcode=100, arg=1, argval=10, argrepr='10', offset=2, starts_line=None, is_jump_target=False), Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='', offset=4, starts_line=None, is_jump_target=False), Instruction(opname='GET_ITER', opcode=68, arg=None, argval=None, argrepr='', offset=6, starts_line=None, is_jump_target=False), - Instruction(opname='FOR_ITER', opcode=93, arg=34, argval=44, argrepr='to 44', offset=8, starts_line=None, is_jump_target=True), + Instruction(opname='FOR_ITER', opcode=93, arg=17, argval=44, argrepr='to 44', offset=8, starts_line=None, is_jump_target=True), Instruction(opname='STORE_FAST', opcode=125, arg=0, argval='i', argrepr='i', offset=10, starts_line=None, is_jump_target=False), Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=12, starts_line=4, is_jump_target=False), Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=14, starts_line=None, is_jump_target=False), @@ -1018,8 +1018,8 @@ Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=20, starts_line=5, is_jump_target=False), Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=22, starts_line=None, is_jump_target=False), Instruction(opname='COMPARE_OP', opcode=107, arg=0, argval='<', argrepr='<', offset=24, starts_line=None, is_jump_target=False), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=30, argval=30, argrepr='', offset=26, starts_line=None, is_jump_target=False), - Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=8, argval=8, argrepr='', offset=28, starts_line=6, is_jump_target=False), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=15, argval=30, argrepr='to 30', offset=26, starts_line=None, is_jump_target=False), + Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=4, argval=8, argrepr='to 8', offset=28, starts_line=6, is_jump_target=False), Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=30, starts_line=7, is_jump_target=True), Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=32, starts_line=None, is_jump_target=False), Instruction(opname='COMPARE_OP', opcode=107, arg=4, argval='>', argrepr='>', offset=34, starts_line=None, is_jump_target=False), @@ -1023,5 +1023,5 @@ Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=30, starts_line=7, is_jump_target=True), Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=32, starts_line=None, is_jump_target=False), Instruction(opname='COMPARE_OP', opcode=107, arg=4, argval='>', argrepr='>', offset=34, starts_line=None, is_jump_target=False), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=42, argval=42, argrepr='', offset=36, starts_line=None, is_jump_target=False), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=21, argval=42, argrepr='to 42', offset=36, starts_line=None, is_jump_target=False), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=38, starts_line=8, is_jump_target=False), @@ -1027,8 +1027,8 @@ Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=38, starts_line=8, is_jump_target=False), - Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=52, argval=52, argrepr='', offset=40, starts_line=None, is_jump_target=False), - Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=8, argval=8, argrepr='', offset=42, starts_line=7, is_jump_target=True), + Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=26, argval=52, argrepr='to 52', offset=40, starts_line=None, is_jump_target=False), + Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=4, argval=8, argrepr='to 8', offset=42, starts_line=7, is_jump_target=True), Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=44, starts_line=10, is_jump_target=True), Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='I can haz else clause?', argrepr="'I can haz else clause?'", offset=46, starts_line=None, is_jump_target=False), Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='', offset=48, starts_line=None, is_jump_target=False), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=50, starts_line=None, is_jump_target=False), Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=52, starts_line=11, is_jump_target=True), @@ -1030,9 +1030,9 @@ Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=44, starts_line=10, is_jump_target=True), Instruction(opname='LOAD_CONST', opcode=100, arg=4, argval='I can haz else clause?', argrepr="'I can haz else clause?'", offset=46, starts_line=None, is_jump_target=False), Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='', offset=48, starts_line=None, is_jump_target=False), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=50, starts_line=None, is_jump_target=False), Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=52, starts_line=11, is_jump_target=True), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=96, argval=96, argrepr='', offset=54, starts_line=None, is_jump_target=False), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=48, argval=96, argrepr='to 96', offset=54, starts_line=None, is_jump_target=False), Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=56, starts_line=12, is_jump_target=True), Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=58, starts_line=None, is_jump_target=False), Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='', offset=60, starts_line=None, is_jump_target=False), @@ -1044,8 +1044,8 @@ Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=72, starts_line=14, is_jump_target=False), Instruction(opname='LOAD_CONST', opcode=100, arg=3, argval=6, argrepr='6', offset=74, starts_line=None, is_jump_target=False), Instruction(opname='COMPARE_OP', opcode=107, arg=4, argval='>', argrepr='>', offset=76, starts_line=None, is_jump_target=False), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=82, argval=82, argrepr='', offset=78, starts_line=None, is_jump_target=False), - Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=52, argval=52, argrepr='', offset=80, starts_line=15, is_jump_target=False), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=41, argval=82, argrepr='to 82', offset=78, starts_line=None, is_jump_target=False), + Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=26, argval=52, argrepr='to 52', offset=80, starts_line=15, is_jump_target=False), Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=82, starts_line=16, is_jump_target=True), Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=84, starts_line=None, is_jump_target=False), Instruction(opname='COMPARE_OP', opcode=107, arg=0, argval='<', argrepr='<', offset=86, starts_line=None, is_jump_target=False), @@ -1049,6 +1049,6 @@ Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=82, starts_line=16, is_jump_target=True), Instruction(opname='LOAD_CONST', opcode=100, arg=2, argval=4, argrepr='4', offset=84, starts_line=None, is_jump_target=False), Instruction(opname='COMPARE_OP', opcode=107, arg=0, argval='<', argrepr='<', offset=86, starts_line=None, is_jump_target=False), - Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=92, argval=92, argrepr='', offset=88, starts_line=None, is_jump_target=False), - Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=104, argval=104, argrepr='', offset=90, starts_line=17, is_jump_target=False), + Instruction(opname='POP_JUMP_IF_FALSE', opcode=114, arg=46, argval=92, argrepr='to 92', offset=88, starts_line=None, is_jump_target=False), + Instruction(opname='JUMP_ABSOLUTE', opcode=113, arg=52, argval=104, argrepr='to 104', offset=90, starts_line=17, is_jump_target=False), Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=92, starts_line=11, is_jump_target=True), @@ -1054,6 +1054,6 @@ Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=92, starts_line=11, is_jump_target=True), - Instruction(opname='POP_JUMP_IF_TRUE', opcode=115, arg=56, argval=56, argrepr='', offset=94, starts_line=None, is_jump_target=False), + Instruction(opname='POP_JUMP_IF_TRUE', opcode=115, arg=28, argval=56, argrepr='to 56', offset=94, starts_line=None, is_jump_target=False), Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=96, starts_line=19, is_jump_target=True), Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval='Who let lolcatz into this test suite?', argrepr="'Who let lolcatz into this test suite?'", offset=98, starts_line=None, is_jump_target=False), Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='', offset=100, starts_line=None, is_jump_target=False), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=102, starts_line=None, is_jump_target=False), @@ -1056,11 +1056,11 @@ Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=96, starts_line=19, is_jump_target=True), Instruction(opname='LOAD_CONST', opcode=100, arg=6, argval='Who let lolcatz into this test suite?', argrepr="'Who let lolcatz into this test suite?'", offset=98, starts_line=None, is_jump_target=False), Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='', offset=100, starts_line=None, is_jump_target=False), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=102, starts_line=None, is_jump_target=False), - Instruction(opname='SETUP_FINALLY', opcode=122, arg=96, argval=202, argrepr='to 202', offset=104, starts_line=20, is_jump_target=True), - Instruction(opname='SETUP_FINALLY', opcode=122, arg=12, argval=120, argrepr='to 120', offset=106, starts_line=None, is_jump_target=False), + Instruction(opname='SETUP_FINALLY', opcode=122, arg=48, argval=202, argrepr='to 202', offset=104, starts_line=20, is_jump_target=True), + Instruction(opname='SETUP_FINALLY', opcode=122, arg=6, argval=120, argrepr='to 120', offset=106, starts_line=None, is_jump_target=False), Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=108, starts_line=21, is_jump_target=False), Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval=0, argrepr='0', offset=110, starts_line=None, is_jump_target=False), Instruction(opname='BINARY_TRUE_DIVIDE', opcode=27, arg=None, argval=None, argrepr='', offset=112, starts_line=None, is_jump_target=False), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=114, starts_line=None, is_jump_target=False), Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=116, starts_line=None, is_jump_target=False), @@ -1062,8 +1062,8 @@ Instruction(opname='LOAD_CONST', opcode=100, arg=5, argval=1, argrepr='1', offset=108, starts_line=21, is_jump_target=False), Instruction(opname='LOAD_CONST', opcode=100, arg=7, argval=0, argrepr='0', offset=110, starts_line=None, is_jump_target=False), Instruction(opname='BINARY_TRUE_DIVIDE', opcode=27, arg=None, argval=None, argrepr='', offset=112, starts_line=None, is_jump_target=False), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=114, starts_line=None, is_jump_target=False), Instruction(opname='POP_BLOCK', opcode=87, arg=None, argval=None, argrepr='', offset=116, starts_line=None, is_jump_target=False), - Instruction(opname='JUMP_FORWARD', opcode=110, arg=24, argval=144, argrepr='to 144', offset=118, starts_line=None, is_jump_target=False), + Instruction(opname='JUMP_FORWARD', opcode=110, arg=12, argval=144, argrepr='to 144', offset=118, starts_line=None, is_jump_target=False), Instruction(opname='DUP_TOP', opcode=4, arg=None, argval=None, argrepr='', offset=120, starts_line=22, is_jump_target=True), Instruction(opname='LOAD_GLOBAL', opcode=116, arg=2, argval='ZeroDivisionError', argrepr='ZeroDivisionError', offset=122, starts_line=None, is_jump_target=False), @@ -1068,6 +1068,6 @@ Instruction(opname='DUP_TOP', opcode=4, arg=None, argval=None, argrepr='', offset=120, starts_line=22, is_jump_target=True), Instruction(opname='LOAD_GLOBAL', opcode=116, arg=2, argval='ZeroDivisionError', argrepr='ZeroDivisionError', offset=122, starts_line=None, is_jump_target=False), - Instruction(opname='JUMP_IF_NOT_EXC_MATCH', opcode=121, arg=212, argval=212, argrepr='', offset=124, starts_line=None, is_jump_target=False), + Instruction(opname='JUMP_IF_NOT_EXC_MATCH', opcode=121, arg=106, argval=212, argrepr='to 212', offset=124, starts_line=None, is_jump_target=False), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=126, starts_line=None, is_jump_target=False), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=128, starts_line=None, is_jump_target=False), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=130, starts_line=None, is_jump_target=False), @@ -1076,5 +1076,5 @@ Instruction(opname='CALL_FUNCTION', opcode=131, arg=1, argval=1, argrepr='', offset=136, starts_line=None, is_jump_target=False), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=138, starts_line=None, is_jump_target=False), Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=140, starts_line=None, is_jump_target=False), - Instruction(opname='JUMP_FORWARD', opcode=110, arg=44, argval=188, argrepr='to 188', offset=142, starts_line=None, is_jump_target=False), + Instruction(opname='JUMP_FORWARD', opcode=110, arg=22, argval=188, argrepr='to 188', offset=142, starts_line=None, is_jump_target=False), Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=144, starts_line=25, is_jump_target=True), @@ -1080,5 +1080,5 @@ Instruction(opname='LOAD_FAST', opcode=124, arg=0, argval='i', argrepr='i', offset=144, starts_line=25, is_jump_target=True), - Instruction(opname='SETUP_WITH', opcode=143, arg=24, argval=172, argrepr='to 172', offset=146, starts_line=None, is_jump_target=False), + Instruction(opname='SETUP_WITH', opcode=143, arg=12, argval=172, argrepr='to 172', offset=146, starts_line=None, is_jump_target=False), Instruction(opname='STORE_FAST', opcode=125, arg=1, argval='dodgy', argrepr='dodgy', offset=148, starts_line=None, is_jump_target=False), Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=150, starts_line=26, is_jump_target=False), Instruction(opname='LOAD_CONST', opcode=100, arg=9, argval='Never reach this', argrepr="'Never reach this'", offset=152, starts_line=None, is_jump_target=False), @@ -1090,5 +1090,5 @@ Instruction(opname='DUP_TOP', opcode=4, arg=None, argval=None, argrepr='', offset=164, starts_line=None, is_jump_target=False), Instruction(opname='CALL_FUNCTION', opcode=131, arg=3, argval=3, argrepr='', offset=166, starts_line=None, is_jump_target=False), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=168, starts_line=None, is_jump_target=False), - Instruction(opname='JUMP_FORWARD', opcode=110, arg=16, argval=188, argrepr='to 188', offset=170, starts_line=None, is_jump_target=False), + Instruction(opname='JUMP_FORWARD', opcode=110, arg=8, argval=188, argrepr='to 188', offset=170, starts_line=None, is_jump_target=False), Instruction(opname='WITH_EXCEPT_START', opcode=49, arg=None, argval=None, argrepr='', offset=172, starts_line=None, is_jump_target=True), @@ -1094,5 +1094,5 @@ Instruction(opname='WITH_EXCEPT_START', opcode=49, arg=None, argval=None, argrepr='', offset=172, starts_line=None, is_jump_target=True), - Instruction(opname='POP_JUMP_IF_TRUE', opcode=115, arg=178, argval=178, argrepr='', offset=174, starts_line=None, is_jump_target=False), + Instruction(opname='POP_JUMP_IF_TRUE', opcode=115, arg=89, argval=178, argrepr='to 178', offset=174, starts_line=None, is_jump_target=False), Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=176, starts_line=None, is_jump_target=False), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=178, starts_line=None, is_jump_target=True), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=180, starts_line=None, is_jump_target=False), diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9kb2N0ZXN0LnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9kb2N0ZXN0LnB5 100644 --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -2846,7 +2846,7 @@ >>> from test.support.os_helper import temp_dir >>> with temp_dir() as tmpdir: ... fn = os.path.join(tmpdir, 'myfile.doc') - ... with open(fn, 'w') as f: + ... with open(fn, 'w', encoding='utf-8') as f: ... _ = f.write('This is a very simple test file.\n') ... _ = f.write(' >>> 1 + 1\n') ... _ = f.write(' 2\n') @@ -2898,7 +2898,7 @@ >>> from test.support.os_helper import temp_dir >>> with temp_dir() as tmpdir: ... fn = os.path.join(tmpdir, 'myfile.doc') - ... with open(fn, 'w') as f: + ... with open(fn, 'w', encoding="utf-8") as f: ... _ = f.write('This is another simple test file.\n') ... _ = f.write(' >>> 1 + 1\n') ... _ = f.write(' 2\n') @@ -2909,7 +2909,7 @@ ... _ = f.write('\n') ... _ = f.write('And that is it.\n') ... fn2 = os.path.join(tmpdir, 'myfile2.py') - ... with open(fn2, 'w') as f: + ... with open(fn2, 'w', encoding='utf-8') as f: ... _ = f.write('def test_func():\n') ... _ = f.write(' \"\"\"\n') ... _ = f.write(' This is simple python test function.\n') diff --git a/Lib/test/test_email/__init__.py b/Lib/test/test_email/__init__.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9lbWFpbC9fX2luaXRfXy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9lbWFpbC9fX2luaXRfXy5weQ== 100644 --- a/Lib/test/test_email/__init__.py +++ b/Lib/test/test_email/__init__.py @@ -38,7 +38,7 @@ ndiffAssertEqual = unittest.TestCase.assertEqual def _msgobj(self, filename): - with openfile(filename) as fp: + with openfile(filename, encoding="utf-8") as fp: return email.message_from_file(fp, policy=self.policy) def _str_msg(self, string, message=None, policy=None): diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9lbWFpbC90ZXN0X2VtYWlsLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9lbWFpbC90ZXN0X2VtYWlsLnB5 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -214,7 +214,7 @@ def test_message_rfc822_only(self): # Issue 7970: message/rfc822 not in multipart parsed by # HeaderParser caused an exception when flattened. - with openfile('msg_46.txt') as fp: + with openfile('msg_46.txt', encoding="utf-8") as fp: msgdata = fp.read() parser = HeaderParser() msg = parser.parsestr(msgdata) @@ -225,7 +225,7 @@ def test_byte_message_rfc822_only(self): # Make sure new bytes header parser also passes this. - with openfile('msg_46.txt') as fp: + with openfile('msg_46.txt', encoding="utf-8") as fp: msgdata = fp.read().encode('ascii') parser = email.parser.BytesHeaderParser() msg = parser.parsebytes(msgdata) @@ -274,7 +274,7 @@ def test_decoded_generator(self): eq = self.assertEqual msg = self._msgobj('msg_07.txt') - with openfile('msg_17.txt') as fp: + with openfile('msg_17.txt', encoding="utf-8") as fp: text = fp.read() s = StringIO() g = DecodedGenerator(s) @@ -295,7 +295,7 @@ def test_as_string(self): msg = self._msgobj('msg_01.txt') - with openfile('msg_01.txt') as fp: + with openfile('msg_01.txt', encoding="utf-8") as fp: text = fp.read() self.assertEqual(text, str(msg)) fullrepr = msg.as_string(unixfrom=True) @@ -349,7 +349,7 @@ def test_as_bytes(self): msg = self._msgobj('msg_01.txt') - with openfile('msg_01.txt') as fp: + with openfile('msg_01.txt', encoding="utf-8") as fp: data = fp.read().encode('ascii') self.assertEqual(data, bytes(msg)) fullrepr = msg.as_bytes(unixfrom=True) @@ -2436,7 +2436,7 @@ # Test the MIMEMessage class class TestMIMEMessage(TestEmailBase): def setUp(self): - with openfile('msg_11.txt') as fp: + with openfile('msg_11.txt', encoding="utf-8") as fp: self._text = fp.read() def test_type_error(self): @@ -2555,7 +2555,7 @@ def test_epilogue(self): eq = self.ndiffAssertEqual - with openfile('msg_21.txt') as fp: + with openfile('msg_21.txt', encoding="utf-8") as fp: text = fp.read() msg = Message() msg['From'] = 'aperson@dom.ain' @@ -2610,7 +2610,7 @@ def test_default_type(self): eq = self.assertEqual - with openfile('msg_30.txt') as fp: + with openfile('msg_30.txt', encoding="utf-8") as fp: msg = email.message_from_file(fp) container1 = msg.get_payload(0) eq(container1.get_default_type(), 'message/rfc822') @@ -2627,7 +2627,7 @@ def test_default_type_with_explicit_container_type(self): eq = self.assertEqual - with openfile('msg_28.txt') as fp: + with openfile('msg_28.txt', encoding="utf-8") as fp: msg = email.message_from_file(fp) container1 = msg.get_payload(0) eq(container1.get_default_type(), 'message/rfc822') @@ -2753,7 +2753,7 @@ linesep = '\n' def _msgobj(self, filename): - with openfile(filename) as fp: + with openfile(filename, encoding="utf-8") as fp: data = fp.read() msg = email.message_from_string(data) return msg, data @@ -2909,7 +2909,7 @@ # Test various other bits of the package's functionality class TestMiscellaneous(TestEmailBase): def test_message_from_string(self): - with openfile('msg_01.txt') as fp: + with openfile('msg_01.txt', encoding="utf-8") as fp: text = fp.read() msg = email.message_from_string(text) s = StringIO() @@ -2920,7 +2920,7 @@ self.assertEqual(text, s.getvalue()) def test_message_from_file(self): - with openfile('msg_01.txt') as fp: + with openfile('msg_01.txt', encoding="utf-8") as fp: text = fp.read() fp.seek(0) msg = email.message_from_file(fp) @@ -2932,7 +2932,7 @@ self.assertEqual(text, s.getvalue()) def test_message_from_string_with_class(self): - with openfile('msg_01.txt') as fp: + with openfile('msg_01.txt', encoding="utf-8") as fp: text = fp.read() # Create a subclass @@ -2942,7 +2942,7 @@ msg = email.message_from_string(text, MyMessage) self.assertIsInstance(msg, MyMessage) # Try something more complicated - with openfile('msg_02.txt') as fp: + with openfile('msg_02.txt', encoding="utf-8") as fp: text = fp.read() msg = email.message_from_string(text, MyMessage) for subpart in msg.walk(): @@ -2953,7 +2953,7 @@ class MyMessage(Message): pass - with openfile('msg_01.txt') as fp: + with openfile('msg_01.txt', encoding="utf-8") as fp: msg = email.message_from_file(fp, MyMessage) self.assertIsInstance(msg, MyMessage) # Try something more complicated @@ -2957,7 +2957,7 @@ msg = email.message_from_file(fp, MyMessage) self.assertIsInstance(msg, MyMessage) # Try something more complicated - with openfile('msg_02.txt') as fp: + with openfile('msg_02.txt', encoding="utf-8") as fp: msg = email.message_from_file(fp, MyMessage) for subpart in msg.walk(): self.assertIsInstance(subpart, MyMessage) @@ -3386,7 +3386,7 @@ def test_Generator_linend(self): # Issue 14645. - with openfile('msg_26.txt', newline='\n') as f: + with openfile('msg_26.txt', encoding="utf-8", newline='\n') as f: msgtxt = f.read() msgtxt_nl = msgtxt.replace('\r\n', '\n') msg = email.message_from_string(msgtxt) @@ -3397,7 +3397,7 @@ def test_BytesGenerator_linend(self): # Issue 14645. - with openfile('msg_26.txt', newline='\n') as f: + with openfile('msg_26.txt', encoding="utf-8", newline='\n') as f: msgtxt = f.read() msgtxt_nl = msgtxt.replace('\r\n', '\n') msg = email.message_from_string(msgtxt_nl) @@ -3456,7 +3456,7 @@ it = iterators.body_line_iterator(msg) lines = list(it) eq(len(lines), 43) - with openfile('msg_19.txt') as fp: + with openfile('msg_19.txt', encoding="utf-8") as fp: neq(EMPTYSTRING.join(lines), fp.read()) def test_typed_subpart_iterator(self): @@ -3597,7 +3597,7 @@ def test_header_parser(self): eq = self.assertEqual # Parse only the headers of a complex multipart MIME document - with openfile('msg_02.txt') as fp: + with openfile('msg_02.txt', encoding="utf-8") as fp: msg = HeaderParser().parse(fp) eq(msg['from'], 'ppp-request@zzz.org') eq(msg['to'], 'ppp@zzz.org') @@ -3631,8 +3631,8 @@ self.assertFalse(fp.closed) def test_parser_does_not_close_file(self): - with openfile('msg_02.txt', 'r') as fp: + with openfile('msg_02.txt', encoding="utf-8") as fp: email.parser.Parser().parse(fp) self.assertFalse(fp.closed) def test_parser_on_exception_does_not_close_file(self): @@ -3635,8 +3635,8 @@ email.parser.Parser().parse(fp) self.assertFalse(fp.closed) def test_parser_on_exception_does_not_close_file(self): - with openfile('msg_15.txt', 'r') as fp: + with openfile('msg_15.txt', encoding="utf-8") as fp: parser = email.parser.Parser self.assertRaises(email.errors.StartBoundaryNotFoundDefect, parser(policy=email.policy.strict).parse, fp) @@ -3680,7 +3680,7 @@ def test_crlf_separation(self): eq = self.assertEqual - with openfile('msg_26.txt', newline='\n') as fp: + with openfile('msg_26.txt', encoding="utf-8", newline='\n') as fp: msg = Parser().parse(fp) eq(len(msg.get_payload()), 2) part1 = msg.get_payload(0) @@ -3691,7 +3691,7 @@ def test_crlf_flatten(self): # Using newline='\n' preserves the crlfs in this input file. - with openfile('msg_26.txt', newline='\n') as fp: + with openfile('msg_26.txt', encoding="utf-8", newline='\n') as fp: text = fp.read() msg = email.message_from_string(text) s = StringIO() @@ -3704,7 +3704,7 @@ def test_multipart_digest_with_extra_mime_headers(self): eq = self.assertEqual neq = self.ndiffAssertEqual - with openfile('msg_28.txt') as fp: + with openfile('msg_28.txt', encoding="utf-8") as fp: msg = email.message_from_file(fp) # Structure is: # multipart/digest @@ -4261,7 +4261,7 @@ def test_encode(self): eq = self.assertEqual - eq(base64mime.body_encode(b''), b'') + eq(base64mime.body_encode(b''), '') eq(base64mime.body_encode(b'hello'), 'aGVsbG8=\n') # Test the binary flag eq(base64mime.body_encode(b'hello\n'), 'aGVsbG8K\n') @@ -4292,7 +4292,6 @@ eq(he('hello\nworld'), '=?iso-8859-1?b?aGVsbG8Kd29ybGQ=?=') - class TestQuopri(unittest.TestCase): def setUp(self): # Set of characters (as byte integers) that don't need to be encoded @@ -5448,7 +5447,7 @@ class TestSigned(TestEmailBase): def _msg_and_obj(self, filename): - with openfile(filename) as fp: + with openfile(filename, encoding="utf-8") as fp: original = fp.read() msg = email.message_from_string(original) return original, msg diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9lbWJlZC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9lbWJlZC5weQ== 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -389,6 +389,7 @@ 'site_import': 1, 'bytes_warning': 0, + 'warn_default_encoding': 0, 'inspect': 0, 'interactive': 0, 'optimization_level': 0, diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9lbnVtLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9lbnVtLnB5 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -7,7 +7,7 @@ import unittest import threading from collections import OrderedDict -from enum import Enum, IntEnum, StrEnum, EnumMeta, Flag, IntFlag, unique, auto +from enum import Enum, IntEnum, StrEnum, EnumType, Flag, IntFlag, unique, auto from enum import STRICT, CONFORM, EJECT, KEEP from io import StringIO from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL @@ -262,11 +262,8 @@ self.assertIn(e, Season) self.assertIs(type(e), Season) self.assertIsInstance(e, Season) - self.assertEqual(str(e), 'Season.' + season) - self.assertEqual( - repr(e), - '<Season.{0}: {1}>'.format(season, i), - ) + self.assertEqual(str(e), season) + self.assertEqual(repr(e), 'Season.{0}'.format(season)) def test_value_name(self): Season = self.Season @@ -440,7 +437,7 @@ def test_reserved__sunder_(self): with self.assertRaisesRegex( ValueError, - "_sunder_ names, such as '_bad_', are reserved", + '_sunder_ names, such as ._bad_., are reserved', ): class Bad(Enum): _bad_ = 1 @@ -488,7 +485,7 @@ two = 2.0 def __format__(self, spec): return 'Format!!' - self.assertEqual(str(EnumWithFormatOverride.one), 'EnumWithFormatOverride.one') + self.assertEqual(str(EnumWithFormatOverride.one), 'one') self.assertEqual('{}'.format(EnumWithFormatOverride.one), 'Format!!') def test_str_and_format_override_enum(self): @@ -528,7 +525,7 @@ two = 2.0 def __format__(self, spec): return 'TestFloat success!' - self.assertEqual(str(TestFloat.one), 'TestFloat.one') + self.assertEqual(str(TestFloat.one), 'one') self.assertEqual('{}'.format(TestFloat.one), 'TestFloat success!') def assertFormatIsValue(self, spec, member): @@ -614,6 +611,8 @@ A = 1 B = 2 C = 3 + def __repr__(self): + return '<%s.%s: %r>' % (self.__class__.__name__, self._name_, self._value_) self.assertEqual(repr(MyEnum.A), '<MyEnum.A: 0x1>') def test_too_many_data_types(self): @@ -1933,6 +1932,38 @@ else: raise Exception('Exception not raised.') + def test_missing_exceptions_reset(self): + import weakref + # + class TestEnum(enum.Enum): + VAL1 = 'val1' + VAL2 = 'val2' + # + class Class1: + def __init__(self): + # Gracefully handle an exception of our own making + try: + raise ValueError() + except ValueError: + pass + # + class Class2: + def __init__(self): + # Gracefully handle an exception of Enum's making + try: + TestEnum('invalid_value') + except ValueError: + pass + # No strong refs here so these are free to die. + class_1_ref = weakref.ref(Class1()) + class_2_ref = weakref.ref(Class2()) + # + # The exception raised by Enum creates a reference loop and thus + # Class2 instances will stick around until the next gargage collection + # cycle, unlike Class1. + self.assertIs(class_1_ref(), None) + self.assertIs(class_2_ref(), None) + def test_multiple_mixin(self): class MaxMixin: @classproperty @@ -1959,7 +1990,7 @@ self.assertEqual(Color.GREEN.value, 2) self.assertEqual(Color.BLUE.value, 3) self.assertEqual(Color.MAX, 3) - self.assertEqual(str(Color.BLUE), 'Color.BLUE') + self.assertEqual(str(Color.BLUE), 'BLUE') class Color(MaxMixin, StrMixin, Enum): RED = auto() GREEN = auto() @@ -2330,9 +2361,9 @@ def test_str(self): Perm = self.Perm - self.assertEqual(str(Perm.R), 'Perm.R') - self.assertEqual(str(Perm.W), 'Perm.W') - self.assertEqual(str(Perm.X), 'Perm.X') - self.assertEqual(str(Perm.R | Perm.W), 'Perm.R|W') - self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'Perm.R|W|X') + self.assertEqual(str(Perm.R), 'R') + self.assertEqual(str(Perm.W), 'W') + self.assertEqual(str(Perm.X), 'X') + self.assertEqual(str(Perm.R | Perm.W), 'R|W') + self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'R|W|X') self.assertEqual(str(Perm(0)), 'Perm(0)') @@ -2338,6 +2369,6 @@ self.assertEqual(str(Perm(0)), 'Perm(0)') - self.assertEqual(str(~Perm.R), 'Perm.W|X') - self.assertEqual(str(~Perm.W), 'Perm.R|X') - self.assertEqual(str(~Perm.X), 'Perm.R|W') - self.assertEqual(str(~(Perm.R | Perm.W)), 'Perm.X') + self.assertEqual(str(~Perm.R), 'W|X') + self.assertEqual(str(~Perm.W), 'R|X') + self.assertEqual(str(~Perm.X), 'R|W') + self.assertEqual(str(~(Perm.R | Perm.W)), 'X') self.assertEqual(str(~(Perm.R | Perm.W | Perm.X)), 'Perm(0)') @@ -2343,4 +2374,4 @@ self.assertEqual(str(~(Perm.R | Perm.W | Perm.X)), 'Perm(0)') - self.assertEqual(str(Perm(~0)), 'Perm.R|W|X') + self.assertEqual(str(Perm(~0)), 'R|W|X') Open = self.Open @@ -2345,16 +2376,15 @@ Open = self.Open - self.assertEqual(str(Open.RO), 'Open.RO') - self.assertEqual(str(Open.WO), 'Open.WO') - self.assertEqual(str(Open.AC), 'Open.AC') - self.assertEqual(str(Open.RO | Open.CE), 'Open.CE') - self.assertEqual(str(Open.WO | Open.CE), 'Open.WO|CE') - self.assertEqual(str(~Open.RO), 'Open.WO|RW|CE') - self.assertEqual(str(~Open.WO), 'Open.RW|CE') - self.assertEqual(str(~Open.AC), 'Open.CE') - self.assertEqual(str(~Open.CE), 'Open.AC') - self.assertEqual(str(~(Open.RO | Open.CE)), 'Open.AC') - self.assertEqual(str(~(Open.WO | Open.CE)), 'Open.RW') + self.assertEqual(str(Open.RO), 'RO') + self.assertEqual(str(Open.WO), 'WO') + self.assertEqual(str(Open.AC), 'AC') + self.assertEqual(str(Open.RO | Open.CE), 'CE') + self.assertEqual(str(Open.WO | Open.CE), 'WO|CE') + self.assertEqual(str(~Open.RO), 'WO|RW|CE') + self.assertEqual(str(~Open.WO), 'RW|CE') + self.assertEqual(str(~Open.AC), 'CE') + self.assertEqual(str(~(Open.RO | Open.CE)), 'AC') + self.assertEqual(str(~(Open.WO | Open.CE)), 'RW') def test_repr(self): Perm = self.Perm @@ -2358,17 +2388,17 @@ def test_repr(self): Perm = self.Perm - self.assertEqual(repr(Perm.R), '<Perm.R: 4>') - self.assertEqual(repr(Perm.W), '<Perm.W: 2>') - self.assertEqual(repr(Perm.X), '<Perm.X: 1>') - self.assertEqual(repr(Perm.R | Perm.W), '<Perm.R|W: 6>') - self.assertEqual(repr(Perm.R | Perm.W | Perm.X), '<Perm.R|W|X: 7>') - self.assertEqual(repr(Perm(0)), '<Perm: 0>') - self.assertEqual(repr(~Perm.R), '<Perm.W|X: 3>') - self.assertEqual(repr(~Perm.W), '<Perm.R|X: 5>') - self.assertEqual(repr(~Perm.X), '<Perm.R|W: 6>') - self.assertEqual(repr(~(Perm.R | Perm.W)), '<Perm.X: 1>') - self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '<Perm: 0>') - self.assertEqual(repr(Perm(~0)), '<Perm.R|W|X: 7>') + self.assertEqual(repr(Perm.R), 'Perm.R') + self.assertEqual(repr(Perm.W), 'Perm.W') + self.assertEqual(repr(Perm.X), 'Perm.X') + self.assertEqual(repr(Perm.R | Perm.W), 'Perm.R|Perm.W') + self.assertEqual(repr(Perm.R | Perm.W | Perm.X), 'Perm.R|Perm.W|Perm.X') + self.assertEqual(repr(Perm(0)), '0x0') + self.assertEqual(repr(~Perm.R), 'Perm.W|Perm.X') + self.assertEqual(repr(~Perm.W), 'Perm.R|Perm.X') + self.assertEqual(repr(~Perm.X), 'Perm.R|Perm.W') + self.assertEqual(repr(~(Perm.R | Perm.W)), 'Perm.X') + self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '0x0') + self.assertEqual(repr(Perm(~0)), 'Perm.R|Perm.W|Perm.X') Open = self.Open @@ -2373,16 +2403,15 @@ Open = self.Open - self.assertEqual(repr(Open.RO), '<Open.RO: 0>') - self.assertEqual(repr(Open.WO), '<Open.WO: 1>') - self.assertEqual(repr(Open.AC), '<Open.AC: 3>') - self.assertEqual(repr(Open.RO | Open.CE), '<Open.CE: 524288>') - self.assertEqual(repr(Open.WO | Open.CE), '<Open.WO|CE: 524289>') - self.assertEqual(repr(~Open.RO), '<Open.WO|RW|CE: 524291>') - self.assertEqual(repr(~Open.WO), '<Open.RW|CE: 524290>') - self.assertEqual(repr(~Open.AC), '<Open.CE: 524288>') - self.assertEqual(repr(~Open.CE), '<Open.AC: 3>') - self.assertEqual(repr(~(Open.RO | Open.CE)), '<Open.AC: 3>') - self.assertEqual(repr(~(Open.WO | Open.CE)), '<Open.RW: 2>') + self.assertEqual(repr(Open.RO), 'Open.RO') + self.assertEqual(repr(Open.WO), 'Open.WO') + self.assertEqual(repr(Open.AC), 'Open.AC') + self.assertEqual(repr(Open.RO | Open.CE), 'Open.CE') + self.assertEqual(repr(Open.WO | Open.CE), 'Open.WO|Open.CE') + self.assertEqual(repr(~Open.RO), 'Open.WO|Open.RW|Open.CE') + self.assertEqual(repr(~Open.WO), 'Open.RW|Open.CE') + self.assertEqual(repr(~Open.AC), 'Open.CE') + self.assertEqual(repr(~(Open.RO | Open.CE)), 'Open.AC') + self.assertEqual(repr(~(Open.WO | Open.CE)), 'Open.RW') def test_format(self): Perm = self.Perm @@ -2386,8 +2415,8 @@ def test_format(self): Perm = self.Perm - self.assertEqual(format(Perm.R, ''), 'Perm.R') - self.assertEqual(format(Perm.R | Perm.X, ''), 'Perm.R|X') + self.assertEqual(format(Perm.R, ''), 'R') + self.assertEqual(format(Perm.R | Perm.X, ''), 'R|X') def test_or(self): Perm = self.Perm @@ -2707,7 +2736,7 @@ self.assertEqual(Color.GREEN.value, 2) self.assertEqual(Color.BLUE.value, 4) self.assertEqual(Color.ALL.value, 7) - self.assertEqual(str(Color.BLUE), 'Color.BLUE') + self.assertEqual(str(Color.BLUE), 'BLUE') class Color(AllMixin, StrMixin, Flag): RED = auto() GREEN = auto() @@ -2850,11 +2879,11 @@ def test_str(self): Perm = self.Perm - self.assertEqual(str(Perm.R), 'Perm.R') - self.assertEqual(str(Perm.W), 'Perm.W') - self.assertEqual(str(Perm.X), 'Perm.X') - self.assertEqual(str(Perm.R | Perm.W), 'Perm.R|W') - self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'Perm.R|W|X') + self.assertEqual(str(Perm.R), 'R') + self.assertEqual(str(Perm.W), 'W') + self.assertEqual(str(Perm.X), 'X') + self.assertEqual(str(Perm.R | Perm.W), 'R|W') + self.assertEqual(str(Perm.R | Perm.W | Perm.X), 'R|W|X') self.assertEqual(str(Perm.R | 8), '12') self.assertEqual(str(Perm(0)), 'Perm(0)') self.assertEqual(str(Perm(8)), '8') @@ -2858,9 +2887,9 @@ self.assertEqual(str(Perm.R | 8), '12') self.assertEqual(str(Perm(0)), 'Perm(0)') self.assertEqual(str(Perm(8)), '8') - self.assertEqual(str(~Perm.R), 'Perm.W|X') - self.assertEqual(str(~Perm.W), 'Perm.R|X') - self.assertEqual(str(~Perm.X), 'Perm.R|W') - self.assertEqual(str(~(Perm.R | Perm.W)), 'Perm.X') + self.assertEqual(str(~Perm.R), 'W|X') + self.assertEqual(str(~Perm.W), 'R|X') + self.assertEqual(str(~Perm.X), 'R|W') + self.assertEqual(str(~(Perm.R | Perm.W)), 'X') self.assertEqual(str(~(Perm.R | Perm.W | Perm.X)), 'Perm(0)') self.assertEqual(str(~(Perm.R | 8)), '-13') @@ -2865,6 +2894,6 @@ self.assertEqual(str(~(Perm.R | Perm.W | Perm.X)), 'Perm(0)') self.assertEqual(str(~(Perm.R | 8)), '-13') - self.assertEqual(str(Perm(~0)), 'Perm.R|W|X') + self.assertEqual(str(Perm(~0)), 'R|W|X') self.assertEqual(str(Perm(~8)), '-9') Open = self.Open @@ -2868,9 +2897,9 @@ self.assertEqual(str(Perm(~8)), '-9') Open = self.Open - self.assertEqual(str(Open.RO), 'Open.RO') - self.assertEqual(str(Open.WO), 'Open.WO') - self.assertEqual(str(Open.AC), 'Open.AC') - self.assertEqual(str(Open.RO | Open.CE), 'Open.CE') - self.assertEqual(str(Open.WO | Open.CE), 'Open.WO|CE') + self.assertEqual(str(Open.RO), 'RO') + self.assertEqual(str(Open.WO), 'WO') + self.assertEqual(str(Open.AC), 'AC') + self.assertEqual(str(Open.RO | Open.CE), 'CE') + self.assertEqual(str(Open.WO | Open.CE), 'WO|CE') self.assertEqual(str(Open(4)), '4') @@ -2876,9 +2905,8 @@ self.assertEqual(str(Open(4)), '4') - self.assertEqual(str(~Open.RO), 'Open.WO|RW|CE') - self.assertEqual(str(~Open.WO), 'Open.RW|CE') - self.assertEqual(str(~Open.AC), 'Open.CE') - self.assertEqual(str(~Open.CE), 'Open.AC') - self.assertEqual(str(~(Open.RO | Open.CE)), 'Open.AC') - self.assertEqual(str(~(Open.WO | Open.CE)), 'Open.RW') + self.assertEqual(str(~Open.RO), 'WO|RW|CE') + self.assertEqual(str(~Open.WO), 'RW|CE') + self.assertEqual(str(~Open.AC), 'CE') + self.assertEqual(str(~(Open.RO | Open.CE)), 'AC') + self.assertEqual(str(~(Open.WO | Open.CE)), 'RW') self.assertEqual(str(Open(~4)), '-5') @@ -2883,7 +2911,4 @@ self.assertEqual(str(Open(~4)), '-5') - Skip = self.Skip - self.assertEqual(str(Skip(~4)), 'Skip.FIRST|SECOND|EIGHTH') - def test_repr(self): Perm = self.Perm @@ -2888,8 +2913,8 @@ def test_repr(self): Perm = self.Perm - self.assertEqual(repr(Perm.R), '<Perm.R: 4>') - self.assertEqual(repr(Perm.W), '<Perm.W: 2>') - self.assertEqual(repr(Perm.X), '<Perm.X: 1>') - self.assertEqual(repr(Perm.R | Perm.W), '<Perm.R|W: 6>') - self.assertEqual(repr(Perm.R | Perm.W | Perm.X), '<Perm.R|W|X: 7>') + self.assertEqual(repr(Perm.R), 'Perm.R') + self.assertEqual(repr(Perm.W), 'Perm.W') + self.assertEqual(repr(Perm.X), 'Perm.X') + self.assertEqual(repr(Perm.R | Perm.W), 'Perm.R|Perm.W') + self.assertEqual(repr(Perm.R | Perm.W | Perm.X), 'Perm.R|Perm.W|Perm.X') self.assertEqual(repr(Perm.R | 8), '12') @@ -2895,3 +2920,3 @@ self.assertEqual(repr(Perm.R | 8), '12') - self.assertEqual(repr(Perm(0)), '<Perm: 0>') + self.assertEqual(repr(Perm(0)), '0x0') self.assertEqual(repr(Perm(8)), '8') @@ -2897,7 +2922,7 @@ self.assertEqual(repr(Perm(8)), '8') - self.assertEqual(repr(~Perm.R), '<Perm.W|X: 3>') - self.assertEqual(repr(~Perm.W), '<Perm.R|X: 5>') - self.assertEqual(repr(~Perm.X), '<Perm.R|W: 6>') - self.assertEqual(repr(~(Perm.R | Perm.W)), '<Perm.X: 1>') - self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '<Perm: 0>') + self.assertEqual(repr(~Perm.R), 'Perm.W|Perm.X') + self.assertEqual(repr(~Perm.W), 'Perm.R|Perm.X') + self.assertEqual(repr(~Perm.X), 'Perm.R|Perm.W') + self.assertEqual(repr(~(Perm.R | Perm.W)), 'Perm.X') + self.assertEqual(repr(~(Perm.R | Perm.W | Perm.X)), '0x0') self.assertEqual(repr(~(Perm.R | 8)), '-13') @@ -2903,5 +2928,5 @@ self.assertEqual(repr(~(Perm.R | 8)), '-13') - self.assertEqual(repr(Perm(~0)), '<Perm.R|W|X: 7>') + self.assertEqual(repr(Perm(~0)), 'Perm.R|Perm.W|Perm.X') self.assertEqual(repr(Perm(~8)), '-9') Open = self.Open @@ -2905,9 +2930,9 @@ self.assertEqual(repr(Perm(~8)), '-9') Open = self.Open - self.assertEqual(repr(Open.RO), '<Open.RO: 0>') - self.assertEqual(repr(Open.WO), '<Open.WO: 1>') - self.assertEqual(repr(Open.AC), '<Open.AC: 3>') - self.assertEqual(repr(Open.RO | Open.CE), '<Open.CE: 524288>') - self.assertEqual(repr(Open.WO | Open.CE), '<Open.WO|CE: 524289>') + self.assertEqual(repr(Open.RO), 'Open.RO') + self.assertEqual(repr(Open.WO), 'Open.WO') + self.assertEqual(repr(Open.AC), 'Open.AC') + self.assertEqual(repr(Open.RO | Open.CE), 'Open.CE') + self.assertEqual(repr(Open.WO | Open.CE), 'Open.WO|Open.CE') self.assertEqual(repr(Open(4)), '4') @@ -2913,8 +2938,8 @@ self.assertEqual(repr(Open(4)), '4') - self.assertEqual(repr(~Open.RO), '<Open.WO|RW|CE: 524291>') - self.assertEqual(repr(~Open.WO), '<Open.RW|CE: 524290>') - self.assertEqual(repr(~Open.AC), '<Open.CE: 524288>') - self.assertEqual(repr(~(Open.RO | Open.CE)), '<Open.AC: 3>') - self.assertEqual(repr(~(Open.WO | Open.CE)), '<Open.RW: 2>') + self.assertEqual(repr(~Open.RO), 'Open.WO|Open.RW|Open.CE') + self.assertEqual(repr(~Open.WO), 'Open.RW|Open.CE') + self.assertEqual(repr(~Open.AC), 'Open.CE') + self.assertEqual(repr(~(Open.RO | Open.CE)), 'Open.AC') + self.assertEqual(repr(~(Open.WO | Open.CE)), 'Open.RW') self.assertEqual(repr(Open(~4)), '-5') @@ -2919,8 +2944,5 @@ self.assertEqual(repr(Open(~4)), '-5') - Skip = self.Skip - self.assertEqual(repr(Skip(~4)), '<Skip.FIRST|SECOND|EIGHTH: 11>') - def test_format(self): Perm = self.Perm self.assertEqual(format(Perm.R, ''), '4') @@ -3252,7 +3274,7 @@ self.assertEqual(Color.GREEN.value, 2) self.assertEqual(Color.BLUE.value, 4) self.assertEqual(Color.ALL.value, 7) - self.assertEqual(str(Color.BLUE), 'Color.BLUE') + self.assertEqual(str(Color.BLUE), 'BLUE') class Color(AllMixin, StrMixin, IntFlag): RED = auto() GREEN = auto() @@ -3374,6 +3396,8 @@ value = 4 +class TestEnumTypeSubclassing(unittest.TestCase): + pass expected_help_output_with_docs = """\ Help on class Color in module %s: @@ -3390,5 +3414,5 @@ |\x20\x20 | Data and other attributes defined here: |\x20\x20 - | blue = <Color.blue: 3> + | blue = Color.blue |\x20\x20 @@ -3394,3 +3418,3 @@ |\x20\x20 - | green = <Color.green: 2> + | green = Color.green |\x20\x20 @@ -3396,5 +3420,5 @@ |\x20\x20 - | red = <Color.red: 1> + | red = Color.red |\x20\x20 | ---------------------------------------------------------------------- | Data descriptors inherited from enum.Enum: @@ -3406,7 +3430,7 @@ | The value of the Enum member. |\x20\x20 | ---------------------------------------------------------------------- - | Readonly properties inherited from enum.EnumMeta: + | Readonly properties inherited from enum.EnumType: |\x20\x20 | __members__ | Returns a mapping of member name->value. @@ -3427,5 +3451,5 @@ |\x20\x20 | Data and other attributes defined here: |\x20\x20 - | blue = <Color.blue: 3> + | blue = Color.blue |\x20\x20 @@ -3431,3 +3455,3 @@ |\x20\x20 - | green = <Color.green: 2> + | green = Color.green |\x20\x20 @@ -3433,5 +3457,5 @@ |\x20\x20 - | red = <Color.red: 1> + | red = Color.red |\x20\x20 | ---------------------------------------------------------------------- | Data descriptors inherited from enum.Enum: @@ -3441,7 +3465,7 @@ | value |\x20\x20 | ---------------------------------------------------------------------- - | Data descriptors inherited from enum.EnumMeta: + | Data descriptors inherited from enum.EnumType: |\x20\x20 | __members__""" @@ -3468,7 +3492,7 @@ def test_inspect_getmembers(self): values = dict(( - ('__class__', EnumMeta), + ('__class__', EnumType), ('__doc__', 'An enumeration.'), ('__members__', self.Color.__members__), ('__module__', __name__), @@ -3495,7 +3519,7 @@ from inspect import Attribute values = [ Attribute(name='__class__', kind='data', - defining_class=object, object=EnumMeta), + defining_class=object, object=EnumType), Attribute(name='__doc__', kind='data', defining_class=self.Color, object='An enumeration.'), Attribute(name='__members__', kind='property', @@ -3499,7 +3523,7 @@ Attribute(name='__doc__', kind='data', defining_class=self.Color, object='An enumeration.'), Attribute(name='__members__', kind='property', - defining_class=EnumMeta, object=EnumMeta.__members__), + defining_class=EnumType, object=EnumType.__members__), Attribute(name='__module__', kind='data', defining_class=self.Color, object=__name__), Attribute(name='blue', kind='data', @@ -3589,6 +3613,45 @@ ('test.test_enum', '__main__')[__name__=='__main__'], filter=lambda x: x.startswith('CONVERT_TEST_')) + def test_convert_repr_and_str(self): + module = ('test.test_enum', '__main__')[__name__=='__main__'] + test_type = enum.IntEnum._convert_( + 'UnittestConvert', + module, + filter=lambda x: x.startswith('CONVERT_TEST_')) + self.assertEqual(repr(test_type.CONVERT_TEST_NAME_A), '%s.CONVERT_TEST_NAME_A' % module) + self.assertEqual(str(test_type.CONVERT_TEST_NAME_A), 'CONVERT_TEST_NAME_A') + self.assertEqual(format(test_type.CONVERT_TEST_NAME_A), '5') + +# global names for StrEnum._convert_ test +CONVERT_STR_TEST_2 = 'goodbye' +CONVERT_STR_TEST_1 = 'hello' + +class TestStrEnumConvert(unittest.TestCase): + + def test_convert(self): + test_type = enum.StrEnum._convert_( + 'UnittestConvert', + ('test.test_enum', '__main__')[__name__=='__main__'], + filter=lambda x: x.startswith('CONVERT_STR_')) + # Ensure that test_type has all of the desired names and values. + self.assertEqual(test_type.CONVERT_STR_TEST_1, 'hello') + self.assertEqual(test_type.CONVERT_STR_TEST_2, 'goodbye') + # Ensure that test_type only picked up names matching the filter. + self.assertEqual([name for name in dir(test_type) + if name[0:2] not in ('CO', '__')], + [], msg='Names other than CONVERT_STR_* found.') + + def test_convert_repr_and_str(self): + module = ('test.test_enum', '__main__')[__name__=='__main__'] + test_type = enum.StrEnum._convert_( + 'UnittestConvert', + module, + filter=lambda x: x.startswith('CONVERT_STR_')) + self.assertEqual(repr(test_type.CONVERT_STR_TEST_1), '%s.CONVERT_STR_TEST_1' % module) + self.assertEqual(str(test_type.CONVERT_STR_TEST_2), 'goodbye') + self.assertEqual(format(test_type.CONVERT_STR_TEST_1), 'hello') + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_eof.py b/Lib/test/test_eof.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9lb2YucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9lb2YucHk= 100644 --- a/Lib/test/test_eof.py +++ b/Lib/test/test_eof.py @@ -55,9 +55,9 @@ file_name = script_helper.make_script(temp_dir, 'foo', '\\') rc, out, err = script_helper.assert_python_failure(file_name) self.assertIn(b'unexpected EOF while parsing', err) - self.assertIn(b'line 2', err) + self.assertIn(b'line 1', err) self.assertIn(b'\\', err) file_name = script_helper.make_script(temp_dir, 'foo', 'y = 6\\') rc, out, err = script_helper.assert_python_failure(file_name) self.assertIn(b'unexpected EOF while parsing', err) @@ -59,9 +59,9 @@ self.assertIn(b'\\', err) file_name = script_helper.make_script(temp_dir, 'foo', 'y = 6\\') rc, out, err = script_helper.assert_python_failure(file_name) self.assertIn(b'unexpected EOF while parsing', err) - self.assertIn(b'line 2', err) + self.assertIn(b'line 1', err) self.assertIn(b'y = 6\\', err) if __name__ == "__main__": diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9leGNlcHRpb25zLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9leGNlcHRpb25zLnB5 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -54,5 +54,5 @@ self.assertRaises(AttributeError, getattr, sys, "undefined_attribute") self.raise_catch(EOFError, "EOFError") - fp = open(TESTFN, 'w') + fp = open(TESTFN, 'w', encoding="utf-8") fp.close() @@ -58,5 +58,5 @@ fp.close() - fp = open(TESTFN, 'r') + fp = open(TESTFN, 'r', encoding="utf-8") savestdin = sys.stdin try: try: @@ -260,7 +260,7 @@ check('[*x for x in xs]', 1, 2) check('foo(x for x in range(10), 100)', 1, 5) check('for 1 in []: pass', 1, 5) - check('(yield i) = 2', 1, 2) + check('(yield i) = 2', 1, 11) check('def f(*):\n pass', 1, 8) @cpython_only @@ -1414,6 +1414,165 @@ gc_collect() +class AttributeErrorTests(unittest.TestCase): + def test_attributes(self): + # Setting 'attr' should not be a problem. + exc = AttributeError('Ouch!') + self.assertIsNone(exc.name) + self.assertIsNone(exc.obj) + + sentinel = object() + exc = AttributeError('Ouch', name='carry', obj=sentinel) + self.assertEqual(exc.name, 'carry') + self.assertIs(exc.obj, sentinel) + + def test_getattr_has_name_and_obj(self): + class A: + blech = None + + obj = A() + try: + obj.bluch + except AttributeError as exc: + self.assertEqual("bluch", exc.name) + self.assertEqual(obj, exc.obj) + + def test_getattr_has_name_and_obj_for_method(self): + class A: + def blech(self): + return + + obj = A() + try: + obj.bluch() + except AttributeError as exc: + self.assertEqual("bluch", exc.name) + self.assertEqual(obj, exc.obj) + + def test_getattr_suggestions(self): + class Substitution: + noise = more_noise = a = bc = None + blech = None + + class Elimination: + noise = more_noise = a = bc = None + blch = None + + class Addition: + noise = more_noise = a = bc = None + bluchin = None + + class SubstitutionOverElimination: + blach = None + bluc = None + + class SubstitutionOverAddition: + blach = None + bluchi = None + + class EliminationOverAddition: + blucha = None + bluc = None + + for cls, suggestion in [(Substitution, "blech?"), + (Elimination, "blch?"), + (Addition, "bluchin?"), + (EliminationOverAddition, "bluc?"), + (SubstitutionOverElimination, "blach?"), + (SubstitutionOverAddition, "blach?")]: + try: + cls().bluch + except AttributeError as exc: + with support.captured_stderr() as err: + sys.__excepthook__(*sys.exc_info()) + + self.assertIn(suggestion, err.getvalue()) + + def test_getattr_suggestions_do_not_trigger_for_long_attributes(self): + class A: + blech = None + + try: + A().somethingverywrong + except AttributeError as exc: + with support.captured_stderr() as err: + sys.__excepthook__(*sys.exc_info()) + + self.assertNotIn("blech", err.getvalue()) + + def test_getattr_suggestions_do_not_trigger_for_big_dicts(self): + class A: + blech = None + # A class with a very big __dict__ will not be consider + # for suggestions. + for index in range(101): + setattr(A, f"index_{index}", None) + + try: + A().bluch + except AttributeError as exc: + with support.captured_stderr() as err: + sys.__excepthook__(*sys.exc_info()) + + self.assertNotIn("blech", err.getvalue()) + + def test_getattr_suggestions_no_args(self): + class A: + blech = None + def __getattr__(self, attr): + raise AttributeError() + + try: + A().bluch + except AttributeError as exc: + with support.captured_stderr() as err: + sys.__excepthook__(*sys.exc_info()) + + self.assertIn("blech", err.getvalue()) + + class A: + blech = None + def __getattr__(self, attr): + raise AttributeError + + try: + A().bluch + except AttributeError as exc: + with support.captured_stderr() as err: + sys.__excepthook__(*sys.exc_info()) + + self.assertIn("blech", err.getvalue()) + + def test_getattr_suggestions_invalid_args(self): + class NonStringifyClass: + __str__ = None + __repr__ = None + + class A: + blech = None + def __getattr__(self, attr): + raise AttributeError(NonStringifyClass()) + + class B: + blech = None + def __getattr__(self, attr): + raise AttributeError("Error", 23) + + class C: + blech = None + def __getattr__(self, attr): + raise AttributeError(23) + + for cls in [A, B, C]: + try: + cls().bluch + except AttributeError as exc: + with support.captured_stderr() as err: + sys.__excepthook__(*sys.exc_info()) + + self.assertIn("blech", err.getvalue()) + + class ImportErrorTests(unittest.TestCase): def test_attributes(self): diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9maWxlLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9maWxlLnB5 100644 --- a/Lib/test/test_file.py +++ b/Lib/test/test_file.py @@ -52,7 +52,7 @@ # verify readinto refuses text files a = array('b', b'x'*10) self.f.close() - self.f = self.open(TESTFN, 'r') + self.f = self.open(TESTFN, encoding="utf-8") if hasattr(self.f, "readinto"): self.assertRaises(TypeError, self.f.readinto, a) diff --git a/Lib/test/test_file_eintr.py b/Lib/test/test_file_eintr.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9maWxlX2VpbnRyLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9maWxlX2VpbnRyLnB5 100644 --- a/Lib/test/test_file_eintr.py +++ b/Lib/test/test_file_eintr.py @@ -214,7 +214,7 @@ def _generate_infile_setup_code(self): """Returns the infile = ... line of code to make a TextIOWrapper.""" return ('import %s as io ;' - 'infile = io.open(sys.stdin.fileno(), "rt", newline=None) ;' + 'infile = io.open(sys.stdin.fileno(), encoding="utf-8", newline=None) ;' 'assert isinstance(infile, io.TextIOWrapper)' % self.modname) diff --git a/Lib/test/test_filecmp.py b/Lib/test/test_filecmp.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9maWxlY21wLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9maWxlY21wLnB5 100644 --- a/Lib/test/test_filecmp.py +++ b/Lib/test/test_filecmp.py @@ -15,6 +15,6 @@ self.name_diff = os_helper.TESTFN + '-diff' data = 'Contents of file go here.\n' for name in [self.name, self.name_same, self.name_diff]: - with open(name, 'w') as output: + with open(name, 'w', encoding="utf-8") as output: output.write(data) @@ -19,6 +19,6 @@ output.write(data) - with open(self.name_diff, 'a+') as output: + with open(self.name_diff, 'a+', encoding="utf-8") as output: output.write('An extra line.\n') self.dir = tempfile.gettempdir() @@ -72,6 +72,6 @@ fn = 'FiLe' # Verify case-insensitive comparison else: fn = 'file' - with open(os.path.join(dir, fn), 'w') as output: + with open(os.path.join(dir, fn), 'w', encoding="utf-8") as output: output.write(data) @@ -76,6 +76,6 @@ output.write(data) - with open(os.path.join(self.dir_diff, 'file2'), 'w') as output: + with open(os.path.join(self.dir_diff, 'file2'), 'w', encoding="utf-8") as output: output.write('An extra file.\n') def tearDown(self): @@ -103,7 +103,7 @@ "Comparing directory to same fails") # Add different file2 - with open(os.path.join(self.dir, 'file2'), 'w') as output: + with open(os.path.join(self.dir, 'file2'), 'w', encoding="utf-8") as output: output.write('Different contents.\n') self.assertFalse(filecmp.cmpfiles(self.dir, self.dir_same, @@ -188,7 +188,7 @@ self._assert_report(d.report, expected_report) # Add different file2 - with open(os.path.join(self.dir_diff, 'file2'), 'w') as output: + with open(os.path.join(self.dir_diff, 'file2'), 'w', encoding="utf-8") as output: output.write('Different contents.\n') d = filecmp.dircmp(self.dir, self.dir_diff) self.assertEqual(d.same_files, ['file']) diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9maWxlaW5wdXQucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9maWxlaW5wdXQucHk= 100644 --- a/Lib/test/test_fileinput.py +++ b/Lib/test/test_fileinput.py @@ -2,6 +2,7 @@ Tests for fileinput module. Nick Mathewson ''' +import io import os import sys import re @@ -238,7 +239,7 @@ # try opening in universal newline mode t1 = self.writeTmp(b"A\nB\r\nC\rD", mode="wb") with warnings_helper.check_warnings(('', DeprecationWarning)): - fi = FileInput(files=t1, mode="U") + fi = FileInput(files=t1, mode="U", encoding="utf-8") with warnings_helper.check_warnings(('', DeprecationWarning)): lines = list(fi) self.assertEqual(lines, ["A\n", "B\n", "C\n", "D"]) @@ -278,7 +279,7 @@ class CustomOpenHook: def __init__(self): self.invoked = False - def __call__(self, *args): + def __call__(self, *args, **kargs): self.invoked = True return open(*args) @@ -334,6 +335,14 @@ with open(temp_file, 'rb') as f: self.assertEqual(f.read(), b'New line.') + def test_file_hook_backward_compatibility(self): + def old_hook(filename, mode): + return io.StringIO("I used to receive only filename and mode") + t = self.writeTmp("\n") + with FileInput([t], openhook=old_hook) as fi: + result = fi.readline() + self.assertEqual(result, "I used to receive only filename and mode") + def test_context_manager(self): t1 = self.writeTmp("A\nB\nC") t2 = self.writeTmp("D\nE\nF") @@ -529,9 +538,9 @@ """A class that mocks out fileinput.FileInput for use during unit tests""" def __init__(self, files=None, inplace=False, backup="", *, - mode="r", openhook=None): + mode="r", openhook=None, encoding=None, errors=None): self.files = files self.inplace = inplace self.backup = backup self.mode = mode self.openhook = openhook @@ -533,8 +542,10 @@ self.files = files self.inplace = inplace self.backup = backup self.mode = mode self.openhook = openhook + self.encoding = encoding + self.errors = errors self._file = None self.invocation_counts = collections.defaultdict(lambda: 0) self.return_values = {} @@ -637,6 +648,7 @@ backup = object() mode = object() openhook = object() + encoding = object() # call fileinput.input() with different values for each argument result = fileinput.input(files=files, inplace=inplace, backup=backup, @@ -640,7 +652,7 @@ # call fileinput.input() with different values for each argument result = fileinput.input(files=files, inplace=inplace, backup=backup, - mode=mode, openhook=openhook) + mode=mode, openhook=openhook, encoding=encoding) # ensure fileinput._state was set to the returned object self.assertIs(result, fileinput._state, "fileinput._state") @@ -863,5 +875,6 @@ self.assertIs(fileinput._state, instance) class InvocationRecorder: + def __init__(self): self.invocation_count = 0 @@ -866,5 +879,6 @@ def __init__(self): self.invocation_count = 0 + def __call__(self, *args, **kwargs): self.invocation_count += 1 self.last_invocation = (args, kwargs) @@ -868,6 +882,8 @@ def __call__(self, *args, **kwargs): self.invocation_count += 1 self.last_invocation = (args, kwargs) + return io.BytesIO(b'some bytes') + class Test_hook_compressed(unittest.TestCase): """Unit tests for fileinput.hook_compressed()""" @@ -886,8 +902,8 @@ original_open = gzip.open gzip.open = self.fake_open try: - result = fileinput.hook_compressed("test.gz", 3) + result = fileinput.hook_compressed("test.gz", "3") finally: gzip.open = original_open self.assertEqual(self.fake_open.invocation_count, 1) @@ -890,11 +906,21 @@ finally: gzip.open = original_open self.assertEqual(self.fake_open.invocation_count, 1) - self.assertEqual(self.fake_open.last_invocation, (("test.gz", 3), {})) + self.assertEqual(self.fake_open.last_invocation, (("test.gz", "3"), {})) + + @unittest.skipUnless(gzip, "Requires gzip and zlib") + def test_gz_with_encoding_fake(self): + original_open = gzip.open + gzip.open = lambda filename, mode: io.BytesIO(b'Ex-binary string') + try: + result = fileinput.hook_compressed("test.gz", "3", encoding="utf-8") + finally: + gzip.open = original_open + self.assertEqual(list(result), ['Ex-binary string']) @unittest.skipUnless(bz2, "Requires bz2") def test_bz2_ext_fake(self): original_open = bz2.BZ2File bz2.BZ2File = self.fake_open try: @@ -895,11 +921,11 @@ @unittest.skipUnless(bz2, "Requires bz2") def test_bz2_ext_fake(self): original_open = bz2.BZ2File bz2.BZ2File = self.fake_open try: - result = fileinput.hook_compressed("test.bz2", 4) + result = fileinput.hook_compressed("test.bz2", "4") finally: bz2.BZ2File = original_open self.assertEqual(self.fake_open.invocation_count, 1) @@ -902,7 +928,7 @@ finally: bz2.BZ2File = original_open self.assertEqual(self.fake_open.invocation_count, 1) - self.assertEqual(self.fake_open.last_invocation, (("test.bz2", 4), {})) + self.assertEqual(self.fake_open.last_invocation, (("test.bz2", "4"), {})) def test_blah_ext(self): @@ -907,5 +933,5 @@ def test_blah_ext(self): - self.do_test_use_builtin_open("abcd.blah", 5) + self.do_test_use_builtin_open("abcd.blah", "5") def test_gz_ext_builtin(self): @@ -910,5 +936,5 @@ def test_gz_ext_builtin(self): - self.do_test_use_builtin_open("abcd.Gz", 6) + self.do_test_use_builtin_open("abcd.Gz", "6") def test_bz2_ext_builtin(self): @@ -913,6 +939,6 @@ def test_bz2_ext_builtin(self): - self.do_test_use_builtin_open("abcd.Bz2", 7) + self.do_test_use_builtin_open("abcd.Bz2", "7") def do_test_use_builtin_open(self, filename, mode): original_open = self.replace_builtin_open(self.fake_open) @@ -923,7 +949,7 @@ self.assertEqual(self.fake_open.invocation_count, 1) self.assertEqual(self.fake_open.last_invocation, - ((filename, mode), {})) + ((filename, mode), {'encoding': 'locale', 'errors': None})) @staticmethod def replace_builtin_open(new_open_func): diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9mbG9hdC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9mbG9hdC5weQ== 100644 --- a/Lib/test/test_float.py +++ b/Lib/test/test_float.py @@ -729,7 +729,7 @@ @support.requires_IEEE_754 def test_format_testfile(self): - with open(format_testfile) as testfile: + with open(format_testfile, encoding="utf-8") as testfile: for line in testfile: if line.startswith('--'): continue @@ -769,7 +769,7 @@ class ReprTestCase(unittest.TestCase): def test_repr(self): with open(os.path.join(os.path.split(__file__)[0], - 'floating_points.txt')) as floats_file: + 'floating_points.txt'), encoding="utf-8") as floats_file: for line in floats_file: line = line.strip() if not line or line.startswith('#'): diff --git a/Lib/test/test_fractions.py b/Lib/test/test_fractions.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9mcmFjdGlvbnMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9mcmFjdGlvbnMucHk= 100644 --- a/Lib/test/test_fractions.py +++ b/Lib/test/test_fractions.py @@ -369,4 +369,5 @@ self.assertEqual(F(1, 2), F(1, 10) + F(2, 5)) self.assertEqual(F(-3, 10), F(1, 10) - F(2, 5)) self.assertEqual(F(1, 25), F(1, 10) * F(2, 5)) + self.assertEqual(F(5, 6), F(2, 3) * F(5, 4)) self.assertEqual(F(1, 4), F(1, 10) / F(2, 5)) @@ -372,4 +373,5 @@ self.assertEqual(F(1, 4), F(1, 10) / F(2, 5)) + self.assertEqual(F(-15, 8), F(3, 4) / F(-2, 5)) self.assertTypedEquals(2, F(9, 10) // F(2, 5)) self.assertTypedEquals(10**23, F(10**23, 1) // F(1)) self.assertEqual(F(5, 6), F(7, 3) % F(3, 2)) diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9mc3RyaW5nLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9mc3RyaW5nLnB5 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -990,7 +990,7 @@ ]) def test_assignment(self): - self.assertAllRaise(SyntaxError, 'invalid syntax', + self.assertAllRaise(SyntaxError, r'invalid syntax', ["f'' = 3", "f'{0}' = x", "f'{x}' = x", @@ -1110,7 +1110,7 @@ # see issue 38964 with temp_cwd() as cwd: file_path = os.path.join(cwd, 't.py') - with open(file_path, 'w') as f: + with open(file_path, 'w', encoding="utf-8") as f: f.write('f"{a b}"') # This generates a SyntaxError _, _, stderr = assert_python_failure(file_path, PYTHONIOENCODING='ascii') @@ -1275,5 +1275,14 @@ with self.assertRaisesRegex(ValueError, error_msg): f'{1:_,}' + def test_syntax_error_for_starred_expressions(self): + error_msg = re.escape("cannot use starred expression here") + with self.assertRaisesRegex(SyntaxError, error_msg): + compile("f'{*a}'", "?", "exec") + + error_msg = re.escape("cannot use double starred expression here") + with self.assertRaisesRegex(SyntaxError, error_msg): + compile("f'{**a}'", "?", "exec") + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9nYy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9nYy5weQ== 100644 --- a/Lib/test/test_gc.py +++ b/Lib/test/test_gc.py @@ -750,7 +750,7 @@ a.link = a raise SystemExit(0)""" self.addCleanup(unlink, TESTFN) - with open(TESTFN, 'w') as script: + with open(TESTFN, 'w', encoding="utf-8") as script: script.write(code) rc, out, err = assert_python_ok(TESTFN) self.assertEqual(out.strip(), b'__del__ called') diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9nZW5lcmF0b3JzLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9nZW5lcmF0b3JzLnB5 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -2013,7 +2013,7 @@ >>> def f(): (yield bar) = y Traceback (most recent call last): ... -SyntaxError: cannot assign to yield expression +SyntaxError: cannot assign to yield expression here. Maybe you meant '==' instead of '='? >>> def f(): (yield bar) += y Traceback (most recent call last): diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9nemlwLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9nemlwLnB5 100644 --- a/Lib/test/test_gzip.py +++ b/Lib/test/test_gzip.py @@ -660,8 +660,8 @@ def test_text_modes(self): uncompressed = data1.decode("ascii") * 50 uncompressed_raw = uncompressed.replace("\n", os.linesep) - with gzip.open(self.filename, "wt") as f: + with gzip.open(self.filename, "wt", encoding="ascii") as f: f.write(uncompressed) with open(self.filename, "rb") as f: file_data = gzip.decompress(f.read()).decode("ascii") self.assertEqual(file_data, uncompressed_raw) @@ -664,6 +664,6 @@ f.write(uncompressed) with open(self.filename, "rb") as f: file_data = gzip.decompress(f.read()).decode("ascii") self.assertEqual(file_data, uncompressed_raw) - with gzip.open(self.filename, "rt") as f: + with gzip.open(self.filename, "rt", encoding="ascii") as f: self.assertEqual(f.read(), uncompressed) @@ -669,5 +669,5 @@ self.assertEqual(f.read(), uncompressed) - with gzip.open(self.filename, "at") as f: + with gzip.open(self.filename, "at", encoding="ascii") as f: f.write(uncompressed) with open(self.filename, "rb") as f: file_data = gzip.decompress(f.read()).decode("ascii") @@ -681,7 +681,7 @@ self.assertEqual(f.read(), uncompressed_bytes) with gzip.open(io.BytesIO(compressed), "rb") as f: self.assertEqual(f.read(), uncompressed_bytes) - with gzip.open(io.BytesIO(compressed), "rt") as f: + with gzip.open(io.BytesIO(compressed), "rt", encoding="ascii") as f: self.assertEqual(f.read(), uncompressed_str) def test_bad_params(self): @@ -722,5 +722,5 @@ def test_newline(self): # Test with explicit newline (universal newline mode disabled). uncompressed = data1.decode("ascii") * 50 - with gzip.open(self.filename, "wt", newline="\n") as f: + with gzip.open(self.filename, "wt", encoding="ascii", newline="\n") as f: f.write(uncompressed) @@ -726,5 +726,5 @@ f.write(uncompressed) - with gzip.open(self.filename, "rt", newline="\r") as f: + with gzip.open(self.filename, "rt", encoding="ascii", newline="\r") as f: self.assertEqual(f.readlines(), [uncompressed]) diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9oYXNobGliLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9oYXNobGliLnB5 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -82,7 +82,7 @@ def read_vectors(hash_name): url = URL.format(hash_name) try: - testdata = support.open_urlresource(url) + testdata = support.open_urlresource(url, encoding="utf-8") except (OSError, HTTPException): raise unittest.SkipTest("Could not retrieve {}".format(url)) with testdata: diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9obWFjLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9obWFjLnB5 100644 --- a/Lib/test/test_hmac.py +++ b/Lib/test/test_hmac.py @@ -11,7 +11,8 @@ from _operator import _compare_digest as operator_compare_digest try: + import _hashlib as _hashopenssl from _hashlib import HMAC as C_HMAC from _hashlib import hmac_new as c_hmac_new from _hashlib import compare_digest as openssl_compare_digest except ImportError: @@ -14,8 +15,9 @@ from _hashlib import HMAC as C_HMAC from _hashlib import hmac_new as c_hmac_new from _hashlib import compare_digest as openssl_compare_digest except ImportError: + _hashopenssl = None C_HMAC = None c_hmac_new = None openssl_compare_digest = None @@ -18,7 +20,12 @@ C_HMAC = None c_hmac_new = None openssl_compare_digest = None +try: + import _sha256 as sha256_module +except ImportError: + sha256_module = None + def ignore_warning(func): @functools.wraps(func) @@ -32,6 +39,6 @@ class TestVectorsTestCase(unittest.TestCase): - def asssert_hmac( - self, key, data, digest, hashfunc, hashname, digest_size, block_size + def assert_hmac_internals( + self, h, digest, hashname, digest_size, block_size ): @@ -37,8 +44,7 @@ ): - h = hmac.HMAC(key, data, digestmod=hashfunc) self.assertEqual(h.hexdigest().upper(), digest.upper()) self.assertEqual(h.digest(), binascii.unhexlify(digest)) self.assertEqual(h.name, f"hmac-{hashname}") self.assertEqual(h.digest_size, digest_size) self.assertEqual(h.block_size, block_size) @@ -39,7 +45,15 @@ self.assertEqual(h.hexdigest().upper(), digest.upper()) self.assertEqual(h.digest(), binascii.unhexlify(digest)) self.assertEqual(h.name, f"hmac-{hashname}") self.assertEqual(h.digest_size, digest_size) self.assertEqual(h.block_size, block_size) + def assert_hmac( + self, key, data, digest, hashfunc, hashname, digest_size, block_size + ): + h = hmac.HMAC(key, data, digestmod=hashfunc) + self.assert_hmac_internals( + h, digest, hashname, digest_size, block_size + ) + h = hmac.HMAC(key, data, digestmod=hashname) @@ -45,9 +59,7 @@ h = hmac.HMAC(key, data, digestmod=hashname) - self.assertEqual(h.hexdigest().upper(), digest.upper()) - self.assertEqual(h.digest(), binascii.unhexlify(digest)) - self.assertEqual(h.name, f"hmac-{hashname}") - self.assertEqual(h.digest_size, digest_size) - self.assertEqual(h.block_size, block_size) + self.assert_hmac_internals( + h, digest, hashname, digest_size, block_size + ) h = hmac.HMAC(key, digestmod=hashname) h2 = h.copy() @@ -56,11 +68,9 @@ self.assertEqual(h.hexdigest().upper(), digest.upper()) h = hmac.new(key, data, digestmod=hashname) - self.assertEqual(h.hexdigest().upper(), digest.upper()) - self.assertEqual(h.digest(), binascii.unhexlify(digest)) - self.assertEqual(h.name, f"hmac-{hashname}") - self.assertEqual(h.digest_size, digest_size) - self.assertEqual(h.block_size, block_size) + self.assert_hmac_internals( + h, digest, hashname, digest_size, block_size + ) h = hmac.new(key, None, digestmod=hashname) h.update(data) @@ -81,15 +91,12 @@ hmac.digest(key, data, digest=hashfunc), binascii.unhexlify(digest) ) - with unittest.mock.patch('hmac._openssl_md_meths', {}): - self.assertEqual( - hmac.digest(key, data, digest=hashname), - binascii.unhexlify(digest) - ) - self.assertEqual( - hmac.digest(key, data, digest=hashfunc), - binascii.unhexlify(digest) - ) + + h = hmac.HMAC.__new__(hmac.HMAC) + h._init_old(key, data, digestmod=hashname) + self.assert_hmac_internals( + h, digest, hashname, digest_size, block_size + ) if c_hmac_new is not None: h = c_hmac_new(key, data, digestmod=hashname) @@ -93,11 +100,9 @@ if c_hmac_new is not None: h = c_hmac_new(key, data, digestmod=hashname) - self.assertEqual(h.hexdigest().upper(), digest.upper()) - self.assertEqual(h.digest(), binascii.unhexlify(digest)) - self.assertEqual(h.name, f"hmac-{hashname}") - self.assertEqual(h.digest_size, digest_size) - self.assertEqual(h.block_size, block_size) + self.assert_hmac_internals( + h, digest, hashname, digest_size, block_size + ) h = c_hmac_new(key, digestmod=hashname) h2 = h.copy() @@ -105,8 +110,20 @@ h.update(data) self.assertEqual(h.hexdigest().upper(), digest.upper()) + func = getattr(_hashopenssl, f"openssl_{hashname}") + h = c_hmac_new(key, data, digestmod=func) + self.assert_hmac_internals( + h, digest, hashname, digest_size, block_size + ) + + h = hmac.HMAC.__new__(hmac.HMAC) + h._init_hmac(key, data, digestmod=hashname) + self.assert_hmac_internals( + h, digest, hashname, digest_size, block_size + ) + @hashlib_helper.requires_hashdigest('md5', openssl=True) def test_md5_vectors(self): # Test the HMAC module against test vectors from the RFC. def md5test(key, data, digest): @@ -108,9 +125,9 @@ @hashlib_helper.requires_hashdigest('md5', openssl=True) def test_md5_vectors(self): # Test the HMAC module against test vectors from the RFC. def md5test(key, data, digest): - self.asssert_hmac( + self.assert_hmac( key, data, digest, hashfunc=hashlib.md5, hashname="md5", @@ -150,7 +167,7 @@ @hashlib_helper.requires_hashdigest('sha1', openssl=True) def test_sha_vectors(self): def shatest(key, data, digest): - self.asssert_hmac( + self.assert_hmac( key, data, digest, hashfunc=hashlib.sha1, hashname="sha1", @@ -191,7 +208,7 @@ def hmactest(key, data, hexdigests): digest = hexdigests[hashfunc] - self.asssert_hmac( + self.assert_hmac( key, data, digest, hashfunc=hashfunc, hashname=hash_name, @@ -427,6 +444,15 @@ ): C_HMAC() + @unittest.skipUnless(sha256_module is not None, 'need _sha256') + def test_with_sha256_module(self): + h = hmac.HMAC(b"key", b"hash this!", digestmod=sha256_module.sha256) + self.assertEqual(h.hexdigest(), self.expected) + self.assertEqual(h.name, "hmac-sha256") + + digest = hmac.digest(b"key", b"hash this!", sha256_module.sha256) + self.assertEqual(digest, binascii.unhexlify(self.expected)) + class SanityTestCase(unittest.TestCase): @@ -447,5 +473,5 @@ class CopyTestCase(unittest.TestCase): @hashlib_helper.requires_hashdigest('sha256') - def test_attributes(self): + def test_attributes_old(self): # Testing if attributes are of same type. @@ -451,3 +477,4 @@ # Testing if attributes are of same type. - h1 = hmac.HMAC(b"key", digestmod="sha256") + h1 = hmac.HMAC.__new__(hmac.HMAC) + h1._init_old(b"key", b"msg", digestmod="sha256") h2 = h1.copy() @@ -453,9 +480,7 @@ h2 = h1.copy() - self.assertTrue(h1._digest_cons == h2._digest_cons, - "digest constructors don't match.") self.assertEqual(type(h1._inner), type(h2._inner), "Types of inner don't match.") self.assertEqual(type(h1._outer), type(h2._outer), "Types of outer don't match.") @hashlib_helper.requires_hashdigest('sha256') @@ -456,8 +481,8 @@ self.assertEqual(type(h1._inner), type(h2._inner), "Types of inner don't match.") self.assertEqual(type(h1._outer), type(h2._outer), "Types of outer don't match.") @hashlib_helper.requires_hashdigest('sha256') - def test_realcopy(self): + def test_realcopy_old(self): # Testing if the copy method created a real copy. @@ -463,5 +488,6 @@ # Testing if the copy method created a real copy. - h1 = hmac.HMAC(b"key", digestmod="sha256") + h1 = hmac.HMAC.__new__(hmac.HMAC) + h1._init_old(b"key", b"msg", digestmod="sha256") h2 = h1.copy() # Using id() in case somebody has overridden __eq__/__ne__. self.assertTrue(id(h1) != id(h2), "No real copy of the HMAC instance.") @@ -469,7 +495,5 @@ "No real copy of the attribute 'inner'.") self.assertTrue(id(h1._outer) != id(h2._outer), "No real copy of the attribute 'outer'.") - self.assertEqual(h1._inner, h1.inner) - self.assertEqual(h1._outer, h1.outer) - self.assertEqual(h1._digest_cons, h1.digest_cons) + self.assertIs(h1._hmac, None) @@ -475,2 +499,3 @@ + @unittest.skipIf(_hashopenssl is None, "test requires _hashopenssl") @hashlib_helper.requires_hashdigest('sha256') @@ -476,10 +501,9 @@ @hashlib_helper.requires_hashdigest('sha256') - def test_properties(self): - # deprecated properties - h1 = hmac.HMAC(b"key", digestmod="sha256") - self.assertEqual(h1._inner, h1.inner) - self.assertEqual(h1._outer, h1.outer) - self.assertEqual(h1._digest_cons, h1.digest_cons) + def test_realcopy_hmac(self): + h1 = hmac.HMAC.__new__(hmac.HMAC) + h1._init_hmac(b"key", b"msg", digestmod="sha256") + h2 = h1.copy() + self.assertTrue(id(h1._hmac) != id(h2._hmac)) @hashlib_helper.requires_hashdigest('sha256') def test_equality(self): diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXAucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXAucHk= 100644 --- a/Lib/test/test_imp.py +++ b/Lib/test/test_imp.py @@ -102,7 +102,7 @@ temp_mod_name = 'test_imp_helper' sys.path.insert(0, '.') try: - with open(temp_mod_name + '.py', 'w') as file: + with open(temp_mod_name + '.py', 'w', encoding="latin-1") as file: file.write("# coding: cp1252\nu = 'test.test_imp'\n") file, filename, info = imp.find_module(temp_mod_name) file.close() @@ -157,7 +157,7 @@ # if the curdir is not in sys.path the test fails when run with # ./python ./Lib/test/regrtest.py test_imp sys.path.insert(0, os.curdir) - with open(temp_mod_name + '.py', 'w') as file: + with open(temp_mod_name + '.py', 'w', encoding="utf-8") as file: file.write('a = 1\n') file, filename, info = imp.find_module(temp_mod_name) with file: @@ -185,7 +185,7 @@ if not os.path.exists(test_package_name): os.mkdir(test_package_name) - with open(init_file_name, 'w') as file: + with open(init_file_name, 'w', encoding="utf-8") as file: file.write('b = 2\n') with warnings.catch_warnings(): warnings.simplefilter('ignore') @@ -310,7 +310,7 @@ def test_multiple_calls_to_get_data(self): # Issue #18755: make sure multiple calls to get_data() can succeed. loader = imp._LoadSourceCompatibility('imp', imp.__file__, - open(imp.__file__)) + open(imp.__file__, encoding="utf-8")) loader.get_data(imp.__file__) # File should be closed loader.get_data(imp.__file__) # Will need to create a newly opened file diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnQvX19pbml0X18ucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnQvX19pbml0X18ucHk= 100644 --- a/Lib/test/test_import/__init__.py +++ b/Lib/test/test_import/__init__.py @@ -117,7 +117,7 @@ def test_from_import_star_invalid_type(self): import re with _ready_to_import() as (name, path): - with open(path, 'w') as f: + with open(path, 'w', encoding='utf-8') as f: f.write("__all__ = [b'invalid_type']") globals = {} with self.assertRaisesRegex( @@ -126,7 +126,7 @@ exec(f"from {name} import *", globals) self.assertNotIn(b"invalid_type", globals) with _ready_to_import() as (name, path): - with open(path, 'w') as f: + with open(path, 'w', encoding='utf-8') as f: f.write("globals()[b'invalid_type'] = object()") globals = {} with self.assertRaisesRegex( @@ -155,7 +155,7 @@ else: pyc = TESTFN + ".pyc" - with open(source, "w") as f: + with open(source, "w", encoding='utf-8') as f: print("# This tests Python's ability to import a", ext, "file.", file=f) a = random.randrange(1000) @@ -195,7 +195,7 @@ filename = module + '.py' # Create a file with a list of 65000 elements. - with open(filename, 'w') as f: + with open(filename, 'w', encoding='utf-8') as f: f.write('d = [\n') for i in range(65000): f.write('"",\n') @@ -232,7 +232,7 @@ def test_failing_import_sticks(self): source = TESTFN + ".py" - with open(source, "w") as f: + with open(source, "w", encoding='utf-8') as f: print("a = 1/0", file=f) # New in 2.4, we shouldn't be able to import that no matter how often @@ -281,7 +281,7 @@ def test_failing_reload(self): # A failing reload should leave the module object in sys.modules. source = TESTFN + os.extsep + "py" - with open(source, "w") as f: + with open(source, "w", encoding='utf-8') as f: f.write("a = 1\nb=2\n") sys.path.insert(0, os.curdir) @@ -298,7 +298,7 @@ remove_files(TESTFN) # Now damage the module. - with open(source, "w") as f: + with open(source, "w", encoding='utf-8') as f: f.write("a = 10\nb=20//0\n") self.assertRaises(ZeroDivisionError, importlib.reload, mod) @@ -320,7 +320,7 @@ def test_file_to_source(self): # check if __file__ points to the source file where available source = TESTFN + ".py" - with open(source, "w") as f: + with open(source, "w", encoding='utf-8') as f: f.write("test = None\n") sys.path.insert(0, os.curdir) @@ -369,7 +369,7 @@ try: source = TESTFN + ".py" compiled = importlib.util.cache_from_source(source) - with open(source, 'w') as f: + with open(source, 'w', encoding='utf-8') as f: pass try: os.utime(source, (2 ** 33 - 5, 2 ** 33 - 5)) @@ -574,7 +574,7 @@ # with later updates, see issue #6074 for details with _ready_to_import() as (name, path): # Write a Python file, make it read-only and import it - with open(path, 'w') as f: + with open(path, 'w', encoding='utf-8') as f: f.write("x = 'original'\n") # Tweak the mtime of the source to ensure pyc gets updated later s = os.stat(path) @@ -584,7 +584,7 @@ self.assertEqual(m.x, 'original') # Change the file and then reimport it os.chmod(path, 0o600) - with open(path, 'w') as f: + with open(path, 'w', encoding='utf-8') as f: f.write("x = 'rewritten'\n") unload(name) importlib.invalidate_caches() @@ -623,7 +623,7 @@ self.sys_path = sys.path[:] self.orig_module = sys.modules.pop(self.module_name, None) os.mkdir(self.dir_name) - with open(self.file_name, "w") as f: + with open(self.file_name, "w", encoding='utf-8') as f: f.write(self.module_source) sys.path.insert(0, self.dir_name) importlib.invalidate_caches() @@ -704,7 +704,8 @@ # Regression test for http://bugs.python.org/issue1293. def test_trailing_slash(self): - with open(os.path.join(self.path, 'test_trailing_slash.py'), 'w') as f: + with open(os.path.join(self.path, 'test_trailing_slash.py'), + 'w', encoding='utf-8') as f: f.write("testdata = 'test_trailing_slash'") sys.path.append(self.path+'/') mod = __import__("test_trailing_slash") @@ -842,7 +843,7 @@ def setUp(self): self.source = TESTFN + '.py' self._clean() - with open(self.source, 'w') as fp: + with open(self.source, 'w', encoding='utf-8') as fp: print('# This is a test file written by test_import.py', file=fp) sys.path.insert(0, os.curdir) importlib.invalidate_caches() @@ -905,7 +906,7 @@ m = __import__(TESTFN) try: self.assertEqual(m.__file__, - os.path.join(os.curdir, os.path.relpath(pyc_file))) + os.path.join(os.getcwd(), os.curdir, os.path.relpath(pyc_file))) finally: os.remove(pyc_file) @@ -913,7 +914,7 @@ # Modules now also have an __cached__ that points to the pyc file. m = __import__(TESTFN) pyc_file = importlib.util.cache_from_source(TESTFN + '.py') - self.assertEqual(m.__cached__, os.path.join(os.curdir, pyc_file)) + self.assertEqual(m.__cached__, os.path.join(os.getcwd(), os.curdir, pyc_file)) @skip_if_dont_write_bytecode def test___cached___legacy_pyc(self): @@ -929,7 +930,7 @@ importlib.invalidate_caches() m = __import__(TESTFN) self.assertEqual(m.__cached__, - os.path.join(os.curdir, os.path.relpath(pyc_file))) + os.path.join(os.getcwd(), os.curdir, os.path.relpath(pyc_file))) @skip_if_dont_write_bytecode def test_package___cached__(self): @@ -941,5 +942,5 @@ os.mkdir('pep3147') self.addCleanup(cleanup) # Touch the __init__.py - with open(os.path.join('pep3147', '__init__.py'), 'w'): + with open(os.path.join('pep3147', '__init__.py'), 'wb'): pass @@ -945,7 +946,7 @@ pass - with open(os.path.join('pep3147', 'foo.py'), 'w'): + with open(os.path.join('pep3147', 'foo.py'), 'wb'): pass importlib.invalidate_caches() m = __import__('pep3147.foo') init_pyc = importlib.util.cache_from_source( os.path.join('pep3147', '__init__.py')) @@ -947,8 +948,8 @@ pass importlib.invalidate_caches() m = __import__('pep3147.foo') init_pyc = importlib.util.cache_from_source( os.path.join('pep3147', '__init__.py')) - self.assertEqual(m.__cached__, os.path.join(os.curdir, init_pyc)) + self.assertEqual(m.__cached__, os.path.join(os.getcwd(), os.curdir, init_pyc)) foo_pyc = importlib.util.cache_from_source(os.path.join('pep3147', 'foo.py')) self.assertEqual(sys.modules['pep3147.foo'].__cached__, @@ -953,6 +954,6 @@ foo_pyc = importlib.util.cache_from_source(os.path.join('pep3147', 'foo.py')) self.assertEqual(sys.modules['pep3147.foo'].__cached__, - os.path.join(os.curdir, foo_pyc)) + os.path.join(os.getcwd(), os.curdir, foo_pyc)) def test_package___cached___from_pyc(self): # Like test___cached__ but ensuring __cached__ when imported from a @@ -964,5 +965,5 @@ os.mkdir('pep3147') self.addCleanup(cleanup) # Touch the __init__.py - with open(os.path.join('pep3147', '__init__.py'), 'w'): + with open(os.path.join('pep3147', '__init__.py'), 'wb'): pass @@ -968,5 +969,5 @@ pass - with open(os.path.join('pep3147', 'foo.py'), 'w'): + with open(os.path.join('pep3147', 'foo.py'), 'wb'): pass importlib.invalidate_caches() m = __import__('pep3147.foo') @@ -976,6 +977,6 @@ m = __import__('pep3147.foo') init_pyc = importlib.util.cache_from_source( os.path.join('pep3147', '__init__.py')) - self.assertEqual(m.__cached__, os.path.join(os.curdir, init_pyc)) + self.assertEqual(m.__cached__, os.path.join(os.getcwd(), os.curdir, init_pyc)) foo_pyc = importlib.util.cache_from_source(os.path.join('pep3147', 'foo.py')) self.assertEqual(sys.modules['pep3147.foo'].__cached__, @@ -980,9 +981,9 @@ foo_pyc = importlib.util.cache_from_source(os.path.join('pep3147', 'foo.py')) self.assertEqual(sys.modules['pep3147.foo'].__cached__, - os.path.join(os.curdir, foo_pyc)) + os.path.join(os.getcwd(), os.curdir, foo_pyc)) def test_recompute_pyc_same_second(self): # Even when the source file doesn't change timestamp, a change in # source size is enough to trigger recomputation of the pyc file. __import__(TESTFN) unload(TESTFN) @@ -983,10 +984,10 @@ def test_recompute_pyc_same_second(self): # Even when the source file doesn't change timestamp, a change in # source size is enough to trigger recomputation of the pyc file. __import__(TESTFN) unload(TESTFN) - with open(self.source, 'a') as fp: + with open(self.source, 'a', encoding='utf-8') as fp: print("x = 5", file=fp) m = __import__(TESTFN) self.assertEqual(m.x, 5) @@ -1118,7 +1119,7 @@ def create_module(self, mod, contents, ext=".py"): fname = os.path.join(TESTFN, mod + ext) - with open(fname, "w") as f: + with open(fname, "w", encoding='utf-8') as f: f.write(contents) self.addCleanup(unload, mod) importlib.invalidate_caches() @@ -1195,6 +1196,6 @@ os.mkdir(pkg_path) # Touch the __init__.py init_path = os.path.join(pkg_path, '__init__.py') - with open(init_path, 'w') as f: + with open(init_path, 'w', encoding='utf-8') as f: f.write(parent) bar_path = os.path.join(pkg_path, 'bar.py') @@ -1199,6 +1200,6 @@ f.write(parent) bar_path = os.path.join(pkg_path, 'bar.py') - with open(bar_path, 'w') as f: + with open(bar_path, 'w', encoding='utf-8') as f: f.write(child) importlib.invalidate_caches() return init_path, bar_path diff --git a/Lib/test/test_importlib/builtin/test_finder.py b/Lib/test/test_importlib/builtin/test_finder.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvYnVpbHRpbi90ZXN0X2ZpbmRlci5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvYnVpbHRpbi90ZXN0X2ZpbmRlci5weQ== 100644 --- a/Lib/test/test_importlib/builtin/test_finder.py +++ b/Lib/test/test_importlib/builtin/test_finder.py @@ -5,6 +5,7 @@ import sys import unittest +import warnings @unittest.skipIf(util.BUILTINS.good_name is None, 'no reasonable builtin module') @@ -58,7 +59,9 @@ def test_module(self): # Common case. with util.uncache(util.BUILTINS.good_name): - found = self.machinery.BuiltinImporter.find_module(util.BUILTINS.good_name) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + found = self.machinery.BuiltinImporter.find_module(util.BUILTINS.good_name) self.assertTrue(found) self.assertTrue(hasattr(found, 'load_module')) @@ -70,9 +73,11 @@ def test_failure(self): assert 'importlib' not in sys.builtin_module_names - loader = self.machinery.BuiltinImporter.find_module('importlib') + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + loader = self.machinery.BuiltinImporter.find_module('importlib') self.assertIsNone(loader) def test_ignore_path(self): # The value for 'path' should always trigger a failed import. with util.uncache(util.BUILTINS.good_name): @@ -74,10 +79,13 @@ self.assertIsNone(loader) def test_ignore_path(self): # The value for 'path' should always trigger a failed import. with util.uncache(util.BUILTINS.good_name): - loader = self.machinery.BuiltinImporter.find_module(util.BUILTINS.good_name, - ['pkg']) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + loader = self.machinery.BuiltinImporter.find_module( + util.BUILTINS.good_name, + ['pkg']) self.assertIsNone(loader) diff --git a/Lib/test/test_importlib/extension/test_case_sensitivity.py b/Lib/test/test_importlib/extension/test_case_sensitivity.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvZXh0ZW5zaW9uL3Rlc3RfY2FzZV9zZW5zaXRpdml0eS5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvZXh0ZW5zaW9uL3Rlc3RfY2FzZV9zZW5zaXRpdml0eS5weQ== 100644 --- a/Lib/test/test_importlib/extension/test_case_sensitivity.py +++ b/Lib/test/test_importlib/extension/test_case_sensitivity.py @@ -12,10 +12,10 @@ @util.case_insensitive_tests class ExtensionModuleCaseSensitivityTest(util.CASEOKTestBase): - def find_module(self): + def find_spec(self): good_name = util.EXTENSIONS.name bad_name = good_name.upper() assert good_name != bad_name finder = self.machinery.FileFinder(util.EXTENSIONS.path, (self.machinery.ExtensionFileLoader, self.machinery.EXTENSION_SUFFIXES)) @@ -16,13 +16,13 @@ good_name = util.EXTENSIONS.name bad_name = good_name.upper() assert good_name != bad_name finder = self.machinery.FileFinder(util.EXTENSIONS.path, (self.machinery.ExtensionFileLoader, self.machinery.EXTENSION_SUFFIXES)) - return finder.find_module(bad_name) + return finder.find_spec(bad_name) @unittest.skipIf(sys.flags.ignore_environment, 'ignore_environment flag was set') def test_case_sensitive(self): with os_helper.EnvironmentVarGuard() as env: env.unset('PYTHONCASEOK') self.caseok_env_changed(should_exist=False) @@ -23,14 +23,14 @@ @unittest.skipIf(sys.flags.ignore_environment, 'ignore_environment flag was set') def test_case_sensitive(self): with os_helper.EnvironmentVarGuard() as env: env.unset('PYTHONCASEOK') self.caseok_env_changed(should_exist=False) - loader = self.find_module() - self.assertIsNone(loader) + spec = self.find_spec() + self.assertIsNone(spec) @unittest.skipIf(sys.flags.ignore_environment, 'ignore_environment flag was set') def test_case_insensitivity(self): with os_helper.EnvironmentVarGuard() as env: env.set('PYTHONCASEOK', '1') self.caseok_env_changed(should_exist=True) @@ -31,11 +31,11 @@ @unittest.skipIf(sys.flags.ignore_environment, 'ignore_environment flag was set') def test_case_insensitivity(self): with os_helper.EnvironmentVarGuard() as env: env.set('PYTHONCASEOK', '1') self.caseok_env_changed(should_exist=True) - loader = self.find_module() - self.assertTrue(hasattr(loader, 'load_module')) + spec = self.find_spec() + self.assertTrue(spec) (Frozen_ExtensionCaseSensitivity, diff --git a/Lib/test/test_importlib/extension/test_finder.py b/Lib/test/test_importlib/extension/test_finder.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvZXh0ZW5zaW9uL3Rlc3RfZmluZGVyLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvZXh0ZW5zaW9uL3Rlc3RfZmluZGVyLnB5 100644 --- a/Lib/test/test_importlib/extension/test_finder.py +++ b/Lib/test/test_importlib/extension/test_finder.py @@ -11,7 +11,7 @@ """Test the finder for extension modules.""" - def find_module(self, fullname): + def find_spec(self, fullname): importer = self.machinery.FileFinder(util.EXTENSIONS.path, (self.machinery.ExtensionFileLoader, self.machinery.EXTENSION_SUFFIXES)) @@ -15,8 +15,7 @@ importer = self.machinery.FileFinder(util.EXTENSIONS.path, (self.machinery.ExtensionFileLoader, self.machinery.EXTENSION_SUFFIXES)) - with warnings.catch_warnings(): - warnings.simplefilter('ignore', DeprecationWarning) - return importer.find_module(fullname) + + return importer.find_spec(fullname) def test_module(self): @@ -21,6 +20,6 @@ def test_module(self): - self.assertTrue(self.find_module(util.EXTENSIONS.name)) + self.assertTrue(self.find_spec(util.EXTENSIONS.name)) # No extension module as an __init__ available for testing. test_package = test_package_in_package = None @@ -32,7 +31,7 @@ test_package_over_module = None def test_failure(self): - self.assertIsNone(self.find_module('asdfjkl;')) + self.assertIsNone(self.find_spec('asdfjkl;')) (Frozen_FinderTests, diff --git a/Lib/test/test_importlib/extension/test_loader.py b/Lib/test/test_importlib/extension/test_loader.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvZXh0ZW5zaW9uL3Rlc3RfbG9hZGVyLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvZXh0ZW5zaW9uL3Rlc3RfbG9hZGVyLnB5 100644 --- a/Lib/test/test_importlib/extension/test_loader.py +++ b/Lib/test/test_importlib/extension/test_loader.py @@ -89,8 +89,7 @@ ) = util.test_both(LoaderTests, machinery=machinery) class MultiPhaseExtensionModuleTests(abc.LoaderTests): - """Test loading extension modules with multi-phase initialization (PEP 489) - """ + # Test loading extension modules with multi-phase initialization (PEP 489). def setUp(self): self.name = '_testmultiphase' @@ -101,9 +100,9 @@ self.name, self.spec.origin) def load_module(self): - '''Load the module from the test extension''' + # Load the module from the test extension. with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) return self.loader.load_module(self.name) def load_module_by_name(self, fullname): @@ -105,9 +104,9 @@ with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) return self.loader.load_module(self.name) def load_module_by_name(self, fullname): - '''Load a module from the test extension by name''' + # Load a module from the test extension by name. origin = self.spec.origin loader = self.machinery.ExtensionFileLoader(fullname, origin) spec = importlib.util.spec_from_loader(fullname, loader) @@ -125,7 +124,7 @@ test_state_after_failure = None def test_module(self): - '''Test loading an extension module''' + # Test loading an extension module. with util.uncache(self.name): module = self.load_module() for attr, value in [('__name__', self.name), @@ -139,7 +138,7 @@ self.machinery.ExtensionFileLoader) def test_functionality(self): - '''Test basic functionality of stuff defined in an extension module''' + # Test basic functionality of stuff defined in an extension module. with util.uncache(self.name): module = self.load_module() self.assertIsInstance(module, types.ModuleType) @@ -159,7 +158,7 @@ self.assertEqual(module.str_const, 'something different') def test_reload(self): - '''Test that reload didn't re-set the module's attributes''' + # Test that reload didn't re-set the module's attributes. with util.uncache(self.name): module = self.load_module() ex_class = module.Example @@ -167,7 +166,7 @@ self.assertIs(ex_class, module.Example) def test_try_registration(self): - '''Assert that the PyState_{Find,Add,Remove}Module C API doesn't work''' + # Assert that the PyState_{Find,Add,Remove}Module C API doesn't work. module = self.load_module() with self.subTest('PyState_FindModule'): self.assertEqual(module.call_state_registration_func(0), None) @@ -179,10 +178,10 @@ module.call_state_registration_func(2) def test_load_submodule(self): - '''Test loading a simulated submodule''' + # Test loading a simulated submodule. module = self.load_module_by_name('pkg.' + self.name) self.assertIsInstance(module, types.ModuleType) self.assertEqual(module.__name__, 'pkg.' + self.name) self.assertEqual(module.str_const, 'something different') def test_load_short_name(self): @@ -183,10 +182,10 @@ module = self.load_module_by_name('pkg.' + self.name) self.assertIsInstance(module, types.ModuleType) self.assertEqual(module.__name__, 'pkg.' + self.name) self.assertEqual(module.str_const, 'something different') def test_load_short_name(self): - '''Test loading module with a one-character name''' + # Test loading module with a one-character name. module = self.load_module_by_name('x') self.assertIsInstance(module, types.ModuleType) self.assertEqual(module.__name__, 'x') @@ -194,9 +193,9 @@ self.assertNotIn('x', sys.modules) def test_load_twice(self): - '''Test that 2 loads result in 2 module objects''' + # Test that 2 loads result in 2 module objects. module1 = self.load_module_by_name(self.name) module2 = self.load_module_by_name(self.name) self.assertIsNot(module1, module2) def test_unloadable(self): @@ -198,12 +197,12 @@ module1 = self.load_module_by_name(self.name) module2 = self.load_module_by_name(self.name) self.assertIsNot(module1, module2) def test_unloadable(self): - '''Test nonexistent module''' + # Test nonexistent module. name = 'asdfjkl;' with self.assertRaises(ImportError) as cm: self.load_module_by_name(name) self.assertEqual(cm.exception.name, name) def test_unloadable_nonascii(self): @@ -204,13 +203,13 @@ name = 'asdfjkl;' with self.assertRaises(ImportError) as cm: self.load_module_by_name(name) self.assertEqual(cm.exception.name, name) def test_unloadable_nonascii(self): - '''Test behavior with nonexistent module with non-ASCII name''' + # Test behavior with nonexistent module with non-ASCII name. name = 'fo\xf3' with self.assertRaises(ImportError) as cm: self.load_module_by_name(name) self.assertEqual(cm.exception.name, name) def test_nonmodule(self): @@ -211,10 +210,10 @@ name = 'fo\xf3' with self.assertRaises(ImportError) as cm: self.load_module_by_name(name) self.assertEqual(cm.exception.name, name) def test_nonmodule(self): - '''Test returning a non-module object from create works''' + # Test returning a non-module object from create works. name = self.name + '_nonmodule' mod = self.load_module_by_name(name) self.assertNotEqual(type(mod), type(unittest)) @@ -222,7 +221,7 @@ # issue 27782 def test_nonmodule_with_methods(self): - '''Test creating a non-module object with methods defined''' + # Test creating a non-module object with methods defined. name = self.name + '_nonmodule_with_methods' mod = self.load_module_by_name(name) self.assertNotEqual(type(mod), type(unittest)) @@ -230,10 +229,10 @@ self.assertEqual(mod.bar(10, 1), 9) def test_null_slots(self): - '''Test that NULL slots aren't a problem''' + # Test that NULL slots aren't a problem. name = self.name + '_null_slots' module = self.load_module_by_name(name) self.assertIsInstance(module, types.ModuleType) self.assertEqual(module.__name__, name) def test_bad_modules(self): @@ -234,10 +233,10 @@ name = self.name + '_null_slots' module = self.load_module_by_name(name) self.assertIsInstance(module, types.ModuleType) self.assertEqual(module.__name__, name) def test_bad_modules(self): - '''Test SystemError is raised for misbehaving extensions''' + # Test SystemError is raised for misbehaving extensions. for name_base in [ 'bad_slot_large', 'bad_slot_negative', @@ -261,5 +260,5 @@ self.load_module_by_name(name) def test_nonascii(self): - '''Test that modules with non-ASCII names can be loaded''' + # Test that modules with non-ASCII names can be loaded. # punycode behaves slightly differently in some-ASCII and no-ASCII @@ -265,5 +264,5 @@ # punycode behaves slightly differently in some-ASCII and no-ASCII - # cases, so test both + # cases, so test both. cases = [ (self.name + '_zkou\u0161ka_na\u010dten\xed', 'Czech'), ('\uff3f\u30a4\u30f3\u30dd\u30fc\u30c8\u30c6\u30b9\u30c8', diff --git a/Lib/test/test_importlib/fixtures.py b/Lib/test/test_importlib/fixtures.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvZml4dHVyZXMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvZml4dHVyZXMucHk= 100644 --- a/Lib/test/test_importlib/fixtures.py +++ b/Lib/test/test_importlib/fixtures.py @@ -250,7 +250,7 @@ with full_name.open('wb') as f: f.write(contents) else: - with full_name.open('w') as f: + with full_name.open('w', encoding='utf-8') as f: f.write(DALS(contents)) diff --git a/Lib/test/test_importlib/frozen/test_finder.py b/Lib/test/test_importlib/frozen/test_finder.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvZnJvemVuL3Rlc3RfZmluZGVyLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvZnJvemVuL3Rlc3RfZmluZGVyLnB5 100644 --- a/Lib/test/test_importlib/frozen/test_finder.py +++ b/Lib/test/test_importlib/frozen/test_finder.py @@ -4,6 +4,7 @@ machinery = util.import_importlib('importlib.machinery') import unittest +import warnings class FindSpecTests(abc.FinderTests): @@ -49,7 +50,9 @@ def find(self, name, path=None): finder = self.machinery.FrozenImporter - return finder.find_module(name, path) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + return finder.find_module(name, path) def test_module(self): name = '__hello__' diff --git a/Lib/test/test_importlib/frozen/test_loader.py b/Lib/test/test_importlib/frozen/test_loader.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvZnJvemVuL3Rlc3RfbG9hZGVyLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvZnJvemVuL3Rlc3RfbG9hZGVyLnB5 100644 --- a/Lib/test/test_importlib/frozen/test_loader.py +++ b/Lib/test/test_importlib/frozen/test_loader.py @@ -78,7 +78,7 @@ test_state_after_failure = None def test_unloadable(self): - assert self.machinery.FrozenImporter.find_module('_not_real') is None + assert self.machinery.FrozenImporter.find_spec('_not_real') is None with self.assertRaises(ImportError) as cm: self.exec_module('_not_real') self.assertEqual(cm.exception.name, '_not_real') @@ -160,14 +160,6 @@ self.assertEqual(repr_str, "<module '__hello__' (frozen)>") - def test_module_repr_indirect(self): - with warnings.catch_warnings(): - warnings.simplefilter("ignore", DeprecationWarning) - with util.uncache('__hello__'), captured_stdout(): - module = self.machinery.FrozenImporter.load_module('__hello__') - self.assertEqual(repr(module), - "<module '__hello__' (frozen)>") - # No way to trigger an error in a frozen module. test_state_after_failure = None diff --git a/Lib/test/test_importlib/import_/test_path.py b/Lib/test/test_importlib/import_/test_path.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvaW1wb3J0Xy90ZXN0X3BhdGgucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvaW1wb3J0Xy90ZXN0X3BhdGgucHk= 100644 --- a/Lib/test/test_importlib/import_/test_path.py +++ b/Lib/test/test_importlib/import_/test_path.py @@ -75,7 +75,8 @@ with util.import_state(path_importer_cache={}, path_hooks=[], path=[path_entry]): with warnings.catch_warnings(record=True) as w: - warnings.simplefilter('always') + warnings.simplefilter('always', ImportWarning) + warnings.simplefilter('ignore', DeprecationWarning) self.assertIsNone(self.find('os')) self.assertIsNone(sys.path_importer_cache[path_entry]) self.assertEqual(len(w), 1) @@ -123,8 +124,10 @@ failing_finder.to_return = None path = 'testing path' with util.import_state(path_importer_cache={path: failing_finder}): - self.assertIsNone( + with warnings.catch_warnings(): + warnings.simplefilter("ignore", ImportWarning) + self.assertIsNone( self.machinery.PathFinder.find_spec('whatever', [path])) success_finder = TestFinder() success_finder.to_return = __loader__ with util.import_state(path_importer_cache={path: success_finder}): @@ -127,8 +130,10 @@ self.machinery.PathFinder.find_spec('whatever', [path])) success_finder = TestFinder() success_finder.to_return = __loader__ with util.import_state(path_importer_cache={path: success_finder}): - spec = self.machinery.PathFinder.find_spec('whatever', [path]) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", ImportWarning) + spec = self.machinery.PathFinder.find_spec('whatever', [path]) self.assertEqual(spec.loader, __loader__) def test_finder_with_find_loader(self): @@ -139,8 +144,10 @@ return self.loader, self.portions path = 'testing path' with util.import_state(path_importer_cache={path: TestFinder()}): - self.assertIsNone( + with warnings.catch_warnings(): + warnings.simplefilter("ignore", ImportWarning) + self.assertIsNone( self.machinery.PathFinder.find_spec('whatever', [path])) success_finder = TestFinder() success_finder.loader = __loader__ with util.import_state(path_importer_cache={path: success_finder}): @@ -143,8 +150,10 @@ self.machinery.PathFinder.find_spec('whatever', [path])) success_finder = TestFinder() success_finder.loader = __loader__ with util.import_state(path_importer_cache={path: success_finder}): - spec = self.machinery.PathFinder.find_spec('whatever', [path]) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", ImportWarning) + spec = self.machinery.PathFinder.find_spec('whatever', [path]) self.assertEqual(spec.loader, __loader__) def test_finder_with_find_spec(self): @@ -208,7 +217,9 @@ class FindModuleTests(FinderTests): def find(self, *args, **kwargs): - return self.machinery.PathFinder.find_module(*args, **kwargs) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + return self.machinery.PathFinder.find_module(*args, **kwargs) def check_found(self, found, importer): self.assertIs(found, importer) @@ -248,7 +259,9 @@ with util.import_state(path=[Finder.path_location]+sys.path[:], path_hooks=[Finder]): - self.machinery.PathFinder.find_spec('importlib') + with warnings.catch_warnings(): + warnings.simplefilter("ignore", ImportWarning) + self.machinery.PathFinder.find_spec('importlib') def test_finder_with_failing_find_module(self): # PathEntryFinder with find_module() defined should work. @@ -266,7 +279,10 @@ with util.import_state(path=[Finder.path_location]+sys.path[:], path_hooks=[Finder]): - self.machinery.PathFinder.find_module('importlib') + with warnings.catch_warnings(): + warnings.simplefilter("ignore", ImportWarning) + warnings.simplefilter("ignore", DeprecationWarning) + self.machinery.PathFinder.find_module('importlib') (Frozen_PEFTests, diff --git a/Lib/test/test_importlib/partial/cfimport.py b/Lib/test/test_importlib/partial/cfimport.py new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvcGFydGlhbC9jZmltcG9ydC5weQ== --- /dev/null +++ b/Lib/test/test_importlib/partial/cfimport.py @@ -0,0 +1,38 @@ +import os +import sys +import threading +import traceback + + +NLOOPS = 50 +NTHREADS = 30 + + +def t1(): + try: + from concurrent.futures import ThreadPoolExecutor + except Exception: + traceback.print_exc() + os._exit(1) + +def t2(): + try: + from concurrent.futures.thread import ThreadPoolExecutor + except Exception: + traceback.print_exc() + os._exit(1) + +def main(): + for j in range(NLOOPS): + threads = [] + for i in range(NTHREADS): + threads.append(threading.Thread(target=t2 if i % 1 else t1)) + for thread in threads: + thread.start() + for thread in threads: + thread.join() + sys.modules.pop('concurrent.futures', None) + sys.modules.pop('concurrent.futures.thread', None) + +if __name__ == "__main__": + main() diff --git a/Lib/test/test_importlib/partial/pool_in_threads.py b/Lib/test/test_importlib/partial/pool_in_threads.py new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvcGFydGlhbC9wb29sX2luX3RocmVhZHMucHk= --- /dev/null +++ b/Lib/test/test_importlib/partial/pool_in_threads.py @@ -0,0 +1,27 @@ +import multiprocessing +import os +import threading +import traceback + + +def t(): + try: + with multiprocessing.Pool(1): + pass + except Exception: + traceback.print_exc() + os._exit(1) + + +def main(): + threads = [] + for i in range(20): + threads.append(threading.Thread(target=t)) + for thread in threads: + thread.start() + for thread in threads: + thread.join() + + +if __name__ == "__main__": + main() diff --git a/Lib/test/test_importlib/source/test_case_sensitivity.py b/Lib/test/test_importlib/source/test_case_sensitivity.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvc291cmNlL3Rlc3RfY2FzZV9zZW5zaXRpdml0eS5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvc291cmNlL3Rlc3RfY2FzZV9zZW5zaXRpdml0eS5weQ== 100644 --- a/Lib/test/test_importlib/source/test_case_sensitivity.py +++ b/Lib/test/test_importlib/source/test_case_sensitivity.py @@ -9,6 +9,7 @@ import os from test.support import os_helper import unittest +import warnings @util.case_insensitive_tests @@ -64,7 +65,9 @@ class CaseSensitivityTestPEP302(CaseSensitivityTest): def find(self, finder): - return finder.find_module(self.name) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + return finder.find_module(self.name) (Frozen_CaseSensitivityTestPEP302, diff --git a/Lib/test/test_importlib/source/test_file_loader.py b/Lib/test/test_importlib/source/test_file_loader.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvc291cmNlL3Rlc3RfZmlsZV9sb2FkZXIucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvc291cmNlL3Rlc3RfZmlsZV9sb2FkZXIucHk= 100644 --- a/Lib/test/test_importlib/source/test_file_loader.py +++ b/Lib/test/test_importlib/source/test_file_loader.py @@ -124,7 +124,7 @@ module = loader.load_module('_temp') module_id = id(module) module_dict_id = id(module.__dict__) - with open(mapping['_temp'], 'w') as file: + with open(mapping['_temp'], 'w', encoding='utf-8') as file: file.write("testing_var = 42\n") with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) @@ -145,7 +145,7 @@ orig_module = types.ModuleType(name) for attr in attributes: setattr(orig_module, attr, value) - with open(mapping[name], 'w') as file: + with open(mapping[name], 'w', encoding='utf-8') as file: file.write('+++ bad syntax +++') loader = self.machinery.SourceFileLoader('_temp', mapping['_temp']) with self.assertRaises(SyntaxError): @@ -162,7 +162,7 @@ # [syntax error] def test_bad_syntax(self): with util.create_modules('_temp') as mapping: - with open(mapping['_temp'], 'w') as file: + with open(mapping['_temp'], 'w', encoding='utf-8') as file: file.write('=') loader = self.machinery.SourceFileLoader('_temp', mapping['_temp']) with self.assertRaises(SyntaxError): @@ -175,7 +175,7 @@ # Loading a module found from an empty string entry on sys.path should # not only work, but keep all attributes relative. file_path = '_temp.py' - with open(file_path, 'w') as file: + with open(file_path, 'w', encoding='utf-8') as file: file.write("# test file for importlib") try: with util.uncache('_temp'): @@ -199,7 +199,7 @@ with util.create_modules('_temp') as mapping: source = mapping['_temp'] compiled = self.util.cache_from_source(source) - with open(source, 'w') as f: + with open(source, 'w', encoding='utf-8') as f: f.write("x = 5") try: os.utime(source, (2 ** 33 - 5, 2 ** 33 - 5)) diff --git a/Lib/test/test_importlib/source/test_finder.py b/Lib/test/test_importlib/source/test_finder.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvc291cmNlL3Rlc3RfZmluZGVyLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvc291cmNlL3Rlc3RfZmluZGVyLnB5 100644 --- a/Lib/test/test_importlib/source/test_finder.py +++ b/Lib/test/test_importlib/source/test_finder.py @@ -127,7 +127,7 @@ # The empty string from sys.path means to search in the cwd. finder = self.machinery.FileFinder('', (self.machinery.SourceFileLoader, self.machinery.SOURCE_SUFFIXES)) - with open('mod.py', 'w') as file: + with open('mod.py', 'w', encoding='utf-8') as file: file.write("# test file for importlib") try: loader = self._find(finder, 'mod', loader_only=True) diff --git a/Lib/test/test_importlib/test_abc.py b/Lib/test/test_importlib/test_abc.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9hYmMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9hYmMucHk= 100644 --- a/Lib/test/test_importlib/test_abc.py +++ b/Lib/test/test_importlib/test_abc.py @@ -55,7 +55,7 @@ class MetaPathFinder(InheritanceTests): - superclass_names = ['Finder'] + superclass_names = [] subclass_names = ['BuiltinImporter', 'FrozenImporter', 'PathFinder', 'WindowsRegistryFinder'] @@ -66,7 +66,7 @@ class PathEntryFinder(InheritanceTests): - superclass_names = ['Finder'] + superclass_names = [] subclass_names = ['FileFinder'] @@ -220,12 +220,14 @@ def test_module_repr(self): mod = types.ModuleType('blah') - with self.assertRaises(NotImplementedError): - self.ins.module_repr(mod) - original_repr = repr(mod) - mod.__loader__ = self.ins - # Should still return a proper repr. - self.assertTrue(repr(mod)) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + with self.assertRaises(NotImplementedError): + self.ins.module_repr(mod) + original_repr = repr(mod) + mod.__loader__ = self.ins + # Should still return a proper repr. + self.assertTrue(repr(mod)) (Frozen_LDefaultTests, diff --git a/Lib/test/test_importlib/test_api.py b/Lib/test/test_importlib/test_api.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9hcGkucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9hcGkucHk= 100644 --- a/Lib/test/test_importlib/test_api.py +++ b/Lib/test/test_importlib/test_api.py @@ -151,6 +151,7 @@ with test_util.import_state(meta_path=[self.FakeMetaFinder]): with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) + warnings.simplefilter('ignore', ImportWarning) self.assertEqual((name, None), self.init.find_loader(name)) def test_success_path(self): @@ -161,6 +162,7 @@ with test_util.import_state(meta_path=[self.FakeMetaFinder]): with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) + warnings.simplefilter('ignore', ImportWarning) self.assertEqual((name, path), self.init.find_loader(name, path)) @@ -310,7 +312,7 @@ '__file__': None, } os.mkdir(name) - with open(bad_path, 'w') as init_file: + with open(bad_path, 'w', encoding='utf-8') as init_file: init_file.write('eggs = None') module = self.init.import_module(name) ns = vars(module).copy() @@ -438,5 +440,5 @@ with self.subTest(name=name): self.assertTrue(hasattr(module, '__loader__'), '{!r} lacks a __loader__ attribute'.format(name)) - if self.machinery.BuiltinImporter.find_module(name): + if self.machinery.BuiltinImporter.find_spec(name): self.assertIsNot(module.__loader__, None) @@ -442,5 +444,5 @@ self.assertIsNot(module.__loader__, None) - elif self.machinery.FrozenImporter.find_module(name): + elif self.machinery.FrozenImporter.find_spec(name): self.assertIsNot(module.__loader__, None) def test_everyone_has___spec__(self): @@ -448,5 +450,5 @@ if isinstance(module, types.ModuleType): with self.subTest(name=name): self.assertTrue(hasattr(module, '__spec__')) - if self.machinery.BuiltinImporter.find_module(name): + if self.machinery.BuiltinImporter.find_spec(name): self.assertIsNot(module.__spec__, None) @@ -452,5 +454,5 @@ self.assertIsNot(module.__spec__, None) - elif self.machinery.FrozenImporter.find_module(name): + elif self.machinery.FrozenImporter.find_spec(name): self.assertIsNot(module.__spec__, None) diff --git a/Lib/test/test_importlib/test_files.py b/Lib/test/test_importlib/test_files.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9maWxlcy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9maWxlcy5weQ== 100644 --- a/Lib/test/test_importlib/test_files.py +++ b/Lib/test/test_importlib/test_files.py @@ -15,7 +15,7 @@ def test_read_text(self): files = resources.files(self.data) - actual = files.joinpath('utf-8.file').read_text() + actual = files.joinpath('utf-8.file').read_text(encoding='utf-8') assert actual == 'Hello, UTF-8 world!\n' @unittest.skipUnless( diff --git a/Lib/test/test_importlib/test_main.py b/Lib/test/test_importlib/test_main.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9tYWluLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9tYWluLnB5 100644 --- a/Lib/test/test_importlib/test_main.py +++ b/Lib/test/test_importlib/test_main.py @@ -36,12 +36,10 @@ Distribution.from_name('does-not-exist') def test_package_not_found_mentions_metadata(self): - """ - When a package is not found, that could indicate that the - packgae is not installed or that it is installed without - metadata. Ensure the exception mentions metadata to help - guide users toward the cause. See #124. - """ + # When a package is not found, that could indicate that the + # packgae is not installed or that it is installed without + # metadata. Ensure the exception mentions metadata to help + # guide users toward the cause. See #124. with self.assertRaises(PackageNotFoundError) as ctx: Distribution.from_name('does-not-exist') @@ -85,8 +83,8 @@ metadata_dir = site_dir / 'my_pkg.dist-info' metadata_dir.mkdir() metadata = metadata_dir / 'METADATA' - with metadata.open('w') as strm: + with metadata.open('w', encoding='utf-8') as strm: strm.write('Version: 1.0\n') return 'my-pkg' def test_dashes_in_dist_name_found_as_underscores(self): @@ -89,11 +87,9 @@ strm.write('Version: 1.0\n') return 'my-pkg' def test_dashes_in_dist_name_found_as_underscores(self): - """ - For a package with a dash in the name, the dist-info metadata - uses underscores in the name. Ensure the metadata loads. - """ + # For a package with a dash in the name, the dist-info metadata + # uses underscores in the name. Ensure the metadata loads. pkg_name = self.pkg_with_dashes(self.site_dir) assert version(pkg_name) == '1.0' @@ -106,8 +102,8 @@ metadata_dir = site_dir / 'CherryPy.dist-info' metadata_dir.mkdir() metadata = metadata_dir / 'METADATA' - with metadata.open('w') as strm: + with metadata.open('w', encoding='utf-8') as strm: strm.write('Version: 1.0\n') return 'CherryPy' def test_dist_name_found_as_any_case(self): @@ -110,10 +106,8 @@ strm.write('Version: 1.0\n') return 'CherryPy' def test_dist_name_found_as_any_case(self): - """ - Ensure the metadata loads when queried with any case. - """ + # Ensure the metadata loads when queried with any case. pkg_name = self.pkg_with_mixed_case(self.site_dir) assert version(pkg_name) == '1.0' assert version(pkg_name.lower()) == '1.0' @@ -241,7 +235,7 @@ assert "'name'" in repr(self.ep) def test_hashable(self): - """EntryPoints should be hashable""" + # EntryPoints should be hashable. hash(self.ep) def test_json_dump(self): @@ -245,9 +239,7 @@ hash(self.ep) def test_json_dump(self): - """ - json should not expect to be able to dump an EntryPoint - """ + # json should not expect to be able to dump an EntryPoint. with self.assertRaises(Exception): with warnings.catch_warnings(record=True): json.dumps(self.ep) @@ -259,9 +251,7 @@ assert self.ep.attr is None def test_sortable(self): - """ - EntryPoint objects are sortable, but result is undefined. - """ + # EntryPoint objects are sortable, but result is undefined. sorted( [ EntryPoint('b', 'val', 'group'), @@ -274,10 +264,8 @@ fixtures.OnSysPath, fixtures.SiteDir, fixtures.FileBuilder, unittest.TestCase ): def test_unicode_dir_on_sys_path(self): - """ - Ensure a Unicode subdirectory of a directory on sys.path - does not crash. - """ + # Ensure a Unicode subdirectory of a directory on sys.path + # does not crash. fixtures.build_files( {self.unicode_filename(): {}}, prefix=self.site_dir, diff --git a/Lib/test/test_importlib/test_metadata_api.py b/Lib/test/test_importlib/test_metadata_api.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9tZXRhZGF0YV9hcGkucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9tZXRhZGF0YV9hcGkucHk= 100644 --- a/Lib/test/test_importlib/test_metadata_api.py +++ b/Lib/test/test_importlib/test_metadata_api.py @@ -81,10 +81,8 @@ self.assertEqual(ep.dist.version, "1.0.0") def test_entry_points_unique_packages(self): - """ - Entry points should only be exposed for the first package - on sys.path with a given name. - """ + # Entry points should only be exposed for the first package + # on sys.path with a given name. alt_site_dir = self.fixtures.enter_context(fixtures.tempdir()) self.fixtures.enter_context(self.add_sys_path(alt_site_dir)) alt_pkg = { @@ -116,11 +114,9 @@ assert entry_points(group='missing') == () def test_entry_points_dict_construction(self): - """ - Prior versions of entry_points() returned simple lists and - allowed casting those lists into maps by name using ``dict()``. - Capture this now deprecated use-case. - """ + # Prior versions of entry_points() returned simple lists and + # allowed casting those lists into maps by name using ``dict()``. + # Capture this now deprecated use-case. with warnings.catch_warnings(record=True) as caught: warnings.filterwarnings("default", category=DeprecationWarning) eps = dict(entry_points(group='entries')) @@ -134,11 +130,9 @@ assert "Construction of dict of EntryPoints is deprecated" in str(expected) def test_entry_points_groups_getitem(self): - """ - Prior versions of entry_points() returned a dict. Ensure - that callers using '.__getitem__()' are supported but warned to - migrate. - """ + # Prior versions of entry_points() returned a dict. Ensure + # that callers using '.__getitem__()' are supported but warned to + # migrate. with warnings.catch_warnings(record=True): entry_points()['entries'] == entry_points(group='entries') @@ -146,11 +140,9 @@ entry_points()['missing'] def test_entry_points_groups_get(self): - """ - Prior versions of entry_points() returned a dict. Ensure - that callers using '.get()' are supported but warned to - migrate. - """ + # Prior versions of entry_points() returned a dict. Ensure + # that callers using '.get()' are supported but warned to + # migrate. with warnings.catch_warnings(record=True): entry_points().get('missing', 'default') == 'default' entry_points().get('entries', 'default') == entry_points()['entries'] @@ -259,7 +251,7 @@ assert any(dist.metadata['Name'] == 'distinfo-pkg' for dist in dists) def test_distribution_at_pathlib(self): - """Demonstrate how to load metadata direct from a directory.""" + # Demonstrate how to load metadata direct from a directory. dist_info_path = self.site_dir / 'distinfo_pkg-1.0.0.dist-info' dist = Distribution.at(dist_info_path) assert dist.version == '1.0.0' diff --git a/Lib/test/test_importlib/test_namespace_pkgs.py b/Lib/test/test_importlib/test_namespace_pkgs.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9uYW1lc3BhY2VfcGtncy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9uYW1lc3BhY2VfcGtncy5weQ== 100644 --- a/Lib/test/test_importlib/test_namespace_pkgs.py +++ b/Lib/test/test_importlib/test_namespace_pkgs.py @@ -3,6 +3,7 @@ import os import sys import unittest +import warnings from test.test_importlib import util @@ -82,7 +83,10 @@ def test_module_repr(self): import foo.one - self.assertEqual(repr(foo), "<module 'foo' (namespace)>") + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + self.assertEqual(foo.__spec__.loader.module_repr(foo), + "<module 'foo' (namespace)>") class DynamicPathNamespacePackage(NamespacePackageTest): diff --git a/Lib/test/test_importlib/test_path.py b/Lib/test/test_importlib/test_path.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9wYXRoLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9wYXRoLnB5 100644 --- a/Lib/test/test_importlib/test_path.py +++ b/Lib/test/test_importlib/test_path.py @@ -29,11 +29,9 @@ data = data01 def test_natural_path(self): - """ - Guarantee the internal implementation detail that - file-system-backed resources do not get the tempdir - treatment. - """ + # Guarantee the internal implementation detail that + # file-system-backed resources do not get the tempdir + # treatment. with resources.path(self.data, 'utf-8.file') as path: assert 'data' in str(path) diff --git a/Lib/test/test_importlib/test_pkg_import.py b/Lib/test/test_importlib/test_pkg_import.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9wa2dfaW1wb3J0LnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9wa2dfaW1wb3J0LnB5 100644 --- a/Lib/test/test_importlib/test_pkg_import.py +++ b/Lib/test/test_importlib/test_pkg_import.py @@ -42,7 +42,7 @@ compiled_path = cache_from_source(self.module_path) if os.path.exists(compiled_path): os.remove(compiled_path) - with open(self.module_path, 'w') as f: + with open(self.module_path, 'w', encoding='utf-8') as f: f.write(contents) def test_package_import__semantics(self): diff --git a/Lib/test/test_importlib/test_reader.py b/Lib/test/test_importlib/test_reader.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9yZWFkZXIucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9yZWFkZXIucHk= 100644 --- a/Lib/test/test_importlib/test_reader.py +++ b/Lib/test/test_importlib/test_reader.py @@ -60,7 +60,6 @@ path.open() def test_join_path(self): - print('test_join_path') prefix = os.path.abspath(os.path.join(__file__, '..')) data01 = os.path.join(prefix, 'data01') path = MultiplexedPath(self.folder, data01) diff --git a/Lib/test/test_importlib/test_spec.py b/Lib/test/test_importlib/test_spec.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9zcGVjLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF9zcGVjLnB5 100644 --- a/Lib/test/test_importlib/test_spec.py +++ b/Lib/test/test_importlib/test_spec.py @@ -506,7 +506,7 @@ def setUp(self): self.name = 'spam' - self.path = 'spam.py' + self.path = os.path.abspath('spam.py') self.cached = self.util.cache_from_source(self.path) self.loader = TestLoader() self.fileloader = TestLoader(self.path) @@ -645,7 +645,7 @@ self.assertEqual(spec.loader, self.fileloader) self.assertEqual(spec.origin, self.path) self.assertIs(spec.loader_state, None) - self.assertEqual(spec.submodule_search_locations, ['']) + self.assertEqual(spec.submodule_search_locations, [os.getcwd()]) self.assertEqual(spec.cached, self.cached) self.assertTrue(spec.has_location) @@ -744,7 +744,7 @@ self.assertEqual(spec.loader, self.fileloader) self.assertEqual(spec.origin, self.path) self.assertIs(spec.loader_state, None) - self.assertEqual(spec.submodule_search_locations, ['']) + self.assertEqual(spec.submodule_search_locations, [os.getcwd()]) self.assertEqual(spec.cached, self.cached) self.assertTrue(spec.has_location) @@ -769,7 +769,7 @@ self.assertEqual(spec.loader, self.pkgloader) self.assertEqual(spec.origin, self.path) self.assertIs(spec.loader_state, None) - self.assertEqual(spec.submodule_search_locations, ['']) + self.assertEqual(spec.submodule_search_locations, [os.getcwd()]) self.assertEqual(spec.cached, self.cached) self.assertTrue(spec.has_location) @@ -817,6 +817,17 @@ self.assertEqual(spec.cached, self.cached) self.assertTrue(spec.has_location) + def test_spec_from_file_location_relative_path(self): + spec = self.util.spec_from_file_location(self.name, + os.path.basename(self.path), loader=self.fileloader) + + self.assertEqual(spec.name, self.name) + self.assertEqual(spec.loader, self.fileloader) + self.assertEqual(spec.origin, self.path) + self.assertIs(spec.loader_state, None) + self.assertIs(spec.submodule_search_locations, None) + self.assertEqual(spec.cached, self.cached) + self.assertTrue(spec.has_location) (Frozen_FactoryTests, Source_FactoryTests diff --git a/Lib/test/test_importlib/test_threaded_import.py b/Lib/test/test_importlib/test_threaded_import.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF90aHJlYWRlZF9pbXBvcnQucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF90aHJlYWRlZF9pbXBvcnQucHk= 100644 --- a/Lib/test/test_importlib/test_threaded_import.py +++ b/Lib/test/test_importlib/test_threaded_import.py @@ -17,7 +17,7 @@ from test.support import (verbose, run_unittest) from test.support.import_helper import forget from test.support.os_helper import (TESTFN, unlink, rmtree) -from test.support import threading_helper +from test.support import script_helper, threading_helper def task(N, done, done_tasks, errors): try: @@ -245,6 +245,18 @@ __import__(TESTFN) del sys.modules[TESTFN] + def test_concurrent_futures_circular_import(self): + # Regression test for bpo-43515 + fn = os.path.join(os.path.dirname(__file__), + 'partial', 'cfimport.py') + script_helper.assert_python_ok(fn) + + def test_multiprocessing_pool_circular_import(self): + # Regression test for bpo-41567 + fn = os.path.join(os.path.dirname(__file__), + 'partial', 'pool_in_threads.py') + script_helper.assert_python_ok(fn) + @threading_helper.reap_threads def test_main(): diff --git a/Lib/test/test_importlib/test_util.py b/Lib/test/test_importlib/test_util.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF91dGlsLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF91dGlsLnB5 100644 --- a/Lib/test/test_importlib/test_util.py +++ b/Lib/test/test_importlib/test_util.py @@ -845,7 +845,6 @@ 'only applies to candidate or final python release levels' ) def test_magic_number(self): - """ - Each python minor release should generally have a MAGIC_NUMBER - that does not change once the release reaches candidate status. + # Each python minor release should generally have a MAGIC_NUMBER + # that does not change once the release reaches candidate status. @@ -851,6 +850,6 @@ - Once a release reaches candidate status, the value of the constant - EXPECTED_MAGIC_NUMBER in this test should be changed. - This test will then check that the actual MAGIC_NUMBER matches - the expected value for the release. + # Once a release reaches candidate status, the value of the constant + # EXPECTED_MAGIC_NUMBER in this test should be changed. + # This test will then check that the actual MAGIC_NUMBER matches + # the expected value for the release. @@ -856,11 +855,10 @@ - In exceptional cases, it may be required to change the MAGIC_NUMBER - for a maintenance release. In this case the change should be - discussed in python-dev. If a change is required, community - stakeholders such as OS package maintainers must be notified - in advance. Such exceptional releases will then require an - adjustment to this test case. - """ + # In exceptional cases, it may be required to change the MAGIC_NUMBER + # for a maintenance release. In this case the change should be + # discussed in python-dev. If a change is required, community + # stakeholders such as OS package maintainers must be notified + # in advance. Such exceptional releases will then require an + # adjustment to this test case. EXPECTED_MAGIC_NUMBER = 3413 actual = int.from_bytes(importlib.util.MAGIC_NUMBER[:2], 'little') diff --git a/Lib/test/test_importlib/test_windows.py b/Lib/test/test_importlib/test_windows.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF93aW5kb3dzLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdGVzdF93aW5kb3dzLnB5 100644 --- a/Lib/test/test_importlib/test_windows.py +++ b/Lib/test/test_importlib/test_windows.py @@ -7,7 +7,6 @@ import unittest from test import support from test.support import import_helper -from distutils.util import get_platform from contextlib import contextmanager from .util import temp_module @@ -18,6 +17,25 @@ EnumKey, CloseKey, DeleteKey, OpenKey ) +def get_platform(): + # Port of distutils.util.get_platform(). + TARGET_TO_PLAT = { + 'x86' : 'win32', + 'x64' : 'win-amd64', + 'arm' : 'win-arm32', + } + if ('VSCMD_ARG_TGT_ARCH' in os.environ and + os.environ['VSCMD_ARG_TGT_ARCH'] in TARGET_TO_PLAT): + return TARGET_TO_PLAT[os.environ['VSCMD_ARG_TGT_ARCH']] + elif 'amd64' in sys.version.lower(): + return 'win-amd64' + elif '(arm)' in sys.version.lower(): + return 'win-arm32' + elif '(arm64)' in sys.version.lower(): + return 'win-arm64' + else: + return sys.platform + def delete_registry_tree(root, subkey): try: hkey = OpenKey(root, subkey, access=KEY_ALL_ACCESS) @@ -101,10 +119,10 @@ self.assertIn(expected_tag, suffixes) - # Ensure the tags are in the correct order + # Ensure the tags are in the correct order. tagged_i = suffixes.index(expected_tag) self.assertLess(tagged_i, untagged_i) (Frozen_WindowsExtensionSuffixTests, Source_WindowsExtensionSuffixTests ) = test_util.test_both(WindowsExtensionSuffixTests, machinery=machinery) @@ -105,6 +123,51 @@ tagged_i = suffixes.index(expected_tag) self.assertLess(tagged_i, untagged_i) (Frozen_WindowsExtensionSuffixTests, Source_WindowsExtensionSuffixTests ) = test_util.test_both(WindowsExtensionSuffixTests, machinery=machinery) + + +@unittest.skipUnless(sys.platform.startswith('win'), 'requires Windows') +class WindowsBootstrapPathTests(unittest.TestCase): + def check_join(self, expected, *inputs): + from importlib._bootstrap_external import _path_join + actual = _path_join(*inputs) + if expected.casefold() == actual.casefold(): + return + self.assertEqual(expected, actual) + + def test_path_join(self): + self.check_join(r"C:\A\B", "C:\\", "A", "B") + self.check_join(r"C:\A\B", "D:\\", "D", "C:\\", "A", "B") + self.check_join(r"C:\A\B", "C:\\", "A", "C:B") + self.check_join(r"C:\A\B", "C:\\", "A\\B") + self.check_join(r"C:\A\B", r"C:\A\B") + + self.check_join("D:A", r"D:", "A") + self.check_join("D:A", r"C:\B\C", "D:", "A") + self.check_join("D:A", r"C:\B\C", r"D:A") + + self.check_join(r"A\B\C", "A", "B", "C") + self.check_join(r"A\B\C", "A", r"B\C") + self.check_join(r"A\B/C", "A", "B/C") + self.check_join(r"A\B\C", "A/", "B\\", "C") + + # Dots are not normalised by this function + self.check_join(r"A\../C", "A", "../C") + self.check_join(r"A.\.\B", "A.", ".", "B") + + self.check_join(r"\\Server\Share\A\B\C", r"\\Server\Share", "A", "B", "C") + self.check_join(r"\\Server\Share\A\B\C", r"\\Server\Share", "D", r"\A", "B", "C") + self.check_join(r"\\Server\Share\A\B\C", r"\\Server2\Share2", "D", + r"\\Server\Share", "A", "B", "C") + self.check_join(r"\\Server\Share\A\B\C", r"\\Server", r"\Share", "A", "B", "C") + self.check_join(r"\\Server\Share", r"\\Server\Share") + self.check_join(r"\\Server\Share\\", r"\\Server\Share\\") + + # Handle edge cases with empty segments + self.check_join("C:\\A", "C:/A", "") + self.check_join("C:\\", "C:/", "") + self.check_join("C:", "C:", "") + self.check_join("//Server/Share\\", "//Server/Share/", "") + self.check_join("//Server/Share\\", "//Server/Share", "") diff --git a/Lib/test/test_importlib/util.py b/Lib/test/test_importlib/util.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdXRpbC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbXBvcnRsaWIvdXRpbC5weQ== 100644 --- a/Lib/test/test_importlib/util.py +++ b/Lib/test/test_importlib/util.py @@ -116,7 +116,7 @@ def submodule(parent, name, pkg_dir, content=''): path = os.path.join(pkg_dir, name + '.py') - with open(path, 'w') as subfile: + with open(path, 'w', encoding='utf-8') as subfile: subfile.write(content) return '{}.{}'.format(parent, name), path @@ -176,7 +176,7 @@ content = '' if content is not None: # not a namespace package - with open(modpath, 'w') as modfile: + with open(modpath, 'w', encoding='utf-8') as modfile: modfile.write(content) yield location @@ -384,7 +384,7 @@ os.mkdir(file_path) created_paths.append(file_path) file_path = os.path.join(file_path, name_parts[-1] + '.py') - with open(file_path, 'w') as file: + with open(file_path, 'w', encoding='utf-8') as file: file.write(source.format(name)) created_paths.append(file_path) mapping[name] = file_path diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbnNwZWN0LnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbnNwZWN0LnB5 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -363,7 +363,7 @@ fodderModule = None def setUp(self): - with open(inspect.getsourcefile(self.fodderModule)) as fp: + with open(inspect.getsourcefile(self.fodderModule), encoding="utf-8") as fp: self.source = fp.read() def sourcerange(self, top, bottom): @@ -773,8 +773,8 @@ def setUp(self): self.tempdir = TESTFN + '_dir' os.mkdir(self.tempdir) - with open(os.path.join(self.tempdir, - 'inspect_fodder3%spy' % os.extsep), 'w') as f: + with open(os.path.join(self.tempdir, 'inspect_fodder3%spy' % os.extsep), + 'w', encoding='utf-8') as f: f.write("class X:\n pass # No EOL") with DirsOnSysPath(self.tempdir): import inspect_fodder3 as mod3 @@ -1805,7 +1805,7 @@ def test_no_dict_no_slots_instance_member(self): # returns descriptor - with open(__file__) as handle: + with open(__file__, encoding='utf-8') as handle: self.assertEqual(inspect.getattr_static(handle, 'name'), type(handle).name) def test_inherited_slots(self): @@ -3860,6 +3860,9 @@ needs_groups = {"range", "slice", "dir", "getattr", "next", "iter", "vars"} no_signature |= needs_groups + # These have unrepresentable parameter default values of NULL + needs_null = {"anext"} + no_signature |= needs_null # These need PEP 457 groups or a signature change to accept None needs_semantic_update = {"round"} no_signature |= needs_semantic_update @@ -4042,7 +4045,7 @@ def assertInspectEqual(self, path, source): inspected_src = inspect.getsource(source) - with open(path) as src: + with open(path, encoding='utf-8') as src: self.assertEqual( src.read().splitlines(True), inspected_src.splitlines(True) @@ -4053,7 +4056,7 @@ with _ready_to_import('reload_bug', self.src_before) as (name, path): module = importlib.import_module(name) self.assertInspectEqual(path, module) - with open(path, 'w') as src: + with open(path, 'w', encoding='utf-8') as src: src.write(self.src_after) self.assertInspectEqual(path, module) diff --git a/Lib/test/test_interpreters.py b/Lib/test/test_interpreters.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pbnRlcnByZXRlcnMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pbnRlcnByZXRlcnMucHk= 100644 --- a/Lib/test/test_interpreters.py +++ b/Lib/test/test_interpreters.py @@ -14,7 +14,7 @@ indented = script.replace('\n', '\n ') wrapped = dedent(f""" import contextlib - with open({w}, 'w') as spipe: + with open({w}, 'w', encoding='utf-8') as spipe: with contextlib.redirect_stdout(spipe): {indented} """) @@ -18,7 +18,7 @@ with contextlib.redirect_stdout(spipe): {indented} """) - return wrapped, open(r) + return wrapped, open(r, encoding='utf-8') def clean_up_interpreters(): @@ -411,7 +411,7 @@ def test_fork(self): interp = interpreters.create() import tempfile - with tempfile.NamedTemporaryFile('w+') as file: + with tempfile.NamedTemporaryFile('w+', encoding='utf-8') as file: file.write('') file.flush() @@ -421,7 +421,7 @@ try: os.fork() except RuntimeError: - with open('{file.name}', 'w') as out: + with open('{file.name}', 'w', encoding='utf-8') as out: out.write('{expected}') """) interp.run(script) diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pby5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pby5weQ== 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -407,10 +407,12 @@ def test_invalid_operations(self): # Try writing on a file opened in read mode and vice-versa. exc = self.UnsupportedOperation - for mode in ("w", "wb"): - with self.open(os_helper.TESTFN, mode) as fp: - self.assertRaises(exc, fp.read) - self.assertRaises(exc, fp.readline) + with self.open(os_helper.TESTFN, "w", encoding="utf-8") as fp: + self.assertRaises(exc, fp.read) + self.assertRaises(exc, fp.readline) + with self.open(os_helper.TESTFN, "wb") as fp: + self.assertRaises(exc, fp.read) + self.assertRaises(exc, fp.readline) with self.open(os_helper.TESTFN, "wb", buffering=0) as fp: self.assertRaises(exc, fp.read) self.assertRaises(exc, fp.readline) @@ -420,7 +422,7 @@ with self.open(os_helper.TESTFN, "rb") as fp: self.assertRaises(exc, fp.write, b"blah") self.assertRaises(exc, fp.writelines, [b"blah\n"]) - with self.open(os_helper.TESTFN, "r") as fp: + with self.open(os_helper.TESTFN, "r", encoding="utf-8") as fp: self.assertRaises(exc, fp.write, "blah") self.assertRaises(exc, fp.writelines, ["blah\n"]) # Non-zero seeking from current or end pos @@ -533,8 +535,8 @@ def test_open_handles_NUL_chars(self): fn_with_NUL = 'foo\0bar' - self.assertRaises(ValueError, self.open, fn_with_NUL, 'w') + self.assertRaises(ValueError, self.open, fn_with_NUL, 'w', encoding="utf-8") bytes_fn = bytes(fn_with_NUL, 'ascii') with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) @@ -537,8 +539,8 @@ bytes_fn = bytes(fn_with_NUL, 'ascii') with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) - self.assertRaises(ValueError, self.open, bytes_fn, 'w') + self.assertRaises(ValueError, self.open, bytes_fn, 'w', encoding="utf-8") def test_raw_file_io(self): with self.open(os_helper.TESTFN, "wb", buffering=0) as f: @@ -575,7 +577,7 @@ self.assertEqual(f.readline(), b"foo\x00bar\n") self.assertEqual(f.readline(None), b"another line") self.assertRaises(TypeError, f.readline, 5.3) - with self.open(os_helper.TESTFN, "r") as f: + with self.open(os_helper.TESTFN, "r", encoding="utf-8") as f: self.assertRaises(TypeError, f.readline, 5.3) def test_readline_nonsizeable(self): @@ -638,7 +640,7 @@ self.assertEqual(f.tell(), 3) with self.open(os_helper.TESTFN, "ab") as f: self.assertEqual(f.tell(), 3) - with self.open(os_helper.TESTFN, "a") as f: + with self.open(os_helper.TESTFN, "a", encoding="utf-8") as f: self.assertGreater(f.tell(), 0) def test_destructor(self): @@ -730,6 +732,6 @@ def test_closefd(self): self.assertRaises(ValueError, self.open, os_helper.TESTFN, 'w', - closefd=False) + encoding="utf-8", closefd=False) def test_read_closed(self): @@ -734,4 +736,4 @@ def test_read_closed(self): - with self.open(os_helper.TESTFN, "w") as f: + with self.open(os_helper.TESTFN, "w", encoding="utf-8") as f: f.write("egg\n") @@ -737,6 +739,6 @@ f.write("egg\n") - with self.open(os_helper.TESTFN, "r") as f: - file = self.open(f.fileno(), "r", closefd=False) + with self.open(os_helper.TESTFN, "r", encoding="utf-8") as f: + file = self.open(f.fileno(), "r", encoding="utf-8", closefd=False) self.assertEqual(file.read(), "egg\n") file.seek(0) file.close() @@ -749,8 +751,9 @@ def test_no_closefd_with_filename(self): # can't use closefd in combination with a file name - self.assertRaises(ValueError, self.open, os_helper.TESTFN, "r", closefd=False) + self.assertRaises(ValueError, self.open, os_helper.TESTFN, "r", + encoding="utf-8", closefd=False) def test_closefd_attr(self): with self.open(os_helper.TESTFN, "wb") as f: f.write(b"egg\n") @@ -753,6 +756,6 @@ def test_closefd_attr(self): with self.open(os_helper.TESTFN, "wb") as f: f.write(b"egg\n") - with self.open(os_helper.TESTFN, "r") as f: + with self.open(os_helper.TESTFN, "r", encoding="utf-8") as f: self.assertEqual(f.buffer.raw.closefd, True) @@ -758,5 +761,5 @@ self.assertEqual(f.buffer.raw.closefd, True) - file = self.open(f.fileno(), "r", closefd=False) + file = self.open(f.fileno(), "r", encoding="utf-8", closefd=False) self.assertEqual(file.buffer.raw.closefd, False) def test_garbage_collection(self): @@ -821,5 +824,5 @@ self.check_flush_error_on_close(fd, 'wb', closefd=False) os.close(fd) # text io - self.check_flush_error_on_close(os_helper.TESTFN, 'w') + self.check_flush_error_on_close(os_helper.TESTFN, 'w', encoding="utf-8") fd = os.open(os_helper.TESTFN, os.O_WRONLY|os.O_CREAT) @@ -825,3 +828,3 @@ fd = os.open(os_helper.TESTFN, os.O_WRONLY|os.O_CREAT) - self.check_flush_error_on_close(fd, 'w') + self.check_flush_error_on_close(fd, 'w', encoding="utf-8") fd = os.open(os_helper.TESTFN, os.O_WRONLY|os.O_CREAT) @@ -827,5 +830,5 @@ fd = os.open(os_helper.TESTFN, os.O_WRONLY|os.O_CREAT) - self.check_flush_error_on_close(fd, 'w', closefd=False) + self.check_flush_error_on_close(fd, 'w', encoding="utf-8", closefd=False) os.close(fd) def test_multi_close(self): @@ -860,8 +863,8 @@ self.assertTrue(hasattr(obj, "__dict__")) def test_opener(self): - with self.open(os_helper.TESTFN, "w") as f: + with self.open(os_helper.TESTFN, "w", encoding="utf-8") as f: f.write("egg\n") fd = os.open(os_helper.TESTFN, os.O_RDONLY) def opener(path, flags): return fd @@ -864,8 +867,8 @@ f.write("egg\n") fd = os.open(os_helper.TESTFN, os.O_RDONLY) def opener(path, flags): return fd - with self.open("non-existent", "r", opener=opener) as f: + with self.open("non-existent", "r", encoding="utf-8", opener=opener) as f: self.assertEqual(f.read(), "egg\n") def test_bad_opener_negative_1(self): @@ -899,8 +902,8 @@ def test_nonbuffered_textio(self): with warnings_helper.check_no_resource_warning(self): with self.assertRaises(ValueError): - self.open(os_helper.TESTFN, 'w', buffering=0) + self.open(os_helper.TESTFN, 'w', encoding="utf-8", buffering=0) def test_invalid_newline(self): with warnings_helper.check_no_resource_warning(self): with self.assertRaises(ValueError): @@ -903,8 +906,8 @@ def test_invalid_newline(self): with warnings_helper.check_no_resource_warning(self): with self.assertRaises(ValueError): - self.open(os_helper.TESTFN, 'w', newline='invalid') + self.open(os_helper.TESTFN, 'w', encoding="utf-8", newline='invalid') def test_buffered_readinto_mixin(self): # Test the implementation provided by BufferedIOBase @@ -921,6 +924,6 @@ def test_fspath_support(self): def check_path_succeeds(path): - with self.open(path, "w") as f: + with self.open(path, "w", encoding="utf-8") as f: f.write("egg\n") @@ -925,8 +928,8 @@ f.write("egg\n") - with self.open(path, "r") as f: + with self.open(path, "r", encoding="utf-8") as f: self.assertEqual(f.read(), "egg\n") check_path_succeeds(FakePath(os_helper.TESTFN)) check_path_succeeds(FakePath(os.fsencode(os_helper.TESTFN))) @@ -928,8 +931,8 @@ self.assertEqual(f.read(), "egg\n") check_path_succeeds(FakePath(os_helper.TESTFN)) check_path_succeeds(FakePath(os.fsencode(os_helper.TESTFN))) - with self.open(os_helper.TESTFN, "w") as f: + with self.open(os_helper.TESTFN, "w", encoding="utf-8") as f: bad_path = FakePath(f.fileno()) with self.assertRaises(TypeError): @@ -934,6 +937,6 @@ bad_path = FakePath(f.fileno()) with self.assertRaises(TypeError): - self.open(bad_path, 'w') + self.open(bad_path, 'w', encoding="utf-8") bad_path = FakePath(None) with self.assertRaises(TypeError): @@ -937,7 +940,7 @@ bad_path = FakePath(None) with self.assertRaises(TypeError): - self.open(bad_path, 'w') + self.open(bad_path, 'w', encoding="utf-8") bad_path = FakePath(FloatingPointError) with self.assertRaises(FloatingPointError): @@ -941,7 +944,7 @@ bad_path = FakePath(FloatingPointError) with self.assertRaises(FloatingPointError): - self.open(bad_path, 'w') + self.open(bad_path, 'w', encoding="utf-8") # ensure that refcounting is correct with some error conditions with self.assertRaisesRegex(ValueError, 'read/write/append mode'): @@ -945,7 +948,7 @@ # ensure that refcounting is correct with some error conditions with self.assertRaisesRegex(ValueError, 'read/write/append mode'): - self.open(FakePath(os_helper.TESTFN), 'rwxa') + self.open(FakePath(os_helper.TESTFN), 'rwxa', encoding="utf-8") def test_RawIOBase_readall(self): # Exercise the default unlimited RawIOBase.read() and readall() @@ -2590,7 +2593,7 @@ def test_constructor(self): r = self.BytesIO(b"\xc3\xa9\n\n") b = self.BufferedReader(r, 1000) - t = self.TextIOWrapper(b) + t = self.TextIOWrapper(b, encoding="utf-8") t.__init__(b, encoding="latin-1", newline="\r\n") self.assertEqual(t.encoding, "latin-1") self.assertEqual(t.line_buffering, False) @@ -2598,8 +2601,8 @@ self.assertEqual(t.encoding, "utf-8") self.assertEqual(t.line_buffering, True) self.assertEqual("\xe9\n", t.readline()) - self.assertRaises(TypeError, t.__init__, b, newline=42) - self.assertRaises(ValueError, t.__init__, b, newline='xyzzy') + self.assertRaises(TypeError, t.__init__, b, encoding="utf-8", newline=42) + self.assertRaises(ValueError, t.__init__, b, encoding="utf-8", newline='xyzzy') def test_uninitialized(self): t = self.TextIOWrapper.__new__(self.TextIOWrapper) @@ -2609,7 +2612,7 @@ self.assertRaisesRegex((ValueError, AttributeError), 'uninitialized|has no attribute', t.read, 0) - t.__init__(self.MockRawIO()) + t.__init__(self.MockRawIO(), encoding="utf-8") self.assertEqual(t.read(0), '') def test_non_text_encoding_codecs_are_rejected(self): @@ -2624,7 +2627,7 @@ def test_detach(self): r = self.BytesIO() b = self.BufferedWriter(r) - t = self.TextIOWrapper(b) + t = self.TextIOWrapper(b, encoding="ascii") self.assertIs(t.detach(), b) t = self.TextIOWrapper(b, encoding="ascii") @@ -2664,7 +2667,7 @@ def test_recursive_repr(self): # Issue #25455 raw = self.BytesIO() - t = self.TextIOWrapper(raw) + t = self.TextIOWrapper(raw, encoding="utf-8") with support.swap_attr(raw, 'name', t): try: repr(t) # Should not crash @@ -2674,7 +2677,7 @@ def test_line_buffering(self): r = self.BytesIO() b = self.BufferedWriter(r, 1000) - t = self.TextIOWrapper(b, newline="\n", line_buffering=True) + t = self.TextIOWrapper(b, encoding="utf-8", newline="\n", line_buffering=True) t.write("X") self.assertEqual(r.getvalue(), b"") # No flush happened t.write("Y\nZ") @@ -2685,7 +2688,7 @@ def test_reconfigure_line_buffering(self): r = self.BytesIO() b = self.BufferedWriter(r, 1000) - t = self.TextIOWrapper(b, newline="\n", line_buffering=False) + t = self.TextIOWrapper(b, encoding="utf-8", newline="\n", line_buffering=False) t.write("AB\nC") self.assertEqual(r.getvalue(), b"") @@ -2722,7 +2725,9 @@ current_locale_encoding = locale.getpreferredencoding(False) b = self.BytesIO() - t = self.TextIOWrapper(b) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", EncodingWarning) + t = self.TextIOWrapper(b) self.assertEqual(t.encoding, current_locale_encoding) finally: os.environ.clear() @@ -2735,5 +2740,5 @@ import _testcapi b = self.BytesIO() b.fileno = lambda: _testcapi.INT_MAX + 1 - self.assertRaises(OverflowError, self.TextIOWrapper, b) + self.assertRaises(OverflowError, self.TextIOWrapper, b, encoding="locale") b.fileno = lambda: _testcapi.UINT_MAX + 1 @@ -2739,8 +2744,8 @@ b.fileno = lambda: _testcapi.UINT_MAX + 1 - self.assertRaises(OverflowError, self.TextIOWrapper, b) + self.assertRaises(OverflowError, self.TextIOWrapper, b, encoding="locale") def test_encoding(self): # Check the encoding attribute is always set, and valid b = self.BytesIO() t = self.TextIOWrapper(b, encoding="utf-8") self.assertEqual(t.encoding, "utf-8") @@ -2741,10 +2746,12 @@ def test_encoding(self): # Check the encoding attribute is always set, and valid b = self.BytesIO() t = self.TextIOWrapper(b, encoding="utf-8") self.assertEqual(t.encoding, "utf-8") - t = self.TextIOWrapper(b) + with warnings.catch_warnings(): + warnings.simplefilter("ignore", EncodingWarning) + t = self.TextIOWrapper(b) self.assertIsNotNone(t.encoding) codecs.lookup(t.encoding) @@ -2909,7 +2916,7 @@ rawio = self.CloseFailureIO() with support.catch_unraisable_exception() as cm: with self.assertRaises(AttributeError): - self.TextIOWrapper(rawio).xyzzy + self.TextIOWrapper(rawio, encoding="utf-8").xyzzy if not IOBASE_EMITS_UNRAISABLE: self.assertIsNone(cm.unraisable) @@ -3116,7 +3123,7 @@ class UnReadable(self.BytesIO): def readable(self): return False - txt = self.TextIOWrapper(UnReadable()) + txt = self.TextIOWrapper(UnReadable(), encoding="utf-8") self.assertRaises(OSError, txt.read) def test_read_one_by_one(self): @@ -3120,7 +3127,7 @@ self.assertRaises(OSError, txt.read) def test_read_one_by_one(self): - txt = self.TextIOWrapper(self.BytesIO(b"AA\r\nBB")) + txt = self.TextIOWrapper(self.BytesIO(b"AA\r\nBB"), encoding="utf-8") reads = "" while True: c = txt.read(1) @@ -3130,7 +3137,7 @@ self.assertEqual(reads, "AA\nBB") def test_readlines(self): - txt = self.TextIOWrapper(self.BytesIO(b"AA\nBB\nCC")) + txt = self.TextIOWrapper(self.BytesIO(b"AA\nBB\nCC"), encoding="utf-8") self.assertEqual(txt.readlines(), ["AA\n", "BB\n", "CC"]) txt.seek(0) self.assertEqual(txt.readlines(None), ["AA\n", "BB\n", "CC"]) @@ -3140,7 +3147,7 @@ # read in amounts equal to TextIOWrapper._CHUNK_SIZE which is 128. def test_read_by_chunk(self): # make sure "\r\n" straddles 128 char boundary. - txt = self.TextIOWrapper(self.BytesIO(b"A" * 127 + b"\r\nB")) + txt = self.TextIOWrapper(self.BytesIO(b"A" * 127 + b"\r\nB"), encoding="utf-8") reads = "" while True: c = txt.read(128) @@ -3152,7 +3159,7 @@ def test_writelines(self): l = ['ab', 'cd', 'ef'] buf = self.BytesIO() - txt = self.TextIOWrapper(buf) + txt = self.TextIOWrapper(buf, encoding="utf-8") txt.writelines(l) txt.flush() self.assertEqual(buf.getvalue(), b'abcdef') @@ -3160,9 +3167,9 @@ def test_writelines_userlist(self): l = UserList(['ab', 'cd', 'ef']) buf = self.BytesIO() - txt = self.TextIOWrapper(buf) + txt = self.TextIOWrapper(buf, encoding="utf-8") txt.writelines(l) txt.flush() self.assertEqual(buf.getvalue(), b'abcdef') def test_writelines_error(self): @@ -3164,9 +3171,9 @@ txt.writelines(l) txt.flush() self.assertEqual(buf.getvalue(), b'abcdef') def test_writelines_error(self): - txt = self.TextIOWrapper(self.BytesIO()) + txt = self.TextIOWrapper(self.BytesIO(), encoding="utf-8") self.assertRaises(TypeError, txt.writelines, [1, 2, 3]) self.assertRaises(TypeError, txt.writelines, None) self.assertRaises(TypeError, txt.writelines, b'abc') @@ -3274,5 +3281,5 @@ self.assertEqual(f.read(), 'aaaxxx'.encode(charset)) def test_errors_property(self): - with self.open(os_helper.TESTFN, "w") as f: + with self.open(os_helper.TESTFN, "w", encoding="utf-8") as f: self.assertEqual(f.errors, "strict") @@ -3278,8 +3285,8 @@ self.assertEqual(f.errors, "strict") - with self.open(os_helper.TESTFN, "w", errors="replace") as f: + with self.open(os_helper.TESTFN, "w", encoding="utf-8", errors="replace") as f: self.assertEqual(f.errors, "replace") @support.no_tracing def test_threads_write(self): # Issue6750: concurrent writes could duplicate data event = threading.Event() @@ -3280,10 +3287,10 @@ self.assertEqual(f.errors, "replace") @support.no_tracing def test_threads_write(self): # Issue6750: concurrent writes could duplicate data event = threading.Event() - with self.open(os_helper.TESTFN, "w", buffering=1) as f: + with self.open(os_helper.TESTFN, "w", encoding="utf-8", buffering=1) as f: def run(n): text = "Thread%03d\n" % n event.wait() @@ -3292,7 +3299,7 @@ for x in range(20)] with threading_helper.start_threads(threads, event.set): time.sleep(0.02) - with self.open(os_helper.TESTFN) as f: + with self.open(os_helper.TESTFN, encoding="utf-8") as f: content = f.read() for n in range(20): self.assertEqual(content.count("Thread%03d\n" % n), 1) @@ -3363,7 +3370,7 @@ self.assertRaises(ValueError, txt.flush) def test_unseekable(self): - txt = self.TextIOWrapper(self.MockUnseekableIO(self.testdata)) + txt = self.TextIOWrapper(self.MockUnseekableIO(self.testdata), encoding="utf-8") self.assertRaises(self.UnsupportedOperation, txt.tell) self.assertRaises(self.UnsupportedOperation, txt.seek, 0) @@ -3452,5 +3459,5 @@ def test_read_nonbytes(self): # Issue #17106 # Crash when underlying read() returns non-bytes - t = self.TextIOWrapper(self.StringIO('a')) + t = self.TextIOWrapper(self.StringIO('a'), encoding="utf-8") self.assertRaises(TypeError, t.read, 1) @@ -3456,3 +3463,3 @@ self.assertRaises(TypeError, t.read, 1) - t = self.TextIOWrapper(self.StringIO('a')) + t = self.TextIOWrapper(self.StringIO('a'), encoding="utf-8") self.assertRaises(TypeError, t.readline) @@ -3458,5 +3465,5 @@ self.assertRaises(TypeError, t.readline) - t = self.TextIOWrapper(self.StringIO('a')) + t = self.TextIOWrapper(self.StringIO('a'), encoding="utf-8") self.assertRaises(TypeError, t.read) def test_illegal_encoder(self): @@ -3724,8 +3731,8 @@ def test_initialization(self): r = self.BytesIO(b"\xc3\xa9\n\n") b = self.BufferedReader(r, 1000) - t = self.TextIOWrapper(b) - self.assertRaises(ValueError, t.__init__, b, newline='xyzzy') + t = self.TextIOWrapper(b, encoding="utf-8") + self.assertRaises(ValueError, t.__init__, b, encoding="utf-8", newline='xyzzy') self.assertRaises(ValueError, t.read) t = self.TextIOWrapper.__new__(self.TextIOWrapper) @@ -3948,7 +3955,7 @@ f.close() with warnings_helper.check_warnings(('', DeprecationWarning)): - f = self.open(os_helper.TESTFN, "U") + f = self.open(os_helper.TESTFN, "U", encoding="utf-8") self.assertEqual(f.name, os_helper.TESTFN) self.assertEqual(f.buffer.name, os_helper.TESTFN) self.assertEqual(f.buffer.raw.name, os_helper.TESTFN) @@ -3957,7 +3964,7 @@ self.assertEqual(f.buffer.raw.mode, "rb") f.close() - f = self.open(os_helper.TESTFN, "w+") + f = self.open(os_helper.TESTFN, "w+", encoding="utf-8") self.assertEqual(f.mode, "w+") self.assertEqual(f.buffer.mode, "rb+") # Does it really matter? self.assertEqual(f.buffer.raw.mode, "rb+") @@ -3974,7 +3981,7 @@ # bpo-27805: Ignore ESPIPE from lseek() in open(). r, w = os.pipe() self.addCleanup(os.close, r) - f = self.open(w, 'a') + f = self.open(w, 'a', encoding="utf-8") self.addCleanup(f.close) # Check that the file is marked non-seekable. On Windows and OpenVMS, # however, lseek somehow succeeds on pipes. @@ -3999,6 +4006,8 @@ {"mode": "w+", "buffering": 2}, {"mode": "w+b", "buffering": 0}, ]: + if "b" not in kwargs["mode"]: + kwargs["encoding"] = "utf-8" f = self.open(os_helper.TESTFN, **kwargs) f.close() self.assertRaises(ValueError, f.flush) @@ -4059,7 +4068,7 @@ self.assertNotIsInstance(f, abcmodule.RawIOBase) self.assertIsInstance(f, abcmodule.BufferedIOBase) self.assertNotIsInstance(f, abcmodule.TextIOBase) - with self.open(os_helper.TESTFN, "w") as f: + with self.open(os_helper.TESTFN, "w", encoding="utf-8") as f: self.assertIsInstance(f, abcmodule.IOBase) self.assertNotIsInstance(f, abcmodule.RawIOBase) self.assertNotIsInstance(f, abcmodule.BufferedIOBase) @@ -4085,7 +4094,7 @@ def test_warn_on_dealloc(self): self._check_warn_on_dealloc(os_helper.TESTFN, "wb", buffering=0) self._check_warn_on_dealloc(os_helper.TESTFN, "wb") - self._check_warn_on_dealloc(os_helper.TESTFN, "w") + self._check_warn_on_dealloc(os_helper.TESTFN, "w", encoding="utf-8") def _check_warn_on_dealloc_fd(self, *args, **kwargs): fds = [] @@ -4109,7 +4118,7 @@ def test_warn_on_dealloc_fd(self): self._check_warn_on_dealloc_fd("rb", buffering=0) self._check_warn_on_dealloc_fd("rb") - self._check_warn_on_dealloc_fd("r") + self._check_warn_on_dealloc_fd("r", encoding="utf-8") def test_pickling(self): @@ -4125,6 +4134,8 @@ {"mode": "w+b"}, {"mode": "w+b", "buffering": 0}, ]: + if "b" not in kwargs["mode"]: + kwargs["encoding"] = "utf-8" for protocol in range(pickle.HIGHEST_PROTOCOL + 1): with self.open(os_helper.TESTFN, **kwargs) as f: self.assertRaises(TypeError, pickle.dumps, f, protocol) @@ -4191,5 +4202,5 @@ def test_create_fail(self): # 'x' mode fails if file is existing - with self.open(os_helper.TESTFN, 'w'): + with self.open(os_helper.TESTFN, 'w', encoding="utf-8"): pass @@ -4195,5 +4206,5 @@ pass - self.assertRaises(FileExistsError, self.open, os_helper.TESTFN, 'x') + self.assertRaises(FileExistsError, self.open, os_helper.TESTFN, 'x', encoding="utf-8") def test_create_writes(self): # 'x' mode opens for writing @@ -4204,7 +4215,7 @@ def test_open_allargs(self): # there used to be a buffer overflow in the parser for rawmode - self.assertRaises(ValueError, self.open, os_helper.TESTFN, 'rwax+') + self.assertRaises(ValueError, self.open, os_helper.TESTFN, 'rwax+', encoding="utf-8") def test_check_encoding_errors(self): # bpo-37388: open() and TextIOWrapper must check encoding and errors @@ -4251,6 +4262,37 @@ proc = assert_python_failure('-X', 'dev', '-c', code) self.assertEqual(proc.rc, 10, proc) + def test_check_encoding_warning(self): + # PEP 597: Raise warning when encoding is not specified + # and sys.flags.warn_default_encoding is set. + mod = self.io.__name__ + filename = __file__ + code = textwrap.dedent(f'''\ + import sys + from {mod} import open, TextIOWrapper + import pathlib + + with open({filename!r}) as f: # line 5 + pass + + pathlib.Path({filename!r}).read_text() # line 8 + ''') + proc = assert_python_ok('-X', 'warn_default_encoding', '-c', code) + warnings = proc.err.splitlines() + self.assertEqual(len(warnings), 2) + self.assertTrue( + warnings[0].startswith(b"<string>:5: EncodingWarning: ")) + self.assertTrue( + warnings[1].startswith(b"<string>:8: EncodingWarning: ")) + + @support.cpython_only + # Depending if OpenWrapper was already created or not, the warning is + # emitted or not. For example, the attribute is already created when this + # test is run multiple times. + @warnings_helper.ignore_warnings(category=DeprecationWarning) + def test_openwrapper(self): + self.assertIs(self.io.OpenWrapper, self.io.open) + class CMiscIOTest(MiscIOTest): io = io @@ -4458,7 +4500,7 @@ @unittest.skipIf(sys.platform in ("OpenVMS"), "-= it hangs =-") def test_interrupted_read_retry_text(self): self.check_interrupted_read_retry(lambda x: x, - mode="r") + mode="r", encoding="latin1") def check_interrupted_write_retry(self, item, **fdopen_kwargs): """Check that a buffered write, when it gets interrupted (either @@ -4573,8 +4615,6 @@ globs = globals() c_io_ns.update((x.__name__, globs["C" + x.__name__]) for x in mocks) py_io_ns.update((x.__name__, globs["Py" + x.__name__]) for x in mocks) - # Avoid turning open into a bound method. - py_io_ns["open"] = pyio.OpenWrapper for test in tests: if test.__name__.startswith("C"): for name, obj in c_io_ns.items(): diff --git a/Lib/test/test_iter.py b/Lib/test/test_iter.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9pdGVyLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9pdGVyLnB5 100644 --- a/Lib/test/test_iter.py +++ b/Lib/test/test_iter.py @@ -337,9 +337,9 @@ # Test a file def test_iter_file(self): - f = open(TESTFN, "w") + f = open(TESTFN, "w", encoding="utf-8") try: for i in range(5): f.write("%d\n" % i) finally: f.close() @@ -341,9 +341,9 @@ try: for i in range(5): f.write("%d\n" % i) finally: f.close() - f = open(TESTFN, "r") + f = open(TESTFN, "r", encoding="utf-8") try: self.check_for_loop(f, ["0\n", "1\n", "2\n", "3\n", "4\n"], pickle=False) self.check_for_loop(f, [], pickle=False) @@ -366,9 +366,9 @@ self.assertRaises(TypeError, list, list) self.assertRaises(TypeError, list, 42) - f = open(TESTFN, "w") + f = open(TESTFN, "w", encoding="utf-8") try: for i in range(5): f.write("%d\n" % i) finally: f.close() @@ -370,9 +370,9 @@ try: for i in range(5): f.write("%d\n" % i) finally: f.close() - f = open(TESTFN, "r") + f = open(TESTFN, "r", encoding="utf-8") try: self.assertEqual(list(f), ["0\n", "1\n", "2\n", "3\n", "4\n"]) f.seek(0, 0) @@ -399,9 +399,9 @@ self.assertRaises(TypeError, tuple, list) self.assertRaises(TypeError, tuple, 42) - f = open(TESTFN, "w") + f = open(TESTFN, "w", encoding="utf-8") try: for i in range(5): f.write("%d\n" % i) finally: f.close() @@ -403,9 +403,9 @@ try: for i in range(5): f.write("%d\n" % i) finally: f.close() - f = open(TESTFN, "r") + f = open(TESTFN, "r", encoding="utf-8") try: self.assertEqual(tuple(f), ("0\n", "1\n", "2\n", "3\n", "4\n")) f.seek(0, 0) @@ -476,10 +476,10 @@ self.assertEqual(max(d.values()), 3) self.assertEqual(min(iter(d.values())), 1) - f = open(TESTFN, "w") + f = open(TESTFN, "w", encoding="utf-8") try: f.write("medium line\n") f.write("xtra large line\n") f.write("itty-bitty line\n") finally: f.close() @@ -480,10 +480,10 @@ try: f.write("medium line\n") f.write("xtra large line\n") f.write("itty-bitty line\n") finally: f.close() - f = open(TESTFN, "r") + f = open(TESTFN, "r", encoding="utf-8") try: self.assertEqual(min(f), "itty-bitty line\n") f.seek(0, 0) @@ -509,9 +509,9 @@ i < len(d) and dkeys[i] or None) for i in range(3)] - f = open(TESTFN, "w") + f = open(TESTFN, "w", encoding="utf-8") try: for i in range(10): f.write("xy" * i + "\n") # line i has len 2*i+1 finally: f.close() @@ -513,9 +513,9 @@ try: for i in range(10): f.write("xy" * i + "\n") # line i has len 2*i+1 finally: f.close() - f = open(TESTFN, "r") + f = open(TESTFN, "r", encoding="utf-8") try: self.assertEqual(list(map(len, f)), list(range(1, 21, 2))) finally: @@ -556,8 +556,8 @@ self.i = i+1 return i - f = open(TESTFN, "w") + f = open(TESTFN, "w", encoding="utf-8") try: f.write("a\n" "bbb\n" "cc\n") finally: f.close() @@ -560,8 +560,8 @@ try: f.write("a\n" "bbb\n" "cc\n") finally: f.close() - f = open(TESTFN, "r") + f = open(TESTFN, "r", encoding="utf-8") try: self.assertEqual(list(zip(IntsFrom(0), f, IntsFrom(-100))), [(0, "a\n", -100), @@ -624,9 +624,9 @@ return "fooled you!" return next(self.it) - f = open(TESTFN, "w") + f = open(TESTFN, "w", encoding="utf-8") try: f.write("a\n" + "b\n" + "c\n") finally: f.close() @@ -628,9 +628,9 @@ try: f.write("a\n" + "b\n" + "c\n") finally: f.close() - f = open(TESTFN, "r") + f = open(TESTFN, "r", encoding="utf-8") # Nasty: string.join(s) can't know whether unicode.join() is needed # until it's seen all of s's elements. But in this case, f's # iterator cannot be restarted. So what we're testing here is @@ -676,8 +676,8 @@ self.assertIn((k, v), d.items()) self.assertNotIn((v, k), d.items()) - f = open(TESTFN, "w") + f = open(TESTFN, "w", encoding="utf-8") try: f.write("a\n" "b\n" "c\n") finally: f.close() @@ -680,8 +680,8 @@ try: f.write("a\n" "b\n" "c\n") finally: f.close() - f = open(TESTFN, "r") + f = open(TESTFN, "r", encoding="utf-8") try: for chunk in "abc": f.seek(0, 0) @@ -713,8 +713,8 @@ self.assertEqual(countOf(d.values(), 2j), 1) self.assertEqual(countOf(d.values(), 1j), 0) - f = open(TESTFN, "w") + f = open(TESTFN, "w", encoding="utf-8") try: f.write("a\n" "b\n" "c\n" "b\n") finally: f.close() @@ -717,8 +717,8 @@ try: f.write("a\n" "b\n" "c\n" "b\n") finally: f.close() - f = open(TESTFN, "r") + f = open(TESTFN, "r", encoding="utf-8") try: for letter, count in ("a", 1), ("b", 2), ("c", 1), ("d", 0): f.seek(0, 0) @@ -748,8 +748,8 @@ self.assertRaises(TypeError, indexOf, indexOf, indexOf) self.assertRaises(ZeroDivisionError, indexOf, BadIterableClass(), 1) - f = open(TESTFN, "w") + f = open(TESTFN, "w", encoding="utf-8") try: f.write("a\n" "b\n" "c\n" "d\n" "e\n") finally: f.close() @@ -752,8 +752,8 @@ try: f.write("a\n" "b\n" "c\n" "d\n" "e\n") finally: f.close() - f = open(TESTFN, "r") + f = open(TESTFN, "r", encoding="utf-8") try: fiter = iter(f) self.assertEqual(indexOf(fiter, "b\n"), 1) @@ -774,7 +774,7 @@ # Test iterators with file.writelines(). def test_writelines(self): - f = open(TESTFN, "w") + f = open(TESTFN, "w", encoding="utf-8") try: self.assertRaises(TypeError, f.writelines, None) @@ -813,7 +813,7 @@ f.writelines(Whatever(6, 6+2000)) f.close() - f = open(TESTFN) + f = open(TESTFN, encoding="utf-8") expected = [str(i) + "\n" for i in range(1, 2006)] self.assertEqual(list(f), expected) @@ -857,10 +857,10 @@ a, b, c = {1: 42, 2: 42, 3: 42}.values() self.assertEqual((a, b, c), (42, 42, 42)) - f = open(TESTFN, "w") + f = open(TESTFN, "w", encoding="utf-8") lines = ("a\n", "bb\n", "ccc\n") try: for line in lines: f.write(line) finally: f.close() @@ -861,10 +861,10 @@ lines = ("a\n", "bb\n", "ccc\n") try: for line in lines: f.write(line) finally: f.close() - f = open(TESTFN, "r") + f = open(TESTFN, "r", encoding="utf-8") try: a, b, c = f self.assertEqual((a, b, c), lines) diff --git a/Lib/test/test_json/test_tool.py b/Lib/test/test_json/test_tool.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9qc29uL3Rlc3RfdG9vbC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9qc29uL3Rlc3RfdG9vbC5weQ== 100644 --- a/Lib/test/test_json/test_tool.py +++ b/Lib/test/test_json/test_tool.py @@ -125,7 +125,7 @@ outfile = os_helper.TESTFN + '.out' rc, out, err = assert_python_ok('-m', 'json.tool', infile, outfile) self.addCleanup(os.remove, outfile) - with open(outfile, "r") as fp: + with open(outfile, "r", encoding="utf-8") as fp: self.assertEqual(fp.read(), self.expect) self.assertEqual(rc, 0) self.assertEqual(out, b'') diff --git a/Lib/test/test_linecache.py b/Lib/test/test_linecache.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9saW5lY2FjaGUucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9saW5lY2FjaGUucHk= 100644 --- a/Lib/test/test_linecache.py +++ b/Lib/test/test_linecache.py @@ -116,7 +116,7 @@ # Check module loading for entry in MODULES: filename = os.path.join(MODULE_PATH, entry) + '.py' - with open(filename) as file: + with open(filename, encoding='utf-8') as file: for index, line in enumerate(file): self.assertEqual(line, getline(filename, index + 1)) @@ -126,7 +126,7 @@ def test_no_ending_newline(self): self.addCleanup(os_helper.unlink, os_helper.TESTFN) - with open(os_helper.TESTFN, "w") as fp: + with open(os_helper.TESTFN, "w", encoding='utf-8') as fp: fp.write(SOURCE_3) lines = linecache.getlines(os_helper.TESTFN) self.assertEqual(lines, ["\n", "def f():\n", " return 3\n"]) @@ -153,9 +153,9 @@ # Create a source file and cache its contents source_name = os_helper.TESTFN + '.py' self.addCleanup(os_helper.unlink, source_name) - with open(source_name, 'w') as source: + with open(source_name, 'w', encoding='utf-8') as source: source.write(SOURCE_1) getline(source_name, 1) # Keep a copy of the old contents source_list = [] @@ -157,10 +157,10 @@ source.write(SOURCE_1) getline(source_name, 1) # Keep a copy of the old contents source_list = [] - with open(source_name) as source: + with open(source_name, encoding='utf-8') as source: for index, line in enumerate(source): self.assertEqual(line, getline(source_name, index + 1)) source_list.append(line) @@ -163,8 +163,8 @@ for index, line in enumerate(source): self.assertEqual(line, getline(source_name, index + 1)) source_list.append(line) - with open(source_name, 'w') as source: + with open(source_name, 'w', encoding='utf-8') as source: source.write(SOURCE_2) # Try to update a bogus cache entry @@ -176,7 +176,7 @@ # Update the cache and check whether it matches the new source file linecache.checkcache(source_name) - with open(source_name) as source: + with open(source_name, encoding='utf-8') as source: for index, line in enumerate(source): self.assertEqual(line, getline(source_name, index + 1)) source_list.append(line) diff --git a/Lib/test/test_lltrace.py b/Lib/test/test_lltrace.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9sbHRyYWNlLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9sbHRyYWNlLnB5 100644 --- a/Lib/test/test_lltrace.py +++ b/Lib/test/test_lltrace.py @@ -13,7 +13,7 @@ # bpo-34113. The crash happened at the command line console of # debug Python builds with __ltrace__ enabled (only possible in console), # when the interal Python stack was negatively adjusted - with open(os_helper.TESTFN, 'w') as fd: + with open(os_helper.TESTFN, 'w', encoding='utf-8') as fd: self.addCleanup(os_helper.unlink, os_helper.TESTFN) fd.write(textwrap.dedent("""\ import code diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9sb2NhbGUucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9sb2NhbGUucHk= 100644 --- a/Lib/test/test_locale.py +++ b/Lib/test/test_locale.py @@ -1,3 +1,4 @@ +from decimal import Decimal from test.support import verbose, is_android from test.support.warnings_helper import check_warnings import unittest @@ -569,7 +570,13 @@ loc = locale.getlocale(locale.LC_CTYPE) if verbose: print('testing with %a' % (loc,), end=' ', flush=True) - locale.setlocale(locale.LC_CTYPE, loc) + try: + locale.setlocale(locale.LC_CTYPE, loc) + except locale.Error as exc: + # bpo-37945: setlocale(LC_CTYPE) fails with getlocale(LC_CTYPE) + # and the tr_TR locale on Windows. getlocale() builds a locale + # which is not recognize by setlocale(). + self.skipTest(f"setlocale(LC_CTYPE, {loc!r}) failed: {exc!r}") self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE)) def test_invalid_locale_format_in_localetuple(self): @@ -635,5 +642,32 @@ self._test_atoi('50 000', 50000) +class BaseLocalizeTest(BaseLocalizedTest): + + def _test_localize(self, value, out, grouping=False): + self.assertEqual(locale.localize(value, grouping=grouping), out) + + +class TestEnUSLocalize(EnUSCookedTest, BaseLocalizeTest): + + def test_localize(self): + self._test_localize('50000.00', '50000.00') + self._test_localize( + '{0:.16f}'.format(Decimal('1.15')), '1.1500000000000000') + + +class TestCLocalize(CCookedTest, BaseLocalizeTest): + + def test_localize(self): + self._test_localize('50000.00', '50000.00') + + +class TestfrFRLocalize(FrFRCookedTest, BaseLocalizeTest): + + def test_localize(self): + self._test_localize('50000.00', '50000,00') + self._test_localize('50000.00', '50 000,00', grouping=True) + + if __name__ == '__main__': unittest.main() diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9sb2dnaW5nLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9sb2dnaW5nLnB5 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -553,7 +553,7 @@ os.close(fd) if not existing: os.unlink(fn) - h = logging.handlers.WatchedFileHandler(fn, delay=True) + h = logging.handlers.WatchedFileHandler(fn, encoding='utf-8', delay=True) if existing: dev, ino = h.dev, h.ino self.assertEqual(dev, -1) @@ -616,7 +616,7 @@ if sys.platform in ('linux', 'darwin'): cases += ((logging.handlers.WatchedFileHandler, (pfn, 'w')),) for cls, args in cases: - h = cls(*args) + h = cls(*args, encoding="utf-8") self.assertTrue(os.path.exists(fn)) h.close() os.unlink(fn) @@ -645,7 +645,7 @@ remover = threading.Thread(target=remove_loop, args=(fn, del_count)) remover.daemon = True remover.start() - h = logging.handlers.WatchedFileHandler(fn, delay=delay) + h = logging.handlers.WatchedFileHandler(fn, encoding='utf-8', delay=delay) f = logging.Formatter('%(asctime)s: %(levelname)s: %(message)s') h.setFormatter(f) try: @@ -677,7 +677,7 @@ def __init__(self): super().__init__() self.sub_handler = logging.StreamHandler( - stream=open('/dev/null', 'wt')) + stream=open('/dev/null', 'wt', encoding='utf-8')) def emit(self, record): self.sub_handler.acquire() @@ -849,7 +849,7 @@ """ self._thread = t = threading.Thread(target=self.serve_forever, args=(self.poll_interval,)) - t.setDaemon(True) + t.daemon = True t.start() def serve_forever(self, poll_interval): @@ -901,7 +901,7 @@ """ self._thread = t = threading.Thread(target=self.serve_forever, args=(self.poll_interval,)) - t.setDaemon(True) + t.daemon = True t.start() def serve_forever(self, poll_interval): @@ -4355,7 +4355,7 @@ # basicConfig() opens the file, but logging.shutdown() closes # it at Python exit. When A.__del__() is called, # FileHandler._open() must be called again to re-open the file. - logging.basicConfig(filename={filename!r}) + logging.basicConfig(filename={filename!r}, encoding="utf-8") a = A() @@ -4365,7 +4365,7 @@ """) assert_python_ok("-c", code) - with open(filename) as fp: + with open(filename, encoding="utf-8") as fp: self.assertEqual(fp.read().rstrip(), "ERROR:root:log in __del__") def test_recursion_error(self): @@ -4559,9 +4559,9 @@ h2.close() os.remove(fn) - logging.basicConfig(filename='test.log') + logging.basicConfig(filename='test.log', encoding='utf-8') self.assertEqual(len(logging.root.handlers), 1) handler = logging.root.handlers[0] self.assertIsInstance(handler, logging.FileHandler) @@ -4563,9 +4563,9 @@ self.assertEqual(len(logging.root.handlers), 1) handler = logging.root.handlers[0] self.assertIsInstance(handler, logging.FileHandler) - expected = logging.FileHandler('test.log', 'a') + expected = logging.FileHandler('test.log', 'a', encoding='utf-8') self.assertEqual(handler.stream.mode, expected.stream.mode) self.assertEqual(handler.stream.name, expected.stream.name) self.addCleanup(cleanup, handler, expected, 'test.log') @@ -5165,7 +5165,7 @@ class FileHandlerTest(BaseFileTest): def test_delay(self): os.unlink(self.fn) - fh = logging.FileHandler(self.fn, delay=True) + fh = logging.FileHandler(self.fn, encoding='utf-8', delay=True) self.assertIsNone(fh.stream) self.assertFalse(os.path.exists(self.fn)) fh.handle(logging.makeLogRecord({})) @@ -5180,8 +5180,9 @@ def test_should_not_rollover(self): # If maxbytes is zero rollover never occurs - rh = logging.handlers.RotatingFileHandler(self.fn, maxBytes=0) + rh = logging.handlers.RotatingFileHandler( + self.fn, encoding="utf-8", maxBytes=0) self.assertFalse(rh.shouldRollover(None)) rh.close() def test_should_rollover(self): @@ -5184,11 +5185,11 @@ self.assertFalse(rh.shouldRollover(None)) rh.close() def test_should_rollover(self): - rh = logging.handlers.RotatingFileHandler(self.fn, maxBytes=1) + rh = logging.handlers.RotatingFileHandler(self.fn, encoding="utf-8", maxBytes=1) self.assertTrue(rh.shouldRollover(self.next_rec())) rh.close() def test_file_created(self): # checks that the file is created and assumes it was created # by us @@ -5189,10 +5190,10 @@ self.assertTrue(rh.shouldRollover(self.next_rec())) rh.close() def test_file_created(self): # checks that the file is created and assumes it was created # by us - rh = logging.handlers.RotatingFileHandler(self.fn) + rh = logging.handlers.RotatingFileHandler(self.fn, encoding="utf-8") rh.emit(self.next_rec()) self.assertLogFile(self.fn) rh.close() @@ -5201,7 +5202,7 @@ def namer(name): return name + ".test" rh = logging.handlers.RotatingFileHandler( - self.fn, backupCount=2, maxBytes=1) + self.fn, encoding="utf-8", backupCount=2, maxBytes=1) rh.namer = namer rh.emit(self.next_rec()) self.assertLogFile(self.fn) @@ -5222,7 +5223,7 @@ os.rename(source, dest + ".rotated") rh = HandlerWithNamerAndRotator( - self.fn, backupCount=2, maxBytes=1) + self.fn, encoding="utf-8", backupCount=2, maxBytes=1) self.assertEqual(rh.namer(self.fn), self.fn + ".test") rh.emit(self.next_rec()) self.assertLogFile(self.fn) @@ -5245,7 +5246,7 @@ os.remove(source) rh = logging.handlers.RotatingFileHandler( - self.fn, backupCount=2, maxBytes=1) + self.fn, encoding="utf-8", backupCount=2, maxBytes=1) rh.rotator = rotator rh.namer = namer m1 = self.next_rec() diff --git a/Lib/test/test_lzma.py b/Lib/test/test_lzma.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9sem1hLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9sem1hLnB5 100644 --- a/Lib/test/test_lzma.py +++ b/Lib/test/test_lzma.py @@ -1250,6 +1250,6 @@ def test_text_modes(self): uncompressed = INPUT.decode("ascii") uncompressed_raw = uncompressed.replace("\n", os.linesep) - with lzma.open(BytesIO(COMPRESSED_XZ), "rt") as f: + with lzma.open(BytesIO(COMPRESSED_XZ), "rt", encoding="ascii") as f: self.assertEqual(f.read(), uncompressed) with BytesIO() as bio: @@ -1254,6 +1254,6 @@ self.assertEqual(f.read(), uncompressed) with BytesIO() as bio: - with lzma.open(bio, "wt") as f: + with lzma.open(bio, "wt", encoding="ascii") as f: f.write(uncompressed) file_data = lzma.decompress(bio.getvalue()).decode("ascii") self.assertEqual(file_data, uncompressed_raw) @@ -1257,7 +1257,7 @@ f.write(uncompressed) file_data = lzma.decompress(bio.getvalue()).decode("ascii") self.assertEqual(file_data, uncompressed_raw) - with lzma.open(bio, "at") as f: + with lzma.open(bio, "at", encoding="ascii") as f: f.write(uncompressed) file_data = lzma.decompress(bio.getvalue()).decode("ascii") self.assertEqual(file_data, uncompressed_raw * 2) @@ -1334,6 +1334,6 @@ # Test with explicit newline (universal newline mode disabled). text = INPUT.decode("ascii") with BytesIO() as bio: - with lzma.open(bio, "wt", newline="\n") as f: + with lzma.open(bio, "wt", encoding="ascii", newline="\n") as f: f.write(text) bio.seek(0) @@ -1338,9 +1338,9 @@ f.write(text) bio.seek(0) - with lzma.open(bio, "rt", newline="\r") as f: + with lzma.open(bio, "rt", encoding="ascii", newline="\r") as f: self.assertEqual(f.readlines(), [text]) def test_x_mode(self): self.addCleanup(unlink, TESTFN) for mode in ("x", "xb", "xt"): unlink(TESTFN) @@ -1341,10 +1341,11 @@ self.assertEqual(f.readlines(), [text]) def test_x_mode(self): self.addCleanup(unlink, TESTFN) for mode in ("x", "xb", "xt"): unlink(TESTFN) - with lzma.open(TESTFN, mode): + encoding = "ascii" if "t" in mode else None + with lzma.open(TESTFN, mode, encoding=encoding): pass with self.assertRaises(FileExistsError): with lzma.open(TESTFN, mode): diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9tYWlsYm94LnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9tYWlsYm94LnB5 100644 --- a/Lib/test/test_mailbox.py +++ b/Lib/test/test_mailbox.py @@ -77,7 +77,7 @@ self.assertEqual(len(self._box), 6) with self.assertWarns(DeprecationWarning): keys.append(self._box.add( - io.TextIOWrapper(io.BytesIO(_bytes_sample_message)))) + io.TextIOWrapper(io.BytesIO(_bytes_sample_message), encoding="utf-8"))) self.assertEqual(len(self._box), 7) self.assertEqual(self._box.get_string(keys[0]), self._template % 0) for i in (1, 2, 3, 4, 5, 6): @@ -160,7 +160,7 @@ self._non_latin_bin_msg.split(b'\n')) def test_add_text_file_warns(self): - with tempfile.TemporaryFile('w+') as f: + with tempfile.TemporaryFile('w+', encoding='utf-8') as f: f.write(_sample_message) f.seek(0) with self.assertWarns(DeprecationWarning): @@ -724,5 +724,5 @@ # Remove old files from 'tmp' foo_path = os.path.join(self._path, 'tmp', 'foo') bar_path = os.path.join(self._path, 'tmp', 'bar') - with open(foo_path, 'w') as f: + with open(foo_path, 'w', encoding='utf-8') as f: f.write("@") @@ -728,5 +728,5 @@ f.write("@") - with open(bar_path, 'w') as f: + with open(bar_path, 'w', encoding='utf-8') as f: f.write("@") self._box.clean() self.assertTrue(os.path.exists(foo_path)) @@ -990,7 +990,7 @@ os_helper.unlink(lock_remnant) def assertMailboxEmpty(self): - with open(self._path) as f: + with open(self._path, 'rb') as f: self.assertEqual(f.readlines(), []) def test_get_bytes_from(self): @@ -1158,8 +1158,8 @@ self._box.add('From: foo\n\n0') # No newline at the end if sys.platform == 'OpenVMS': self._box.flush() - with open(self._path) as f: + with open(self._path, encoding='utf-8') as f: data = f.read() self.assertEqual(data[-3:], '0\n\n') self._box.add('From: foo\n\n0\n') # Newline at the end @@ -1162,8 +1162,8 @@ data = f.read() self.assertEqual(data[-3:], '0\n\n') self._box.add('From: foo\n\n0\n') # Newline at the end - with open(self._path) as f: + with open(self._path, encoding='utf-8') as f: data = f.read() self.assertEqual(data[-3:], '0\n\n') @@ -1313,7 +1313,7 @@ _factory = lambda self, path, factory=None: mailbox.Babyl(path, factory) def assertMailboxEmpty(self): - with open(self._path) as f: + with open(self._path, 'rb') as f: self.assertEqual(f.readlines(), []) def tearDown(self): @@ -1398,7 +1398,7 @@ def test_initialize_with_file(self): # Initialize based on contents of file - with open(self._path, 'w+') as f: + with open(self._path, 'w+', encoding='utf-8') as f: f.write(_sample_message) f.seek(0) msg = self._factory(f) @@ -2166,7 +2166,7 @@ filename = ".".join((str(t), str(pid), "myhostname", "mydomain")) tmpname = os.path.join(self._dir, "tmp", filename) newname = os.path.join(self._dir, dir, filename) - with open(tmpname, "w") as fp: + with open(tmpname, "w", encoding="utf-8") as fp: self._msgfiles.append(tmpname) if mbox: fp.write(FROM_) diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9tYXRoLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9tYXRoLnB5 100644 --- a/Lib/test/test_math.py +++ b/Lib/test/test_math.py @@ -130,7 +130,7 @@ id fn arg -> expected [flag]* """ - with open(fname) as fp: + with open(fname, encoding="utf-8") as fp: for line in fp: # strip comments, and skip blank lines if '--' in line: @@ -153,7 +153,7 @@ Empty lines or lines starting with -- are ignored yields id, fn, arg_real, arg_imag, exp_real, exp_imag """ - with open(fname) as fp: + with open(fname, encoding="utf-8") as fp: for line in fp: # skip comment lines and blank lines if line.startswith('--') or not line.strip(): diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9taW1ldHlwZXMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9taW1ldHlwZXMucHk= 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -64,7 +64,7 @@ with os_helper.temp_dir() as directory: data = "x-application/x-unittest pyunit\n" file = pathlib.Path(directory, "sample.mimetype") - file.write_text(data) + file.write_text(data, encoding="utf-8") mime_dict = mimetypes.read_mime_types(file) eq(mime_dict[".pyunit"], "x-application/x-unittest") diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9udHBhdGgucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9udHBhdGgucHk= 100644 --- a/Lib/test/test_ntpath.py +++ b/Lib/test/test_ntpath.py @@ -503,5 +503,4 @@ env.clear() tester('ntpath.expanduser("~test")', '~test') - env['HOMEPATH'] = 'eric\\idle' env['HOMEDRIVE'] = 'C:\\' @@ -507,5 +506,7 @@ env['HOMEDRIVE'] = 'C:\\' - tester('ntpath.expanduser("~test")', 'C:\\eric\\test') - tester('ntpath.expanduser("~")', 'C:\\eric\\idle') + env['HOMEPATH'] = 'Users\\eric' + env['USERNAME'] = 'eric' + tester('ntpath.expanduser("~test")', 'C:\\Users\\test') + tester('ntpath.expanduser("~")', 'C:\\Users\\eric') del env['HOMEDRIVE'] @@ -510,6 +511,6 @@ del env['HOMEDRIVE'] - tester('ntpath.expanduser("~test")', 'eric\\test') - tester('ntpath.expanduser("~")', 'eric\\idle') + tester('ntpath.expanduser("~test")', 'Users\\test') + tester('ntpath.expanduser("~")', 'Users\\eric') env.clear() @@ -514,6 +515,7 @@ env.clear() - env['USERPROFILE'] = 'C:\\eric\\idle' - tester('ntpath.expanduser("~test")', 'C:\\eric\\test') - tester('ntpath.expanduser("~")', 'C:\\eric\\idle') + env['USERPROFILE'] = 'C:\\Users\\eric' + env['USERNAME'] = 'eric' + tester('ntpath.expanduser("~test")', 'C:\\Users\\test') + tester('ntpath.expanduser("~")', 'C:\\Users\\eric') tester('ntpath.expanduser("~test\\foo\\bar")', @@ -519,3 +521,3 @@ tester('ntpath.expanduser("~test\\foo\\bar")', - 'C:\\eric\\test\\foo\\bar') + 'C:\\Users\\test\\foo\\bar') tester('ntpath.expanduser("~test/foo/bar")', @@ -521,3 +523,3 @@ tester('ntpath.expanduser("~test/foo/bar")', - 'C:\\eric\\test/foo/bar') + 'C:\\Users\\test/foo/bar') tester('ntpath.expanduser("~\\foo\\bar")', @@ -523,3 +525,3 @@ tester('ntpath.expanduser("~\\foo\\bar")', - 'C:\\eric\\idle\\foo\\bar') + 'C:\\Users\\eric\\foo\\bar') tester('ntpath.expanduser("~/foo/bar")', @@ -525,6 +527,6 @@ tester('ntpath.expanduser("~/foo/bar")', - 'C:\\eric\\idle/foo/bar') + 'C:\\Users\\eric/foo/bar') # bpo-36264: ignore `HOME` when set on windows env.clear() env['HOME'] = 'F:\\' @@ -527,10 +529,21 @@ # bpo-36264: ignore `HOME` when set on windows env.clear() env['HOME'] = 'F:\\' - env['USERPROFILE'] = 'C:\\eric\\idle' - tester('ntpath.expanduser("~test")', 'C:\\eric\\test') - tester('ntpath.expanduser("~")', 'C:\\eric\\idle') + env['USERPROFILE'] = 'C:\\Users\\eric' + env['USERNAME'] = 'eric' + tester('ntpath.expanduser("~test")', 'C:\\Users\\test') + tester('ntpath.expanduser("~")', 'C:\\Users\\eric') + + # bpo-39899: don't guess another user's home directory if + # `%USERNAME% != basename(%USERPROFILE%)` + env.clear() + env['USERPROFILE'] = 'C:\\Users\\eric' + env['USERNAME'] = 'idle' + tester('ntpath.expanduser("~test")', '~test') + tester('ntpath.expanduser("~")', 'C:\\Users\\eric') + + @unittest.skipUnless(nt, "abspath requires 'nt' module") def test_abspath(self): diff --git a/Lib/test/test_opcodes.py b/Lib/test/test_opcodes.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9vcGNvZGVzLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9vcGNvZGVzLnB5 100644 --- a/Lib/test/test_opcodes.py +++ b/Lib/test/test_opcodes.py @@ -24,7 +24,7 @@ def test_setup_annotations_line(self): # check that SETUP_ANNOTATIONS does not create spurious line numbers try: - with open(ann_module.__file__) as f: + with open(ann_module.__file__, encoding="utf-8") as f: txt = f.read() co = compile(txt, ann_module.__file__, 'exec') self.assertEqual(co.co_firstlineno, 1) diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9wYXRobGliLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9wYXRobGliLnB5 100644 --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -1828,6 +1828,21 @@ p.chmod(new_mode) self.assertEqual(p.stat().st_mode, new_mode) + # On Windows, os.chmod does not follow symlinks (issue #15411) + @only_posix + def test_chmod_follow_symlinks_true(self): + p = self.cls(BASE) / 'linkA' + q = p.resolve() + mode = q.stat().st_mode + # Clear writable bit. + new_mode = mode & ~0o222 + p.chmod(new_mode, follow_symlinks=True) + self.assertEqual(q.stat().st_mode, new_mode) + # Set writable bit + new_mode = mode | 0o222 + p.chmod(new_mode, follow_symlinks=True) + self.assertEqual(q.stat().st_mode, new_mode) + # XXX also need a test for lchmod. def test_stat(self): @@ -1840,6 +1855,17 @@ self.assertNotEqual(p.stat(), st) @os_helper.skip_unless_symlink + def test_stat_no_follow_symlinks(self): + p = self.cls(BASE) / 'linkA' + st = p.stat() + self.assertNotEqual(st, p.stat(follow_symlinks=False)) + + def test_stat_no_follow_symlinks_nosymlink(self): + p = self.cls(BASE) / 'fileA' + st = p.stat() + self.assertEqual(st, p.stat(follow_symlinks=False)) + + @os_helper.skip_unless_symlink def test_lstat(self): p = self.cls(BASE)/ 'linkA' st = p.stat() @@ -2594,7 +2620,7 @@ env.pop('USERNAME', None) self.assertEqual(p1.expanduser(), P('C:/Users/alice/My Documents')) - self.assertRaises(KeyError, p2.expanduser) + self.assertRaises(RuntimeError, p2.expanduser) env['USERNAME'] = 'alice' self.assertEqual(p2.expanduser(), P('C:/Users/alice/My Documents')) diff --git a/Lib/test/test_patma.py b/Lib/test/test_patma.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9wYXRtYS5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9wYXRtYS5weQ== 100644 --- a/Lib/test/test_patma.py +++ b/Lib/test/test_patma.py @@ -17,7 +17,7 @@ class MyClass: x: int y: str - __match_args__ = ["x", "y"] + __match_args__ = ("x", "y") @dataclasses.dataclass @@ -2018,7 +2018,7 @@ def test_patma_200(self): class Class: - __match_args__ = ["a", "b"] + __match_args__ = ("a", "b") c = Class() c.a = 0 c.b = 1 @@ -2046,7 +2046,7 @@ class Parent: __match_args__ = "a", "b" class Child(Parent): - __match_args__ = ["c", "d"] + __match_args__ = ("c", "d") c = Child() c.a = 0 c.b = 1 @@ -2500,7 +2500,7 @@ @no_perf def test_patma_248(self): class Class: - __match_args__ = [None] + __match_args__ = (None,) x = Class() y = z = None with self.assertRaises(TypeError): @@ -2513,7 +2513,7 @@ @no_perf def test_patma_249(self): class Class: - __match_args__ = [] + __match_args__ = () x = Class() y = z = None with self.assertRaises(TypeError): @@ -2560,7 +2560,7 @@ @no_perf def test_patma_253(self): class Class: - __match_args__ = ["a", "a"] + __match_args__ = ("a", "a") a = None x = Class() w = y = z = None @@ -2575,7 +2575,7 @@ @no_perf def test_patma_254(self): class Class: - __match_args__ = ["a"] + __match_args__ = ("a",) a = None x = Class() w = y = z = None @@ -2841,6 +2841,22 @@ self.assertEqual(x, range(10)) self.assertIs(y, None) + @no_perf + def test_patma_282(self): + class Class: + __match_args__ = ["spam", "eggs"] + spam = 0 + eggs = 1 + x = Class() + w = y = z = None + with self.assertRaises(TypeError): + match x: + case Class(y, z): + w = 0 + self.assertIs(w, None) + self.assertIs(y, None) + self.assertIs(z, None) + class PerfPatma(TestPatma): diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9wZGIucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9wZGIucHk= 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -213,6 +213,9 @@ BAZ """ +def reset_Breakpoint(): + import bdb + bdb.Breakpoint.clearBreakpoints() def test_pdb_breakpoint_commands(): """Test basic commands related to breakpoints. @@ -227,10 +230,7 @@ First, need to clear bdb state that might be left over from previous tests. Otherwise, the new breakpoints might get assigned different numbers. - >>> from bdb import Breakpoint - >>> Breakpoint.next = 1 - >>> Breakpoint.bplist = {} - >>> Breakpoint.bpbynumber = [None] + >>> reset_Breakpoint() Now test the breakpoint commands. NORMALIZE_WHITESPACE is needed because the breakpoint list outputs a tab for the "stop only" and "ignore next" @@ -323,6 +323,72 @@ 4 """ +def test_pdb_breakpoints_preserved_across_interactive_sessions(): + """Breakpoints are remembered between interactive sessions + + >>> reset_Breakpoint() + >>> with PdbTestInput([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE + ... 'import test.test_pdb', + ... 'break test.test_pdb.do_something', + ... 'break test.test_pdb.do_nothing', + ... 'break', + ... 'continue', + ... ]): + ... pdb.run('print()') + > <string>(1)<module>()... + (Pdb) import test.test_pdb + (Pdb) break test.test_pdb.do_something + Breakpoint 1 at ...test_pdb.py:... + (Pdb) break test.test_pdb.do_nothing + Breakpoint 2 at ...test_pdb.py:... + (Pdb) break + Num Type Disp Enb Where + 1 breakpoint keep yes at ...test_pdb.py:... + 2 breakpoint keep yes at ...test_pdb.py:... + (Pdb) continue + + >>> with PdbTestInput([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE + ... 'break', + ... 'break pdb.find_function', + ... 'break', + ... 'clear 1', + ... 'continue', + ... ]): + ... pdb.run('print()') + > <string>(1)<module>()... + (Pdb) break + Num Type Disp Enb Where + 1 breakpoint keep yes at ...test_pdb.py:... + 2 breakpoint keep yes at ...test_pdb.py:... + (Pdb) break pdb.find_function + Breakpoint 3 at ...pdb.py:94 + (Pdb) break + Num Type Disp Enb Where + 1 breakpoint keep yes at ...test_pdb.py:... + 2 breakpoint keep yes at ...test_pdb.py:... + 3 breakpoint keep yes at ...pdb.py:... + (Pdb) clear 1 + Deleted breakpoint 1 at ...test_pdb.py:... + (Pdb) continue + + >>> with PdbTestInput([ # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE + ... 'break', + ... 'clear 2', + ... 'clear 3', + ... 'continue', + ... ]): + ... pdb.run('print()') + > <string>(1)<module>()... + (Pdb) break + Num Type Disp Enb Where + 2 breakpoint keep yes at ...test_pdb.py:... + 3 breakpoint keep yes at ...pdb.py:... + (Pdb) clear 2 + Deleted breakpoint 2 at ...test_pdb.py:... + (Pdb) clear 3 + Deleted breakpoint 3 at ...pdb.py:... + (Pdb) continue + """ def do_nothing(): pass @@ -699,8 +765,7 @@ ... test_function_2() ... end = 1 - >>> from bdb import Breakpoint - >>> Breakpoint.next = 1 + >>> reset_Breakpoint() >>> with PdbTestInput(['break test_function_2', ... 'continue', ... 'return', @@ -1137,7 +1202,7 @@ > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[1]>(3)test_function() -> for i in test_gen(): (Pdb) break test_gen - Breakpoint 6 at <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[0]>:1 + Breakpoint 1 at <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[0]>:1 (Pdb) continue > <doctest test.test_pdb.test_pdb_next_command_in_generator_for_loop[0]>(2)test_gen() -> yield 0 @@ -1213,6 +1278,7 @@ ... print('pdb %d: %s' % (i, sess._previous_sigint_handler)) ... i += 1 + >>> reset_Breakpoint() >>> with PdbTestInput(['continue', ... 'continue']): ... test_function() @@ -1443,6 +1509,19 @@ 'Fail to handle a syntax error in the debuggee.' .format(expected, stdout)) + def test_issue26053(self): + # run command of pdb prompt echoes the correct args + script = "print('hello')" + commands = """ + continue + run a b c + run d e f + quit + """ + stdout, stderr = self.run_pdb_script(script, commands) + res = '\n'.join([x.strip() for x in stdout.splitlines()]) + self.assertRegex(res, "Restarting .* with arguments:\na b c") + self.assertRegex(res, "Restarting .* with arguments:\nd e f") def test_readrc_kwarg(self): script = textwrap.dedent(""" diff --git a/Lib/test/test_peg_generator/test_c_parser.py b/Lib/test/test_peg_generator/test_c_parser.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9wZWdfZ2VuZXJhdG9yL3Rlc3RfY19wYXJzZXIucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9wZWdfZ2VuZXJhdG9yL3Rlc3RfY19wYXJzZXIucHk= 100644 --- a/Lib/test/test_peg_generator/test_c_parser.py +++ b/Lib/test/test_peg_generator/test_c_parser.py @@ -96,5 +96,5 @@ def test_c_parser(self) -> None: grammar_source = """ - start[mod_ty]: a[asdl_stmt_seq*]=stmt* $ { Module(a, NULL, p->arena) } + start[mod_ty]: a[asdl_stmt_seq*]=stmt* $ { _PyAST_Module(a, NULL, p->arena) } stmt[stmt_ty]: a=expr_stmt { a } @@ -100,6 +100,6 @@ stmt[stmt_ty]: a=expr_stmt { a } - expr_stmt[stmt_ty]: a=expression NEWLINE { _Py_Expr(a, EXTRA) } - expression[expr_ty]: ( l=expression '+' r=term { _Py_BinOp(l, Add, r, EXTRA) } - | l=expression '-' r=term { _Py_BinOp(l, Sub, r, EXTRA) } + expr_stmt[stmt_ty]: a=expression NEWLINE { _PyAST_Expr(a, EXTRA) } + expression[expr_ty]: ( l=expression '+' r=term { _PyAST_BinOp(l, Add, r, EXTRA) } + | l=expression '-' r=term { _PyAST_BinOp(l, Sub, r, EXTRA) } | t=term { t } ) @@ -104,7 +104,7 @@ | t=term { t } ) - term[expr_ty]: ( l=term '*' r=factor { _Py_BinOp(l, Mult, r, EXTRA) } - | l=term '/' r=factor { _Py_BinOp(l, Div, r, EXTRA) } + term[expr_ty]: ( l=term '*' r=factor { _PyAST_BinOp(l, Mult, r, EXTRA) } + | l=term '/' r=factor { _PyAST_BinOp(l, Div, r, EXTRA) } | f=factor { f } ) factor[expr_ty]: ('(' e=expression ')' { e } @@ -237,8 +237,8 @@ def test_return_stmt_noexpr_action(self) -> None: grammar_source = """ - start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) } + start[mod_ty]: a=[statements] ENDMARKER { _PyAST_Module(a, NULL, p->arena) } statements[asdl_stmt_seq*]: a[asdl_stmt_seq*]=statement+ { a } statement[stmt_ty]: simple_stmt simple_stmt[stmt_ty]: small_stmt small_stmt[stmt_ty]: return_stmt @@ -241,8 +241,8 @@ statements[asdl_stmt_seq*]: a[asdl_stmt_seq*]=statement+ { a } statement[stmt_ty]: simple_stmt simple_stmt[stmt_ty]: small_stmt small_stmt[stmt_ty]: return_stmt - return_stmt[stmt_ty]: a='return' NEWLINE { _Py_Return(NULL, EXTRA) } + return_stmt[stmt_ty]: a='return' NEWLINE { _PyAST_Return(NULL, EXTRA) } """ test_source = """ stmt = "return" @@ -252,8 +252,8 @@ def test_gather_action_ast(self) -> None: grammar_source = """ - start[mod_ty]: a[asdl_stmt_seq*]=';'.pass_stmt+ NEWLINE ENDMARKER { Module(a, NULL, p->arena) } - pass_stmt[stmt_ty]: a='pass' { _Py_Pass(EXTRA)} + start[mod_ty]: a[asdl_stmt_seq*]=';'.pass_stmt+ NEWLINE ENDMARKER { _PyAST_Module(a, NULL, p->arena) } + pass_stmt[stmt_ty]: a='pass' { _PyAST_Pass(EXTRA)} """ test_source = """ stmt = "pass; pass" @@ -263,8 +263,8 @@ def test_pass_stmt_action(self) -> None: grammar_source = """ - start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) } + start[mod_ty]: a=[statements] ENDMARKER { _PyAST_Module(a, NULL, p->arena) } statements[asdl_stmt_seq*]: a[asdl_stmt_seq*]=statement+ { a } statement[stmt_ty]: simple_stmt simple_stmt[stmt_ty]: small_stmt small_stmt[stmt_ty]: pass_stmt @@ -267,8 +267,8 @@ statements[asdl_stmt_seq*]: a[asdl_stmt_seq*]=statement+ { a } statement[stmt_ty]: simple_stmt simple_stmt[stmt_ty]: small_stmt small_stmt[stmt_ty]: pass_stmt - pass_stmt[stmt_ty]: a='pass' NEWLINE { _Py_Pass(EXTRA) } + pass_stmt[stmt_ty]: a='pass' NEWLINE { _PyAST_Pass(EXTRA) } """ test_source = """ stmt = "pass" @@ -278,7 +278,7 @@ def test_if_stmt_action(self) -> None: grammar_source = """ - start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) } + start[mod_ty]: a=[statements] ENDMARKER { _PyAST_Module(a, NULL, p->arena) } statements[asdl_stmt_seq*]: a=statement+ { (asdl_stmt_seq*)_PyPegen_seq_flatten(p, a) } statement[asdl_stmt_seq*]: a=compound_stmt { (asdl_stmt_seq*)_PyPegen_singleton_seq(p, a) } | simple_stmt @@ -290,7 +290,7 @@ compound_stmt: if_stmt - if_stmt: 'if' a=full_expression ':' b=block { _Py_If(a, b, NULL, EXTRA) } + if_stmt: 'if' a=full_expression ':' b=block { _PyAST_If(a, b, NULL, EXTRA) } small_stmt[stmt_ty]: pass_stmt @@ -294,7 +294,7 @@ small_stmt[stmt_ty]: pass_stmt - pass_stmt[stmt_ty]: a='pass' { _Py_Pass(EXTRA) } + pass_stmt[stmt_ty]: a='pass' { _PyAST_Pass(EXTRA) } full_expression: NAME """ @@ -306,5 +306,5 @@ def test_same_name_different_types(self) -> None: grammar_source = """ - start[mod_ty]: a[asdl_stmt_seq*]=import_from+ NEWLINE ENDMARKER { Module(a, NULL, p->arena)} + start[mod_ty]: a[asdl_stmt_seq*]=import_from+ NEWLINE ENDMARKER { _PyAST_Module(a, NULL, p->arena)} import_from[stmt_ty]: ( a='from' !'import' c=simple_name 'import' d=import_as_names_from { @@ -310,3 +310,3 @@ import_from[stmt_ty]: ( a='from' !'import' c=simple_name 'import' d=import_as_names_from { - _Py_ImportFrom(c->v.Name.id, d, 0, EXTRA) } + _PyAST_ImportFrom(c->v.Name.id, d, 0, EXTRA) } | a='from' '.' 'import' c=import_as_names_from { @@ -312,5 +312,5 @@ | a='from' '.' 'import' c=import_as_names_from { - _Py_ImportFrom(NULL, c, 1, EXTRA) } + _PyAST_ImportFrom(NULL, c, 1, EXTRA) } ) simple_name[expr_ty]: NAME import_as_names_from[asdl_alias_seq*]: a[asdl_alias_seq*]=','.import_as_name_from+ { a } @@ -314,7 +314,7 @@ ) simple_name[expr_ty]: NAME import_as_names_from[asdl_alias_seq*]: a[asdl_alias_seq*]=','.import_as_name_from+ { a } - import_as_name_from[alias_ty]: a=NAME 'as' b=NAME { _Py_alias(((expr_ty) a)->v.Name.id, ((expr_ty) b)->v.Name.id, p->arena) } + import_as_name_from[alias_ty]: a=NAME 'as' b=NAME { _PyAST_alias(((expr_ty) a)->v.Name.id, ((expr_ty) b)->v.Name.id, EXTRA) } """ test_source = """ for stmt in ("from a import b as c", "from . import a as b"): @@ -326,9 +326,9 @@ def test_with_stmt_with_paren(self) -> None: grammar_source = """ - start[mod_ty]: a=[statements] ENDMARKER { Module(a, NULL, p->arena) } + start[mod_ty]: a=[statements] ENDMARKER { _PyAST_Module(a, NULL, p->arena) } statements[asdl_stmt_seq*]: a=statement+ { (asdl_stmt_seq*)_PyPegen_seq_flatten(p, a) } statement[asdl_stmt_seq*]: a=compound_stmt { (asdl_stmt_seq*)_PyPegen_singleton_seq(p, a) } compound_stmt[stmt_ty]: with_stmt with_stmt[stmt_ty]: ( a='with' '(' b[asdl_withitem_seq*]=','.with_item+ ')' ':' c=block { @@ -330,8 +330,8 @@ statements[asdl_stmt_seq*]: a=statement+ { (asdl_stmt_seq*)_PyPegen_seq_flatten(p, a) } statement[asdl_stmt_seq*]: a=compound_stmt { (asdl_stmt_seq*)_PyPegen_singleton_seq(p, a) } compound_stmt[stmt_ty]: with_stmt with_stmt[stmt_ty]: ( a='with' '(' b[asdl_withitem_seq*]=','.with_item+ ')' ':' c=block { - _Py_With(b, (asdl_stmt_seq*) _PyPegen_singleton_seq(p, c), NULL, EXTRA) } + _PyAST_With(b, (asdl_stmt_seq*) _PyPegen_singleton_seq(p, c), NULL, EXTRA) } ) with_item[withitem_ty]: ( @@ -336,5 +336,5 @@ ) with_item[withitem_ty]: ( - e=NAME o=['as' t=NAME { t }] { _Py_withitem(e, _PyPegen_set_expr_context(p, o, Store), p->arena) } + e=NAME o=['as' t=NAME { t }] { _PyAST_withitem(e, _PyPegen_set_expr_context(p, o, Store), p->arena) } ) block[stmt_ty]: a=pass_stmt NEWLINE { a } | NEWLINE INDENT a=pass_stmt DEDENT { a } @@ -339,6 +339,6 @@ ) block[stmt_ty]: a=pass_stmt NEWLINE { a } | NEWLINE INDENT a=pass_stmt DEDENT { a } - pass_stmt[stmt_ty]: a='pass' { _Py_Pass(EXTRA) } + pass_stmt[stmt_ty]: a='pass' { _PyAST_Pass(EXTRA) } """ test_source = """ stmt = "with (\\n a as b,\\n c as d\\n): pass" @@ -352,6 +352,6 @@ def test_ternary_operator(self) -> None: grammar_source = """ - start[mod_ty]: a=expr ENDMARKER { Module(a, NULL, p->arena) } - expr[asdl_stmt_seq*]: a=listcomp NEWLINE { (asdl_stmt_seq*)_PyPegen_singleton_seq(p, _Py_Expr(a, EXTRA)) } + start[mod_ty]: a=expr ENDMARKER { _PyAST_Module(a, NULL, p->arena) } + expr[asdl_stmt_seq*]: a=listcomp NEWLINE { (asdl_stmt_seq*)_PyPegen_singleton_seq(p, _PyAST_Expr(a, EXTRA)) } listcomp[expr_ty]: ( @@ -357,5 +357,5 @@ listcomp[expr_ty]: ( - a='[' b=NAME c=for_if_clauses d=']' { _Py_ListComp(b, c, EXTRA) } + a='[' b=NAME c=for_if_clauses d=']' { _PyAST_ListComp(b, c, EXTRA) } ) for_if_clauses[asdl_comprehension_seq*]: ( a[asdl_comprehension_seq*]=(y=[ASYNC] 'for' a=NAME 'in' b=NAME c[asdl_expr_seq*]=('if' z=NAME { z })* @@ -359,7 +359,7 @@ ) for_if_clauses[asdl_comprehension_seq*]: ( a[asdl_comprehension_seq*]=(y=[ASYNC] 'for' a=NAME 'in' b=NAME c[asdl_expr_seq*]=('if' z=NAME { z })* - { _Py_comprehension(_Py_Name(((expr_ty) a)->v.Name.id, Store, EXTRA), b, c, (y == NULL) ? 0 : 1, p->arena) })+ { a } + { _PyAST_comprehension(_PyAST_Name(((expr_ty) a)->v.Name.id, Store, EXTRA), b, c, (y == NULL) ? 0 : 1, p->arena) })+ { a } ) """ test_source = """ diff --git a/Lib/test/test_pickle.py b/Lib/test/test_pickle.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9waWNrbGUucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9waWNrbGUucHk= 100644 --- a/Lib/test/test_pickle.py +++ b/Lib/test/test_pickle.py @@ -483,7 +483,8 @@ if exc in (BlockingIOError, ResourceWarning, StopAsyncIteration, - RecursionError): + RecursionError, + EncodingWarning): continue if exc is not OSError and issubclass(exc, OSError): self.assertEqual(reverse_mapping('builtins', name), diff --git a/Lib/test/test_pkgutil.py b/Lib/test/test_pkgutil.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9wa2d1dGlsLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9wa2d1dGlsLnB5 100644 --- a/Lib/test/test_pkgutil.py +++ b/Lib/test/test_pkgutil.py @@ -506,7 +506,8 @@ def check_deprecated(self): return check_warnings( - ("This emulation is deprecated, use 'importlib' instead", + ("This emulation is deprecated and slated for removal in " + "Python 3.12; use 'importlib' instead", DeprecationWarning)) def test_importer_deprecated(self): diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9wb3NpeC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9wb3NpeC5weQ== 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -45,8 +45,8 @@ def setUp(self): # create empty file - fp = open(os_helper.TESTFN, 'w+') - fp.close() + with open(os_helper.TESTFN, "wb"): + pass self.teardown_files = [ os_helper.TESTFN ] self._warnings_manager = warnings_helper.check_warnings() self._warnings_manager.__enter__() @@ -1585,7 +1585,7 @@ args = self.python_args('-c', script) pid = self.spawn_func(args[0], args, os.environ) support.wait_process(pid, exitcode=0) - with open(pidfile) as f: + with open(pidfile, encoding="utf-8") as f: self.assertEqual(f.read(), str(pid)) def test_no_such_executable(self): @@ -1608,10 +1608,10 @@ self.addCleanup(os_helper.unlink, envfile) script = f"""if 1: import os - with open({envfile!r}, "w") as envfile: + with open({envfile!r}, "w", encoding="utf-8") as envfile: envfile.write(os.environ['foo']) """ args = self.python_args('-c', script) pid = self.spawn_func(args[0], args, {**os.environ, 'foo': 'bar'}) support.wait_process(pid, exitcode=0) @@ -1612,10 +1612,10 @@ envfile.write(os.environ['foo']) """ args = self.python_args('-c', script) pid = self.spawn_func(args[0], args, {**os.environ, 'foo': 'bar'}) support.wait_process(pid, exitcode=0) - with open(envfile) as f: + with open(envfile, encoding="utf-8") as f: self.assertEqual(f.read(), 'bar') def test_none_file_actions(self): @@ -1867,7 +1867,7 @@ file_actions=file_actions) support.wait_process(pid, exitcode=0) - with open(outfile) as f: + with open(outfile, encoding="utf-8") as f: self.assertEqual(f.read(), 'hello') def test_close_file(self): @@ -1878,7 +1878,7 @@ try: os.fstat(0) except OSError as e: - with open({closefile!r}, 'w') as closefile: + with open({closefile!r}, 'w', encoding='utf-8') as closefile: closefile.write('is closed %d' % e.errno) """ args = self.python_args('-c', script) @@ -1886,7 +1886,7 @@ file_actions=[(os.POSIX_SPAWN_CLOSE, 0)]) support.wait_process(pid, exitcode=0) - with open(closefile) as f: + with open(closefile, encoding="utf-8") as f: self.assertEqual(f.read(), 'is closed %d' % errno.EBADF) def test_dup2(self): @@ -1904,7 +1904,7 @@ pid = self.spawn_func(args[0], args, os.environ, file_actions=file_actions) support.wait_process(pid, exitcode=0) - with open(dupfile) as f: + with open(dupfile, encoding="utf-8") as f: self.assertEqual(f.read(), 'hello') diff --git a/Lib/test/test_pprint.py b/Lib/test/test_pprint.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9wcHJpbnQucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9wcHJpbnQucHk= 100644 --- a/Lib/test/test_pprint.py +++ b/Lib/test/test_pprint.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import collections +import dataclasses import io import itertools import pprint @@ -66,6 +67,38 @@ def __repr__(self): return '*'*len(dict.__repr__(self)) +@dataclasses.dataclass +class dataclass1: + field1: str + field2: int + field3: bool = False + field4: int = dataclasses.field(default=1, repr=False) + +@dataclasses.dataclass +class dataclass2: + a: int = 1 + def __repr__(self): + return "custom repr that doesn't fit within pprint width" + +@dataclasses.dataclass(repr=False) +class dataclass3: + a: int = 1 + +@dataclasses.dataclass +class dataclass4: + a: "dataclass4" + b: int = 1 + +@dataclasses.dataclass +class dataclass5: + a: "dataclass6" + b: int = 1 + +@dataclasses.dataclass +class dataclass6: + c: "dataclass5" + d: int = 1 + class Unorderable: def __repr__(self): return str(id(self)) @@ -206,6 +239,7 @@ self.assertEqual(pprint.pformat(simple), native) self.assertEqual(pprint.pformat(simple, width=1, indent=0) .replace('\n', ' '), native) + self.assertEqual(pprint.pformat(simple, underscore_numbers=True), native) self.assertEqual(pprint.saferepr(simple), native) def test_container_repr_override_called(self): @@ -323,6 +357,18 @@ '1 ' '2']]]]]""") + def test_integer(self): + self.assertEqual(pprint.pformat(1234567), '1234567') + self.assertEqual(pprint.pformat(1234567, underscore_numbers=True), '1_234_567') + + class Temperature(int): + def __new__(cls, celsius_degrees): + return super().__new__(Temperature, celsius_degrees) + def __repr__(self): + kelvin_degrees = self + 273.15 + return f"{kelvin_degrees}°K" + self.assertEqual(pprint.pformat(Temperature(1000)), '1273.15°K') + def test_sorted_dict(self): # Starting in Python 2.5, pprint sorts dict displays by key regardless # of how small the dictionary may be. @@ -415,7 +461,7 @@ lazy=7, dog=8, ) - formatted = pprint.pformat(ns, width=60) + formatted = pprint.pformat(ns, width=60, indent=4) self.assertEqual(formatted, """\ namespace(the=0, quick=1, @@ -452,6 +498,56 @@ lazy=7, dog=8)""") + def test_empty_dataclass(self): + dc = dataclasses.make_dataclass("MyDataclass", ())() + formatted = pprint.pformat(dc) + self.assertEqual(formatted, "MyDataclass()") + + def test_small_dataclass(self): + dc = dataclass1("text", 123) + formatted = pprint.pformat(dc) + self.assertEqual(formatted, "dataclass1(field1='text', field2=123, field3=False)") + + def test_larger_dataclass(self): + dc = dataclass1("some fairly long text", int(1e10), True) + formatted = pprint.pformat([dc, dc], width=60, indent=4) + self.assertEqual(formatted, """\ +[ dataclass1(field1='some fairly long text', + field2=10000000000, + field3=True), + dataclass1(field1='some fairly long text', + field2=10000000000, + field3=True)]""") + + def test_dataclass_with_repr(self): + dc = dataclass2() + formatted = pprint.pformat(dc, width=20) + self.assertEqual(formatted, "custom repr that doesn't fit within pprint width") + + def test_dataclass_no_repr(self): + dc = dataclass3() + formatted = pprint.pformat(dc, width=10) + self.assertRegex(formatted, r"<test.test_pprint.dataclass3 object at \w+>") + + def test_recursive_dataclass(self): + dc = dataclass4(None) + dc.a = dc + formatted = pprint.pformat(dc, width=10) + self.assertEqual(formatted, """\ +dataclass4(a=..., + b=1)""") + + def test_cyclic_dataclass(self): + dc5 = dataclass5(None) + dc6 = dataclass6(None) + dc5.a = dc6 + dc6.c = dc5 + formatted = pprint.pformat(dc5, width=10) + self.assertEqual(formatted, """\ +dataclass5(a=dataclass6(c=..., + d=1), + b=1)""") + def test_subclassing(self): # length(repr(obj)) > width o = {'names with spaces': 'should be presented using repr()', diff --git a/Lib/test/test_profile.py b/Lib/test/test_profile.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9wcm9maWxlLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9wcm9maWxlLnB5 100644 --- a/Lib/test/test_profile.py +++ b/Lib/test/test_profile.py @@ -115,7 +115,7 @@ def test_output_file_when_changing_directory(self): with temp_dir() as tmpdir, change_cwd(tmpdir): os.mkdir('dest') - with open('demo.py', 'w') as f: + with open('demo.py', 'w', encoding="utf-8") as f: f.write('import os; os.chdir("dest")') assert_python_ok( diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9weWRvYy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9weWRvYy5weQ== 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -453,7 +453,7 @@ zero = 0 one = 1 doc = pydoc.render_doc(BinaryInteger) - self.assertIn('<BinaryInteger.zero: 0>', doc) + self.assertIn('BinaryInteger.zero', doc) def test_mixed_case_module_names_are_lower_cased(self): # issue16484 @@ -1142,7 +1142,8 @@ '''A static method''' ... self.assertEqual(self._get_summary_lines(X.__dict__['sm']), - "<staticmethod object>") + 'sm(x, y)\n' + ' A static method\n') self.assertEqual(self._get_summary_lines(X.sm), """\ sm(x, y) A static method @@ -1162,7 +1163,8 @@ '''A class method''' ... self.assertEqual(self._get_summary_lines(X.__dict__['cm']), - "<classmethod object>") + 'cm(...)\n' + ' A class method\n') self.assertEqual(self._get_summary_lines(X.cm), """\ cm(x) method of builtins.type instance A class method @@ -1375,10 +1377,9 @@ ("topic?key=def", "Pydoc: KEYWORD def"), ("topic?key=STRINGS", "Pydoc: TOPIC STRINGS"), ("foobar", "Pydoc: Error - foobar"), - ("getfile?key=foobar", "Pydoc: Error - getfile?key=foobar"), ] with self.restrict_walk_packages(): for url, title in requests: self.call_url_handler(url, title) @@ -1379,14 +1380,9 @@ ] with self.restrict_walk_packages(): for url, title in requests: self.call_url_handler(url, title) - path = string.__file__ - title = "Pydoc: getfile " + path - url = "getfile?key=" + path - self.call_url_handler(url, title) - class TestHelper(unittest.TestCase): def test_keywords(self): diff --git a/Lib/test/test_reprlib.py b/Lib/test/test_reprlib.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9yZXBybGliLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9yZXBybGliLnB5 100644 --- a/Lib/test/test_reprlib.py +++ b/Lib/test/test_reprlib.py @@ -203,5 +203,5 @@ class C: def foo(cls): pass x = staticmethod(C.foo) - self.assertTrue(repr(x).startswith('<staticmethod object at 0x')) + self.assertEqual(repr(x), f'<staticmethod({C.foo!r})>') x = classmethod(C.foo) @@ -207,5 +207,5 @@ x = classmethod(C.foo) - self.assertTrue(repr(x).startswith('<classmethod object at 0x')) + self.assertEqual(repr(x), f'<classmethod({C.foo!r})>') def test_unsortable(self): # Repr.repr() used to call sorted() on sets, frozensets and dicts diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9zaHV0aWwucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9zaHV0aWwucHk= 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -75,7 +75,9 @@ """ if isinstance(path, tuple): path = os.path.join(*path) - with open(path, 'wb' if binary else 'w') as fp: + mode = 'wb' if binary else 'w' + encoding = None if binary else "utf-8" + with open(path, mode, encoding=encoding) as fp: fp.write(content) def write_test_file(path, size): @@ -105,7 +107,9 @@ """ if isinstance(path, tuple): path = os.path.join(*path) - with open(path, 'rb' if binary else 'r') as fp: + mode = 'rb' if binary else 'r' + encoding = None if binary else "utf-8" + with open(path, mode, encoding=encoding) as fp: return fp.read() def rlistdir(path): @@ -675,7 +679,7 @@ flag = [] src = self.mkdtemp() dst = tempfile.mktemp(dir=self.mkdtemp()) - with open(os.path.join(src, 'foo'), 'w') as f: + with open(os.path.join(src, 'foo'), 'w', encoding='utf-8') as f: f.close() shutil.copytree(src, dst, copy_function=custom_cpfun) self.assertEqual(len(flag), 1) @@ -747,7 +751,7 @@ src_dir = self.mkdtemp() dst_dir = os.path.join(self.mkdtemp(), 'destination') os.mkdir(os.path.join(src_dir, 'real_dir')) - with open(os.path.join(src_dir, 'real_dir', 'test.txt'), 'w'): + with open(os.path.join(src_dir, 'real_dir', 'test.txt'), 'wb'): pass os.symlink(os.path.join(src_dir, 'real_dir'), os.path.join(src_dir, 'link_to_dir'), @@ -1175,10 +1179,10 @@ src = os.path.join(TESTFN, 'cheese') dst = os.path.join(TESTFN, 'shop') try: - with open(src, 'w') as f: + with open(src, 'w', encoding='utf-8') as f: f.write('cheddar') try: os.link(src, dst) except PermissionError as e: self.skipTest('os.link(): %s' % e) self.assertRaises(shutil.SameFileError, shutil.copyfile, src, dst) @@ -1179,10 +1183,10 @@ f.write('cheddar') try: os.link(src, dst) except PermissionError as e: self.skipTest('os.link(): %s' % e) self.assertRaises(shutil.SameFileError, shutil.copyfile, src, dst) - with open(src, 'r') as f: + with open(src, 'r', encoding='utf-8') as f: self.assertEqual(f.read(), 'cheddar') os.remove(dst) finally: @@ -1195,10 +1199,10 @@ src = os.path.join(TESTFN, 'cheese') dst = os.path.join(TESTFN, 'shop') try: - with open(src, 'w') as f: + with open(src, 'w', encoding='utf-8') as f: f.write('cheddar') # Using `src` here would mean we end up with a symlink pointing # to TESTFN/TESTFN/cheese, while it should point at # TESTFN/cheese. os.symlink('cheese', dst) self.assertRaises(shutil.SameFileError, shutil.copyfile, src, dst) @@ -1199,10 +1203,10 @@ f.write('cheddar') # Using `src` here would mean we end up with a symlink pointing # to TESTFN/TESTFN/cheese, while it should point at # TESTFN/cheese. os.symlink('cheese', dst) self.assertRaises(shutil.SameFileError, shutil.copyfile, src, dst) - with open(src, 'r') as f: + with open(src, 'r', encoding='utf-8') as f: self.assertEqual(f.read(), 'cheddar') os.remove(dst) finally: @@ -2596,7 +2600,7 @@ # sys.__stdout__ is not a terminal on Unix # or fileno() not in (0, 1, 2) on Windows - with open(os.devnull, 'w') as f, \ + with open(os.devnull, 'w', encoding='utf-8') as f, \ support.swap_attr(sys, '__stdout__', f): size = shutil.get_terminal_size(fallback=(30, 40)) self.assertEqual(size.columns, 30) diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9zaWduYWwucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9zaWduYWwucHk= 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -879,7 +879,7 @@ %s - blocked = %s + blocked = %r signum = signal.SIGALRM # child: block and wait the signal diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9zaXRlLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9zaXRlLnB5 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py @@ -173,6 +173,7 @@ pth_dir, pth_fn = self.make_pth("abc\x00def\n") with captured_stderr() as err_out: self.assertFalse(site.addpackage(pth_dir, pth_fn, set())) + self.maxDiff = None self.assertEqual(err_out.getvalue(), "") for path in sys.path: if isinstance(path, str): @@ -408,56 +409,6 @@ """Restore sys.path""" sys.path[:] = self.sys_path - def test_abs_paths(self): - # Make sure all imported modules have their __file__ and __cached__ - # attributes as absolute paths. Arranging to put the Lib directory on - # PYTHONPATH would cause the os module to have a relative path for - # __file__ if abs_paths() does not get run. sys and builtins (the - # only other modules imported before site.py runs) do not have - # __file__ or __cached__ because they are built-in. - try: - parent = os.path.relpath(os.path.dirname(os.__file__)) - cwd = os.getcwd() - except ValueError: - # Failure to get relpath probably means we need to chdir - # to the same drive. - cwd, parent = os.path.split(os.path.dirname(os.__file__)) - with change_cwd(cwd): - env = os.environ.copy() - env['PYTHONPATH'] = parent - code = ('import os, sys', - # use ASCII to avoid locale issues with non-ASCII directories - 'os_file = os.__file__.encode("ascii", "backslashreplace")', - r'sys.stdout.buffer.write(os_file + b"\n")', - 'os_cached = os.__cached__.encode("ascii", "backslashreplace")', - r'sys.stdout.buffer.write(os_cached + b"\n")') - command = '\n'.join(code) - # First, prove that with -S (no 'import site'), the paths are - # relative. - proc = subprocess.Popen([sys.executable, '-S', '-c', command], - env=env, - stdout=subprocess.PIPE) - stdout, stderr = proc.communicate() - - self.assertEqual(proc.returncode, 0) - os__file__, os__cached__ = stdout.splitlines()[:2] - if sys.platform != 'OpenVMS': - self.assertFalse(os.path.isabs(os__file__)) - self.assertFalse(os.path.isabs(os__cached__)) - # Now, with 'import site', it works. - proc = subprocess.Popen([sys.executable, '-c', command], - env=env, - stdout=subprocess.PIPE) - stdout, stderr = proc.communicate() - self.assertEqual(proc.returncode, 0) - os__file__, os__cached__ = stdout.splitlines()[:2] - self.assertTrue(os.path.isabs(os__file__), - "expected absolute path, got {}" - .format(os__file__.decode('ascii'))) - self.assertTrue(os.path.isabs(os__cached__), - "expected absolute path, got {}" - .format(os__cached__.decode('ascii'))) - def test_abs_paths_cached_None(self): """Test for __cached__ is None. diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9zb2NrZXQucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9zb2NrZXQucHk= 100755 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -1524,5 +1524,5 @@ infos = socket.getaddrinfo(HOST, 80, socket.AF_INET, socket.SOCK_STREAM) for family, type, _, _, _ in infos: self.assertEqual(family, socket.AF_INET) - self.assertEqual(str(family), 'AddressFamily.AF_INET') + self.assertEqual(str(family), 'AF_INET') self.assertEqual(type, socket.SOCK_STREAM) @@ -1528,5 +1528,5 @@ self.assertEqual(type, socket.SOCK_STREAM) - self.assertEqual(str(type), 'SocketKind.SOCK_STREAM') + self.assertEqual(str(type), 'SOCK_STREAM') infos = socket.getaddrinfo(HOST, None, 0, socket.SOCK_STREAM) for _, socktype, _, _, _ in infos: self.assertEqual(socktype, socket.SOCK_STREAM) @@ -1801,8 +1801,8 @@ # Make sure that the AF_* and SOCK_* constants have enum-like string # reprs. with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: - self.assertEqual(str(s.family), 'AddressFamily.AF_INET') - self.assertEqual(str(s.type), 'SocketKind.SOCK_STREAM') + self.assertEqual(str(s.family), 'AF_INET') + self.assertEqual(str(s.type), 'SOCK_STREAM') def test_socket_consistent_sock_type(self): SOCK_NONBLOCK = getattr(socket, 'SOCK_NONBLOCK', 0) diff --git a/Lib/test/test_source_encoding.py b/Lib/test/test_source_encoding.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9zb3VyY2VfZW5jb2RpbmcucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9zb3VyY2VfZW5jb2RpbmcucHk= 100644 --- a/Lib/test/test_source_encoding.py +++ b/Lib/test/test_source_encoding.py @@ -205,6 +205,23 @@ b'print(ascii("\xc3\xa4"))\n') self.check_script_output(src, br"'\xe4'") + def test_crlf(self): + src = (b'print(ascii("""\r\n"""))\n') + out = self.check_script_output(src, br"'\n'") + + def test_crcrlf(self): + src = (b'print(ascii("""\r\r\n"""))\n') + out = self.check_script_output(src, br"'\n\n'") + + def test_crcrcrlf(self): + src = (b'print(ascii("""\r\r\r\n"""))\n') + out = self.check_script_output(src, br"'\n\n\n'") + + def test_crcrcrlf2(self): + src = (b'#coding:iso-8859-1\n' + b'print(ascii("""\r\r\r\n"""))\n') + out = self.check_script_output(src, br"'\n\n\n'") + class BytesSourceEncodingTest(AbstractSourceEncodingTest, unittest.TestCase): diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9zc2wucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9zc2wucHk= 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -42,6 +42,7 @@ IS_LIBRESSL = ssl.OPENSSL_VERSION.startswith('LibreSSL') IS_OPENSSL_1_1_0 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 0) IS_OPENSSL_1_1_1 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (1, 1, 1) +IS_OPENSSL_3_0_0 = not IS_LIBRESSL and ssl.OPENSSL_VERSION_INFO >= (3, 0, 0) PY_SSL_DEFAULT_CIPHERS = sysconfig.get_config_var('PY_SSL_DEFAULT_CIPHERS') PROTOCOL_TO_TLS_VERSION = {} @@ -150,6 +151,7 @@ OP_SINGLE_ECDH_USE = getattr(ssl, "OP_SINGLE_ECDH_USE", 0) OP_CIPHER_SERVER_PREFERENCE = getattr(ssl, "OP_CIPHER_SERVER_PREFERENCE", 0) OP_ENABLE_MIDDLEBOX_COMPAT = getattr(ssl, "OP_ENABLE_MIDDLEBOX_COMPAT", 0) +OP_IGNORE_UNEXPECTED_EOF = getattr(ssl, "OP_IGNORE_UNEXPECTED_EOF", 0) # Ubuntu has patched OpenSSL and changed behavior of security level 2 # see https://bugs.python.org/issue41561#msg389003 @@ -166,7 +168,10 @@ def seclevel_workaround(*ctxs): """"Lower security level to '1' and allow all ciphers for TLS 1.0/1""" for ctx in ctxs: - if ctx.minimum_version <= ssl.TLSVersion.TLSv1_1: + if ( + hasattr(ctx, "minimum_version") and + ctx.minimum_version <= ssl.TLSVersion.TLSv1_1 + ): ctx.set_ciphers("@SECLEVEL=1:ALL") else: def seclevel_workaround(*ctxs): @@ -212,6 +217,10 @@ if not getattr(ssl, f'HAS_{version.name}'): return False + if IS_OPENSSL_3_0_0 and version < ssl.TLSVersion.TLSv1_2: + # bpo43791: 3.0.0-alpha14 fails with TLSV1_ALERT_INTERNAL_ERROR + return False + # check runtime and dynamic crypto policy settings. A TLS version may # be compiled in but disabled by a policy or config option. ctx = ssl.SSLContext() @@ -381,7 +390,7 @@ # Make sure that the PROTOCOL_* constants have enum-like string # reprs. proto = ssl.PROTOCOL_TLS - self.assertEqual(str(proto), '_SSLMethod.PROTOCOL_TLS') + self.assertEqual(str(proto), 'PROTOCOL_TLS') ctx = ssl.SSLContext(proto) self.assertIs(ctx.protocol, proto) @@ -1164,7 +1173,8 @@ # SSLContext also enables these by default default |= (OP_NO_COMPRESSION | OP_CIPHER_SERVER_PREFERENCE | OP_SINGLE_DH_USE | OP_SINGLE_ECDH_USE | - OP_ENABLE_MIDDLEBOX_COMPAT) + OP_ENABLE_MIDDLEBOX_COMPAT | + OP_IGNORE_UNEXPECTED_EOF) self.assertEqual(default, ctx.options) ctx.options |= ssl.OP_NO_TLSv1 self.assertEqual(default | ssl.OP_NO_TLSv1, ctx.options) @@ -2310,6 +2320,8 @@ rc = s.connect_ex((REMOTE_HOST, 443)) if rc == 0: self.skipTest("REMOTE_HOST responded too quickly") + elif rc == errno.ENETUNREACH: + self.skipTest("Network unreachable.") self.assertIn(rc, (errno.EAGAIN, errno.EWOULDBLOCK)) @unittest.skipUnless(socket_helper.IPV6_ENABLED, 'Needs IPv6') @@ -4789,6 +4801,28 @@ msg ) + def test_msg_callback_deadlock_bpo43577(self): + client_context, server_context, hostname = testing_context() + server_context2 = testing_context()[1] + + def msg_cb(conn, direction, version, content_type, msg_type, data): + pass + + def sni_cb(sock, servername, ctx): + sock.context = server_context2 + + server_context._msg_callback = msg_cb + server_context.sni_callback = sni_cb + + server = ThreadedEchoServer(context=server_context, chatty=False) + with server: + with client_context.wrap_socket(socket.socket(), + server_hostname=hostname) as s: + s.connect((HOST, server.port)) + with client_context.wrap_socket(socket.socket(), + server_hostname=hostname) as s: + s.connect((HOST, server.port)) + def test_main(verbose=False): if support.verbose: diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9zdXBwb3J0LnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9zdXBwb3J0LnB5 100644 --- a/Lib/test/test_support.py +++ b/Lib/test/test_support.py @@ -47,7 +47,7 @@ self.assertNotIn("sched", sys.modules) def test_unlink(self): - with open(TESTFN, "w") as f: + with open(TESTFN, "w", encoding="utf-8") as f: pass os_helper.unlink(TESTFN) self.assertFalse(os.path.exists(TESTFN)) @@ -79,7 +79,7 @@ def test_forget(self): mod_filename = TESTFN + '.py' - with open(mod_filename, 'w') as f: + with open(mod_filename, 'w', encoding="utf-8") as f: print('foo = 1', file=f) sys.path.insert(0, os.curdir) importlib.invalidate_caches() diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9zeW50YXgucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9zeW50YXgucHk= 100644 --- a/Lib/test/test_syntax.py +++ b/Lib/test/test_syntax.py @@ -61,7 +61,7 @@ >>> f() = 1 Traceback (most recent call last): -SyntaxError: cannot assign to function call +SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='? >>> yield = 1 Traceback (most recent call last): @@ -73,7 +73,7 @@ >>> a + 1 = 2 Traceback (most recent call last): -SyntaxError: cannot assign to operator +SyntaxError: cannot assign to expression here. Maybe you meant '==' instead of '='? >>> (x for x in x) = 1 Traceback (most recent call last): @@ -81,7 +81,7 @@ >>> 1 = 1 Traceback (most recent call last): -SyntaxError: cannot assign to literal +SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='? >>> "abc" = 1 Traceback (most recent call last): @@ -85,7 +85,7 @@ >>> "abc" = 1 Traceback (most recent call last): -SyntaxError: cannot assign to literal +SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='? >>> b"" = 1 Traceback (most recent call last): @@ -89,7 +89,7 @@ >>> b"" = 1 Traceback (most recent call last): -SyntaxError: cannot assign to literal +SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='? >>> ... = 1 Traceback (most recent call last): @@ -93,7 +93,7 @@ >>> ... = 1 Traceback (most recent call last): -SyntaxError: cannot assign to Ellipsis +SyntaxError: cannot assign to Ellipsis here. Maybe you meant '==' instead of '='? >>> `1` = 1 Traceback (most recent call last): @@ -126,7 +126,7 @@ >>> [a, b, c + 1] = [1, 2, 3] Traceback (most recent call last): -SyntaxError: cannot assign to operator +SyntaxError: cannot assign to expression >>> [a, b[1], c + 1] = [1, 2, 3] Traceback (most recent call last): @@ -130,7 +130,7 @@ >>> [a, b[1], c + 1] = [1, 2, 3] Traceback (most recent call last): -SyntaxError: cannot assign to operator +SyntaxError: cannot assign to expression >>> [a, b.c.d, c + 1] = [1, 2, 3] Traceback (most recent call last): @@ -134,7 +134,7 @@ >>> [a, b.c.d, c + 1] = [1, 2, 3] Traceback (most recent call last): -SyntaxError: cannot assign to operator +SyntaxError: cannot assign to expression >>> a if 1 else b = 1 Traceback (most recent call last): @@ -181,7 +181,7 @@ >>> for (*a, b, c+1) in b: pass Traceback (most recent call last): -SyntaxError: cannot assign to operator +SyntaxError: cannot assign to expression >>> for (x, *(y, z.d())) in b: pass Traceback (most recent call last): @@ -193,7 +193,7 @@ >>> for a, b, (c + 1, d()): pass Traceback (most recent call last): -SyntaxError: cannot assign to operator +SyntaxError: cannot assign to expression >>> for i < (): pass Traceback (most recent call last): @@ -217,7 +217,7 @@ >>> with a as (*b, c, d+1): pass Traceback (most recent call last): -SyntaxError: cannot assign to operator +SyntaxError: cannot assign to expression >>> with a as (x, *(y, z.d())): pass Traceback (most recent call last): @@ -465,7 +465,7 @@ # SyntaxError: expression cannot contain assignment, perhaps you meant "=="? # >>> f(True=2) # Traceback (most recent call last): -# SyntaxError: cannot assign to True +# SyntaxError: cannot assign to True here. Maybe you meant '==' instead of '='? >>> f(__debug__=1) Traceback (most recent call last): SyntaxError: cannot assign to __debug__ @@ -684,7 +684,7 @@ ... pass Traceback (most recent call last): ... - SyntaxError: cannot assign to function call + SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='? >>> if 1: ... pass @@ -692,7 +692,7 @@ ... x() = 1 Traceback (most recent call last): ... - SyntaxError: cannot assign to function call + SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='? >>> if 1: ... x() = 1 @@ -702,7 +702,7 @@ ... pass Traceback (most recent call last): ... - SyntaxError: cannot assign to function call + SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='? >>> if 1: ... pass @@ -712,7 +712,7 @@ ... pass Traceback (most recent call last): ... - SyntaxError: cannot assign to function call + SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='? >>> if 1: ... pass @@ -722,7 +722,7 @@ ... x() = 1 Traceback (most recent call last): ... - SyntaxError: cannot assign to function call + SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='? Missing ':' before suites: @@ -843,6 +843,43 @@ Traceback (most recent call last): SyntaxError: expected ':' + >>> if x = 3: + ... pass + Traceback (most recent call last): + SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='? + + >>> while x = 3: + ... pass + Traceback (most recent call last): + SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='? + + >>> if x.a = 3: + ... pass + Traceback (most recent call last): + SyntaxError: cannot assign to attribute here. Maybe you meant '==' instead of '='? + + >>> while x.a = 3: + ... pass + Traceback (most recent call last): + SyntaxError: cannot assign to attribute here. Maybe you meant '==' instead of '='? + +Ensure that early = are not matched by the parser as invalid comparisons + >>> f(2, 4, x=34); {1,2 a} + Traceback (most recent call last): + SyntaxError: invalid syntax + + >>> dict(x=34); x $ y + Traceback (most recent call last): + SyntaxError: invalid syntax + + >>> dict(x=34, (x for x in range 10), 1); x $ y + Traceback (most recent call last): + SyntaxError: invalid syntax + + >>> dict(x=34, x=1, y=2); x $ y + Traceback (most recent call last): + SyntaxError: invalid syntax + Make sure that the old "raise X, Y[, Z]" form is gone: >>> raise X, Y Traceback (most recent call last): @@ -894,7 +931,7 @@ >>> {1, 2, 3} = 42 Traceback (most recent call last): -SyntaxError: cannot assign to set display +SyntaxError: cannot assign to set display here. Maybe you meant '==' instead of '='? >>> {1: 2, 3: 4} = 42 Traceback (most recent call last): @@ -898,7 +935,7 @@ >>> {1: 2, 3: 4} = 42 Traceback (most recent call last): -SyntaxError: cannot assign to dict display +SyntaxError: cannot assign to dict literal here. Maybe you meant '==' instead of '='? >>> f'{x}' = 42 Traceback (most recent call last): @@ -902,7 +939,7 @@ >>> f'{x}' = 42 Traceback (most recent call last): -SyntaxError: cannot assign to f-string expression +SyntaxError: cannot assign to f-string expression here. Maybe you meant '==' instead of '='? >>> f'{x}-{y}' = 42 Traceback (most recent call last): @@ -906,7 +943,7 @@ >>> f'{x}-{y}' = 42 Traceback (most recent call last): -SyntaxError: cannot assign to f-string expression +SyntaxError: cannot assign to f-string expression here. Maybe you meant '==' instead of '='? >>> from t import x, Traceback (most recent call last): @@ -1000,31 +1037,31 @@ def test_assign_del(self): self._check_error("del (,)", "invalid syntax") - self._check_error("del 1", "delete literal") - self._check_error("del (1, 2)", "delete literal") - self._check_error("del None", "delete None") - self._check_error("del *x", "delete starred") - self._check_error("del (*x)", "use starred expression") - self._check_error("del (*x,)", "delete starred") - self._check_error("del [*x,]", "delete starred") - self._check_error("del f()", "delete function call") - self._check_error("del f(a, b)", "delete function call") - self._check_error("del o.f()", "delete function call") - self._check_error("del a[0]()", "delete function call") - self._check_error("del x, f()", "delete function call") - self._check_error("del f(), x", "delete function call") - self._check_error("del [a, b, ((c), (d,), e.f())]", "delete function call") - self._check_error("del (a if True else b)", "delete conditional") - self._check_error("del +a", "delete operator") - self._check_error("del a, +b", "delete operator") - self._check_error("del a + b", "delete operator") - self._check_error("del (a + b, c)", "delete operator") - self._check_error("del (c[0], a + b)", "delete operator") - self._check_error("del a.b.c + 2", "delete operator") - self._check_error("del a.b.c[0] + 2", "delete operator") - self._check_error("del (a, b, (c, d.e.f + 2))", "delete operator") - self._check_error("del [a, b, (c, d.e.f[0] + 2)]", "delete operator") - self._check_error("del (a := 5)", "delete named expression") + self._check_error("del 1", "cannot delete literal") + self._check_error("del (1, 2)", "cannot delete literal") + self._check_error("del None", "cannot delete None") + self._check_error("del *x", "cannot delete starred") + self._check_error("del (*x)", "cannot use starred expression") + self._check_error("del (*x,)", "cannot delete starred") + self._check_error("del [*x,]", "cannot delete starred") + self._check_error("del f()", "cannot delete function call") + self._check_error("del f(a, b)", "cannot delete function call") + self._check_error("del o.f()", "cannot delete function call") + self._check_error("del a[0]()", "cannot delete function call") + self._check_error("del x, f()", "cannot delete function call") + self._check_error("del f(), x", "cannot delete function call") + self._check_error("del [a, b, ((c), (d,), e.f())]", "cannot delete function call") + self._check_error("del (a if True else b)", "cannot delete conditional") + self._check_error("del +a", "cannot delete expression") + self._check_error("del a, +b", "cannot delete expression") + self._check_error("del a + b", "cannot delete expression") + self._check_error("del (a + b, c)", "cannot delete expression") + self._check_error("del (c[0], a + b)", "cannot delete expression") + self._check_error("del a.b.c + 2", "cannot delete expression") + self._check_error("del a.b.c[0] + 2", "cannot delete expression") + self._check_error("del (a, b, (c, d.e.f + 2))", "cannot delete expression") + self._check_error("del [a, b, (c, d.e.f[0] + 2)]", "cannot delete expression") + self._check_error("del (a := 5)", "cannot delete named expression") # We don't have a special message for this, but make sure we don't # report "cannot delete name" self._check_error("del a += b", "invalid syntax") @@ -1162,6 +1199,11 @@ """ self._check_error(code, "expected ':'") + def test_invalid_line_continuation_error_position(self): + self._check_error(r"a = 3 \ 4", + "unexpected character after line continuation character", + lineno=1, offset=9) + def test_invalid_line_continuation_left_recursive(self): # Check bpo-42218: SyntaxErrors following left-recursive rules # (t_primary_raw in this case) need to be tested explicitly diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF9zeXMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF9zeXMucHk= 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -591,7 +591,8 @@ "inspect", "interactive", "optimize", "dont_write_bytecode", "no_user_site", "no_site", "ignore_environment", "verbose", "bytes_warning", "quiet", - "hash_randomization", "isolated", "dev_mode", "utf8_mode") + "hash_randomization", "isolated", "dev_mode", "utf8_mode", + "warn_default_encoding") for attr in attrs: self.assertTrue(hasattr(sys.flags, attr), attr) attr_type = bool if attr == "dev_mode" else int @@ -1511,6 +1512,21 @@ self.assertIsNone(cur.firstiter) self.assertIsNone(cur.finalizer) + def test_changing_sys_stderr_and_removing_reference(self): + # If the default displayhook doesn't take a strong reference + # to sys.stderr the following code can crash. See bpo-43660 + # for more details. + code = textwrap.dedent(''' + import sys + class MyStderr: + def write(self, s): + sys.stderr = None + sys.stderr = MyStderr() + 1/0 + ''') + rc, out, err = assert_python_failure('-c', code) + self.assertEqual(out, b"") + self.assertEqual(err, b"") if __name__ == "__main__": unittest.main() diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF90ZWxuZXRsaWIucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF90ZWxuZXRsaWIucHk= 100644 --- a/Lib/test/test_telnetlib.py +++ b/Lib/test/test_telnetlib.py @@ -29,7 +29,7 @@ self.sock.settimeout(60) # Safety net. Look issue 11812 self.port = socket_helper.bind_port(self.sock) self.thread = threading.Thread(target=server, args=(self.evt,self.sock)) - self.thread.setDaemon(True) + self.thread.daemon = True self.thread.start() self.evt.wait() diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF90aHJlYWRpbmcucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF90aHJlYWRpbmcucHk= 100644 --- a/Lib/test/test_threading.py +++ b/Lib/test/test_threading.py @@ -154,5 +154,5 @@ def test_ident_of_no_threading_threads(self): # The ident still must work for the main thread and dummy threads. - self.assertIsNotNone(threading.currentThread().ident) + self.assertIsNotNone(threading.current_thread().ident) def f(): @@ -158,5 +158,5 @@ def f(): - ident.append(threading.currentThread().ident) + ident.append(threading.current_thread().ident) done.set() done = threading.Event() ident = [] @@ -447,8 +447,17 @@ # Just a quick sanity check to make sure the old method names are # still present t = threading.Thread() - t.isDaemon() - t.setDaemon(True) - t.getName() - t.setName("name") + with self.assertWarnsRegex(DeprecationWarning, + r'get the daemon attribute'): + t.isDaemon() + with self.assertWarnsRegex(DeprecationWarning, + r'set the daemon attribute'): + t.setDaemon(True) + with self.assertWarnsRegex(DeprecationWarning, + r'get the name attribute'): + t.getName() + with self.assertWarnsRegex(DeprecationWarning, + r'set the name attribute'): + t.setName("name") + e = threading.Event() @@ -454,6 +463,16 @@ e = threading.Event() - e.isSet() - threading.activeCount() + with self.assertWarnsRegex(DeprecationWarning, 'use is_set()'): + e.isSet() + + cond = threading.Condition() + cond.acquire() + with self.assertWarnsRegex(DeprecationWarning, 'use notify_all()'): + cond.notifyAll() + + with self.assertWarnsRegex(DeprecationWarning, 'use active_count()'): + threading.activeCount() + with self.assertWarnsRegex(DeprecationWarning, 'use current_thread()'): + threading.currentThread() def test_repr_daemon(self): t = threading.Thread() diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF90eXBpbmcucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF90eXBpbmcucHk= 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -25,7 +25,7 @@ from typing import Pattern, Match from typing import Annotated, ForwardRef from typing import TypeAlias -from typing import ParamSpec, Concatenate +from typing import ParamSpec, Concatenate, ParamSpecArgs, ParamSpecKwargs import abc import typing import weakref @@ -186,6 +186,16 @@ self.assertEqual(Union[X, int].__parameters__, (X,)) self.assertIs(Union[X, int].__origin__, Union) + def test_or(self): + X = TypeVar('X') + # use a string because str doesn't implement + # __or__/__ror__ itself + self.assertEqual(X | "x", Union[X, "x"]) + self.assertEqual("x" | X, Union["x", X]) + # make sure the order is correct + self.assertEqual(get_args(X | "x"), (X, ForwardRef("x"))) + self.assertEqual(get_args("x" | X), (ForwardRef("x"), X)) + def test_union_constrained(self): A = TypeVar('A', str, bytes) self.assertNotEqual(Union[A, str], Union[A]) @@ -2257,6 +2267,12 @@ with self.assertRaises(TypeError): issubclass(int, ClassVar) + def test_bad_module(self): + # bpo-41515 + class BadModule: + pass + BadModule.__module__ = 'bad' # Something not in sys.modules + self.assertEqual(get_type_hints(BadModule), {}) class FinalTests(BaseTestCase): @@ -2864,7 +2880,7 @@ {'x': int, 'y': int}) self.assertEqual(gth(mod_generics_cache.B), {'my_inner_a1': mod_generics_cache.B.A, - 'my_inner_a2': mod_generics_cache.A, + 'my_inner_a2': mod_generics_cache.B.A, 'my_outer_a': mod_generics_cache.A}) def test_respect_no_type_check(self): @@ -3000,7 +3016,14 @@ {'other': MySet[T], 'return': MySet[T]} ) + def test_get_type_hints_classes(self): + class Foo: + y = str + x: y + # This previously raised an error under PEP 563. + self.assertEqual(get_type_hints(Foo), {'x': str}) + class GetUtilitiesTestCase(TestCase): def test_get_origin(self): T = TypeVar('T') @@ -3003,7 +3026,8 @@ class GetUtilitiesTestCase(TestCase): def test_get_origin(self): T = TypeVar('T') + P = ParamSpec('P') class C(Generic[T]): pass self.assertIs(get_origin(C[int]), C) self.assertIs(get_origin(C[T]), C) @@ -3022,6 +3046,8 @@ self.assertIs(get_origin(list[int]), list) self.assertIs(get_origin(list), None) self.assertIs(get_origin(list | str), types.Union) + self.assertIs(get_origin(P.args), P) + self.assertIs(get_origin(P.kwargs), P) def test_get_args(self): T = TypeVar('T') @@ -4265,6 +4291,7 @@ self.assertEqual(C4.__args__, (P, T)) self.assertEqual(C4.__parameters__, (P, T)) - # ParamSpec instances should also have args and kwargs attributes. + def test_args_kwargs(self): + P = ParamSpec('P') self.assertIn('args', dir(P)) self.assertIn('kwargs', dir(P)) @@ -4269,7 +4296,11 @@ self.assertIn('args', dir(P)) self.assertIn('kwargs', dir(P)) - P.args - P.kwargs + self.assertIsInstance(P.args, ParamSpecArgs) + self.assertIsInstance(P.kwargs, ParamSpecKwargs) + self.assertIs(P.args.__origin__, P) + self.assertIs(P.kwargs.__origin__, P) + self.assertEqual(repr(P.args), "P.args") + self.assertEqual(repr(P.kwargs), "P.kwargs") def test_user_generics(self): T = TypeVar("T") diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF91bmljb2RlLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF91bmljb2RlLnB5 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -1467,8 +1467,8 @@ ABC = 'abc' # Testing Unicode formatting strings... self.assertEqual("%s, %s" % (Str.ABC, Str.ABC), - 'Str.ABC, Str.ABC') + 'ABC, ABC') self.assertEqual("%s, %s, %d, %i, %u, %f, %5.2f" % (Str.ABC, Str.ABC, Int.IDES, Int.IDES, Int.IDES, Float.PI, Float.PI), @@ -1471,8 +1471,8 @@ self.assertEqual("%s, %s, %d, %i, %u, %f, %5.2f" % (Str.ABC, Str.ABC, Int.IDES, Int.IDES, Int.IDES, Float.PI, Float.PI), - 'Str.ABC, Str.ABC, 15, 15, 15, 3.141593, 3.14') + 'ABC, ABC, 15, 15, 15, 3.141593, 3.14') # formatting jobs delegated from the string implementation: self.assertEqual('...%(foo)s...' % {'foo':Str.ABC}, @@ -1476,5 +1476,5 @@ # formatting jobs delegated from the string implementation: self.assertEqual('...%(foo)s...' % {'foo':Str.ABC}, - '...Str.ABC...') + '...ABC...') self.assertEqual('...%(foo)s...' % {'foo':Int.IDES}, @@ -1480,5 +1480,5 @@ self.assertEqual('...%(foo)s...' % {'foo':Int.IDES}, - '...Int.IDES...') + '...IDES...') self.assertEqual('...%(foo)i...' % {'foo':Int.IDES}, '...15...') self.assertEqual('...%(foo)d...' % {'foo':Int.IDES}, diff --git a/Lib/test/test_unpack_ex.py b/Lib/test/test_unpack_ex.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF91bnBhY2tfZXgucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF91bnBhY2tfZXgucHk= 100644 --- a/Lib/test/test_unpack_ex.py +++ b/Lib/test/test_unpack_ex.py @@ -349,8 +349,8 @@ >>> (*x),y = 1, 2 # doctest:+ELLIPSIS Traceback (most recent call last): ... - SyntaxError: can't use starred expression here + SyntaxError: cannot use starred expression here >>> (((*x))),y = 1, 2 # doctest:+ELLIPSIS Traceback (most recent call last): ... @@ -353,9 +353,9 @@ >>> (((*x))),y = 1, 2 # doctest:+ELLIPSIS Traceback (most recent call last): ... - SyntaxError: can't use starred expression here + SyntaxError: cannot use starred expression here >>> z,(*x),y = 1, 2, 4 # doctest:+ELLIPSIS Traceback (most recent call last): ... @@ -358,9 +358,9 @@ >>> z,(*x),y = 1, 2, 4 # doctest:+ELLIPSIS Traceback (most recent call last): ... - SyntaxError: can't use starred expression here + SyntaxError: cannot use starred expression here >>> z,(*x) = 1, 2 # doctest:+ELLIPSIS Traceback (most recent call last): ... @@ -363,9 +363,9 @@ >>> z,(*x) = 1, 2 # doctest:+ELLIPSIS Traceback (most recent call last): ... - SyntaxError: can't use starred expression here + SyntaxError: cannot use starred expression here >>> ((*x),y) = 1, 2 # doctest:+ELLIPSIS Traceback (most recent call last): ... @@ -368,8 +368,8 @@ >>> ((*x),y) = 1, 2 # doctest:+ELLIPSIS Traceback (most recent call last): ... - SyntaxError: can't use starred expression here + SyntaxError: cannot use starred expression here Some size constraints (all fail.) diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF91cmxwYXJzZS5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF91cmxwYXJzZS5weQ== 100644 --- a/Lib/test/test_urlparse.py +++ b/Lib/test/test_urlparse.py @@ -893,6 +893,8 @@ with self.subTest(f"Original: {orig!r}, Expected: {expect!r}"): result = urllib.parse.parse_qs(orig, separator=';') self.assertEqual(result, expect, "Error parsing %r" % orig) + result_bytes = urllib.parse.parse_qs(orig, separator=b';') + self.assertEqual(result_bytes, expect, "Error parsing %r" % orig) def test_parse_qsl_separator(self): @@ -912,6 +914,8 @@ with self.subTest(f"Original: {orig!r}, Expected: {expect!r}"): result = urllib.parse.parse_qsl(orig, separator=';') self.assertEqual(result, expect, "Error parsing %r" % orig) + result_bytes = urllib.parse.parse_qsl(orig, separator=b';') + self.assertEqual(result_bytes, expect, "Error parsing %r" % orig) def test_urlencode_sequences(self): diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF93YXJuaW5ncy9fX2luaXRfXy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF93YXJuaW5ncy9fX2luaXRfXy5weQ== 100644 --- a/Lib/test/test_warnings/__init__.py +++ b/Lib/test/test_warnings/__init__.py @@ -935,6 +935,6 @@ def test_tracemalloc(self): self.addCleanup(os_helper.unlink, os_helper.TESTFN) - with open(os_helper.TESTFN, 'w') as fp: + with open(os_helper.TESTFN, 'w', encoding="utf-8") as fp: fp.write(textwrap.dedent(""" def func(): @@ -939,6 +939,6 @@ fp.write(textwrap.dedent(""" def func(): - f = open(__file__) + f = open(__file__, "rb") # Emit ResourceWarning f = None @@ -973,7 +973,7 @@ File "{filename}", lineno 7 func() File "{filename}", lineno 3 - f = open(__file__) + f = open(__file__, "rb") ''').strip() self.assertEqual(stderr, expected) diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF94bWxfZXRyZWUucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF94bWxfZXRyZWUucHk= 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -330,6 +330,9 @@ elem.extend([e]) self.serialize_check(elem, '<body><tag /><tag2 /></body>') elem.remove(e) + elem.extend(iter([e])) + self.serialize_check(elem, '<body><tag /><tag2 /></body>') + elem.remove(e) element = ET.Element("tag", key="value") self.serialize_check(element, '<tag key="value" />') # 1 diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3Rlc3QvdGVzdF94bWxycGMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3Rlc3QvdGVzdF94bWxycGMucHk= 100644 --- a/Lib/test/test_xmlrpc.py +++ b/Lib/test/test_xmlrpc.py @@ -698,8 +698,12 @@ #on AF_INET only. URL = "http://%s:%d"%(ADDR, PORT) serv.server_activate() - paths = ["/foo", "/foo/bar"] + paths = [ + "/foo", "/foo/bar", + "/foo?k=v", "/foo#frag", "/foo?k=v#frag", + "", "/", "/RPC2", "?k=v", "#frag", + ] for path in paths: d = serv.add_dispatcher(path, xmlrpc.server.SimpleXMLRPCDispatcher()) d.register_introspection_functions() d.register_multicall_functions() @@ -702,7 +706,8 @@ for path in paths: d = serv.add_dispatcher(path, xmlrpc.server.SimpleXMLRPCDispatcher()) d.register_introspection_functions() d.register_multicall_functions() + d.register_function(lambda p=path: p, 'test') serv.get_dispatcher(paths[0]).register_function(pow) serv.get_dispatcher(paths[1]).register_function(lambda x,y: x+y, 'add') serv.add_dispatcher("/is/broken", BrokenDispatcher()) @@ -1018,6 +1023,39 @@ p = xmlrpclib.ServerProxy(URL+"/is/broken") self.assertRaises(xmlrpclib.Fault, p.add, 6, 8) + def test_invalid_path(self): + p = xmlrpclib.ServerProxy(URL+"/invalid") + self.assertRaises(xmlrpclib.Fault, p.add, 6, 8) + + def test_path_query_fragment(self): + p = xmlrpclib.ServerProxy(URL+"/foo?k=v#frag") + self.assertEqual(p.test(), "/foo?k=v#frag") + + def test_path_fragment(self): + p = xmlrpclib.ServerProxy(URL+"/foo#frag") + self.assertEqual(p.test(), "/foo#frag") + + def test_path_query(self): + p = xmlrpclib.ServerProxy(URL+"/foo?k=v") + self.assertEqual(p.test(), "/foo?k=v") + + def test_empty_path(self): + p = xmlrpclib.ServerProxy(URL) + self.assertEqual(p.test(), "/RPC2") + + def test_root_path(self): + p = xmlrpclib.ServerProxy(URL + "/") + self.assertEqual(p.test(), "/") + + def test_empty_path_query(self): + p = xmlrpclib.ServerProxy(URL + "?k=v") + self.assertEqual(p.test(), "?k=v") + + def test_empty_path_fragment(self): + p = xmlrpclib.ServerProxy(URL + "#frag") + self.assertEqual(p.test(), "#frag") + + #A test case that verifies that a server using the HTTP/1.1 keep-alive mechanism #does indeed serve subsequent requests on the same connection class BaseKeepaliveServerTestCase(BaseServerTestCase): diff --git a/Lib/threading.py b/Lib/threading.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3RocmVhZGluZy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3RocmVhZGluZy5weQ== 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -388,7 +388,16 @@ """ self.notify(len(self._waiters)) - notifyAll = notify_all + def notifyAll(self): + """Wake up all threads waiting on this condition. + + This method is deprecated, use notify_all() instead. + + """ + import warnings + warnings.warn('notifyAll() is deprecated, use notify_all() instead', + DeprecationWarning, stacklevel=2) + self.notify_all() class Semaphore: @@ -538,7 +547,16 @@ """Return true if and only if the internal flag is true.""" return self._flag - isSet = is_set + def isSet(self): + """Return true if and only if the internal flag is true. + + This method is deprecated, use notify_all() instead. + + """ + import warnings + warnings.warn('isSet() is deprecated, use is_set() instead', + DeprecationWarning, stacklevel=2) + return self.is_set() def set(self): """Set the internal flag to true. @@ -1146,6 +1164,14 @@ self._daemonic = daemonic def isDaemon(self): + """Return whether this thread is a daemon. + + This method is deprecated, use the daemon attribute instead. + + """ + import warnings + warnings.warn('isDaemon() is deprecated, get the daemon attribute instead', + DeprecationWarning, stacklevel=2) return self.daemon def setDaemon(self, daemonic): @@ -1149,6 +1175,14 @@ return self.daemon def setDaemon(self, daemonic): + """Set whether this thread is a daemon. + + This method is deprecated, use the .daemon property instead. + + """ + import warnings + warnings.warn('setDaemon() is deprecated, set the daemon attribute instead', + DeprecationWarning, stacklevel=2) self.daemon = daemonic def getName(self): @@ -1152,6 +1186,14 @@ self.daemon = daemonic def getName(self): + """Return a string used for identification purposes only. + + This method is deprecated, use the name attribute instead. + + """ + import warnings + warnings.warn('getName() is deprecated, get the name attribute instead', + DeprecationWarning, stacklevel=2) return self.name def setName(self, name): @@ -1155,6 +1197,14 @@ return self.name def setName(self, name): + """Set the name string for this thread. + + This method is deprecated, use the name attribute instead. + + """ + import warnings + warnings.warn('setName() is deprecated, set the name attribute instead', + DeprecationWarning, stacklevel=2) self.name = name @@ -1349,7 +1399,16 @@ except KeyError: return _DummyThread() -currentThread = current_thread +def currentThread(): + """Return the current Thread object, corresponding to the caller's thread of control. + + This function is deprecated, use current_thread() instead. + + """ + import warnings + warnings.warn('currentThread() is deprecated, use current_thread() instead', + DeprecationWarning, stacklevel=2) + return current_thread() def active_count(): """Return the number of Thread objects currently alive. @@ -1361,7 +1420,16 @@ with _active_limbo_lock: return len(_active) + len(_limbo) -activeCount = active_count +def activeCount(): + """Return the number of Thread objects currently alive. + + This function is deprecated, use active_count() instead. + + """ + import warnings + warnings.warn('activeCount() is deprecated, use active_count() instead', + DeprecationWarning, stacklevel=2) + return active_count() def _enumerate(): # Same as enumerate(), but without the lock. Internal use only. diff --git a/Lib/turtledemo/two_canvases.py b/Lib/turtledemo/two_canvases.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3R1cnRsZWRlbW8vdHdvX2NhbnZhc2VzLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3R1cnRsZWRlbW8vdHdvX2NhbnZhc2VzLnB5 100644 --- a/Lib/turtledemo/two_canvases.py +++ b/Lib/turtledemo/two_canvases.py @@ -1,7 +1,7 @@ """turtledemo.two_canvases Use TurtleScreen and RawTurtle to draw on two -distinct canvases in a separate windows. The +distinct canvases in a separate window. The new window must be separately closed in addition to pressing the STOP button. """ diff --git a/Lib/typing.py b/Lib/typing.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3R5cGluZy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3R5cGluZy5weQ== 100644 --- a/Lib/typing.py +++ b/Lib/typing.py @@ -114,6 +114,8 @@ 'no_type_check_decorator', 'NoReturn', 'overload', + 'ParamSpecArgs', + 'ParamSpecKwargs', 'runtime_checkable', 'Text', 'TYPE_CHECKING', @@ -646,8 +648,8 @@ def __or__(self, right): return Union[self, right] - def __ror__(self, right): - return Union[self, right] + def __ror__(self, left): + return Union[left, self] def __repr__(self): if self.__covariant__: @@ -727,6 +729,44 @@ self.__module__ = def_mod +class ParamSpecArgs(_Final, _Immutable, _root=True): + """The args for a ParamSpec object. + + Given a ParamSpec object P, P.args is an instance of ParamSpecArgs. + + ParamSpecArgs objects have a reference back to their ParamSpec: + + P.args.__origin__ is P + + This type is meant for runtime introspection and has no special meaning to + static type checkers. + """ + def __init__(self, origin): + self.__origin__ = origin + + def __repr__(self): + return f"{self.__origin__.__name__}.args" + + +class ParamSpecKwargs(_Final, _Immutable, _root=True): + """The kwargs for a ParamSpec object. + + Given a ParamSpec object P, P.kwargs is an instance of ParamSpecKwargs. + + ParamSpecKwargs objects have a reference back to their ParamSpec: + + P.kwargs.__origin__ is P + + This type is meant for runtime introspection and has no special meaning to + static type checkers. + """ + def __init__(self, origin): + self.__origin__ = origin + + def __repr__(self): + return f"{self.__origin__.__name__}.kwargs" + + class ParamSpec(_Final, _Immutable, _TypeVarLike, _root=True): """Parameter specification variable. @@ -776,8 +816,13 @@ __slots__ = ('__name__', '__bound__', '__covariant__', '__contravariant__', '__dict__') - args = object() - kwargs = object() + @property + def args(self): + return ParamSpecArgs(self) + + @property + def kwargs(self): + return ParamSpecKwargs(self) def __init__(self, name, *, bound=None, covariant=False, contravariant=False): self.__name__ = name @@ -1583,7 +1628,10 @@ hints = {} for base in reversed(obj.__mro__): if globalns is None: - base_globals = sys.modules[base.__module__].__dict__ + try: + base_globals = sys.modules[base.__module__].__dict__ + except KeyError: + continue else: base_globals = globalns ann = base.__dict__.get('__annotations__', {}) @@ -1587,8 +1635,9 @@ else: base_globals = globalns ann = base.__dict__.get('__annotations__', {}) + base_locals = dict(vars(base)) if localns is None else localns for name, value in ann.items(): if value is None: value = type(None) if isinstance(value, str): value = ForwardRef(value, is_argument=False) @@ -1590,9 +1639,9 @@ for name, value in ann.items(): if value is None: value = type(None) if isinstance(value, str): value = ForwardRef(value, is_argument=False) - value = _eval_type(value, base_globals, localns) + value = _eval_type(value, base_globals, base_locals) hints[name] = value return hints if include_extras else {k: _strip_annotations(t) for k, t in hints.items()} @@ -1662,6 +1711,7 @@ get_origin(Generic[T]) is Generic get_origin(Union[T, int]) is Union get_origin(List[Tuple[T, T]][int]) == list + get_origin(P.args) is P """ if isinstance(tp, _AnnotatedAlias): return Annotated @@ -1665,7 +1715,8 @@ """ if isinstance(tp, _AnnotatedAlias): return Annotated - if isinstance(tp, (_BaseGenericAlias, GenericAlias)): + if isinstance(tp, (_BaseGenericAlias, GenericAlias, + ParamSpecArgs, ParamSpecKwargs)): return tp.__origin__ if tp is Generic: return Generic diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3VuaXR0ZXN0L21vY2sucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3VuaXR0ZXN0L21vY2sucHk= 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -36,6 +36,10 @@ from functools import wraps, partial +class InvalidSpecError(Exception): + """Indicates that an invalid value was used as a mock spec.""" + + _builtins = {name for name in dir(builtins) if not name.startswith('_')} FILTER_DIR = True @@ -653,10 +657,17 @@ self._mock_children[name] = result elif isinstance(result, _SpecState): - result = create_autospec( - result.spec, result.spec_set, result.instance, - result.parent, result.name - ) + try: + result = create_autospec( + result.spec, result.spec_set, result.instance, + result.parent, result.name + ) + except InvalidSpecError: + target_name = self.__dict__['_mock_name'] or self + raise InvalidSpecError( + f'Cannot autospec attr {name!r} from target ' + f'{target_name!r} as it has already been mocked out. ' + f'[target={self!r}, attr={result.spec!r}]') self._mock_children[name] = result return result @@ -1273,6 +1284,14 @@ ) if not unsafe: _check_spec_arg_typos(kwargs) + if _is_instance_mock(spec): + raise InvalidSpecError( + f'Cannot spec attr {attribute!r} as the spec ' + f'has already been mocked out. [spec={spec!r}]') + if _is_instance_mock(spec_set): + raise InvalidSpecError( + f'Cannot spec attr {attribute!r} as the spec_set ' + f'target has already been mocked out. [spec_set={spec_set!r}]') self.getter = getter self.attribute = attribute @@ -1500,6 +1519,18 @@ if autospec is True: autospec = original + if _is_instance_mock(self.target): + raise InvalidSpecError( + f'Cannot autospec attr {self.attribute!r} as the patch ' + f'target has already been mocked out. ' + f'[target={self.target!r}, attr={autospec!r}]') + if _is_instance_mock(autospec): + target_name = getattr(self.target, '__name__', self.target) + raise InvalidSpecError( + f'Cannot autospec attr {self.attribute!r} from target ' + f'{target_name!r} as it has already been mocked out. ' + f'[target={self.target!r}, attr={autospec!r}]') + new = create_autospec(autospec, spec_set=spec_set, _name=self.attribute, **kwargs) elif kwargs: @@ -2613,6 +2644,9 @@ spec = type(spec) is_type = isinstance(spec, type) + if _is_instance_mock(spec): + raise InvalidSpecError(f'Cannot autospec a Mock object. ' + f'[object={spec!r}]') is_async_func = _is_async_func(spec) _kwargs = {'spec': spec} if spec_set: diff --git a/Lib/unittest/test/testmock/testasync.py b/Lib/unittest/test/testmock/testasync.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3VuaXR0ZXN0L3Rlc3QvdGVzdG1vY2svdGVzdGFzeW5jLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3VuaXR0ZXN0L3Rlc3QvdGVzdG1vY2svdGVzdGFzeW5jLnB5 100644 --- a/Lib/unittest/test/testmock/testasync.py +++ b/Lib/unittest/test/testmock/testasync.py @@ -199,4 +199,5 @@ with self.assertRaises(RuntimeError): create_autospec(async_func, instance=True) + @unittest.skip('Broken test from https://bugs.python.org/issue37251') def test_create_autospec_awaitable_class(self): @@ -202,6 +203,5 @@ def test_create_autospec_awaitable_class(self): - awaitable_mock = create_autospec(spec=AwaitableClass()) - self.assertIsInstance(create_autospec(awaitable_mock), AsyncMock) + self.assertIsInstance(create_autospec(AwaitableClass), AsyncMock) def test_create_autospec(self): spec = create_autospec(async_func_args) diff --git a/Lib/unittest/test/testmock/testmock.py b/Lib/unittest/test/testmock/testmock.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3VuaXR0ZXN0L3Rlc3QvdGVzdG1vY2svdGVzdG1vY2sucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3VuaXR0ZXN0L3Rlc3QvdGVzdG1vY2svdGVzdG1vY2sucHk= 100644 --- a/Lib/unittest/test/testmock/testmock.py +++ b/Lib/unittest/test/testmock/testmock.py @@ -11,7 +11,7 @@ call, DEFAULT, patch, sentinel, MagicMock, Mock, NonCallableMock, NonCallableMagicMock, AsyncMock, _Call, _CallList, - create_autospec + create_autospec, InvalidSpecError ) @@ -205,6 +205,28 @@ self.assertRaisesRegex(ValueError, 'Bazinga!', mock) + def test_autospec_mock(self): + class A(object): + class B(object): + C = None + + with mock.patch.object(A, 'B'): + with self.assertRaisesRegex(InvalidSpecError, + "Cannot autospec attr 'B' from target <MagicMock spec='A'"): + create_autospec(A).B + with self.assertRaisesRegex(InvalidSpecError, + "Cannot autospec attr 'B' from target 'A'"): + mock.patch.object(A, 'B', autospec=True).start() + with self.assertRaisesRegex(InvalidSpecError, + "Cannot autospec attr 'C' as the patch target "): + mock.patch.object(A.B, 'C', autospec=True).start() + with self.assertRaisesRegex(InvalidSpecError, + "Cannot spec attr 'B' as the spec "): + mock.patch.object(A, 'B', spec=A.B).start() + with self.assertRaisesRegex(InvalidSpecError, + "Cannot spec attr 'B' as the spec_set "): + mock.patch.object(A, 'B', spec_set=A.B).start() + def test_reset_mock(self): parent = Mock() spec = ["something"] @@ -2177,7 +2199,7 @@ self.obj_with_bool_func = unittest.mock.MagicMock() obj = Something() - with unittest.mock.patch.object(obj, 'obj_with_bool_func', autospec=True): pass + with unittest.mock.patch.object(obj, 'obj_with_bool_func', spec=object): pass self.assertEqual(obj.obj_with_bool_func.__bool__.call_count, 0) diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3VybGxpYi9wYXJzZS5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3VybGxpYi9wYXJzZS5weQ== 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -733,6 +733,7 @@ Returns a list, as G-d intended. """ qs, _coerce_result = _coerce_args(qs) + separator, _ = _coerce_args(separator) if not separator or (not isinstance(separator, (str, bytes))): raise ValueError("Separator must be of type string or bytes.") diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3VybGxpYi9yZXF1ZXN0LnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3VybGxpYi9yZXF1ZXN0LnB5 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -945,7 +945,7 @@ # (single quotes are a violation of the RFC, but appear in the wild) rx = re.compile('(?:^|,)' # start of the string or ',' '[ \t]*' # optional whitespaces - '([^ \t]+)' # scheme like "Basic" + '([^ \t,]+)' # scheme like "Basic" '[ \t]+' # mandatory whitespaces # realm=xxx # realm='xxx' diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3htbC9ldHJlZS9FbGVtZW50VHJlZS5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3htbC9ldHJlZS9FbGVtZW50VHJlZS5weQ== 100644 --- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -252,7 +252,7 @@ """ for element in elements: self._assert_is_element(element) - self._children.extend(elements) + self._children.append(element) def insert(self, index, subelement): """Insert *subelement* at position *index*.""" diff --git a/Lib/xmlrpc/client.py b/Lib/xmlrpc/client.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3htbHJwYy9jbGllbnQucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3htbHJwYy9jbGllbnQucHk= 100644 --- a/Lib/xmlrpc/client.py +++ b/Lib/xmlrpc/client.py @@ -1421,7 +1421,7 @@ # establish a "logical" server connection # get the url - p = urllib.parse.urlparse(uri) + p = urllib.parse.urlsplit(uri) if p.scheme not in ("http", "https"): raise OSError("unsupported XML-RPC protocol") self.__host = p.netloc @@ -1425,7 +1425,9 @@ if p.scheme not in ("http", "https"): raise OSError("unsupported XML-RPC protocol") self.__host = p.netloc - self.__handler = p.path or "/RPC2" + self.__handler = urllib.parse.urlunsplit(["", "", *p[2:]]) + if not self.__handler: + self.__handler = "/RPC2" if transport is None: if p.scheme == "https": diff --git a/Lib/zipimport.py b/Lib/zipimport.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TGliL3ppcGltcG9ydC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TGliL3ppcGltcG9ydC5weQ== 100644 --- a/Lib/zipimport.py +++ b/Lib/zipimport.py @@ -119,6 +119,9 @@ Deprecated since Python 3.10. Use find_spec() instead. """ + _warnings.warn("zipimporter.find_loader() is deprecated and slated for " + "removal in Python 3.12; use find_spec() instead", + DeprecationWarning) mi = _get_module_info(self, fullname) if mi is not None: # This is a module or package. @@ -152,6 +155,9 @@ Deprecated since Python 3.10. Use find_spec() instead. """ + _warnings.warn("zipimporter.find_module() is deprecated and slated for " + "removal in Python 3.12; use find_spec() instead", + DeprecationWarning) return self.find_loader(fullname, path)[0] def find_spec(self, fullname, target=None): diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWFjL0J1aWxkU2NyaXB0L2J1aWxkLWluc3RhbGxlci5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWFjL0J1aWxkU2NyaXB0L2J1aWxkLWluc3RhbGxlci5weQ== 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -242,9 +242,9 @@ result.extend([ dict( - name="OpenSSL 1.1.1j", - url="https://www.openssl.org/source/openssl-1.1.1j.tar.gz", - checksum='cccaa064ed860a2b4d1303811bf5c682', + name="OpenSSL 1.1.1k", + url="https://www.openssl.org/source/openssl-1.1.1k.tar.gz", + checksum='c4e7d95f782b08116afa27b30393dd27', buildrecipe=build_universal_openssl, configure=None, install=None, diff --git a/Makefile.pre.in b/Makefile.pre.in index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWFrZWZpbGUucHJlLmlu..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWFrZWZpbGUucHJlLmlu 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -317,7 +317,7 @@ PEGEN_HEADERS= \ - $(srcdir)/Include/cpython/parser_interface.h \ + $(srcdir)/Include/internal/pycore_parser.h \ $(srcdir)/Parser/pegen.h \ $(srcdir)/Parser/string_parser.h @@ -387,6 +387,7 @@ Python/dtoa.o \ Python/formatter_unicode.o \ Python/fileutils.o \ + Python/suggestions.o \ Python/$(DYNLOADFILE) \ $(LIBOBJS) \ $(MACHDEP_OBJS) \ @@ -849,8 +850,11 @@ .PHONY=regen-ast regen-ast: - # Regenerate Include/Python-ast.h and Python/Python-ast.c using Parser/asdl_c.py + # Regenerate 3 files using using Parser/asdl_c.py: + # - Include/internal/pycore_ast.h + # - Include/internal/pycore_ast_state.h + # - Python/Python-ast.c $(MKDIR_P) $(srcdir)/Include $(MKDIR_P) $(srcdir)/Python $(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \ $(srcdir)/Parser/Python.asdl \ @@ -853,8 +857,8 @@ $(MKDIR_P) $(srcdir)/Include $(MKDIR_P) $(srcdir)/Python $(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \ $(srcdir)/Parser/Python.asdl \ - -H $(srcdir)/Include/Python-ast.h.new \ + -H $(srcdir)/Include/internal/pycore_ast.h.new \ -I $(srcdir)/Include/internal/pycore_ast_state.h.new \ -C $(srcdir)/Python/Python-ast.c.new @@ -858,7 +862,7 @@ -I $(srcdir)/Include/internal/pycore_ast_state.h.new \ -C $(srcdir)/Python/Python-ast.c.new - $(UPDATE_FILE) $(srcdir)/Include/Python-ast.h $(srcdir)/Include/Python-ast.h.new + $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast.h $(srcdir)/Include/internal/pycore_ast.h.new $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_ast_state.h $(srcdir)/Include/internal/pycore_ast_state.h.new $(UPDATE_FILE) $(srcdir)/Python/Python-ast.c $(srcdir)/Python/Python-ast.c.new @@ -922,7 +926,7 @@ > $(srcdir)/Python/stdlib_module_names.h.new $(UPDATE_FILE) $(srcdir)/Python/stdlib_module_names.h $(srcdir)/Python/stdlib_module_names.h.new -Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o: $(srcdir)/Include/Python-ast.h +Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o: $(srcdir)/Include/internal/pycore_ast.h Python/getplatform.o: $(srcdir)/Python/getplatform.c $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c @@ -1020,8 +1024,6 @@ PYTHON_HEADERS= \ $(srcdir)/Include/Python.h \ $(srcdir)/Include/abstract.h \ - $(srcdir)/Include/asdl.h \ - $(srcdir)/Include/ast.h \ $(srcdir)/Include/bltinmodule.h \ $(srcdir)/Include/boolobject.h \ $(srcdir)/Include/bytearrayobject.h \ @@ -1098,10 +1100,9 @@ \ pyconfig.h \ $(PARSER_HEADERS) \ - $(srcdir)/Include/Python-ast.h \ \ $(srcdir)/Include/cpython/abstract.h \ $(srcdir)/Include/cpython/bytearrayobject.h \ $(srcdir)/Include/cpython/bytesobject.h \ $(srcdir)/Include/cpython/ceval.h \ $(srcdir)/Include/cpython/code.h \ @@ -1102,9 +1103,10 @@ \ $(srcdir)/Include/cpython/abstract.h \ $(srcdir)/Include/cpython/bytearrayobject.h \ $(srcdir)/Include/cpython/bytesobject.h \ $(srcdir)/Include/cpython/ceval.h \ $(srcdir)/Include/cpython/code.h \ + $(srcdir)/Include/cpython/compile.h \ $(srcdir)/Include/cpython/dictobject.h \ $(srcdir)/Include/cpython/fileobject.h \ $(srcdir)/Include/cpython/fileutils.h \ @@ -1118,7 +1120,6 @@ $(srcdir)/Include/cpython/objimpl.h \ $(srcdir)/Include/cpython/odictobject.h \ $(srcdir)/Include/cpython/picklebufobject.h \ - $(srcdir)/Include/cpython/pyarena.h \ $(srcdir)/Include/cpython/pyctype.h \ $(srcdir)/Include/cpython/pydebug.h \ $(srcdir)/Include/cpython/pyerrors.h \ @@ -1135,6 +1136,7 @@ \ $(srcdir)/Include/internal/pycore_abstract.h \ $(srcdir)/Include/internal/pycore_accu.h \ + $(srcdir)/Include/internal/pycore_asdl.h \ $(srcdir)/Include/internal/pycore_ast.h \ $(srcdir)/Include/internal/pycore_ast_state.h \ $(srcdir)/Include/internal/pycore_atomic.h \ @@ -1144,6 +1146,7 @@ $(srcdir)/Include/internal/pycore_call.h \ $(srcdir)/Include/internal/pycore_ceval.h \ $(srcdir)/Include/internal/pycore_code.h \ + $(srcdir)/Include/internal/pycore_compile.h \ $(srcdir)/Include/internal/pycore_condvar.h \ $(srcdir)/Include/internal/pycore_context.h \ $(srcdir)/Include/internal/pycore_dtoa.h \ @@ -1160,6 +1163,7 @@ $(srcdir)/Include/internal/pycore_long.h \ $(srcdir)/Include/internal/pycore_object.h \ $(srcdir)/Include/internal/pycore_pathconfig.h \ + $(srcdir)/Include/internal/pycore_pyarena.h \ $(srcdir)/Include/internal/pycore_pyerrors.h \ $(srcdir)/Include/internal/pycore_pyhash.h \ $(srcdir)/Include/internal/pycore_pylifecycle.h \ @@ -1488,6 +1492,8 @@ test/test_importlib/namespace_pkgs/project3 \ test/test_importlib/namespace_pkgs/project3/parent \ test/test_importlib/namespace_pkgs/project3/parent/child \ + test/test_importlib/namespacedata01 \ + test/test_importlib/partial \ test/test_importlib/source \ test/test_importlib/zipdata01 \ test/test_importlib/zipdata02 \ diff --git a/Misc/ACKS b/Misc/ACKS index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9BQ0tT..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9BQ0tT 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -33,6 +33,7 @@ Akira Yaniv Aknin Jyrki Alakuijala +Tatiana Al-Chueyr Steve Alexander Fred Allen Jeff Allen @@ -902,6 +903,7 @@ W. Trevor King Jeffrey Kintscher Paul Kippes +Sergey B Kirpichev Steve Kirsch Sebastian Kirsche Kamil Kisiel @@ -1380,6 +1382,7 @@ Davin Potts Guillaume Pratte Florian Preinstorfer +Alex Prengère Amrit Prem Paul Prescod Donovan Preston diff --git a/Misc/NEWS.d/3.10.0a7.rst b/Misc/NEWS.d/3.10.0a7.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvMy4xMC4wYTcucnN0 --- /dev/null +++ b/Misc/NEWS.d/3.10.0a7.rst @@ -0,0 +1,983 @@ +.. bpo: 42988 +.. date: 2021-03-24-14-16-56 +.. nonce: P2aNco +.. release date: 2021-04-05 +.. section: Security + +CVE-2021-3426: Remove the ``getfile`` feature of the :mod:`pydoc` module +which could be abused to read arbitrary files on the disk (directory +traversal vulnerability). Moreover, even source code of Python modules can +contain sensitive data like passwords. Vulnerability reported by David +Schwörer. + +.. + +.. bpo: 43285 +.. date: 2021-03-13-03-48-14 +.. nonce: g-Hah3 +.. section: Security + +:mod:`ftplib` no longer trusts the IP address value returned from the server +in response to the PASV command by default. This prevents a malicious FTP +server from using the response to probe IPv4 address and port combinations +on the client network. + +Code that requires the former vulnerable behavior may set a +``trust_server_pasv_ipv4_address`` attribute on their :class:`ftplib.FTP` +instances to ``True`` to re-enable it. + +.. + +.. bpo: 43439 +.. date: 2021-03-08-23-06-07 +.. nonce: 5U3lXm +.. section: Security + +Add audit hooks for :func:`gc.get_objects`, :func:`gc.get_referrers` and +:func:`gc.get_referents`. Patch by Pablo Galindo. + +.. + +.. bpo: 27129 +.. date: 2021-04-03-22-04-46 +.. nonce: u_ehHb +.. section: Core and Builtins + +Update CPython bytecode magic number. + +.. + +.. bpo: 43672 +.. date: 2021-03-31-09-12-54 +.. nonce: jTT5uG +.. section: Core and Builtins + +Raise ImportWarning when calling find_loader(). + +.. + +.. bpo: 43660 +.. date: 2021-03-29-19-50-34 +.. nonce: scTgag +.. section: Core and Builtins + +Fix crash that happens when replacing ``sys.stderr`` with a callable that +can remove the object while an exception is being printed. Patch by Pablo +Galindo. + +.. + +.. bpo: 27129 +.. date: 2021-03-29-16-20-29 +.. nonce: BF03A5 +.. section: Core and Builtins + +The bytecode interpreter uses instruction, rather byte, offsets internally. +This reduces the number of EXTENDED_ARG instructions needed and streamlines +instruction dispatch a bit. + +.. + +.. bpo: 40645 +.. date: 2021-03-29-11-55-06 +.. nonce: PhaT-B +.. section: Core and Builtins + +Fix reference leak in the :mod:`_hashopenssl` extension. Patch by Pablo +Galindo. + +.. + +.. bpo: 42134 +.. date: 2021-03-26-17-30-19 +.. nonce: G4Sjxg +.. section: Core and Builtins + +Calls to find_module() by the import system now raise ImportWarning. + +.. + +.. bpo: 41064 +.. date: 2021-03-24-00-32-20 +.. nonce: _H0K_g +.. section: Core and Builtins + +Improve the syntax error for invalid usage of double starred elements ('**') +in f-strings. Patch by Pablo Galindo. + +.. + +.. bpo: 43575 +.. date: 2021-03-21-12-26-32 +.. nonce: pl-nSg +.. section: Core and Builtins + +Speed up calls to ``map()`` by using the :pep:`590` ``vectorcall`` calling +convention. Patch by Dong-hee Na. + +.. + +.. bpo: 42137 +.. date: 2021-03-20-19-54-47 +.. nonce: A8aQvj +.. section: Core and Builtins + +The import system now prefers using ``__spec__`` for ``ModuleType.__repr__`` +over ``module_repr()``. + +.. + +.. bpo: 43452 +.. date: 2021-03-20-01-21-37 +.. nonce: tDVJkc +.. section: Core and Builtins + +Added micro-optimizations to ``_PyType_Lookup()`` to improve cache lookup +performance in the common case of cache hits. + +.. + +.. bpo: 43555 +.. date: 2021-03-19-22-49-40 +.. nonce: ZmhYSA +.. section: Core and Builtins + +Report the column offset for :exc:`SyntaxError` for invalid line +continuation characters. Patch by Pablo Galindo. + +.. + +.. bpo: 43517 +.. date: 2021-03-16-17-12-54 +.. nonce: zAo6Ws +.. section: Core and Builtins + +Fix misdetection of circular imports when using ``from pkg.mod import +attr``, which caused false positives in non-trivial multi-threaded code. + +.. + +.. bpo: 43497 +.. date: 2021-03-15-07-50-30 +.. nonce: Uc5ZCJ +.. section: Core and Builtins + +Emit SyntaxWarnings for assertions with tuple constants, this is a +regression introduced in python3.7 + +.. + +.. bpo: 39316 +.. date: 2021-03-14-16-44-50 +.. nonce: Ns3a_F +.. section: Core and Builtins + +Tracing now has correct line numbers for attribute accesses when the the +attribute is on a different line from the object. Improves debugging and +profiling for multi-line method chains. + +.. + +.. bpo: 35883 +.. date: 2021-03-13-13-57-21 +.. nonce: UyGpdG +.. section: Core and Builtins + +Python no longer fails at startup with a fatal error if a command line +argument contains an invalid Unicode character. The +:c:func:`Py_DecodeLocale` function now escapes byte sequences which would be +decoded as Unicode characters outside the [U+0000; U+10ffff] range. + +.. + +.. bpo: 43410 +.. date: 2021-03-05-17-23-36 +.. nonce: lCzIg0 +.. section: Core and Builtins + +Fix a bug that was causing the parser to crash when emiting syntax errors +when reading input from stdin. Patch by Pablo Galindo + +.. + +.. bpo: 43406 +.. date: 2021-03-04-22-53-10 +.. nonce: Na_VpA +.. section: Core and Builtins + +Fix a possible race condition where ``PyErr_CheckSignals`` tries to execute +a non-Python signal handler. + +.. + +.. bpo: 42128 +.. date: 2021-03-03-19-04-23 +.. nonce: VouZjn +.. section: Core and Builtins + +Add ``__match_args__`` to :c:type:`structsequence` based classes. Patch by +Pablo Galindo. + +.. + +.. bpo: 43390 +.. date: 2021-03-03-17-58-49 +.. nonce: epPpwV +.. section: Core and Builtins + +CPython now sets the ``SA_ONSTACK`` flag in ``PyOS_setsig`` for the VM's +default signal handlers. This is friendlier to other in-process code that +an extension module or embedding use could pull in (such as Golang's cgo) +where tiny thread stacks are the norm and ``sigaltstack()`` has been used to +provide for signal handlers. This is a no-op change for the vast majority +of processes that don't use sigaltstack. + +.. + +.. bpo: 43287 +.. date: 2021-02-22-03-01-02 +.. nonce: aTs6fO +.. section: Core and Builtins + +Speed up calls to ``filter()`` by using the :pep:`590` ``vectorcall`` +calling convention. Patch by Dong-hee Na. + +.. + +.. bpo: 37448 +.. date: 2021-02-21-14-19-35 +.. nonce: btl7vO +.. section: Core and Builtins + +Add a radix tree based memory map to track in-use obmalloc arenas. Use to +replace the old implementation of address_in_range(). The radix tree +approach makes it easy to increase pool sizes beyond the OS page size. +Boosting the pool and arena size allows obmalloc to handle a significantly +higher percentage of requests from its ultra-fast paths. + +It also has the advantage of eliminating the memory unsanitary behavior of +the previous address_in_range(). The old address_in_range() was marked with +the annotations _Py_NO_SANITIZE_ADDRESS, _Py_NO_SANITIZE_THREAD, and +_Py_NO_SANITIZE_MEMORY. Those annotations are no longer needed. + +To disable the radix tree map, set a preprocessor flag as follows: +`-DWITH_PYMALLOC_RADIX_TREE=0`. + +Co-authored-by: Tim Peters <tim.peters@gmail.com> + +.. + +.. bpo: 29988 +.. date: 2020-02-03-13-23-10 +.. nonce: 8_UB5w +.. section: Core and Builtins + +Only handle asynchronous exceptions and requests to drop the GIL when +returning from a call or on the back edges of loops. Makes sure that +:meth:`__exit__` is always called in with statements, even for interrupts. + +.. + +.. bpo: 43720 +.. date: 2021-04-03-13-45-51 +.. nonce: FDZ5cZ +.. section: Library + +Document various stdlib deprecations in imp, pkgutil, and importlib.util for +removal in Python 3.12. + +.. + +.. bpo: 43433 +.. date: 2021-03-28-23-50-20 +.. nonce: so9j5G +.. section: Library + +:class:`xmlrpc.client.ServerProxy` no longer ignores query and fragment in +the URL of the server. + +.. + +.. bpo: 31956 +.. date: 2021-03-28-16-53-25 +.. nonce: Lt_67U +.. section: Library + +The :meth:`~array.array.index` method of :class:`array.array` now has +optional *start* and *stop* parameters. + +.. + +.. bpo: 40066 +.. date: 2021-03-25-21-26-30 +.. nonce: 7EBQ3_ +.. section: Library + +Enum: adjust ``repr()`` to show only enum and member name (not value, nor +angle brackets) and ``str()`` to show only member name. Update and improve +documentation to match. + +.. + +.. bpo: 42136 +.. date: 2021-03-25-08-44-26 +.. nonce: rRY9e1 +.. section: Library + +Deprecate all module_repr() methods found in importlib as their use is being +phased out by Python 3.12. + +.. + +.. bpo: 35930 +.. date: 2021-03-23-17-18-56 +.. nonce: RZ51pM +.. section: Library + +Raising an exception raised in a "future" instance will create reference +cycles. + +.. + +.. bpo: 41369 +.. date: 2021-03-21-17-50-42 +.. nonce: -fpmYZ +.. section: Library + +Finish updating the vendored libmpdec to version 2.5.1. Patch by Stefan +Krah. + +.. + +.. bpo: 43422 +.. date: 2021-03-21-17-02-52 +.. nonce: POk6cU +.. section: Library + +Revert the _decimal C API which was added in bpo-41324. + +.. + +.. bpo: 43577 +.. date: 2021-03-21-10-13-17 +.. nonce: m7JnAV +.. section: Library + +Fix deadlock when using :class:`ssl.SSLContext` debug callback with +:meth:`ssl.SSLContext.sni_callback`. + +.. + +.. bpo: 43571 +.. date: 2021-03-20-17-40-35 +.. nonce: acAL0W +.. section: Library + +It's now possible to create MPTCP sockets with IPPROTO_MPTCP + +.. + +.. bpo: 43542 +.. date: 2021-03-20-15-43-25 +.. nonce: 6bt2F6 +.. section: Library + +``image/heic`` and ``image/heif`` were added to :mod:`mimetypes`. + +.. + +.. bpo: 40645 +.. date: 2021-03-19-10-22-17 +.. nonce: 5pXhb- +.. section: Library + +The :mod:`hmac` module now uses OpenSSL's HMAC implementation when digestmod +argument is a hash name or builtin hash function. + +.. + +.. bpo: 43510 +.. date: 2021-03-16-17-20-33 +.. nonce: -BeQH_ +.. section: Library + +Implement :pep:`597`: Add ``EncodingWarning`` warning, ``-X +warn_default_encoding`` option, :envvar:`PYTHONWARNDEFAULTENCODING` +environment variable and ``encoding="locale"`` argument value. + +.. + +.. bpo: 43521 +.. date: 2021-03-16-16-05-02 +.. nonce: mRT6fh +.. section: Library + +``ast.unparse`` can now render NaNs and empty sets. + +.. + +.. bpo: 42914 +.. date: 2021-03-14-21-47-28 +.. nonce: 9U1o33 +.. section: Library + +:func:`pprint.pprint` gains a new boolean ``underscore_numbers`` optional +argument to emit integers with thousands separated by an underscore +character for improved readability (for example ``1_000_000`` instead of +``1000000``). + +.. + +.. bpo: 41361 +.. date: 2021-03-13-08-18-01 +.. nonce: lXDIlr +.. section: Library + +:meth:`~collections.deque.rotate` calls are now slightly faster due to +faster argument parsing. + +.. + +.. bpo: 43423 +.. date: 2021-03-11-15-44-18 +.. nonce: rRomRD +.. section: Library + +:func:`subprocess.communicate` no longer raises an IndexError when there is +an empty stdout or stderr IO buffer during a timeout on Windows. + +.. + +.. bpo: 27820 +.. date: 2021-03-10-14-07-44 +.. nonce: Wwdy-r +.. section: Library + +Fixed long-standing bug of smtplib.SMTP where doing AUTH LOGIN with +initial_response_ok=False will fail. + +The cause is that SMTP.auth_login _always_ returns a password if provided +with a challenge string, thus non-compliant with the standard for AUTH +LOGIN. + +Also fixes bug with the test for smtpd. + +.. + +.. bpo: 43445 +.. date: 2021-03-09-11-36-19 +.. nonce: jnj-UB +.. section: Library + +Add frozen modules to :data:`sys.stdlib_module_names`. For example, add +``"_frozen_importlib"`` and ``"_frozen_importlib_external"`` names. + +.. + +.. bpo: 43245 +.. date: 2021-03-08-22-14-37 +.. nonce: nXL-MC +.. section: Library + +Add keyword arguments support to ``ChainMap.new_child()``. + +.. + +.. bpo: 29982 +.. date: 2021-03-07-23-23-03 +.. nonce: Q9iszT +.. section: Library + +Add optional parameter *ignore_cleanup_errors* to +:func:`tempfile.TemporaryDirectory` and allow multiple :func:`cleanup` +attempts. Contributed by C.A.M. Gerlach. + +.. + +.. bpo: 43428 +.. date: 2021-03-07-18-54-39 +.. nonce: br0XmX +.. section: Library + +Include changes from `importlib_metadata 3.7 +<https://importlib-metadata.readthedocs.io/en/latest/history.html#v3-7-0>`_: + +Performance enhancements to distribution discovery. + +``entry_points`` only returns unique distributions. + +Introduces new ``EntryPoints`` object for containing a set of entry points +with convenience methods for selecting entry points by group or name. +``entry_points`` now returns this object if selection parameters are +supplied but continues to return a dict object for compatibility. Users are +encouraged to rely on the selection interface. The dict object result is +likely to be deprecated in the future. + +Added packages_distributions function to return a mapping of packages to the +distributions that provide them. + +.. + +.. bpo: 43332 +.. date: 2021-03-07-11-23-20 +.. nonce: weatsh +.. section: Library + +Improves the networking efficiency of :mod:`http.client` when using a proxy +via :meth:`~HTTPConnection.set_tunnel`. Fewer small send calls are made +during connection setup. + +.. + +.. bpo: 43420 +.. date: 2021-03-07-08-03-31 +.. nonce: cee_X5 +.. section: Library + +Improve performance of :class:`fractions.Fraction` arithmetics for large +components. Contributed by Sergey B. Kirpichev. + +.. + +.. bpo: 43356 +.. date: 2021-03-04-21-51-20 +.. nonce: X7IGBM +.. section: Library + +Allow passing a signal number to ``_thread.interrupt_main()``. + +.. + +.. bpo: 43399 +.. date: 2021-03-04-17-53-46 +.. nonce: Wn95u- +.. section: Library + +Fix ``ElementTree.extend`` not working on iterators when using the Python +implementation + +.. + +.. bpo: 43369 +.. date: 2021-03-02-15-25-28 +.. nonce: F4knlQ +.. section: Library + +Improve :mod:`sqlite3` error handling: If ``sqlite3_column_text()`` and +``sqlite3_column_blob()`` set ``SQLITE_NOMEM``, :exc:`MemoryError` is now +raised. Patch by Erlend E. Aasland. + +.. + +.. bpo: 43368 +.. date: 2021-03-02-13-45-05 +.. nonce: t9XEkQ +.. section: Library + +Fix a regression introduced in GH-24562, where an empty bytestring was +fetched as ``None`` instead of ``b''`` in :mod:`sqlite3`. Patch by Mariusz +Felisiak. + +.. + +.. bpo: 41282 +.. date: 2021-03-02-09-54-22 +.. nonce: xL4h94 +.. section: Library + +Fixed stacklevel of ``DeprecationWarning`` emitted from ``import +distutils``. + +.. + +.. bpo: 42129 +.. date: 2021-02-28-04-21-35 +.. nonce: V0KifQ +.. section: Library + +``importlib.resources`` now honors namespace packages, merging resources +from each location in the namespace as introduced in ``importlib_resources`` +3.2 and including incidental changes through 5.0.3. + +.. + +.. bpo: 43295 +.. date: 2021-02-22-22-54-40 +.. nonce: h_ffu7 +.. section: Library + +:meth:`datetime.datetime.strptime` now raises ``ValueError`` instead of +``IndexError`` when matching ``'z'`` with the ``%z`` format specifier. + +.. + +.. bpo: 43125 +.. date: 2021-02-07-19-13-30 +.. nonce: AqNoMa +.. section: Library + +Return empty string if base64mime.body_encode receive empty bytes + +.. + +.. bpo: 43084 +.. date: 2021-01-31-17-31-13 +.. nonce: i8nLpK +.. section: Library + +:func:`curses.window.enclose` returns now ``True`` or ``False`` (as was +documented) instead of ``1`` or ``0``. + +.. + +.. bpo: 42994 +.. date: 2021-01-21-16-58-34 +.. nonce: El0Ksp +.. section: Library + +Add MIME types for opus, AAC, 3gpp and 3gpp2 + +.. + +.. bpo: 14678 +.. date: 2021-01-07-21-25-49 +.. nonce: 1zniCH +.. section: Library + +Add an invalidate_caches() method to the zipimport.zipimporter class to +support importlib.invalidate_caches(). Patch by Desmond Cheong. + +.. + +.. bpo: 42782 +.. date: 2020-12-29-13-46-57 +.. nonce: 3r0HFY +.. section: Library + +Fail fast in :func:`shutil.move()` to avoid creating destination directories +on failure. + +.. + +.. bpo: 40066 +.. date: 2020-09-23-21-58-34 +.. nonce: f1dr_5 +.. section: Library + +Enum's `repr()` and `str()` have changed: `repr()` is now +*EnumClass.MemberName* and `str()` is *MemberName*. Additionally, stdlib +Enum's whose contents are available as module attributes, such as +`RegexFlag.IGNORECASE`, have their `repr()` as *module.name*, e.g. +`re.IGNORECASE`. + +.. + +.. bpo: 26053 +.. date: 2020-09-01-10-12-13 +.. nonce: hXikw_ +.. section: Library + +Fixed bug where the :mod:`pdb` interactive run command echoed the args from +the shell command line, even if those have been overridden at the pdb +prompt. + +.. + +.. bpo: 24160 +.. date: 2020-08-28-23-07-53 +.. nonce: MSGnKr +.. section: Library + +Fixed bug where breakpoints did not persist across multiple debugger +sessions in :mod:`pdb`'s interactive mode. + +.. + +.. bpo: 40701 +.. date: 2020-05-27-05-42-39 +.. nonce: PBIgW1 +.. section: Library + +When the :data:`tempfile.tempdir` global variable is set to a value of type +bytes, it is now handled consistently. Previously exceptions could be +raised from some tempfile APIs when the directory did not already exist in +this situation. Also ensures that the :func:`tempfile.gettempdir()` and +:func:`tempfile.gettempdirb()` functions *always* return ``str`` and +``bytes`` respectively. + +.. + +.. bpo: 39342 +.. date: 2020-01-15-11-15-35 +.. nonce: S8PuJO +.. section: Library + +Expose ``X509_V_FLAG_ALLOW_PROXY_CERTS`` as +:data:`~ssl.VERIFY_ALLOW_PROXY_CERTS` to allow proxy certificate validation +as explained in +https://www.openssl.org/docs/man1.1.1/man7/proxy-certificates.html. + +.. + +.. bpo: 31861 +.. date: 2018-08-24-01-08-09 +.. nonce: -q9RKJ +.. section: Library + +Add builtins.aiter and builtins.anext. Patch by Joshua Bronson (@jab), +Daniel Pope (@lordmauve), and Justin Wang (@justin39). + +.. + +.. bpo: 43199 +.. date: 2021-03-13-18-43-54 +.. nonce: ZWA6KX +.. section: Documentation + +Answer "Why is there no goto?" in the Design and History FAQ. + +.. + +.. bpo: 43407 +.. date: 2021-03-04-22-53-03 +.. nonce: x570l5 +.. section: Documentation + +Clarified that a result from :func:`time.monotonic`, +:func:`time.perf_counter`, :func:`time.process_time`, or +:func:`time.thread_time` can be compared with the result from any following +call to the same function - not just the next immediate call. + +.. + +.. bpo: 43354 +.. date: 2021-03-02-12-55-34 +.. nonce: ezZYkx +.. section: Documentation + +Fix type documentation for ``Fault.faultCode``; the type has to be ``int`` +instead of ``str``. + +.. + +.. bpo: 41933 +.. date: 2020-10-05-20-04-43 +.. nonce: Pff94- +.. section: Documentation + +Clarified wording of s * n in the Common Sequence Operations + +.. + +.. bpo: 37945 +.. date: 2021-03-31-11-38-42 +.. nonce: HTUYhv +.. section: Tests + +Fix test_getsetlocale_issue1813() of test_locale: skip the test if +``setlocale()`` fails. Patch by Victor Stinner. + +.. + +.. bpo: 41561 +.. date: 2021-03-18-10-34-42 +.. nonce: pDg4w- +.. section: Tests + +Add workaround for Ubuntu's custom OpenSSL security level policy. + +.. + +.. bpo: 43179 +.. date: 2021-03-31-12-20-23 +.. nonce: Qbe1OD +.. section: Build + +Introduce and correctly use ALIGNOF_X in place of SIZEOF_X for +alignment-related code in optimized string routines. Patch by Jessica +Clarke. + +.. + +.. bpo: 43631 +.. date: 2021-03-26-09-16-34 +.. nonce: msJyPi +.. section: Build + +Update macOS, Windows, and CI to OpenSSL 1.1.1k. + +.. + +.. bpo: 43617 +.. date: 2021-03-24-16-55-55 +.. nonce: d69KAv +.. section: Build + +Improve configure.ac: Check for presence of autoconf-archive package and +remove our copies of M4 macros. + +.. + +.. bpo: 43466 +.. date: 2021-03-11-00-14-47 +.. nonce: N861Z5 +.. section: Build + +The ``configure`` script now supports ``--with-openssl-rpath`` option. + +.. + +.. bpo: 43372 +.. date: 2021-03-04-17-13-57 +.. nonce: FfqDVL +.. section: Build + +Use ``_freeze_importlib`` to generate code for the ``__hello__`` module. +This approach ensures the code matches the interpreter version. Previously, +PYTHON_FOR_REGEN was used to generate the code, which might be wrong. The +marshal format for code objects has changed with bpo-42246, commit 877df851. +Update the code and the expected code sizes in ctypes test_frozentable. + +.. + +.. bpo: 43440 +.. date: 2021-03-09-11-15-41 +.. nonce: igy2Mn +.. section: Windows + +Build :mod:`sqlite3` with the ``R*Tree`` module enabled. Patch by Erlend E. +Aasland. + +.. + +.. bpo: 42225 +.. date: 2021-03-29-16-22-27 +.. nonce: iIeiLg +.. section: IDLE + +Document that IDLE can fail on Unix either from misconfigured IP masquerage +rules or failure displaying complex colored (non-ascii) characters. + +.. + +.. bpo: 43688 +.. date: 2021-04-01-09-10-42 +.. nonce: G4gs6k +.. section: C API + +The limited C API is now supported if Python is built in debug mode (if the +``Py_DEBUG`` macro is defined). In the limited C API, the +:c:func:`Py_INCREF` and :c:func:`Py_DECREF` functions are now implemented as +opaque function calls, rather than accessing directly the +:c:member:`PyObject.ob_refcnt` member, if Python is built in debug mode and +the ``Py_LIMITED_API`` macro targets Python 3.10 or newer. It became +possible to support the limited C API in debug mode because the +:c:type:`PyObject` structure is the same in release and debug mode since +Python 3.8 (see :issue:`36465`). + +The limited C API is still not supported in the ``--with-trace-refs`` +special build (``Py_TRACE_REFS`` macro). + +Patch by Victor Stinner. + +.. + +.. bpo: 43244 +.. date: 2021-03-24-01-22-14 +.. nonce: 31-97x +.. section: C API + +Remove the ``pyarena.h`` header file with functions: + +* ``PyArena_New()`` +* ``PyArena_Free()`` +* ``PyArena_Malloc()`` +* ``PyArena_AddPyObject()`` + +These functions were undocumented, excluded from the limited C API, and were +only used internally by the compiler. Patch by Victor Stinner. + +.. + +.. bpo: 43244 +.. date: 2021-03-23-20-53-41 +.. nonce: VK3sLH +.. section: C API + +Remove the compiler and parser functions using ``struct _mod`` type, because +the public AST C API was removed: + +* ``PyAST_Compile()`` +* ``PyAST_CompileEx()`` +* ``PyAST_CompileObject()`` +* ``PyFuture_FromAST()`` +* ``PyFuture_FromASTObject()`` +* ``PyParser_ASTFromFile()`` +* ``PyParser_ASTFromFileObject()`` +* ``PyParser_ASTFromFilename()`` +* ``PyParser_ASTFromString()`` +* ``PyParser_ASTFromStringObject()`` + +These functions were undocumented and excluded from the limited C API. Patch +by Victor Stinner. + +.. + +.. bpo: 43244 +.. date: 2021-03-19-12-56-11 +.. nonce: VuIyOD +.. section: C API + +Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header files. These +functions were undocumented and excluded from the limited C API. Most names +defined by these header files were not prefixed by ``Py`` and so could +create names conflicts. For example, ``Python-ast.h`` defined a ``Yield`` +macro which was conflict with the ``Yield`` name used by the Windows +``<winbase.h>`` header. Use the Python :mod:`ast` module instead. Patch by +Victor Stinner. + +.. + +.. bpo: 43541 +.. date: 2021-03-18-12-44-33 +.. nonce: ICigzd +.. section: C API + +Fix a ``PyEval_EvalCodeEx()`` regression: fix reference counting on +builtins. Patch by Victor Stinner. + +.. + +.. bpo: 43244 +.. date: 2021-03-17-23-53-14 +.. nonce: kfPqA_ +.. section: C API + +Remove the ``symtable.h`` header file and the undocumented functions: + +* ``PyST_GetScope()`` +* ``PySymtable_Build()`` +* ``PySymtable_BuildObject()`` +* ``PySymtable_Free()`` +* ``Py_SymtableString()`` +* ``Py_SymtableStringObject()`` + +The ``Py_SymtableString()`` function was part the stable ABI by mistake but +it could not be used, because the ``symtable.h`` header file was excluded +from the limited C API. + +The Python :mod:`symtable` module remains available and is unchanged. + +Patch by Victor Stinner. + +.. + +.. bpo: 43244 +.. date: 2021-03-17-23-20-07 +.. nonce: diyn2C +.. section: C API + +Remove the ``PyAST_Validate()`` function. It is no longer possible to build +a AST object (``mod_ty`` type) with the public C API. The function was +already excluded from the limited C API (:pep:`384`). Patch by Victor +Stinner. diff --git a/Misc/NEWS.d/next/Build/2021-03-04-17-13-57.bpo-43372.FfqDVL.rst b/Misc/NEWS.d/next/Build/2021-03-04-17-13-57.bpo-43372.FfqDVL.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9CdWlsZC8yMDIxLTAzLTA0LTE3LTEzLTU3LmJwby00MzM3Mi5GZnFEVkwucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Build/2021-03-04-17-13-57.bpo-43372.FfqDVL.rst +++ /dev/null @@ -1,5 +0,0 @@ -Use ``_freeze_importlib`` to generate code for the ``__hello__`` module. -This approach ensures the code matches the interpreter version. Previously, -PYTHON_FOR_REGEN was used to generate the code, which might be wrong. The -marshal format for code objects has changed with bpo-42246, commit 877df851. -Update the code and the expected code sizes in ctypes test_frozentable. diff --git a/Misc/NEWS.d/next/Build/2021-03-11-00-14-47.bpo-43466.N861Z5.rst b/Misc/NEWS.d/next/Build/2021-03-11-00-14-47.bpo-43466.N861Z5.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9CdWlsZC8yMDIxLTAzLTExLTAwLTE0LTQ3LmJwby00MzQ2Ni5OODYxWjUucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Build/2021-03-11-00-14-47.bpo-43466.N861Z5.rst +++ /dev/null @@ -1,1 +0,0 @@ -The ``configure`` script now supports ``--with-openssl-rpath`` option. diff --git a/Misc/NEWS.d/next/Build/2021-03-31-19-50-01.bpo-43567.vd0a-p.rst b/Misc/NEWS.d/next/Build/2021-03-31-19-50-01.bpo-43567.vd0a-p.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9CdWlsZC8yMDIxLTAzLTMxLTE5LTUwLTAxLmJwby00MzU2Ny52ZDBhLXAucnN0 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-03-31-19-50-01.bpo-43567.vd0a-p.rst @@ -0,0 +1,1 @@ +Improved generated code refresh (AST/tokens/opcodes/keywords) on Windows. diff --git a/Misc/NEWS.d/next/C API/2021-03-17-23-20-07.bpo-43244.diyn2C.rst b/Misc/NEWS.d/next/C API/2021-03-17-23-20-07.bpo-43244.diyn2C.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9DIEFQSS8yMDIxLTAzLTE3LTIzLTIwLTA3LmJwby00MzI0NC5kaXluMkMucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/C API/2021-03-17-23-20-07.bpo-43244.diyn2C.rst +++ /dev/null @@ -1,3 +0,0 @@ -Remove the ``PyAST_Validate()`` function. It is no longer possible to build a -AST object (``mod_ty`` type) with the public C API. The function was already -excluded from the limited C API (:pep:`384`). Patch by Victor Stinner. diff --git a/Misc/NEWS.d/next/C API/2021-03-17-23-53-14.bpo-43244.kfPqA_.rst b/Misc/NEWS.d/next/C API/2021-03-17-23-53-14.bpo-43244.kfPqA_.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9DIEFQSS8yMDIxLTAzLTE3LTIzLTUzLTE0LmJwby00MzI0NC5rZlBxQV8ucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/C API/2021-03-17-23-53-14.bpo-43244.kfPqA_.rst +++ /dev/null @@ -1,16 +0,0 @@ -Remove the ``symtable.h`` header file and the undocumented functions: - -* ``PyST_GetScope()`` -* ``PySymtable_Build()`` -* ``PySymtable_BuildObject()`` -* ``PySymtable_Free()`` -* ``Py_SymtableString()`` -* ``Py_SymtableStringObject()`` - -The ``Py_SymtableString()`` function was part the stable ABI by mistake but it -could not be used, because the ``symtable.h`` header file was excluded from the -limited C API. - -The Python :mod:`symtable` module remains available and is unchanged. - -Patch by Victor Stinner. diff --git a/Misc/NEWS.d/next/C API/2021-03-18-12-44-33.bpo-43541.ICigzd.rst b/Misc/NEWS.d/next/C API/2021-03-18-12-44-33.bpo-43541.ICigzd.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9DIEFQSS8yMDIxLTAzLTE4LTEyLTQ0LTMzLmJwby00MzU0MS5JQ2lnemQucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/C API/2021-03-18-12-44-33.bpo-43541.ICigzd.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix a ``PyEval_EvalCodeEx()`` regression: fix reference counting on -builtins. Patch by Victor Stinner. diff --git a/Misc/NEWS.d/next/C API/2021-04-06-20-52-44.bpo-43753.xUsHp1.rst b/Misc/NEWS.d/next/C API/2021-04-06-20-52-44.bpo-43753.xUsHp1.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9DIEFQSS8yMDIxLTA0LTA2LTIwLTUyLTQ0LmJwby00Mzc1My54VXNIcDEucnN0 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2021-04-06-20-52-44.bpo-43753.xUsHp1.rst @@ -0,0 +1,6 @@ +Add the :c:func:`Py_Is(x, y) <Py_Is>` function to test if the *x* object is the +*y* object, the same as ``x is y`` in Python. Add also the :c:func:`Py_IsNone`, +:c:func:`Py_IsTrue`, :c:func:`Py_IsFalse` functions to test if an object is, +respectively, the ``None`` singleton, the ``True`` singleton or the ``False`` +singleton. +Patch by Victor Stinner. diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-10-27-20-20-07.bpo-38530.ZyoDNn.rst b/Misc/NEWS.d/next/Core and Builtins/2019-10-27-20-20-07.bpo-38530.ZyoDNn.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDE5LTEwLTI3LTIwLTIwLTA3LmJwby0zODUzMC5aeW9ETm4ucnN0 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2019-10-27-20-20-07.bpo-38530.ZyoDNn.rst @@ -0,0 +1,3 @@ +When printing :exc:`AttributeError`, :c:func:`PyErr_Display` will offer +suggestions of simmilar attribute names in the object that the exception was +raised from. Patch by Pablo Galindo diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-02-22-03-01-02.bpo-43287.aTs6fO.rst b/Misc/NEWS.d/next/Core and Builtins/2021-02-22-03-01-02.bpo-43287.aTs6fO.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTAyLTIyLTAzLTAxLTAyLmJwby00MzI4Ny5hVHM2Zk8ucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-02-22-03-01-02.bpo-43287.aTs6fO.rst +++ /dev/null @@ -1,2 +0,0 @@ -Speed up calls to ``filter()`` by using the :pep:`590` ``vectorcall`` -calling convention. Patch by Dong-hee Na. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-03-17-58-49.bpo-43390.epPpwV.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-03-17-58-49.bpo-43390.epPpwV.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTAzLTAzLTE3LTU4LTQ5LmJwby00MzM5MC5lcFBwd1YucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-03-03-17-58-49.bpo-43390.epPpwV.rst +++ /dev/null @@ -1,6 +0,0 @@ -CPython now sets the ``SA_ONSTACK`` flag in ``PyOS_setsig`` for the VM's -default signal handlers. This is friendlier to other in-process code that -an extension module or embedding use could pull in (such as Golang's cgo) -where tiny thread stacks are the norm and ``sigaltstack()`` has been used to -provide for signal handlers. This is a no-op change for the vast majority -of processes that don't use sigaltstack. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-03-19-04-23.bpo-42128.VouZjn.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-03-19-04-23.bpo-42128.VouZjn.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTAzLTAzLTE5LTA0LTIzLmJwby00MjEyOC5Wb3Vaam4ucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-03-03-19-04-23.bpo-42128.VouZjn.rst +++ /dev/null @@ -1,2 +0,0 @@ -Add ``__match_args__`` to :c:type:`structsequence` based classes. Patch by -Pablo Galindo. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-04-22-53-10.bpo-43406.Na_VpA.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-04-22-53-10.bpo-43406.Na_VpA.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTAzLTA0LTIyLTUzLTEwLmJwby00MzQwNi5OYV9WcEEucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-03-04-22-53-10.bpo-43406.Na_VpA.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix a possible race condition where ``PyErr_CheckSignals`` tries to execute a -non-Python signal handler. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-05-17-23-36.bpo-43410.lCzIg0.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-05-17-23-36.bpo-43410.lCzIg0.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTAzLTA1LTE3LTIzLTM2LmJwby00MzQxMC5sQ3pJZzAucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-03-05-17-23-36.bpo-43410.lCzIg0.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix a bug that was causing the parser to crash when emiting syntax errors -when reading input from stdin. Patch by Pablo Galindo diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTAzLTEzLTEzLTU3LTIxLmJwby0zNTg4My5VeUdwZEcucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-03-13-13-57-21.bpo-35883.UyGpdG.rst +++ /dev/null @@ -1,4 +0,0 @@ -Python no longer fails at startup with a fatal error if a command line -argument contains an invalid Unicode character. The -:c:func:`Py_DecodeLocale` function now escapes byte sequences which would be -decoded as Unicode characters outside the [U+0000; U+10ffff] range. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-14-16-44-50.bpo-39316.Ns3a_F.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-14-16-44-50.bpo-39316.Ns3a_F.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTAzLTE0LTE2LTQ0LTUwLmJwby0zOTMxNi5OczNhX0YucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-03-14-16-44-50.bpo-39316.Ns3a_F.rst +++ /dev/null @@ -1,3 +0,0 @@ -Tracing now has correct line numbers for attribute accesses when the -the attribute is on a different line from the object. -Improves debugging and profiling for multi-line method chains. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-15-07-50-30.bpo-43497.Uc5ZCJ.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-15-07-50-30.bpo-43497.Uc5ZCJ.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTAzLTE1LTA3LTUwLTMwLmJwby00MzQ5Ny5VYzVaQ0oucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2021-03-15-07-50-30.bpo-43497.Uc5ZCJ.rst +++ /dev/null @@ -1,1 +0,0 @@ -Emit SyntaxWarnings for assertions with tuple constants, this is a regression introduced in python3.7 \ No newline at end of file diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-31-16-32-57.bpo-43682.VSF3vg.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-31-16-32-57.bpo-43682.VSF3vg.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTAzLTMxLTE2LTMyLTU3LmJwby00MzY4Mi5WU0YzdmcucnN0 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-31-16-32-57.bpo-43682.VSF3vg.rst @@ -0,0 +1,2 @@ +Static methods (:func:`@staticmethod <staticmethod>`) are now callable as +regular functions. Patch by Victor Stinner. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-03-31-20-35-11.bpo-43105.PBVmHm.rst b/Misc/NEWS.d/next/Core and Builtins/2021-03-31-20-35-11.bpo-43105.PBVmHm.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTAzLTMxLTIwLTM1LTExLmJwby00MzEwNS5QQlZtSG0ucnN0 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-03-31-20-35-11.bpo-43105.PBVmHm.rst @@ -0,0 +1,2 @@ +Importlib now resolves relative paths when creating module spec objects from +file locations. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-04-01-12-30-30.bpo-43683.AjxOx2.rst b/Misc/NEWS.d/next/Core and Builtins/2021-04-01-12-30-30.bpo-43683.AjxOx2.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTA0LTAxLTEyLTMwLTMwLmJwby00MzY4My5BanhPeDIucnN0 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-04-01-12-30-30.bpo-43683.AjxOx2.rst @@ -0,0 +1,2 @@ +Add GEN_START opcode. Marks start of generator, including async, or coroutine and handles +sending values to a newly created generator or coroutine. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-04-05-17-38-08.bpo-42128.1uVeGK.rst b/Misc/NEWS.d/next/Core and Builtins/2021-04-05-17-38-08.bpo-42128.1uVeGK.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTA0LTA1LTE3LTM4LTA4LmJwby00MjEyOC4xdVZlR0sucnN0 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-04-05-17-38-08.bpo-42128.1uVeGK.rst @@ -0,0 +1,1 @@ +:data:`~object.__match_args__` is no longer allowed to be a list. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-04-07-18-00-05.bpo-43751.8fHsqQ.rst b/Misc/NEWS.d/next/Core and Builtins/2021-04-07-18-00-05.bpo-43751.8fHsqQ.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTA0LTA3LTE4LTAwLTA1LmJwby00Mzc1MS44ZkhzcVEucnN0 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-04-07-18-00-05.bpo-43751.8fHsqQ.rst @@ -0,0 +1,1 @@ +Fixed a bug where ``anext(ait, default)`` would erroneously return None. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-04-08-01-06-22.bpo-43682.eUn4p5.rst b/Misc/NEWS.d/next/Core and Builtins/2021-04-08-01-06-22.bpo-43682.eUn4p5.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTA0LTA4LTAxLTA2LTIyLmJwby00MzY4Mi5lVW40cDUucnN0 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-04-08-01-06-22.bpo-43682.eUn4p5.rst @@ -0,0 +1,5 @@ +Static methods (:func:`@staticmethod <staticmethod>`) and class methods +(:func:`@classmethod <classmethod>`) now inherit the method attributes +(``__module__``, ``__name__``, ``__qualname__``, ``__doc__``, +``__annotations__``) and have a new ``__wrapped__`` attribute. +Patch by Victor Stinner. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-04-08-12-20-29.bpo-43760.tBIsD8.rst b/Misc/NEWS.d/next/Core and Builtins/2021-04-08-12-20-29.bpo-43760.tBIsD8.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTA0LTA4LTEyLTIwLTI5LmJwby00Mzc2MC50QklzRDgucnN0 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-04-08-12-20-29.bpo-43760.tBIsD8.rst @@ -0,0 +1,2 @@ +Move the flag for checking whether tracing is enabled to the C stack, from the heap. +Should speed up dispatch in the interpreter. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-04-09-19-12-48.bpo-43797.HfRqNP.rst b/Misc/NEWS.d/next/Core and Builtins/2021-04-09-19-12-48.bpo-43797.HfRqNP.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTA0LTA5LTE5LTEyLTQ4LmJwby00Mzc5Ny5IZlJxTlAucnN0 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-04-09-19-12-48.bpo-43797.HfRqNP.rst @@ -0,0 +1,2 @@ +Improve ``SyntaxError`` error messages for invalid comparisons. Patch by +Pablo Galindo. diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-04-10-00-01-43.bpo-43798.p_nJFM.rst b/Misc/NEWS.d/next/Core and Builtins/2021-04-10-00-01-43.bpo-43798.p_nJFM.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9Db3JlIGFuZCBCdWlsdGlucy8yMDIxLTA0LTEwLTAwLTAxLTQzLmJwby00Mzc5OC5wX25KRk0ucnN0 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-04-10-00-01-43.bpo-43798.p_nJFM.rst @@ -0,0 +1,1 @@ +:class:`ast.alias` nodes now include source location metadata attributes e.g. lineno, col_offset. diff --git a/Misc/NEWS.d/next/Documentation/2020-10-05-20-04-43.bpo-41933.Pff94-.rst b/Misc/NEWS.d/next/Documentation/2020-10-05-20-04-43.bpo-41933.Pff94-.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9Eb2N1bWVudGF0aW9uLzIwMjAtMTAtMDUtMjAtMDQtNDMuYnBvLTQxOTMzLlBmZjk0LS5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Documentation/2020-10-05-20-04-43.bpo-41933.Pff94-.rst +++ /dev/null @@ -1,1 +0,0 @@ -Clarified wording of s * n in the Common Sequence Operations \ No newline at end of file diff --git a/Misc/NEWS.d/next/Documentation/2021-03-04-22-53-03.bpo-43407.x570l5.rst b/Misc/NEWS.d/next/Documentation/2021-03-04-22-53-03.bpo-43407.x570l5.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9Eb2N1bWVudGF0aW9uLzIwMjEtMDMtMDQtMjItNTMtMDMuYnBvLTQzNDA3Lng1NzBsNS5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Documentation/2021-03-04-22-53-03.bpo-43407.x570l5.rst +++ /dev/null @@ -1,4 +0,0 @@ -Clarified that a result from :func:`time.monotonic`, -:func:`time.perf_counter`, :func:`time.process_time`, or -:func:`time.thread_time` can be compared with the result from any following -call to the same function - not just the next immediate call. diff --git a/Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst b/Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9Eb2N1bWVudGF0aW9uLzIwMjEtMDMtMTMtMTgtNDMtNTQuYnBvLTQzMTk5LlpXQTZLWC5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Documentation/2021-03-13-18-43-54.bpo-43199.ZWA6KX.rst +++ /dev/null @@ -1,1 +0,0 @@ -Answer "Why is there no goto?" in the Design and History FAQ. diff --git a/Misc/NEWS.d/next/Documentation/2021-04-06-07-05-49.bpo-43739.L4HjiX.rst b/Misc/NEWS.d/next/Documentation/2021-04-06-07-05-49.bpo-43739.L4HjiX.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9Eb2N1bWVudGF0aW9uLzIwMjEtMDQtMDYtMDctMDUtNDkuYnBvLTQzNzM5Lkw0SGppWC5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-04-06-07-05-49.bpo-43739.L4HjiX.rst @@ -0,0 +1,1 @@ +Fixing the example code in Doc/extending/extending.rst to declare and initialize the pmodule variable to be of the right type. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Documentation/2021-04-06-14-55-45.bpo-43755.1m0fGq.rst b/Misc/NEWS.d/next/Documentation/2021-04-06-14-55-45.bpo-43755.1m0fGq.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9Eb2N1bWVudGF0aW9uLzIwMjEtMDQtMDYtMTQtNTUtNDUuYnBvLTQzNzU1LjFtMGZHcS5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-04-06-14-55-45.bpo-43755.1m0fGq.rst @@ -0,0 +1,3 @@ +Update documentation to reflect that unparenthesized lambda expressions can +no longer be the expression part in an ``if`` clause in comprehensions and +generator expressions since Python 3.9. diff --git a/Misc/NEWS.d/next/Documentation/2021-04-08-22-42-02.bpo-43778.MszRnY.rst b/Misc/NEWS.d/next/Documentation/2021-04-08-22-42-02.bpo-43778.MszRnY.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9Eb2N1bWVudGF0aW9uLzIwMjEtMDQtMDgtMjItNDItMDIuYnBvLTQzNzc4Lk1zelJuWS5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-04-08-22-42-02.bpo-43778.MszRnY.rst @@ -0,0 +1,2 @@ +Fix the Sphinx glossary_search extension: create the _static/ sub-directory +if it doesn't exist. diff --git a/Misc/NEWS.d/next/Library/2019-08-14-13-19-50.bpo-33731.9esS0d.rst b/Misc/NEWS.d/next/Library/2019-08-14-13-19-50.bpo-33731.9esS0d.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMTktMDgtMTQtMTMtMTktNTAuYnBvLTMzNzMxLjllc1MwZC5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-08-14-13-19-50.bpo-33731.9esS0d.rst @@ -0,0 +1,2 @@ +Provide a locale.localize() function, which converts a normalized number string +into a locale format. diff --git a/Misc/NEWS.d/next/Library/2020-01-15-11-15-35.bpo-39342.S8PuJO.rst b/Misc/NEWS.d/next/Library/2020-01-15-11-15-35.bpo-39342.S8PuJO.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjAtMDEtMTUtMTEtMTUtMzUuYnBvLTM5MzQyLlM4UHVKTy5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2020-01-15-11-15-35.bpo-39342.S8PuJO.rst +++ /dev/null @@ -1,4 +0,0 @@ -Expose ``X509_V_FLAG_ALLOW_PROXY_CERTS`` as -:data:`~ssl.VERIFY_ALLOW_PROXY_CERTS` to allow proxy certificate validation -as explained in -https://www.openssl.org/docs/man1.1.1/man7/proxy-certificates.html. diff --git a/Misc/NEWS.d/next/Library/2020-03-09-20-36-07.bpo-39899.9adF3E.rst b/Misc/NEWS.d/next/Library/2020-03-09-20-36-07.bpo-39899.9adF3E.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjAtMDMtMDktMjAtMzYtMDcuYnBvLTM5ODk5LjlhZEYzRS5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-09-20-36-07.bpo-39899.9adF3E.rst @@ -0,0 +1,3 @@ +:func:`os.path.expanduser()` now refuses to guess Windows home directories if the basename of current user's home directory does not match their username. + +:meth:`pathlib.Path.expanduser()` and :meth:`~pathlib.Path.home()` now consistently raise :exc:`RuntimeError` exception when a home directory cannot be resolved. Previously a :exc:`KeyError` exception could be raised on Windows when the ``"USERNAME"`` environment variable was unset. diff --git a/Misc/NEWS.d/next/Library/2020-03-30-00-13-27.bpo-39906.eaR3fN.rst b/Misc/NEWS.d/next/Library/2020-03-30-00-13-27.bpo-39906.eaR3fN.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjAtMDMtMzAtMDAtMTMtMjcuYnBvLTM5OTA2LmVhUjNmTi5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-03-30-00-13-27.bpo-39906.eaR3fN.rst @@ -0,0 +1,1 @@ +:meth:`pathlib.Path.stat` and :meth:`~pathlib.Path.chmod` now accept a *follow_symlinks* keyword-only argument for consistency with corresponding functions in the :mod:`os` module. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2020-05-27-05-42-39.bpo-40701.PBIgW1.rst b/Misc/NEWS.d/next/Library/2020-05-27-05-42-39.bpo-40701.PBIgW1.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjAtMDUtMjctMDUtNDItMzkuYnBvLTQwNzAxLlBCSWdXMS5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2020-05-27-05-42-39.bpo-40701.PBIgW1.rst +++ /dev/null @@ -1,6 +0,0 @@ -When the :data:`tempfile.tempdir` global variable is set to a value of -type bytes, it is now handled consistently. Previously exceptions -could be raised from some tempfile APIs when the directory did not -already exist in this situation. Also ensures that the -:func:`tempfile.gettempdir()` and :func:`tempfile.gettempdirb()` -functions *always* return ``str`` and ``bytes`` respectively. diff --git a/Misc/NEWS.d/next/Library/2020-06-13-23-33-32.bpo-36470.oi6Kdb.rst b/Misc/NEWS.d/next/Library/2020-06-13-23-33-32.bpo-36470.oi6Kdb.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjAtMDYtMTMtMjMtMzMtMzIuYnBvLTM2NDcwLm9pNktkYi5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-06-13-23-33-32.bpo-36470.oi6Kdb.rst @@ -0,0 +1,2 @@ +Fix dataclasses with ``InitVar``\s and :func:`~dataclasses.replace()`. Patch +by Claudiu Popa. diff --git a/Misc/NEWS.d/next/Library/2020-12-29-13-46-57.bpo-42782.3r0HFY.rst b/Misc/NEWS.d/next/Library/2020-12-29-13-46-57.bpo-42782.3r0HFY.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjAtMTItMjktMTMtNDYtNTcuYnBvLTQyNzgyLjNyMEhGWS5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2020-12-29-13-46-57.bpo-42782.3r0HFY.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fail fast in :func:`shutil.move()` to avoid creating destination directories on -failure. diff --git a/Misc/NEWS.d/next/Library/2021-01-07-21-25-49.bpo-14678.1zniCH.rst b/Misc/NEWS.d/next/Library/2021-01-07-21-25-49.bpo-14678.1zniCH.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDEtMDctMjEtMjUtNDkuYnBvLTE0Njc4LjF6bmlDSC5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-01-07-21-25-49.bpo-14678.1zniCH.rst +++ /dev/null @@ -1,3 +0,0 @@ -Add an invalidate_caches() method to the zipimport.zipimporter class to -support importlib.invalidate_caches(). -Patch by Desmond Cheong. diff --git a/Misc/NEWS.d/next/Library/2021-01-12-23-17-02.bpo-42904.-4qkTD.rst b/Misc/NEWS.d/next/Library/2021-01-12-23-17-02.bpo-42904.-4qkTD.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDEtMTItMjMtMTctMDIuYnBvLTQyOTA0Li00cWtURC5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-01-12-23-17-02.bpo-42904.-4qkTD.rst @@ -0,0 +1,2 @@ +:func:`typing.get_type_hints` now checks the local namespace of a class when +evaluating :pep:`563` annotations inside said class. diff --git a/Misc/NEWS.d/next/Library/2021-01-21-16-58-34.bpo-42994.El0Ksp.rst b/Misc/NEWS.d/next/Library/2021-01-21-16-58-34.bpo-42994.El0Ksp.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDEtMjEtMTYtNTgtMzQuYnBvLTQyOTk0LkVsMEtzcC5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-01-21-16-58-34.bpo-42994.El0Ksp.rst +++ /dev/null @@ -1,1 +0,0 @@ -Add MIME types for opus, AAC, 3gpp and 3gpp2 diff --git a/Misc/NEWS.d/next/Library/2021-01-31-00-23-13.bpo-43080.-fDg4Q.rst b/Misc/NEWS.d/next/Library/2021-01-31-00-23-13.bpo-43080.-fDg4Q.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDEtMzEtMDAtMjMtMTMuYnBvLTQzMDgwLi1mRGc0US5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-01-31-00-23-13.bpo-43080.-fDg4Q.rst @@ -0,0 +1,1 @@ +:mod:`pprint` now has support for :class:`dataclasses.dataclass`. Patch by Lewis Gaul. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2021-02-09-07-24-29.bpo-43176.bocNQn.rst b/Misc/NEWS.d/next/Library/2021-02-09-07-24-29.bpo-43176.bocNQn.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDItMDktMDctMjQtMjkuYnBvLTQzMTc2LmJvY05Rbi5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-02-09-07-24-29.bpo-43176.bocNQn.rst @@ -0,0 +1,1 @@ +Fixed processing of a dataclass that inherits from a frozen dataclass with no fields. It is now correctly detected as an error. diff --git a/Misc/NEWS.d/next/Library/2021-02-22-22-54-40.bpo-43295.h_ffu7.rst b/Misc/NEWS.d/next/Library/2021-02-22-22-54-40.bpo-43295.h_ffu7.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDItMjItMjItNTQtNDAuYnBvLTQzMjk1LmhfZmZ1Ny5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-22-22-54-40.bpo-43295.h_ffu7.rst +++ /dev/null @@ -1,2 +0,0 @@ -:meth:`datetime.datetime.strptime` now raises ``ValueError`` instead of -``IndexError`` when matching ``'z'`` with the ``%z`` format specifier. diff --git a/Misc/NEWS.d/next/Library/2021-02-28-04-21-35.bpo-42129.V0KifQ.rst b/Misc/NEWS.d/next/Library/2021-02-28-04-21-35.bpo-42129.V0KifQ.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDItMjgtMDQtMjEtMzUuYnBvLTQyMTI5LlYwS2lmUS5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-02-28-04-21-35.bpo-42129.V0KifQ.rst +++ /dev/null @@ -1,3 +0,0 @@ -``importlib.resources`` now honors namespace packages, merging resources -from each location in the namespace as introduced in -``importlib_resources`` 3.2 and including incidental changes through 5.0.3. diff --git a/Misc/NEWS.d/next/Library/2021-03-02-09-54-22.bpo-41282.xL4h94.rst b/Misc/NEWS.d/next/Library/2021-03-02-09-54-22.bpo-41282.xL4h94.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDMtMDItMDktNTQtMjIuYnBvLTQxMjgyLnhMNGg5NC5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-03-02-09-54-22.bpo-41282.xL4h94.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fixed stacklevel of ``DeprecationWarning`` emitted from ``import -distutils``. diff --git a/Misc/NEWS.d/next/Library/2021-03-02-13-45-05.bpo-43368.t9XEkQ.rst b/Misc/NEWS.d/next/Library/2021-03-02-13-45-05.bpo-43368.t9XEkQ.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDMtMDItMTMtNDUtMDUuYnBvLTQzMzY4LnQ5WEVrUS5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-03-02-13-45-05.bpo-43368.t9XEkQ.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix a regression introduced in GH-24562, where an empty bytestring was fetched -as ``None`` instead of ``b''`` in :mod:`sqlite3`. Patch by Mariusz Felisiak. diff --git a/Misc/NEWS.d/next/Library/2021-03-02-15-25-28.bpo-43369.F4knlQ.rst b/Misc/NEWS.d/next/Library/2021-03-02-15-25-28.bpo-43369.F4knlQ.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDMtMDItMTUtMjUtMjguYnBvLTQzMzY5LkY0a25sUS5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-03-02-15-25-28.bpo-43369.F4knlQ.rst +++ /dev/null @@ -1,3 +0,0 @@ -Improve :mod:`sqlite3` error handling: If ``sqlite3_column_text()`` and -``sqlite3_column_blob()`` set ``SQLITE_NOMEM``, :exc:`MemoryError` is now -raised. Patch by Erlend E. Aasland. diff --git a/Misc/NEWS.d/next/Library/2021-03-04-21-51-20.bpo-43356.X7IGBM.rst b/Misc/NEWS.d/next/Library/2021-03-04-21-51-20.bpo-43356.X7IGBM.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDMtMDQtMjEtNTEtMjAuYnBvLTQzMzU2Llg3SUdCTS5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-03-04-21-51-20.bpo-43356.X7IGBM.rst +++ /dev/null @@ -1,1 +0,0 @@ -Allow passing a signal number to ``_thread.interrupt_main()``. diff --git a/Misc/NEWS.d/next/Library/2021-03-07-11-23-20.bpo-43332.weatsh.rst b/Misc/NEWS.d/next/Library/2021-03-07-11-23-20.bpo-43332.weatsh.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDMtMDctMTEtMjMtMjAuYnBvLTQzMzMyLndlYXRzaC5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-03-07-11-23-20.bpo-43332.weatsh.rst +++ /dev/null @@ -1,3 +0,0 @@ -Improves the networking efficiency of :mod:`http.client` when using a proxy -via :meth:`~HTTPConnection.set_tunnel`. Fewer small send calls are made -during connection setup. diff --git a/Misc/NEWS.d/next/Library/2021-03-07-18-54-39.bpo-43428.br0XmX.rst b/Misc/NEWS.d/next/Library/2021-03-07-18-54-39.bpo-43428.br0XmX.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDMtMDctMTgtNTQtMzkuYnBvLTQzNDI4LmJyMFhtWC5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-03-07-18-54-39.bpo-43428.br0XmX.rst +++ /dev/null @@ -1,17 +0,0 @@ -Include changes from `importlib_metadata 3.7 -<https://importlib-metadata.readthedocs.io/en/latest/history.html#v3-7-0>`_: - -Performance enhancements to distribution discovery. - -``entry_points`` only returns unique distributions. - -Introduces new ``EntryPoints`` object -for containing a set of entry points with convenience methods for selecting -entry points by group or name. ``entry_points`` now returns this object if -selection parameters are supplied but continues to return a dict object for -compatibility. Users are encouraged to rely on the selection interface. The -dict object result is likely to be deprecated in the future. - -Added -packages_distributions function to return a mapping of packages to the -distributions that provide them. diff --git a/Misc/NEWS.d/next/Library/2021-03-07-23-23-03.bpo-29982.Q9iszT.rst b/Misc/NEWS.d/next/Library/2021-03-07-23-23-03.bpo-29982.Q9iszT.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDMtMDctMjMtMjMtMDMuYnBvLTI5OTgyLlE5aXN6VC5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-03-07-23-23-03.bpo-29982.Q9iszT.rst +++ /dev/null @@ -1,3 +0,0 @@ -Add optional parameter *ignore_cleanup_errors* to -:func:`tempfile.TemporaryDirectory` and allow multiple :func:`cleanup` attempts. -Contributed by C.A.M. Gerlach. diff --git a/Misc/NEWS.d/next/Library/2021-03-08-22-14-37.bpo-43245.nXL-MC.rst b/Misc/NEWS.d/next/Library/2021-03-08-22-14-37.bpo-43245.nXL-MC.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDMtMDgtMjItMTQtMzcuYnBvLTQzMjQ1Lm5YTC1NQy5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-03-08-22-14-37.bpo-43245.nXL-MC.rst +++ /dev/null @@ -1,1 +0,0 @@ -Add keyword arguments support to ``ChainMap.new_child()``. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2021-03-09-11-36-19.bpo-43445.jnj-UB.rst b/Misc/NEWS.d/next/Library/2021-03-09-11-36-19.bpo-43445.jnj-UB.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDMtMDktMTEtMzYtMTkuYnBvLTQzNDQ1Lmpuai1VQi5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-03-09-11-36-19.bpo-43445.jnj-UB.rst +++ /dev/null @@ -1,2 +0,0 @@ -Add frozen modules to :data:`sys.stdlib_module_names`. For example, add -``"_frozen_importlib"`` and ``"_frozen_importlib_external"`` names. diff --git a/Misc/NEWS.d/next/Library/2021-03-10-14-07-44.bpo-27820.Wwdy-r.rst b/Misc/NEWS.d/next/Library/2021-03-10-14-07-44.bpo-27820.Wwdy-r.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDMtMTAtMTQtMDctNDQuYnBvLTI3ODIwLld3ZHktci5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-03-10-14-07-44.bpo-27820.Wwdy-r.rst +++ /dev/null @@ -1,8 +0,0 @@ -Fixed long-standing bug of smtplib.SMTP where doing AUTH LOGIN with -initial_response_ok=False will fail. - -The cause is that SMTP.auth_login _always_ returns a password if provided -with a challenge string, thus non-compliant with the standard for AUTH -LOGIN. - -Also fixes bug with the test for smtpd. diff --git a/Misc/NEWS.d/next/Library/2021-03-11-00-31-41.bpo-42967.2PeQRw.rst b/Misc/NEWS.d/next/Library/2021-03-11-00-31-41.bpo-42967.2PeQRw.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDMtMTEtMDAtMzEtNDEuYnBvLTQyOTY3LjJQZVFSdy5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-11-00-31-41.bpo-42967.2PeQRw.rst @@ -0,0 +1,3 @@ +Allow :class:`bytes` ``separator`` argument in ``urllib.parse.parse_qs`` and +``urllib.parse.parse_qsl`` when parsing :class:`str` query strings. Previously, +this raised a ``TypeError``. diff --git a/Misc/NEWS.d/next/Library/2021-03-11-15-44-18.bpo-43423.rRomRD.rst b/Misc/NEWS.d/next/Library/2021-03-11-15-44-18.bpo-43423.rRomRD.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDMtMTEtMTUtNDQtMTguYnBvLTQzNDIzLnJSb21SRC5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-03-11-15-44-18.bpo-43423.rRomRD.rst +++ /dev/null @@ -1,2 +0,0 @@ -:func:`subprocess.communicate` no longer raises an IndexError when there is an -empty stdout or stderr IO buffer during a timeout on Windows. diff --git a/Misc/NEWS.d/next/Library/2021-03-13-08-18-01.bpo-41361.lXDIlr.rst b/Misc/NEWS.d/next/Library/2021-03-13-08-18-01.bpo-41361.lXDIlr.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDMtMTMtMDgtMTgtMDEuYnBvLTQxMzYxLmxYRElsci5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-03-13-08-18-01.bpo-41361.lXDIlr.rst +++ /dev/null @@ -1,1 +0,0 @@ -:meth:`~collections.deque.rotate` calls are now slightly faster due to faster argument parsing. \ No newline at end of file diff --git a/Misc/NEWS.d/next/Library/2021-03-16-16-05-02.bpo-43521.mRT6fh.rst b/Misc/NEWS.d/next/Library/2021-03-16-16-05-02.bpo-43521.mRT6fh.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDMtMTYtMTYtMDUtMDIuYnBvLTQzNTIxLm1SVDZmaC5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Library/2021-03-16-16-05-02.bpo-43521.mRT6fh.rst +++ /dev/null @@ -1,1 +0,0 @@ -``ast.unparse`` can now render NaNs and empty sets. diff --git a/Misc/NEWS.d/next/Library/2021-04-03-15-24-59.bpo-2135.xmDAYJ.rst b/Misc/NEWS.d/next/Library/2021-04-03-15-24-59.bpo-2135.xmDAYJ.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMDMtMTUtMjQtNTkuYnBvLTIxMzUueG1EQVlKLnJzdA== --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-03-15-24-59.bpo-2135.xmDAYJ.rst @@ -0,0 +1,2 @@ +Deprecate find_module() and find_loader() implementations in importlib and +zipimport. diff --git a/Misc/NEWS.d/next/Library/2021-04-03-18-03-44.bpo-43723.uBhBZS.rst b/Misc/NEWS.d/next/Library/2021-04-03-18-03-44.bpo-43723.uBhBZS.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMDMtMTgtMDMtNDQuYnBvLTQzNzIzLnVCaEJaUy5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-03-18-03-44.bpo-43723.uBhBZS.rst @@ -0,0 +1,19 @@ +The following ``threading`` methods are now deprecated and should be replaced: + +- ``currentThread`` => :func:`threading.current_thread` + +- ``activeCount`` => :func:`threading.active_count` + +- ``Condition.notifyAll`` => :meth:`threading.Condition.notify_all` + +- ``Event.isSet`` => :meth:`threading.Event.is_set` + +- ``Thread.setName`` => :attr:`threading.Thread.name` + +- ``thread.getName`` => :attr:`threading.Thread.name` + +- ``Thread.isDaemon`` => :attr:`threading.Thread.daemon` + +- ``Thread.setDaemon`` => :attr:`threading.Thread.daemon` + +Patch by Jelle Zijlstra. diff --git a/Misc/NEWS.d/next/Library/2021-04-08-09-59-20.bpo-43764.tHjO60.rst b/Misc/NEWS.d/next/Library/2021-04-08-09-59-20.bpo-43764.tHjO60.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMDgtMDktNTktMjAuYnBvLTQzNzY0LnRIak82MC5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-08-09-59-20.bpo-43764.tHjO60.rst @@ -0,0 +1,2 @@ +Fix an issue where :data:`~object.__match_args__` generation could fail for +some :mod:`dataclasses`. diff --git a/Misc/NEWS.d/next/Library/2021-04-08-12-25-08.bpo-43712.f8WXCX.rst b/Misc/NEWS.d/next/Library/2021-04-08-12-25-08.bpo-43712.f8WXCX.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMDgtMTItMjUtMDguYnBvLTQzNzEyLmY4V1hDWC5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-08-12-25-08.bpo-43712.f8WXCX.rst @@ -0,0 +1,2 @@ +Add ``encoding`` and ``errors`` parameters to :func:`fileinput.input` and +:class:`fileinput.FileInput`. diff --git a/Misc/NEWS.d/next/Library/2021-04-08-15-19-20.bpo-43731.nnVd3h.rst b/Misc/NEWS.d/next/Library/2021-04-08-15-19-20.bpo-43731.nnVd3h.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMDgtMTUtMTktMjAuYnBvLTQzNzMxLm5uVmQzaC5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-08-15-19-20.bpo-43731.nnVd3h.rst @@ -0,0 +1,1 @@ +Add an ``encoding`` parameter :func:`logging.fileConfig()`. diff --git a/Misc/NEWS.d/next/Library/2021-04-08-19-32-26.bpo-47383.YI1hdL.rst b/Misc/NEWS.d/next/Library/2021-04-08-19-32-26.bpo-47383.YI1hdL.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMDgtMTktMzItMjYuYnBvLTQ3MzgzLllJMWhkTC5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-08-19-32-26.bpo-47383.YI1hdL.rst @@ -0,0 +1,3 @@ +The ``P.args`` and ``P.kwargs`` attributes of :class:`typing.ParamSpec` are +now instances of the new classes :class:`typing.ParamSpecArgs` and +:class:`typing.ParamSpecKwargs`, which enables a more useful ``repr()``. Patch by Jelle Zijlstra. diff --git a/Misc/NEWS.d/next/Library/2021-04-09-12-08-01.bpo-43788.YsvInM.rst b/Misc/NEWS.d/next/Library/2021-04-09-12-08-01.bpo-43788.YsvInM.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMDktMTItMDgtMDEuYnBvLTQzNzg4LllzdkluTS5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-09-12-08-01.bpo-43788.YsvInM.rst @@ -0,0 +1,4 @@ +The header files for :mod:`ssl` error codes are now OpenSSL +version-specific. Exceptions will now show correct reason and library +codes. The ``make_ssl_data.py`` script has been rewritten to use OpenSSL's +text file with error codes. diff --git a/Misc/NEWS.d/next/Library/2021-04-09-14-08-03.bpo-43789.eaHlAm.rst b/Misc/NEWS.d/next/Library/2021-04-09-14-08-03.bpo-43789.eaHlAm.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMDktMTQtMDgtMDMuYnBvLTQzNzg5LmVhSGxBbS5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-09-14-08-03.bpo-43789.eaHlAm.rst @@ -0,0 +1,2 @@ +OpenSSL 3.0.0: Don't call the password callback function a second time when +first call has signaled an error condition. diff --git a/Misc/NEWS.d/next/Library/2021-04-09-14-51-58.bpo-43785.1mM5xE.rst b/Misc/NEWS.d/next/Library/2021-04-09-14-51-58.bpo-43785.1mM5xE.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMDktMTQtNTEtNTguYnBvLTQzNzg1LjFtTTV4RS5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-09-14-51-58.bpo-43785.1mM5xE.rst @@ -0,0 +1,4 @@ +Improve ``bz2.BZ2File`` performance by removing the RLock from BZ2File. +This makes BZ2File thread unsafe in the face of multiple simultaneous +readers or writers, just like its equivalent classes in :mod:`gzip` and +:mod:`lzma` have always been. Patch by Inada Naoki. diff --git a/Misc/NEWS.d/next/Library/2021-04-09-16-14-22.bpo-43794.-1XPDH.rst b/Misc/NEWS.d/next/Library/2021-04-09-16-14-22.bpo-43794.-1XPDH.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMDktMTYtMTQtMjIuYnBvLTQzNzk0Li0xWFBESC5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-09-16-14-22.bpo-43794.-1XPDH.rst @@ -0,0 +1,1 @@ +Add :data:`ssl.OP_IGNORE_UNEXPECTED_EOF` constants (OpenSSL 3.0.0) diff --git a/Misc/NEWS.d/next/Library/2021-04-10-03-30-36.bpo-43478.iZcBTq.rst b/Misc/NEWS.d/next/Library/2021-04-10-03-30-36.bpo-43478.iZcBTq.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMTAtMDMtMzAtMzYuYnBvLTQzNDc4LmlaY0JUcS5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-10-03-30-36.bpo-43478.iZcBTq.rst @@ -0,0 +1,6 @@ +Mocks can no longer be used as the specs for other Mocks. As a result, an +already-mocked object cannot have an attribute mocked using ``autospec=True`` +or be the subject of a ``create_autospec(...)`` call. This can uncover bugs in +tests since these Mock-derived Mocks will always pass certain tests (e.g. +:func:`isinstance`) and builtin assert functions (e.g. assert_called_once_with) +will unconditionally pass. diff --git a/Misc/NEWS.d/next/Library/2021-04-10-11-35-50.bpo-43799.1iV4pX.rst b/Misc/NEWS.d/next/Library/2021-04-10-11-35-50.bpo-43799.1iV4pX.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMTAtMTEtMzUtNTAuYnBvLTQzNzk5LjFpVjRwWC5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-10-11-35-50.bpo-43799.1iV4pX.rst @@ -0,0 +1,2 @@ +OpenSSL 3.0.0: define ``OPENSSL_API_COMPAT`` 1.1.1 to suppress deprecation +warnings. Python requires OpenSSL 1.1.1 APIs. diff --git a/Misc/NEWS.d/next/Library/2021-04-10-18-23-09.bpo-43764.Le5KJp.rst b/Misc/NEWS.d/next/Library/2021-04-10-18-23-09.bpo-43764.Le5KJp.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMTAtMTgtMjMtMDkuYnBvLTQzNzY0LkxlNUtKcC5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-10-18-23-09.bpo-43764.Le5KJp.rst @@ -0,0 +1,2 @@ +Add match_args parameter to @dataclass decorator to allow suppression of +__match_args__ generation. diff --git a/Misc/NEWS.d/next/Library/2021-04-10-19-14-49.bpo-43772.Bxq0zQ.rst b/Misc/NEWS.d/next/Library/2021-04-10-19-14-49.bpo-43772.Bxq0zQ.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMTAtMTktMTQtNDkuYnBvLTQzNzcyLkJ4cTB6US5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-10-19-14-49.bpo-43772.Bxq0zQ.rst @@ -0,0 +1,1 @@ +Fixed the return value of ``TypeVar.__ror__``. Patch by Jelle Zijlstra. diff --git a/Misc/NEWS.d/next/Library/2021-04-11-21-10-57.bpo-42248.pedB1E.rst b/Misc/NEWS.d/next/Library/2021-04-11-21-10-57.bpo-42248.pedB1E.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMTEtMjEtMTAtNTcuYnBvLTQyMjQ4LnBlZEIxRS5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-11-21-10-57.bpo-42248.pedB1E.rst @@ -0,0 +1,1 @@ +[Enum] ensure exceptions raised in ``_missing__`` are released diff --git a/Misc/NEWS.d/next/Library/2021-04-12-06-01-10.bpo-41515.YaVReb.rst b/Misc/NEWS.d/next/Library/2021-04-12-06-01-10.bpo-41515.YaVReb.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMTItMDYtMDEtMTAuYnBvLTQxNTE1LllhVlJlYi5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-12-06-01-10.bpo-41515.YaVReb.rst @@ -0,0 +1,2 @@ +Fix :exc:`KeyError` raised in :func:`typing.get_type_hints` due to +synthetic modules that don't appear in ``sys.modules``. diff --git a/Misc/NEWS.d/next/Library/2021-04-12-09-57-37.bpo-43680.o1zEk_.rst b/Misc/NEWS.d/next/Library/2021-04-12-09-57-37.bpo-43680.o1zEk_.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMTItMDktNTctMzcuYnBvLTQzNjgwLm8xekVrXy5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-12-09-57-37.bpo-43680.o1zEk_.rst @@ -0,0 +1,6 @@ +The Python :func:`_pyio.open` function becomes a static method to behave as +:func:`io.open` built-in function: don't become a bound method when stored as a +class variable. It becomes possible since static methods are now callable in +Python 3.10. Moreover, :func:`_pyio.OpenWrapper` becomes a simple alias to +:func:`_pyio.open`. +Patch by Victor Stinner. diff --git a/Misc/NEWS.d/next/Library/2021-04-12-11-20-34.bpo-43680.SR0Epv.rst b/Misc/NEWS.d/next/Library/2021-04-12-11-20-34.bpo-43680.SR0Epv.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMTItMTEtMjAtMzQuYnBvLTQzNjgwLlNSMEVwdi5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-12-11-20-34.bpo-43680.SR0Epv.rst @@ -0,0 +1,6 @@ +Deprecate io.OpenWrapper and _pyio.OpenWrapper: use io.open and _pyio.open +instead. Until Python 3.9, _pyio.open was not a static method and +builtins.open was set to OpenWrapper to not become a bound method when set +to a class variable. _io.open is a built-in function whereas _pyio.open is a +Python function. In Python 3.10, _pyio.open() is now a static method, and +builtins.open() is now io.open(). diff --git a/Misc/NEWS.d/next/Library/2021-04-12-15-15-50.bpo-43787.wCy_Wd.rst b/Misc/NEWS.d/next/Library/2021-04-12-15-15-50.bpo-43787.wCy_Wd.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMTItMTUtMTUtNTAuYnBvLTQzNzg3LndDeV9XZC5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-12-15-15-50.bpo-43787.wCy_Wd.rst @@ -0,0 +1,3 @@ +Add ``__iter__()`` method to :class:`bz2.BZ2File`, :class:`gzip.GzipFile`, and +:class:`lzma.LZMAFile`. It makes iterating them about 2x faster. Patch by +Inada Naoki. diff --git a/Misc/NEWS.d/next/Library/2021-04-12-18-01-10.bpo-43820.YkqYW4.rst b/Misc/NEWS.d/next/Library/2021-04-12-18-01-10.bpo-43820.YkqYW4.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9MaWJyYXJ5LzIwMjEtMDQtMTItMTgtMDEtMTAuYnBvLTQzODIwLllrcVlXNC5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-04-12-18-01-10.bpo-43820.YkqYW4.rst @@ -0,0 +1,2 @@ +Remove an unneeded copy of the namespace passed to +dataclasses.make_dataclass(). diff --git a/Misc/NEWS.d/next/Security/2021-01-31-05-28-14.bpo-43075.DoAXqO.rst b/Misc/NEWS.d/next/Security/2021-01-31-05-28-14.bpo-43075.DoAXqO.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9TZWN1cml0eS8yMDIxLTAxLTMxLTA1LTI4LTE0LmJwby00MzA3NS5Eb0FYcU8ucnN0 --- /dev/null +++ b/Misc/NEWS.d/next/Security/2021-01-31-05-28-14.bpo-43075.DoAXqO.rst @@ -0,0 +1,1 @@ +Fix Regular Expression Denial of Service (ReDoS) vulnerability in :class:`urllib.request.AbstractBasicAuthHandler`. The ReDoS-vulnerable regex has quadratic worst-case complexity and it allows cause a denial of service when identifying crafted invalid RFCs. This ReDoS issue is on the client side and needs remote attackers to control the HTTP server. diff --git a/Misc/NEWS.d/next/Security/2021-03-08-23-06-07.bpo-43439.5U3lXm.rst b/Misc/NEWS.d/next/Security/2021-03-08-23-06-07.bpo-43439.5U3lXm.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9TZWN1cml0eS8yMDIxLTAzLTA4LTIzLTA2LTA3LmJwby00MzQzOS41VTNsWG0ucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Security/2021-03-08-23-06-07.bpo-43439.5U3lXm.rst +++ /dev/null @@ -1,2 +0,0 @@ -Add audit hooks for :func:`gc.get_objects`, :func:`gc.get_referrers` and -:func:`gc.get_referents`. Patch by Pablo Galindo. diff --git a/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst b/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9TZWN1cml0eS8yMDIxLTAzLTEzLTAzLTQ4LTE0LmJwby00MzI4NS5nLUhhaDMucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Security/2021-03-13-03-48-14.bpo-43285.g-Hah3.rst +++ /dev/null @@ -1,8 +0,0 @@ -:mod:`ftplib` no longer trusts the IP address value returned from the server -in response to the PASV command by default. This prevents a malicious FTP -server from using the response to probe IPv4 address and port combinations -on the client network. - -Code that requires the former vulnerable behavior may set a -``trust_server_pasv_ipv4_address`` attribute on their -:class:`ftplib.FTP` instances to ``True`` to re-enable it. diff --git a/Misc/NEWS.d/next/Tests/2021-03-18-10-34-42.bpo-41561.pDg4w-.rst b/Misc/NEWS.d/next/Tests/2021-03-18-10-34-42.bpo-41561.pDg4w-.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9UZXN0cy8yMDIxLTAzLTE4LTEwLTM0LTQyLmJwby00MTU2MS5wRGc0dy0ucnN0..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Tests/2021-03-18-10-34-42.bpo-41561.pDg4w-.rst +++ /dev/null @@ -1,1 +0,0 @@ -Add workaround for Ubuntu's custom OpenSSL security level policy. diff --git a/Misc/NEWS.d/next/Tests/2021-04-09-15-10-38.bpo-43791.4KxiXK.rst b/Misc/NEWS.d/next/Tests/2021-04-09-15-10-38.bpo-43791.4KxiXK.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9UZXN0cy8yMDIxLTA0LTA5LTE1LTEwLTM4LmJwby00Mzc5MS40S3hpWEsucnN0 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2021-04-09-15-10-38.bpo-43791.4KxiXK.rst @@ -0,0 +1,2 @@ +OpenSSL 3.0.0: Disable testing of legacy protocols TLS 1.0 and 1.1. Tests +are failing with TLSV1_ALERT_INTERNAL_ERROR. diff --git a/Misc/NEWS.d/next/Tests/2021-04-12-11-14-28.bpo-43811.vGNbnD.rst b/Misc/NEWS.d/next/Tests/2021-04-12-11-14-28.bpo-43811.vGNbnD.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9UZXN0cy8yMDIxLTA0LTEyLTExLTE0LTI4LmJwby00MzgxMS52R05ibkQucnN0 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2021-04-12-11-14-28.bpo-43811.vGNbnD.rst @@ -0,0 +1,2 @@ +Tests multiple OpenSSL versions on GitHub Actions. Use ccache to speed up +testing. diff --git a/Misc/NEWS.d/next/Windows/2021-03-09-11-15-41.bpo-43440.igy2Mn.rst b/Misc/NEWS.d/next/Windows/2021-03-09-11-15-41.bpo-43440.igy2Mn.rst deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9ORVdTLmQvbmV4dC9XaW5kb3dzLzIwMjEtMDMtMDktMTEtMTUtNDEuYnBvLTQzNDQwLmlneTJNbi5yc3Q=..0000000000000000000000000000000000000000 --- a/Misc/NEWS.d/next/Windows/2021-03-09-11-15-41.bpo-43440.igy2Mn.rst +++ /dev/null @@ -1,2 +0,0 @@ -Build :mod:`sqlite3` with the ``R*Tree`` module enabled. Patch by Erlend E. -Aasland. diff --git a/Misc/NEWS.d/next/Windows/2021-04-06-12-27-33.bpo-43745.rdKNda.rst b/Misc/NEWS.d/next/Windows/2021-04-06-12-27-33.bpo-43745.rdKNda.rst new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9ORVdTLmQvbmV4dC9XaW5kb3dzLzIwMjEtMDQtMDYtMTItMjctMzMuYnBvLTQzNzQ1LnJkS05kYS5yc3Q= --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2021-04-06-12-27-33.bpo-43745.rdKNda.rst @@ -0,0 +1,2 @@ +Actually updates Windows release to OpenSSL 1.1.1k. Earlier releases were +mislabelled and actually included 1.1.1i again. diff --git a/Misc/python.man b/Misc/python.man index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TWlzYy9weXRob24ubWFu..8dd72af26abae4c1395bdd7572059de8fccc8d87_TWlzYy9weXRob24ubWFu 100644 --- a/Misc/python.man +++ b/Misc/python.man @@ -165,7 +165,8 @@ .I sys.path for the named module and runs the corresponding .I .py -file as a script. +file as a script. This terminates the option list (following options +are passed as arguments to the module). .TP .B \-O Remove assert statements and any code conditional on the value of diff --git a/Modules/_blake2/impl/blake2b-ref.c b/Modules/_blake2/impl/blake2b-ref.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fYmxha2UyL2ltcGwvYmxha2UyYi1yZWYuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fYmxha2UyL2ltcGwvYmxha2UyYi1yZWYuYw== 100644 --- a/Modules/_blake2/impl/blake2b-ref.c +++ b/Modules/_blake2/impl/blake2b-ref.c @@ -333,7 +333,7 @@ blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); blake2b_compress( S, S->buf ); S->buflen -= BLAKE2B_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); } blake2b_increment_counter( S, S->buflen ); diff --git a/Modules/_blake2/impl/blake2b.c b/Modules/_blake2/impl/blake2b.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fYmxha2UyL2ltcGwvYmxha2UyYi5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fYmxha2UyL2ltcGwvYmxha2UyYi5j 100644 --- a/Modules/_blake2/impl/blake2b.c +++ b/Modules/_blake2/impl/blake2b.c @@ -388,7 +388,7 @@ blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); blake2b_compress( S, S->buf ); S->buflen -= BLAKE2B_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2B_BLOCKBYTES, S->buflen ); } blake2b_increment_counter( S, S->buflen ); diff --git a/Modules/_blake2/impl/blake2s-ref.c b/Modules/_blake2/impl/blake2s-ref.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fYmxha2UyL2ltcGwvYmxha2Uycy1yZWYuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fYmxha2UyL2ltcGwvYmxha2Uycy1yZWYuYw== 100644 --- a/Modules/_blake2/impl/blake2s-ref.c +++ b/Modules/_blake2/impl/blake2s-ref.c @@ -323,7 +323,7 @@ blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); blake2s_compress( S, S->buf ); S->buflen -= BLAKE2S_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); } blake2s_increment_counter( S, ( uint32_t )S->buflen ); diff --git a/Modules/_blake2/impl/blake2s.c b/Modules/_blake2/impl/blake2s.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fYmxha2UyL2ltcGwvYmxha2Uycy5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fYmxha2UyL2ltcGwvYmxha2Uycy5j 100644 --- a/Modules/_blake2/impl/blake2s.c +++ b/Modules/_blake2/impl/blake2s.c @@ -363,7 +363,7 @@ blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); blake2s_compress( S, S->buf ); S->buflen -= BLAKE2S_BLOCKBYTES; - memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); + memmove( S->buf, S->buf + BLAKE2S_BLOCKBYTES, S->buflen ); } blake2s_increment_counter( S, ( uint32_t )S->buflen ); diff --git a/Modules/_collectionsmodule.c b/Modules/_collectionsmodule.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fY29sbGVjdGlvbnNtb2R1bGUuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fY29sbGVjdGlvbnNtb2R1bGUuYw== 100644 --- a/Modules/_collectionsmodule.c +++ b/Modules/_collectionsmodule.c @@ -118,5 +118,14 @@ #define CHECK_NOT_END(link) #endif +/* A simple freelisting scheme is used to minimize calls to the memory + allocator. It accommodates common use cases where new blocks are being + added at about the same rate as old blocks are being freed. + */ + +#define MAXFREEBLOCKS 16 +static Py_ssize_t numfreeblocks = 0; +static block *freeblocks[MAXFREEBLOCKS]; + static block * newblock(void) { @@ -121,6 +130,11 @@ static block * newblock(void) { - block *b = PyMem_Malloc(sizeof(block)); + block *b; + if (numfreeblocks) { + numfreeblocks--; + return freeblocks[numfreeblocks]; + } + b = PyMem_Malloc(sizeof(block)); if (b != NULL) { return b; } @@ -131,7 +145,12 @@ static void freeblock(block *b) { - PyMem_Free(b); + if (numfreeblocks < MAXFREEBLOCKS) { + freeblocks[numfreeblocks] = b; + numfreeblocks++; + } else { + PyMem_Free(b); + } } static PyObject * diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fY3Vyc2VzbW9kdWxlLmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fY3Vyc2VzbW9kdWxlLmM= 100644 --- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -1343,7 +1343,7 @@ #ifdef NCURSES_MOUSE_VERSION /*[clinic input] -_curses.window.enclose -> long +_curses.window.enclose y: int Y-coordinate. @@ -1354,5 +1354,5 @@ Return True if the screen-relative coordinates are enclosed by the window. [clinic start generated code]*/ -static long +static PyObject * _curses_window_enclose_impl(PyCursesWindowObject *self, int y, int x) @@ -1358,3 +1358,3 @@ _curses_window_enclose_impl(PyCursesWindowObject *self, int y, int x) -/*[clinic end generated code: output=5251c961cbe3df63 input=dfe1d9d4d05d8642]*/ +/*[clinic end generated code: output=8679beef50502648 input=4fd3355d723f7bc9]*/ { @@ -1360,5 +1360,5 @@ { - return wenclose(self->win, y, x); + return PyBool_FromLong(wenclose(self->win, y, x)); } #endif diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC9fZGVjaW1hbC5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9fZGVjaW1hbC5j 100644 --- a/Modules/_decimal/_decimal.c +++ b/Modules/_decimal/_decimal.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,8 +33,6 @@ #include <stdlib.h> -#define CPYTHON_DECIMAL_MODULE -#include "pydecimal.h" #include "docstrings.h" @@ -3295,7 +3293,7 @@ } else { size_t n = strlen(spec.dot); - if (n > 1 || (n == 1 && !isascii((uchar)spec.dot[0]))) { + if (n > 1 || (n == 1 && !isascii((unsigned char)spec.dot[0]))) { /* fix locale dependent non-ascii characters */ dot = dotsep_as_utf8(spec.dot); if (dot == NULL) { @@ -3304,7 +3302,7 @@ spec.dot = PyBytes_AS_STRING(dot); } n = strlen(spec.sep); - if (n > 1 || (n == 1 && !isascii((uchar)spec.sep[0]))) { + if (n > 1 || (n == 1 && !isascii((unsigned char)spec.sep[0]))) { /* fix locale dependent non-ascii characters */ sep = dotsep_as_utf8(spec.sep); if (sep == NULL) { @@ -5570,175 +5568,6 @@ }; -/****************************************************************************/ -/* C-API */ -/****************************************************************************/ - -/* Simple API */ -static int -PyDec_TypeCheck(const PyObject *v) -{ - return PyDec_Check(v); -} - -static int -PyDec_IsSpecial(const PyObject *v) -{ - if (!PyDec_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "PyDec_IsSpecial: argument must be a Decimal"); - return -1; - } - - return mpd_isspecial(MPD(v)); -} - -static int -PyDec_IsNaN(const PyObject *v) -{ - if (!PyDec_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "PyDec_IsNaN: argument must be a Decimal"); - return -1; - } - - return mpd_isnan(MPD(v)); -} - -static int -PyDec_IsInfinite(const PyObject *v) -{ - if (!PyDec_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "PyDec_IsInfinite: argument must be a Decimal"); - return -1; - } - - return mpd_isinfinite(MPD(v)); -} - -static int64_t -PyDec_GetDigits(const PyObject *v) -{ - if (!PyDec_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "PyDec_GetDigits: argument must be a Decimal"); - return -1; - } - - return MPD(v)->digits; -} - -static mpd_uint128_triple_t -PyDec_AsUint128Triple(const PyObject *v) -{ - if (!PyDec_Check(v)) { - mpd_uint128_triple_t triple = { MPD_TRIPLE_ERROR, 0, 0, 0, 0 }; - PyErr_SetString(PyExc_TypeError, - "PyDec_AsUint128Triple: argument must be a Decimal"); - return triple; - } - - return mpd_as_uint128_triple(MPD(v)); -} - -static PyObject * -PyDec_FromUint128Triple(const mpd_uint128_triple_t *triple) -{ - PyObject *context; - PyObject *result; - uint32_t status = 0; - - CURRENT_CONTEXT(context); - - result = dec_alloc(); - if (result == NULL) { - return NULL; - } - - if (mpd_from_uint128_triple(MPD(result), triple, &status) < 0) { - if (dec_addstatus(context, status)) { - Py_DECREF(result); - return NULL; - } - } - - return result; -} - -/* Advanced API */ -static PyObject * -PyDec_Alloc(void) -{ - return dec_alloc(); -} - -static mpd_t * -PyDec_Get(PyObject *v) -{ - if (!PyDec_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "PyDec_Get: argument must be a Decimal"); - return NULL; - } - - return MPD(v); -} - -static const mpd_t * -PyDec_GetConst(const PyObject *v) -{ - if (!PyDec_Check(v)) { - PyErr_SetString(PyExc_TypeError, - "PyDec_GetConst: argument must be a Decimal"); - return NULL; - } - - return MPD(v); -} - -static void -destroy_api(PyObject *capsule) -{ - void *capi = PyCapsule_GetPointer(capsule, PyDec_CAPSULE_NAME); - PyMem_Free(capi); -} - -static PyObject * -init_api(void) -{ - void **_decimal_api = PyMem_Calloc(CPYTHON_DECIMAL_MAX_API, sizeof(void *)); - if (_decimal_api == NULL) { - PyErr_NoMemory(); - return NULL; - } - - /* Simple API */ - _decimal_api[PyDec_TypeCheck_INDEX] = (void *)PyDec_TypeCheck; - _decimal_api[PyDec_IsSpecial_INDEX] = (void *)PyDec_IsSpecial; - _decimal_api[PyDec_IsNaN_INDEX] = (void *)PyDec_IsNaN; - _decimal_api[PyDec_IsInfinite_INDEX] = (void *)PyDec_IsInfinite; - _decimal_api[PyDec_GetDigits_INDEX] = (void *)PyDec_GetDigits; - _decimal_api[PyDec_AsUint128Triple_INDEX] = (void *)PyDec_AsUint128Triple; - _decimal_api[PyDec_FromUint128Triple_INDEX] = (void *)PyDec_FromUint128Triple; - - /* Advanced API */ - _decimal_api[PyDec_Alloc_INDEX] = (void *)PyDec_Alloc; - _decimal_api[PyDec_Get_INDEX] = (void *)PyDec_Get; - _decimal_api[PyDec_GetConst_INDEX] = (void *)PyDec_GetConst; - - PyObject *capsule = PyCapsule_New(_decimal_api, PyDec_CAPSULE_NAME, destroy_api); - if (!capsule) { - PyMem_Free(_decimal_api); - } - return capsule; -} - - -/****************************************************************************/ -/* Module */ -/****************************************************************************/ - static PyMethodDef _decimal_methods [] = { { "getcontext", (PyCFunction)PyDec_GetCurrentContext, METH_NOARGS, doc_getcontext}, @@ -5849,9 +5678,7 @@ DecCondMap *cm; struct ssize_constmap *ssize_cm; struct int_constmap *int_cm; - static PyObject *capsule = NULL; - static int initialized = 0; int i; /* Init libmpdec */ @@ -5854,22 +5681,14 @@ int i; /* Init libmpdec */ - if (!initialized) { - mpd_traphandler = dec_traphandler; - mpd_mallocfunc = PyMem_Malloc; - mpd_reallocfunc = PyMem_Realloc; - mpd_callocfunc = mpd_callocfunc_em; - mpd_free = PyMem_Free; - mpd_setminalloc(_Py_DEC_MINALLOC); - - capsule = init_api(); - if (capsule == NULL) { - return NULL; - } - - initialized = 1; - } + mpd_traphandler = dec_traphandler; + mpd_mallocfunc = PyMem_Malloc; + mpd_reallocfunc = PyMem_Realloc; + mpd_callocfunc = mpd_callocfunc_em; + mpd_free = PyMem_Free; + mpd_setminalloc(_Py_DEC_MINALLOC); + /* Init external C-API functions */ _py_long_multiply = PyLong_Type.tp_as_number->nb_multiply; @@ -6094,10 +5913,6 @@ CHECK_INT(PyModule_AddStringConstant(m, "__version__", "1.70")); CHECK_INT(PyModule_AddStringConstant(m, "__libmpdec_version__", mpd_version())); - /* Add capsule API */ - if (PyModule_AddObjectRef(m, "_API", capsule) < 0) { - goto error; - } return m; @@ -6121,7 +5936,6 @@ Py_CLEAR(basic_context_template); /* GCOV_NOT_REACHED */ Py_CLEAR(extended_context_template); /* GCOV_NOT_REACHED */ Py_CLEAR(m); /* GCOV_NOT_REACHED */ - Py_CLEAR(capsule); /* GCOV_NOT_REACHED */ return NULL; /* GCOV_NOT_REACHED */ } diff --git a/Modules/_decimal/libmpdec/README.txt b/Modules/_decimal/libmpdec/README.txt index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9SRUFETUUudHh0..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9SRUFETUUudHh0 100644 --- a/Modules/_decimal/libmpdec/README.txt +++ b/Modules/_decimal/libmpdec/README.txt @@ -29,7 +29,6 @@ Visual Studio only: ~~~~~~~~~~~~~~~~~~~ - vccompat.h -> snprintf <==> sprintf_s and similar things. vcdiv64.asm -> Double word division used in typearith.h. VS 2008 does not allow inline asm for x64. Also, it does not provide an intrinsic for double word division. diff --git a/Modules/_decimal/libmpdec/bench.c b/Modules/_decimal/libmpdec/bench.c new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9iZW5jaC5j --- /dev/null +++ b/Modules/_decimal/libmpdec/bench.c @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include "mpdecimal.h" + +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <time.h> + + +static void +err_exit(const char *msg) +{ + fprintf(stderr, "%s\n", msg); + exit(1); +} + +static mpd_t * +new_mpd(void) +{ + mpd_t *x = mpd_qnew(); + if (x == NULL) { + err_exit("out of memory"); + } + + return x; +} + +/* Nonsense version of escape-time algorithm for calculating a mandelbrot + * set. Just for benchmarking. */ +static void +color_point(mpd_t *x0, mpd_t *y0, long maxiter, mpd_context_t *ctx) +{ + mpd_t *x, *y, *sq_x, *sq_y; + mpd_t *two; + + x = new_mpd(); + y = new_mpd(); + mpd_set_u32(x, 0, ctx); + mpd_set_u32(y, 0, ctx); + + sq_x = new_mpd(); + sq_y = new_mpd(); + mpd_set_u32(sq_x, 0, ctx); + mpd_set_u32(sq_y, 0, ctx); + + two = new_mpd(); + mpd_set_u32(two, 2, ctx); + + for (long i = 0; i < maxiter; i++) { + mpd_mul(y, x, y, ctx); + mpd_mul(y, y, two, ctx); + mpd_add(y, y, y0, ctx); + + mpd_sub(x, sq_x, sq_y, ctx); + mpd_add(x, x, x0, ctx); + + mpd_mul(sq_x, x, x, ctx); + mpd_mul(sq_y, y, y, ctx); + } + + mpd_copy(x0, x, ctx); + + mpd_del(two); + mpd_del(sq_y); + mpd_del(sq_x); + mpd_del(y); + mpd_del(x); +} + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *x0, *y0; + uint32_t prec = 19; + long iter = 10000000; + clock_t start_clock, end_clock; + + if (argc != 3) { + err_exit("usage: bench prec iter\n"); + } + prec = strtoul(argv[1], NULL, 10); + iter = strtol(argv[2], NULL, 10); + + mpd_init(&ctx, prec); + /* no more MPD_MINALLOC changes after here */ + + x0 = new_mpd(); + y0 = new_mpd(); + mpd_set_string(x0, "0.222", &ctx); + mpd_set_string(y0, "0.333", &ctx); + if (ctx.status & MPD_Errors) { + mpd_del(y0); + mpd_del(x0); + err_exit("unexpected error during conversion"); + } + + start_clock = clock(); + color_point(x0, y0, iter, &ctx); + end_clock = clock(); + + mpd_print(x0); + fprintf(stderr, "time: %f\n\n", (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + mpd_del(y0); + mpd_del(x0); + + return 0; +} diff --git a/Modules/_decimal/libmpdec/bench_full.c b/Modules/_decimal/libmpdec/bench_full.c new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9iZW5jaF9mdWxsLmM= --- /dev/null +++ b/Modules/_decimal/libmpdec/bench_full.c @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include "mpdecimal.h" + +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <time.h> + + +static void +err_exit(const char *msg) +{ + fprintf(stderr, "%s\n", msg); + exit(1); +} + +static mpd_t * +new_mpd(void) +{ + mpd_t *x = mpd_qnew(); + if (x == NULL) { + err_exit("out of memory"); + } + + return x; +} + +/* + * Example from: http://en.wikipedia.org/wiki/Mandelbrot_set + * + * Escape time algorithm for drawing the set: + * + * Point x0, y0 is deemed to be in the Mandelbrot set if the return + * value is maxiter. Lower return values indicate how quickly points + * escaped and can be used for coloring. + */ +static int +color_point(const mpd_t *x0, const mpd_t *y0, const long maxiter, mpd_context_t *ctx) +{ + mpd_t *x, *y, *sq_x, *sq_y; + mpd_t *two, *four, *c; + long i; + + x = new_mpd(); + y = new_mpd(); + mpd_set_u32(x, 0, ctx); + mpd_set_u32(y, 0, ctx); + + sq_x = new_mpd(); + sq_y = new_mpd(); + mpd_set_u32(sq_x, 0, ctx); + mpd_set_u32(sq_y, 0, ctx); + + two = new_mpd(); + four = new_mpd(); + mpd_set_u32(two, 2, ctx); + mpd_set_u32(four, 4, ctx); + + c = new_mpd(); + mpd_set_u32(c, 0, ctx); + + for (i = 0; i < maxiter && mpd_cmp(c, four, ctx) <= 0; i++) { + mpd_mul(y, x, y, ctx); + mpd_mul(y, y, two, ctx); + mpd_add(y, y, y0, ctx); + + mpd_sub(x, sq_x, sq_y, ctx); + mpd_add(x, x, x0, ctx); + + mpd_mul(sq_x, x, x, ctx); + mpd_mul(sq_y, y, y, ctx); + mpd_add(c, sq_x, sq_y, ctx); + } + + mpd_del(c); + mpd_del(four); + mpd_del(two); + mpd_del(sq_y); + mpd_del(sq_x); + mpd_del(y); + mpd_del(x); + + return i; +} + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *x0, *y0; + mpd_t *sqrt_2, *xstep, *ystep; + mpd_ssize_t prec = 19; + + long iter = 1000; + int points[40][80]; + int i, j; + clock_t start_clock, end_clock; + + + if (argc != 3) { + fprintf(stderr, "usage: ./bench prec iter\n"); + exit(1); + } + prec = strtoll(argv[1], NULL, 10); + iter = strtol(argv[2], NULL, 10); + + mpd_init(&ctx, prec); + /* no more MPD_MINALLOC changes after here */ + + sqrt_2 = new_mpd(); + xstep = new_mpd(); + ystep = new_mpd(); + x0 = new_mpd(); + y0 = new_mpd(); + + mpd_set_u32(sqrt_2, 2, &ctx); + mpd_sqrt(sqrt_2, sqrt_2, &ctx); + mpd_div_u32(xstep, sqrt_2, 40, &ctx); + mpd_div_u32(ystep, sqrt_2, 20, &ctx); + + start_clock = clock(); + mpd_copy(y0, sqrt_2, &ctx); + for (i = 0; i < 40; i++) { + mpd_copy(x0, sqrt_2, &ctx); + mpd_set_negative(x0); + for (j = 0; j < 80; j++) { + points[i][j] = color_point(x0, y0, iter, &ctx); + mpd_add(x0, x0, xstep, &ctx); + } + mpd_sub(y0, y0, ystep, &ctx); + } + end_clock = clock(); + +#ifdef BENCH_VERBOSE + for (i = 0; i < 40; i++) { + for (j = 0; j < 80; j++) { + if (points[i][j] == iter) { + putchar('*'); + } + else if (points[i][j] >= 10) { + putchar('+'); + } + else if (points[i][j] >= 5) { + putchar('.'); + } + else { + putchar(' '); + } + } + putchar('\n'); + } + putchar('\n'); +#else + (void)points; /* suppress gcc warning */ +#endif + + printf("time: %f\n\n", (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + mpd_del(y0); + mpd_del(x0); + mpd_del(ystep); + mpd_del(xstep); + mpd_del(sqrt_2); + + return 0; +} diff --git a/Modules/_decimal/libmpdec/constants.c b/Modules/_decimal/libmpdec/constants.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9jb25zdGFudHMuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9jb25zdGFudHMuYw== 100644 --- a/Modules/_decimal/libmpdec/constants.c +++ b/Modules/_decimal/libmpdec/constants.c @@ -27,6 +27,7 @@ #include "mpdecimal.h" +#include "basearith.h" #include "constants.h" @@ -111,7 +112,7 @@ #error "CONFIG_64 or CONFIG_32 must be defined." #endif -const char *mpd_round_string[MPD_ROUND_GUARD] = { +const char * const mpd_round_string[MPD_ROUND_GUARD] = { "ROUND_UP", /* round away from 0 */ "ROUND_DOWN", /* round toward 0 (truncate) */ "ROUND_CEILING", /* round toward +infinity */ @@ -123,7 +124,7 @@ "ROUND_TRUNC", /* truncate, but set infinity */ }; -const char *mpd_clamp_string[MPD_CLAMP_GUARD] = { +const char * const mpd_clamp_string[MPD_CLAMP_GUARD] = { "CLAMP_DEFAULT", "CLAMP_IEEE_754" }; diff --git a/Modules/_decimal/libmpdec/context.c b/Modules/_decimal/libmpdec/context.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9jb250ZXh0LmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9jb250ZXh0LmM= 100644 --- a/Modules/_decimal/libmpdec/context.c +++ b/Modules/_decimal/libmpdec/context.c @@ -235,5 +235,5 @@ } int -mpd_qsettraps(mpd_context_t *ctx, uint32_t traps) +mpd_qsettraps(mpd_context_t *ctx, uint32_t flags) { @@ -239,4 +239,4 @@ { - if (traps > MPD_Max_status) { + if (flags > MPD_Max_status) { return 0; } @@ -241,6 +241,6 @@ return 0; } - ctx->traps = traps; + ctx->traps = flags; return 1; } diff --git a/Modules/_decimal/libmpdec/crt.c b/Modules/_decimal/libmpdec/crt.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9jcnQuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9jcnQuYw== 100644 --- a/Modules/_decimal/libmpdec/crt.c +++ b/Modules/_decimal/libmpdec/crt.c @@ -33,4 +33,5 @@ #include "constants.h" #include "crt.h" #include "numbertheory.h" +#include "typearith.h" #include "umodarith.h" @@ -36,5 +37,4 @@ #include "umodarith.h" -#include "typearith.h" /* Bignum: Chinese Remainder Theorem, extends the maximum transform length. */ @@ -62,5 +62,4 @@ _crt_add3(mpd_uint_t w[3], mpd_uint_t v[3]) { mpd_uint_t carry; - mpd_uint_t s; @@ -66,5 +65,4 @@ - s = w[0] + v[0]; - carry = (s < w[0]); - w[0] = s; + w[0] = w[0] + v[0]; + carry = (w[0] < v[0]); @@ -70,5 +68,4 @@ - s = w[1] + (v[1] + carry); - carry = (s < w[1]); - w[1] = s; + w[1] = w[1] + v[1]; + if (w[1] < v[1]) w[2]++; @@ -74,5 +71,8 @@ - w[2] = w[2] + (v[2] + carry); + w[1] = w[1] + carry; + if (w[1] < carry) w[2]++; + + w[2] += v[2]; } /* Divide 3 words in u by v, store result in w, return remainder. */ diff --git a/Modules/_decimal/libmpdec/crt.h b/Modules/_decimal/libmpdec/crt.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9jcnQuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9jcnQuaA== 100644 --- a/Modules/_decimal/libmpdec/crt.h +++ b/Modules/_decimal/libmpdec/crt.h @@ -37,7 +37,7 @@ MPD_PRAGMA(MPD_HIDE_SYMBOLS_START) -void crt3(mpd_uint_t *x1, mpd_uint_t *x2, mpd_uint_t *x3, mpd_size_t nmemb); +void crt3(mpd_uint_t *x1, mpd_uint_t *x2, mpd_uint_t *x3, mpd_size_t rsize); MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */ diff --git a/Modules/_decimal/libmpdec/examples/README.txt b/Modules/_decimal/libmpdec/examples/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9leGFtcGxlcy9SRUFETUUudHh0 --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/README.txt @@ -0,0 +1,8 @@ + + +This directory contains a number of examples. In order to compile, run +(for example): + +gcc -Wall -W -O2 -o powmod powmod.c -lmpdec -lm + + diff --git a/Modules/_decimal/libmpdec/examples/compare.c b/Modules/_decimal/libmpdec/examples/compare.c new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9leGFtcGxlcy9jb21wYXJlLmM= --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/compare.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <mpdecimal.h> + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 3) { + fprintf(stderr, "compare: usage: ./compare x y\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + + start_clock = clock(); + mpd_compare(result, a, b, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(b); + mpd_del(result); + mpd_free(rstring); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/examples/div.c b/Modules/_decimal/libmpdec/examples/div.c new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9leGFtcGxlcy9kaXYuYw== --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/div.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <mpdecimal.h> + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 3) { + fprintf(stderr, "div: usage: ./div x y\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + + start_clock = clock(); + mpd_div(result, a, b, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(b); + mpd_del(result); + mpd_free(rstring); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/examples/divmod.c b/Modules/_decimal/libmpdec/examples/divmod.c new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9leGFtcGxlcy9kaXZtb2QuYw== --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/divmod.c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <mpdecimal.h> + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b; + mpd_t *q, *r; + char *qs, *rs; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 3) { + fprintf(stderr, "divmod: usage: ./divmod x y\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + q = mpd_new(&ctx); + r = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + + start_clock = clock(); + mpd_divmod(q, r, a, b, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + qs = mpd_to_sci(q, 1); + rs = mpd_to_sci(r, 1); + + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s %s\n", qs, rs, status_str); + + mpd_del(q); + mpd_del(r); + mpd_del(a); + mpd_del(b); + mpd_free(qs); + mpd_free(rs); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/examples/multiply.c b/Modules/_decimal/libmpdec/examples/multiply.c new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9leGFtcGxlcy9tdWx0aXBseS5j --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/multiply.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <mpdecimal.h> + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 3) { + fprintf(stderr, "multiply: usage: ./multiply x y\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + + start_clock = clock(); + mpd_mul(result, a, b, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(b); + mpd_del(result); + mpd_free(rstring); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/examples/pow.c b/Modules/_decimal/libmpdec/examples/pow.c new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9leGFtcGxlcy9wb3cuYw== --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/pow.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <mpdecimal.h> + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 3) { + fprintf(stderr, "pow: usage: ./pow x y\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + + start_clock = clock(); + mpd_pow(result, a, b, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(b); + mpd_del(result); + mpd_free(rstring); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/examples/powmod.c b/Modules/_decimal/libmpdec/examples/powmod.c new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9leGFtcGxlcy9wb3dtb2QuYw== --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/powmod.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <mpdecimal.h> + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b, *c; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 4) { + fprintf(stderr, "powmod: usage: ./powmod x y z\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + c = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + mpd_set_string(c, argv[3], &ctx); + + start_clock = clock(); + mpd_powmod(result, a, b, c, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(b); + mpd_del(c); + mpd_del(result); + mpd_free(rstring); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/examples/shift.c b/Modules/_decimal/libmpdec/examples/shift.c new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9leGFtcGxlcy9zaGlmdC5j --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/shift.c @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <mpdecimal.h> + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a, *b; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 3) { + fprintf(stderr, "shift: usage: ./shift x y\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + b = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + mpd_set_string(b, argv[2], &ctx); + + start_clock = clock(); + mpd_shift(result, a, b, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(b); + mpd_del(result); + mpd_free(rstring); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/examples/sqrt.c b/Modules/_decimal/libmpdec/examples/sqrt.c new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9leGFtcGxlcy9zcXJ0LmM= --- /dev/null +++ b/Modules/_decimal/libmpdec/examples/sqrt.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <mpdecimal.h> + + +int +main(int argc, char **argv) +{ + mpd_context_t ctx; + mpd_t *a; + mpd_t *result; + char *rstring; + char status_str[MPD_MAX_FLAG_STRING]; + clock_t start_clock, end_clock; + + if (argc != 2) { + fprintf(stderr, "sqrt: usage: ./sqrt x\n"); + exit(1); + } + + mpd_init(&ctx, 38); + ctx.traps = 0; + + result = mpd_new(&ctx); + a = mpd_new(&ctx); + mpd_set_string(a, argv[1], &ctx); + + start_clock = clock(); + mpd_sqrt(result, a, &ctx); + end_clock = clock(); + fprintf(stderr, "time: %f\n\n", + (double)(end_clock-start_clock)/(double)CLOCKS_PER_SEC); + + rstring = mpd_to_sci(result, 1); + mpd_snprint_flags(status_str, MPD_MAX_FLAG_STRING, ctx.status); + printf("%s %s\n", rstring, status_str); + + mpd_del(a); + mpd_del(result); + mpd_free(rstring); + + return 0; +} + + diff --git a/Modules/_decimal/libmpdec/io.c b/Modules/_decimal/libmpdec/io.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9pby5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9pby5j 100644 --- a/Modules/_decimal/libmpdec/io.c +++ b/Modules/_decimal/libmpdec/io.c @@ -37,4 +37,5 @@ #include <stdlib.h> #include <string.h> +#include "io.h" #include "typearith.h" @@ -40,8 +41,7 @@ #include "typearith.h" -#include "io.h" /* This file contains functions for decimal <-> string conversions, including PEP-3101 formatting for numeric types. */ @@ -42,9 +42,8 @@ /* This file contains functions for decimal <-> string conversions, including PEP-3101 formatting for numeric types. */ -/* Disable warning that is part of -Wextra since gcc 7.0. */ #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 7 #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" @@ -49,5 +48,6 @@ #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && __GNUC__ >= 7 #pragma GCC diagnostic ignored "-Wimplicit-fallthrough" + #pragma GCC diagnostic ignored "-Wmisleading-indentation" #endif @@ -155,7 +155,7 @@ s++; break; default: - if (!isdigit((uchar)*s)) + if (!isdigit((unsigned char)*s)) return NULL; if (coeff == NULL && *exp == NULL) { if (*s == '0') { @@ -159,5 +159,5 @@ return NULL; if (coeff == NULL && *exp == NULL) { if (*s == '0') { - if (!isdigit((uchar)*(s+1))) + if (!isdigit((unsigned char)*(s+1))) if (!(*(s+1) == '.' && @@ -163,5 +163,5 @@ if (!(*(s+1) == '.' && - isdigit((uchar)*(s+2)))) + isdigit((unsigned char)*(s+2)))) coeff = s; } else { @@ -187,7 +187,7 @@ s++; coeff = s; - while (isdigit((uchar)*s)) + while (isdigit((unsigned char)*s)) s++; *end = s; @@ -689,8 +689,8 @@ static int _mpd_copy_utf8(char dest[5], const char *s) { - const uchar *cp = (const uchar *)s; - uchar lb, ub; + const unsigned char *cp = (const unsigned char *)s; + unsigned char lb, ub; int count, i; @@ -843,7 +843,7 @@ } /* minimum width */ - if (isdigit((uchar)*cp)) { + if (isdigit((unsigned char)*cp)) { if (*cp == '0') { return 0; } @@ -865,7 +865,7 @@ /* fraction digits or significant digits */ if (*cp == '.') { cp++; - if (!isdigit((uchar)*cp)) { + if (!isdigit((unsigned char)*cp)) { return 0; } errno = 0; @@ -1105,5 +1105,5 @@ sign = dp++; } /* integer part */ - assert(isdigit((uchar)*dp)); + assert(isdigit((unsigned char)*dp)); intpart = dp++; @@ -1109,5 +1109,5 @@ intpart = dp++; - while (isdigit((uchar)*dp)) { + while (isdigit((unsigned char)*dp)) { dp++; } n_int = (mpd_ssize_t)(dp-intpart); @@ -1262,8 +1262,8 @@ return NULL; } - if (isupper((uchar)type)) { - type = (char)tolower((uchar)type); + if (isupper((unsigned char)type)) { + type = (char)tolower((unsigned char)type); flags |= MPD_FMT_UPPER; } if (spec->sign == ' ') { diff --git a/Modules/_decimal/libmpdec/mpalloc.c b/Modules/_decimal/libmpdec/mpalloc.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9tcGFsbG9jLmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9tcGFsbG9jLmM= 100644 --- a/Modules/_decimal/libmpdec/mpalloc.c +++ b/Modules/_decimal/libmpdec/mpalloc.c @@ -61,13 +61,6 @@ size_t req; mpd_size_t overflow; -#if MPD_SIZE_MAX < SIZE_MAX - /* full_coverage test only */ - if (nmemb > MPD_SIZE_MAX || size > MPD_SIZE_MAX) { - return NULL; - } -#endif - req = mul_size_t_overflow((mpd_size_t)nmemb, (mpd_size_t)size, &overflow); if (overflow) { diff --git a/Modules/_decimal/libmpdec/mpalloc.h b/Modules/_decimal/libmpdec/mpalloc.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9tcGFsbG9jLmg=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9tcGFsbG9jLmg= 100644 --- a/Modules/_decimal/libmpdec/mpalloc.h +++ b/Modules/_decimal/libmpdec/mpalloc.h @@ -39,7 +39,7 @@ MPD_PRAGMA(MPD_HIDE_SYMBOLS_START) -int mpd_switch_to_dyn(mpd_t *result, mpd_ssize_t size, uint32_t *status); -int mpd_switch_to_dyn_zero(mpd_t *result, mpd_ssize_t size, uint32_t *status); -int mpd_realloc_dyn(mpd_t *result, mpd_ssize_t size, uint32_t *status); +int mpd_switch_to_dyn(mpd_t *result, mpd_ssize_t nwords, uint32_t *status); +int mpd_switch_to_dyn_zero(mpd_t *result, mpd_ssize_t nwords, uint32_t *status); +int mpd_realloc_dyn(mpd_t *result, mpd_ssize_t nwords, uint32_t *status); @@ -45,6 +45,6 @@ -int mpd_switch_to_dyn_cxx(mpd_t *result, mpd_ssize_t size); -int mpd_realloc_dyn_cxx(mpd_t *result, mpd_ssize_t size); +int mpd_switch_to_dyn_cxx(mpd_t *result, mpd_ssize_t nwords); +int mpd_realloc_dyn_cxx(mpd_t *result, mpd_ssize_t nwords); MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */ diff --git a/Modules/_decimal/libmpdec/mpdecimal.c b/Modules/_decimal/libmpdec/mpdecimal.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9tcGRlY2ltYWwuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9tcGRlY2ltYWwuYw== 100644 --- a/Modules/_decimal/libmpdec/mpdecimal.c +++ b/Modules/_decimal/libmpdec/mpdecimal.c @@ -66,7 +66,7 @@ #define ALWAYS_INLINE __forceinline #elif defined(__vms) #define ALWAYS_INLINE inline -#elif defined(__IBMC__) || defined(LEGACY_COMPILER) +#elif defined (__IBMC__) || defined(LEGACY_COMPILER) #define ALWAYS_INLINE #undef inline #define inline @@ -4845,7 +4845,7 @@ uint32_t *status) { mpd_context_t varcontext, maxcontext; - mpd_t *z = (mpd_t *) result; + mpd_t *z = result; MPD_NEW_STATIC(v,0,0,0,0); MPD_NEW_STATIC(vtmp,0,0,0,0); MPD_NEW_STATIC(tmp,0,0,0,0); @@ -6370,7 +6370,7 @@ mpd_context_t workctx; MPD_NEW_STATIC(tbase,0,0,0,0); MPD_NEW_STATIC(texp,0,0,0,0); - mpd_ssize_t n; + mpd_uint_t n; mpd_workcontext(&workctx, ctx); @@ -8092,7 +8092,6 @@ } digits = a->digits+a->exp; - assert(digits > 0); #ifdef CONFIG_64 /* ceil(2711437152599294 / log10(2)) + 4 == 2**53 */ diff --git a/Modules/_decimal/libmpdec/mpdecimal.h b/Modules/_decimal/libmpdec/mpdecimal.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9tcGRlY2ltYWwuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9tcGRlY2ltYWwuaA== 100644 --- a/Modules/_decimal/libmpdec/mpdecimal.h +++ b/Modules/_decimal/libmpdec/mpdecimal.h @@ -40,6 +40,7 @@ #include <cstdint> #include <cstdio> #include <cstdlib> + #define MPD_UINT8_C(x) (static_cast<uint8_t>(x)) extern "C" { #else #include <inttypes.h> @@ -47,6 +48,7 @@ #include <stdint.h> #include <stdio.h> #include <stdlib.h> + #define MPD_UINT8_C(x) ((uint8_t)x) #endif @@ -62,7 +64,6 @@ #endif #if defined(_MSC_VER) - #include "vccompat.h" #define EXTINLINE extern inline #else #define EXTINLINE @@ -74,19 +75,9 @@ MPD_PRAGMA(MPD_HIDE_SYMBOLS_START) -#if !defined(LEGACY_COMPILER) - #if !defined(UINT64_MAX) - /* The following #error is just a warning. If the compiler indeed does - * not have uint64_t, it is perfectly safe to comment out the #error. */ - #error "Warning: Compiler without uint64_t. Comment out this line." - #define LEGACY_COMPILER - #endif -#endif - - /******************************************************************************/ /* Version */ /******************************************************************************/ #define MPD_MAJOR_VERSION 2 #define MPD_MINOR_VERSION 5 @@ -87,8 +78,8 @@ /******************************************************************************/ /* Version */ /******************************************************************************/ #define MPD_MAJOR_VERSION 2 #define MPD_MINOR_VERSION 5 -#define MPD_MICRO_VERSION 0 +#define MPD_MICRO_VERSION 1 @@ -94,5 +85,5 @@ -#define MPD_VERSION "2.5.0" +#define MPD_VERSION "2.5.1" #define MPD_VERSION_HEX ((MPD_MAJOR_VERSION << 24) | \ (MPD_MINOR_VERSION << 16) | \ @@ -162,6 +153,7 @@ #define MPD_EXP_INF 2000000000000000001LL #define MPD_EXP_CLAMP (-4000000000000000001LL) #define MPD_MAXIMPORT 105263157894736842L /* ceil((2*MPD_MAX_PREC)/MPD_RDIGITS) */ +#define MPD_IEEE_CONTEXT_MAX_BITS 512 /* 16*(log2(MPD_MAX_EMAX / 3)-3) */ /* conversion specifiers */ #define PRI_mpd_uint_t PRIu64 @@ -203,9 +195,10 @@ #define MPD_MAX_EMAX 425000000L /* ELIMIT-1 */ #define MPD_MIN_EMIN (-425000000L) /* -EMAX */ #define MPD_MIN_ETINY (MPD_MIN_EMIN-(MPD_MAX_PREC-1)) -#define MPD_EXP_INF 1000000001L /* allows for emax=999999999 in the tests */ -#define MPD_EXP_CLAMP (-2000000001L) /* allows for emin=-999999999 in the tests */ -#define MPD_MAXIMPORT 94444445L /* ceil((2*MPD_MAX_PREC)/MPD_RDIGITS) */ +#define MPD_EXP_INF 1000000001L /* allows for emax=999999999 in the tests */ +#define MPD_EXP_CLAMP (-2000000001L) /* allows for emin=-999999999 in the tests */ +#define MPD_MAXIMPORT 94444445L /* ceil((2*MPD_MAX_PREC)/MPD_RDIGITS) */ +#define MPD_IEEE_CONTEXT_MAX_BITS 256 /* 16*(log2(MPD_MAX_EMAX / 3)-3) */ /* conversion specifiers */ #define PRI_mpd_uint_t PRIu32 @@ -242,8 +235,8 @@ enum { MPD_CLAMP_DEFAULT, MPD_CLAMP_IEEE_754, MPD_CLAMP_GUARD }; -extern const char *mpd_round_string[MPD_ROUND_GUARD]; -extern const char *mpd_clamp_string[MPD_CLAMP_GUARD]; +extern const char * const mpd_round_string[MPD_ROUND_GUARD]; +extern const char * const mpd_clamp_string[MPD_CLAMP_GUARD]; typedef struct mpd_context_t { @@ -300,7 +293,6 @@ #define MPD_Insufficient_storage MPD_Malloc_error /* IEEE 754 interchange format contexts */ -#define MPD_IEEE_CONTEXT_MAX_BITS 512 /* 16*(log2(MPD_MAX_EMAX / 3)-3) */ #define MPD_DECIMAL32 32 #define MPD_DECIMAL64 64 #define MPD_DECIMAL128 128 @@ -345,9 +337,9 @@ /******************************************************************************/ /* mpd_t flags */ -#define MPD_POS ((uint8_t)0) -#define MPD_NEG ((uint8_t)1) -#define MPD_INF ((uint8_t)2) -#define MPD_NAN ((uint8_t)4) -#define MPD_SNAN ((uint8_t)8) +#define MPD_POS MPD_UINT8_C(0) +#define MPD_NEG MPD_UINT8_C(1) +#define MPD_INF MPD_UINT8_C(2) +#define MPD_NAN MPD_UINT8_C(4) +#define MPD_SNAN MPD_UINT8_C(8) #define MPD_SPECIAL (MPD_INF|MPD_NAN|MPD_SNAN) @@ -353,8 +345,8 @@ #define MPD_SPECIAL (MPD_INF|MPD_NAN|MPD_SNAN) -#define MPD_STATIC ((uint8_t)16) -#define MPD_STATIC_DATA ((uint8_t)32) -#define MPD_SHARED_DATA ((uint8_t)64) -#define MPD_CONST_DATA ((uint8_t)128) +#define MPD_STATIC MPD_UINT8_C(16) +#define MPD_STATIC_DATA MPD_UINT8_C(32) +#define MPD_SHARED_DATA MPD_UINT8_C(64) +#define MPD_CONST_DATA MPD_UINT8_C(128) #define MPD_DATAFLAGS (MPD_STATIC_DATA|MPD_SHARED_DATA|MPD_CONST_DATA) /* mpd_t */ @@ -368,9 +360,6 @@ } mpd_t; -typedef unsigned char uchar; - - /******************************************************************************/ /* Triple */ /******************************************************************************/ @@ -442,7 +431,7 @@ /* set to NaN with error flags */ void mpd_seterror(mpd_t *result, uint32_t flags, uint32_t *status); /* set a special with sign and type */ -void mpd_setspecial(mpd_t *dec, uint8_t sign, uint8_t type); +void mpd_setspecial(mpd_t *result, uint8_t sign, uint8_t type); /* set coefficient to zero or all nines */ void mpd_zerocoeff(mpd_t *result); void mpd_qmaxcoeff(mpd_t *result, const mpd_context_t *ctx, uint32_t *status); @@ -835,7 +824,7 @@ mpd_t *mpd_qnew(void); mpd_t *mpd_new(mpd_context_t *ctx); -mpd_t *mpd_qnew_size(mpd_ssize_t size); +mpd_t *mpd_qnew_size(mpd_ssize_t nwords); EXTINLINE void mpd_del(mpd_t *dec); EXTINLINE void mpd_uint_zero(mpd_uint_t *dest, mpd_size_t len); @@ -839,7 +828,7 @@ EXTINLINE void mpd_del(mpd_t *dec); EXTINLINE void mpd_uint_zero(mpd_uint_t *dest, mpd_size_t len); -EXTINLINE int mpd_qresize(mpd_t *result, mpd_ssize_t size, uint32_t *status); -EXTINLINE int mpd_qresize_zero(mpd_t *result, mpd_ssize_t size, uint32_t *status); +EXTINLINE int mpd_qresize(mpd_t *result, mpd_ssize_t nwords, uint32_t *status); +EXTINLINE int mpd_qresize_zero(mpd_t *result, mpd_ssize_t nwords, uint32_t *status); EXTINLINE void mpd_minalloc(mpd_t *result); @@ -844,7 +833,7 @@ EXTINLINE void mpd_minalloc(mpd_t *result); -int mpd_resize(mpd_t *result, mpd_ssize_t size, mpd_context_t *ctx); -int mpd_resize_zero(mpd_t *result, mpd_ssize_t size, mpd_context_t *ctx); +int mpd_resize(mpd_t *result, mpd_ssize_t nwords, mpd_context_t *ctx); +int mpd_resize_zero(mpd_t *result, mpd_ssize_t nwords, mpd_context_t *ctx); MPD_PRAGMA(MPD_HIDE_SYMBOLS_END) /* restore previous scope rules */ diff --git a/Modules/_decimal/libmpdec/mpsignal.c b/Modules/_decimal/libmpdec/mpsignal.c new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy9tcHNpZ25hbC5j --- /dev/null +++ b/Modules/_decimal/libmpdec/mpsignal.c @@ -0,0 +1,967 @@ +/* + * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + +#include "mpdecimal.h" + +#include <stddef.h> +#include <stdint.h> + + +/* Signaling wrappers for the quiet functions in mpdecimal.c. */ + + +char * +mpd_format(const mpd_t *dec, const char *fmt, mpd_context_t *ctx) +{ + char *ret; + uint32_t status = 0; + ret = mpd_qformat(dec, fmt, ctx, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} + +void +mpd_import_u16(mpd_t *result, const uint16_t *srcdata, size_t srclen, + uint8_t srcsign, uint32_t base, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qimport_u16(result, srcdata, srclen, srcsign, base, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_import_u32(mpd_t *result, const uint32_t *srcdata, size_t srclen, + uint8_t srcsign, uint32_t base, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qimport_u32(result, srcdata, srclen, srcsign, base, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +size_t +mpd_export_u16(uint16_t **rdata, size_t rlen, uint32_t base, const mpd_t *src, + mpd_context_t *ctx) +{ + size_t n; + uint32_t status = 0; + n = mpd_qexport_u16(rdata, rlen, base, src, &status); + mpd_addstatus_raise(ctx, status); + return n; +} + +size_t +mpd_export_u32(uint32_t **rdata, size_t rlen, uint32_t base, const mpd_t *src, + mpd_context_t *ctx) +{ + size_t n; + uint32_t status = 0; + n = mpd_qexport_u32(rdata, rlen, base, src, &status); + mpd_addstatus_raise(ctx, status); + return n; +} + +void +mpd_finalize(mpd_t *result, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qfinalize(result, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +int +mpd_check_nan(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + if (mpd_qcheck_nan(result, a, ctx, &status)) { + mpd_addstatus_raise(ctx, status); + return 1; + } + return 0; +} + +int +mpd_check_nans(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + if (mpd_qcheck_nans(result, a, b, ctx, &status)) { + mpd_addstatus_raise(ctx, status); + return 1; + } + return 0; +} + +void +mpd_set_string(mpd_t *result, const char *s, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qset_string(result, s, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_maxcoeff(mpd_t *result, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmaxcoeff(result, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +/* set static mpd from signed integer */ +void +mpd_sset_ssize(mpd_t *result, mpd_ssize_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsset_ssize(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_sset_i32(mpd_t *result, int32_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsset_i32(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifdef CONFIG_64 +void +mpd_sset_i64(mpd_t *result, int64_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsset_i64(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +/* set static mpd from unsigned integer */ +void +mpd_sset_uint(mpd_t *result, mpd_uint_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsset_uint(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_sset_u32(mpd_t *result, uint32_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsset_u32(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifdef CONFIG_64 +void +mpd_sset_u64(mpd_t *result, uint64_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsset_u64(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +/* set mpd from signed integer */ +void +mpd_set_ssize(mpd_t *result, mpd_ssize_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qset_ssize(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_set_i32(mpd_t *result, int32_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qset_i32(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_set_i64(mpd_t *result, int64_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qset_i64(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +/* set mpd from unsigned integer */ +void +mpd_set_uint(mpd_t *result, mpd_uint_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qset_uint(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_set_u32(mpd_t *result, uint32_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qset_u32(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_set_u64(mpd_t *result, uint64_t a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qset_u64(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +/* convert mpd to signed integer */ +mpd_ssize_t +mpd_get_ssize(const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_ssize_t ret; + + ret = mpd_qget_ssize(a, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} + +int32_t +mpd_get_i32(const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + int32_t ret; + + ret = mpd_qget_i32(a, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} + +#ifndef LEGACY_COMPILER +int64_t +mpd_get_i64(const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + int64_t ret; + + ret = mpd_qget_i64(a, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} +#endif + +mpd_uint_t +mpd_get_uint(const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_uint_t ret; + + ret = mpd_qget_uint(a, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} + +mpd_uint_t +mpd_abs_uint(const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_uint_t ret; + + ret = mpd_qabs_uint(a, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} + +uint32_t +mpd_get_u32(const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + uint32_t ret; + + ret = mpd_qget_u32(a, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} + +#ifndef LEGACY_COMPILER +uint64_t +mpd_get_u64(const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + uint64_t ret; + + ret = mpd_qget_u64(a, &status); + mpd_addstatus_raise(ctx, status); + return ret; +} +#endif + +void +mpd_and(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qand(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_copy(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + if (!mpd_qcopy(result, a, &status)) { + mpd_addstatus_raise(ctx, status); + } +} + +void +mpd_canonical(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + mpd_copy(result, a, ctx); +} + +void +mpd_copy_abs(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + if (!mpd_qcopy_abs(result, a, &status)) { + mpd_addstatus_raise(ctx, status); + } +} + +void +mpd_copy_negate(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + if (!mpd_qcopy_negate(result, a, &status)) { + mpd_addstatus_raise(ctx, status); + } +} + +void +mpd_copy_sign(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + if (!mpd_qcopy_sign(result, a, b, &status)) { + mpd_addstatus_raise(ctx, status); + } +} + +void +mpd_invert(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qinvert(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_logb(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qlogb(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_or(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qor(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_rotate(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qrotate(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_scaleb(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qscaleb(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_shiftl(mpd_t *result, const mpd_t *a, mpd_ssize_t n, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qshiftl(result, a, n, &status); + mpd_addstatus_raise(ctx, status); +} + +mpd_uint_t +mpd_shiftr(mpd_t *result, const mpd_t *a, mpd_ssize_t n, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_uint_t rnd; + + rnd = mpd_qshiftr(result, a, n, &status); + mpd_addstatus_raise(ctx, status); + return rnd; +} + +void +mpd_shiftn(mpd_t *result, const mpd_t *a, mpd_ssize_t n, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qshiftn(result, a, n, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_shift(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qshift(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_xor(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qxor(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_abs(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qabs(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +int +mpd_cmp(const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + int c; + c = mpd_qcmp(a, b, &status); + mpd_addstatus_raise(ctx, status); + return c; +} + +int +mpd_compare(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + int c; + c = mpd_qcompare(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); + return c; +} + +int +mpd_compare_signal(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + int c; + c = mpd_qcompare_signal(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); + return c; +} + +void +mpd_add(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qadd(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_sub(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsub(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_add_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qadd_ssize(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_add_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qadd_i32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_add_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qadd_i64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_add_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qadd_uint(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_add_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qadd_u32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_add_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qadd_u64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_sub_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsub_ssize(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_sub_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsub_i32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_sub_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsub_i64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_sub_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsub_uint(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_sub_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsub_u32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_sub_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsub_u64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_div(mpd_t *q, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdiv(q, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_div_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdiv_ssize(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_div_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdiv_i32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_div_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdiv_i64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_div_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdiv_uint(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_div_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdiv_u32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_div_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdiv_u64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_divmod(mpd_t *q, mpd_t *r, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdivmod(q, r, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_divint(mpd_t *q, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qdivint(q, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_exp(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qexp(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_fma(mpd_t *result, const mpd_t *a, const mpd_t *b, const mpd_t *c, + mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qfma(result, a, b, c, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_ln(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qln(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_log10(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qlog10(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_max(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmax(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_max_mag(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmax_mag(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_min(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmin(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_min_mag(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmin_mag(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_minus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qminus(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_mul(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmul(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_mul_ssize(mpd_t *result, const mpd_t *a, mpd_ssize_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmul_ssize(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_mul_i32(mpd_t *result, const mpd_t *a, int32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmul_i32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_mul_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmul_i64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_mul_uint(mpd_t *result, const mpd_t *a, mpd_uint_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmul_uint(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_mul_u32(mpd_t *result, const mpd_t *a, uint32_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmul_u32(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +#ifndef LEGACY_COMPILER +void +mpd_mul_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qmul_u64(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} +#endif + +void +mpd_next_minus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qnext_minus(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_next_plus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qnext_plus(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_next_toward(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qnext_toward(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_plus(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qplus(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_pow(mpd_t *result, const mpd_t *base, const mpd_t *exp, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qpow(result, base, exp, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_powmod(mpd_t *result, const mpd_t *base, const mpd_t *exp, const mpd_t *mod, + mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qpowmod(result, base, exp, mod, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_quantize(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qquantize(result, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_rescale(mpd_t *result, const mpd_t *a, mpd_ssize_t exp, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qrescale(result, a, exp, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_reduce(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qreduce(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_rem(mpd_t *r, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qrem(r, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_rem_near(mpd_t *r, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qrem_near(r, a, b, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_round_to_intx(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qround_to_intx(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_round_to_int(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qround_to_int(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_trunc(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qtrunc(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_floor(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qfloor(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_ceil(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qceil(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_sqrt(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qsqrt(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} + +void +mpd_invroot(mpd_t *result, const mpd_t *a, mpd_context_t *ctx) +{ + uint32_t status = 0; + mpd_qinvroot(result, a, ctx, &status); + mpd_addstatus_raise(ctx, status); +} diff --git a/Modules/_decimal/libmpdec/typearith.h b/Modules/_decimal/libmpdec/typearith.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy90eXBlYXJpdGguaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy90eXBlYXJpdGguaA== 100644 --- a/Modules/_decimal/libmpdec/typearith.h +++ b/Modules/_decimal/libmpdec/typearith.h @@ -638,5 +638,5 @@ static inline mpd_size_t mul_size_t_overflow(mpd_size_t a, mpd_size_t b, mpd_size_t *overflow) { - mpd_uint_t lo; + mpd_uint_t hi, lo; @@ -642,6 +642,6 @@ - _mpd_mul_words((mpd_uint_t *)overflow, &lo, (mpd_uint_t)a, - (mpd_uint_t)b); + _mpd_mul_words(&hi, &lo, (mpd_uint_t)a, (mpd_uint_t)b); + *overflow = (mpd_size_t)hi; return lo; } diff --git a/Modules/_decimal/libmpdec/vccompat.h b/Modules/_decimal/libmpdec/vccompat.h deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC9saWJtcGRlYy92Y2NvbXBhdC5o..0000000000000000000000000000000000000000 --- a/Modules/_decimal/libmpdec/vccompat.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2008-2020 Stefan Krah. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - - -#ifndef LIBMPDEC_VCCOMPAT_H_ -#define LIBMPDEC_VCCOMPAT_H_ - - -/* Visual C fixes: no snprintf ... */ -#ifdef _MSC_VER - #ifndef __cplusplus - #undef inline - #define inline __inline - #endif - #undef random - #define random rand - #undef srandom - #define srandom srand - #undef snprintf - #define snprintf sprintf_s - #define HAVE_SNPRINTF - #undef strncasecmp - #define strncasecmp _strnicmp - #undef strcasecmp - #define strcasecmp _stricmp - #undef strtoll - #define strtoll _strtoi64 - #define strdup _strdup -#endif - - -#endif /* LIBMPDEC_VCCOMPAT_H_ */ diff --git a/Modules/_decimal/tests/bench.py b/Modules/_decimal/tests/bench.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC90ZXN0cy9iZW5jaC5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC90ZXN0cy9iZW5jaC5weQ== 100644 --- a/Modules/_decimal/tests/bench.py +++ b/Modules/_decimal/tests/bench.py @@ -7,4 +7,8 @@ import time +try: + from test.support import import_fresh_module +except ImportError: + from test.test_support import import_fresh_module @@ -10,7 +14,6 @@ -import _decimal as C -import _pydecimal as P - +C = import_fresh_module('decimal', fresh=['_decimal']) +P = import_fresh_module('decimal', blocked=['_decimal']) # # NOTE: This is the pi function from the decimal documentation, modified diff --git a/Modules/_decimal/tests/deccheck.py b/Modules/_decimal/tests/deccheck.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC90ZXN0cy9kZWNjaGVjay5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC90ZXN0cy9kZWNjaGVjay5weQ== 100644 --- a/Modules/_decimal/tests/deccheck.py +++ b/Modules/_decimal/tests/deccheck.py @@ -47,8 +47,9 @@ from queue import Queue, Empty from threading import Thread, Event, Lock +from test.support import import_fresh_module from randdec import randfloat, all_unary, all_binary, all_ternary from randdec import unary_optarg, binary_optarg, ternary_optarg from formathelper import rand_format, rand_locale from _pydecimal import _dec_from_triple @@ -50,15 +51,10 @@ from randdec import randfloat, all_unary, all_binary, all_ternary from randdec import unary_optarg, binary_optarg, ternary_optarg from formathelper import rand_format, rand_locale from _pydecimal import _dec_from_triple -from _testcapi import decimal_as_triple -from _testcapi import decimal_from_triple - -import _decimal as C -import _pydecimal as P - - +C = import_fresh_module('decimal', fresh=['_decimal']) +P = import_fresh_module('decimal', blocked=['_decimal']) EXIT_STATUS = 0 @@ -162,45 +158,6 @@ # ====================================================================== -# Triple tests -# ====================================================================== - -def c_as_triple(dec): - sign, hi, lo, exp = decimal_as_triple(dec) - - coeff = hi * 2**64 + lo - return (sign, coeff, exp) - -def c_from_triple(triple): - sign, coeff, exp = triple - - hi = coeff // 2**64 - lo = coeff % 2**64 - return decimal_from_triple((sign, hi, lo, exp)) - -def p_as_triple(dec): - sign, digits, exp = dec.as_tuple() - - s = "".join(str(d) for d in digits) - coeff = int(s) if s else 0 - - if coeff < 0 or coeff >= 2**128: - raise ValueError("value out of bounds for a uint128 triple") - - return (sign, coeff, exp) - -def p_from_triple(triple): - sign, coeff, exp = triple - - if coeff < 0 or coeff >= 2**128: - raise ValueError("value out of bounds for a uint128 triple") - - digits = tuple(int(c) for c in str(coeff)) - - return P.Decimal((sign, digits, exp)) - - -# ====================================================================== # Unified Context # ====================================================================== @@ -893,30 +850,9 @@ t.presults.append(str(t.rp.imag)) t.presults.append(str(t.rp.real)) - ctriple = None - if str(t.rc) == str(t.rp): # see skip handler - try: - ctriple = c_as_triple(t.rc) - except ValueError: - try: - ptriple = p_as_triple(t.rp) - except ValueError: - pass - else: - raise RuntimeError("ValueError not raised") - else: - cres = c_from_triple(ctriple) - t.cresults.append(ctriple) - t.cresults.append(str(cres)) - - ptriple = p_as_triple(t.rp) - pres = p_from_triple(ptriple) - t.presults.append(ptriple) - t.presults.append(str(pres)) - if t.with_maxcontext and isinstance(t.rmax, C.Decimal): t.maxresults.append(t.rmax.to_eng_string()) t.maxresults.append(t.rmax.as_tuple()) t.maxresults.append(str(t.rmax.imag)) t.maxresults.append(str(t.rmax.real)) @@ -917,20 +853,9 @@ if t.with_maxcontext and isinstance(t.rmax, C.Decimal): t.maxresults.append(t.rmax.to_eng_string()) t.maxresults.append(t.rmax.as_tuple()) t.maxresults.append(str(t.rmax.imag)) t.maxresults.append(str(t.rmax.real)) - if ctriple is not None: - # NaN payloads etc. depend on precision and clamp. - if all_nan(t.rc) and all_nan(t.rmax): - t.maxresults.append(ctriple) - t.maxresults.append(str(cres)) - else: - maxtriple = c_as_triple(t.rmax) - maxres = c_from_triple(maxtriple) - t.maxresults.append(maxtriple) - t.maxresults.append(str(maxres)) - nc = t.rc.number_class().lstrip('+-s') stat[nc] += 1 else: diff --git a/Modules/_decimal/tests/formathelper.py b/Modules/_decimal/tests/formathelper.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fZGVjaW1hbC90ZXN0cy9mb3JtYXRoZWxwZXIucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fZGVjaW1hbC90ZXN0cy9mb3JtYXRoZWxwZXIucHk= 100644 --- a/Modules/_decimal/tests/formathelper.py +++ b/Modules/_decimal/tests/formathelper.py @@ -31,5 +31,6 @@ import os, sys, locale, random import platform, subprocess +from test.support import import_fresh_module from distutils.spawn import find_executable @@ -34,7 +35,7 @@ from distutils.spawn import find_executable -import _decimal as C -import _pydecimal as P +C = import_fresh_module('decimal', fresh=['_decimal']) +P = import_fresh_module('decimal', blocked=['_decimal']) windows_lang_strings = [ diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9faGFzaG9wZW5zc2wuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9faGFzaG9wZW5zc2wuYw== 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -11,9 +11,16 @@ * */ +/* Don't warn about deprecated functions, */ +#ifndef OPENSSL_API_COMPAT + // 0x10101000L == 1.1.1, 30000 == 3.0.0 + #define OPENSSL_API_COMPAT 0x10101000L +#endif +#define OPENSSL_NO_DEPRECATED 1 + #define PY_SSIZE_T_CLEAN #include "Python.h" #include "hashlib.h" #include "pystrhex.h" @@ -14,13 +21,12 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "hashlib.h" #include "pystrhex.h" - /* EVP is the preferred interface to hashing in OpenSSL */ #include <openssl/evp.h> #include <openssl/hmac.h> #include <openssl/crypto.h> /* We use the object interface to discover what hashes OpenSSL supports. */ #include <openssl/objects.h> @@ -21,10 +27,10 @@ /* EVP is the preferred interface to hashing in OpenSSL */ #include <openssl/evp.h> #include <openssl/hmac.h> #include <openssl/crypto.h> /* We use the object interface to discover what hashes OpenSSL supports. */ #include <openssl/objects.h> -#include "openssl/err.h" +#include <openssl/err.h> #include <openssl/crypto.h> // FIPS_mode() @@ -86,6 +92,8 @@ #ifdef PY_OPENSSL_HAS_SHAKE PyTypeObject *EVPXOFtype; #endif + PyObject *constructs; + PyObject *unsupported_digestmod_error; } _hashlibstate; static inline _hashlibstate* @@ -289,6 +297,11 @@ #endif } + if (digest == NULL) { + PyErr_Format(PyExc_ValueError, "unsupported hash type %s", name); + return NULL; + } + return digest; } @@ -292,6 +305,48 @@ return digest; } +/* Get digest EVP from object + * + * * string + * * _hashopenssl builtin function + * + * on error returns NULL with exception set. + */ +static const EVP_MD* +py_digest_by_digestmod(PyObject *module, PyObject *digestmod) { + const EVP_MD* evp; + PyObject *name_obj = NULL; + const char *name; + + if (PyUnicode_Check(digestmod)) { + name_obj = digestmod; + } else { + _hashlibstate *state = get_hashlib_state(module); + // borrowed ref + name_obj = PyDict_GetItem(state->constructs, digestmod); + } + if (name_obj == NULL) { + _hashlibstate *state = get_hashlib_state(module); + PyErr_Clear(); + PyErr_Format( + state->unsupported_digestmod_error, + "Unsupported digestmod %R", digestmod); + return NULL; + } + + name = PyUnicode_AsUTF8(name_obj); + if (name == NULL) { + return NULL; + } + + evp = py_digest_by_name(name); + if (evp == NULL) { + return NULL; + } + + return evp; +} + static EVPobject * newEVPobject(PyTypeObject *type) { @@ -816,7 +871,7 @@ /*[clinic end generated code: output=ddd5053f92dffe90 input=c24554d0337be1b0]*/ { Py_buffer view = { 0 }; - PyObject *ret_obj; + PyObject *ret_obj = NULL; char *name; const EVP_MD *digest = NULL; @@ -829,8 +884,11 @@ GET_BUFFER_VIEW_OR_ERROUT(data_obj, &view); digest = py_digest_by_name(name); + if (digest == NULL) { + goto exit; + } ret_obj = EVPnew(module, digest, (unsigned char*)view.buf, view.len, usedforsecurity); @@ -832,8 +890,9 @@ ret_obj = EVPnew(module, digest, (unsigned char*)view.buf, view.len, usedforsecurity); +exit: if (data_obj) PyBuffer_Release(&view); return ret_obj; @@ -1124,7 +1183,6 @@ digest = py_digest_by_name(hash_name); if (digest == NULL) { - PyErr_SetString(PyExc_ValueError, "unsupported hash type"); goto end; } @@ -1328,10 +1386,10 @@ key: Py_buffer msg: Py_buffer - digest: str + digest: object Single-shot HMAC. [clinic start generated code]*/ static PyObject * _hashlib_hmac_singleshot_impl(PyObject *module, Py_buffer *key, @@ -1332,14 +1390,14 @@ Single-shot HMAC. [clinic start generated code]*/ static PyObject * _hashlib_hmac_singleshot_impl(PyObject *module, Py_buffer *key, - Py_buffer *msg, const char *digest) -/*[clinic end generated code: output=15658ede5ab98185 input=019dffc571909a46]*/ + Py_buffer *msg, PyObject *digest) +/*[clinic end generated code: output=82f19965d12706ac input=0a0790cc3db45c2e]*/ { unsigned char md[EVP_MAX_MD_SIZE] = {0}; unsigned int md_len = 0; unsigned char *result; const EVP_MD *evp; @@ -1340,8 +1398,8 @@ { unsigned char md[EVP_MAX_MD_SIZE] = {0}; unsigned int md_len = 0; unsigned char *result; const EVP_MD *evp; - evp = py_digest_by_name(digest); + evp = py_digest_by_digestmod(module, digest); if (evp == NULL) { @@ -1347,4 +1405,3 @@ if (evp == NULL) { - PyErr_SetString(PyExc_ValueError, "unsupported hash type"); return NULL; } @@ -1349,5 +1406,6 @@ return NULL; } + if (key->len > INT_MAX) { PyErr_SetString(PyExc_OverflowError, "key is too long."); @@ -1385,10 +1443,10 @@ key: Py_buffer msg as msg_obj: object(c_default="NULL") = b'' - digestmod: str(c_default="NULL") = None + digestmod: object(c_default="NULL") = None Return a new hmac object. [clinic start generated code]*/ static PyObject * _hashlib_hmac_new_impl(PyObject *module, Py_buffer *key, PyObject *msg_obj, @@ -1389,11 +1447,11 @@ Return a new hmac object. [clinic start generated code]*/ static PyObject * _hashlib_hmac_new_impl(PyObject *module, Py_buffer *key, PyObject *msg_obj, - const char *digestmod) -/*[clinic end generated code: output=9a35673be0cbea1b input=a0878868eb190134]*/ + PyObject *digestmod) +/*[clinic end generated code: output=c20d9e4d9ed6d219 input=5f4071dcc7f34362]*/ { PyTypeObject *type = get_hashlib_state(module)->HMACtype; const EVP_MD *digest; @@ -1407,9 +1465,9 @@ return NULL; } - if ((digestmod == NULL) || !strlen(digestmod)) { + if (digestmod == NULL) { PyErr_SetString( PyExc_TypeError, "Missing required parameter 'digestmod'."); return NULL; } @@ -1411,11 +1469,10 @@ PyErr_SetString( PyExc_TypeError, "Missing required parameter 'digestmod'."); return NULL; } - digest = py_digest_by_name(digestmod); - if (!digest) { - PyErr_SetString(PyExc_ValueError, "unknown hash function"); + digest = py_digest_by_digestmod(module, digestmod); + if (digest == NULL) { return NULL; } @@ -1811,5 +1868,4 @@ /*[clinic end generated code: output=87eece1bab4d3fa9 input=2db61538c41c6fef]*/ { - int result; #if OPENSSL_VERSION_NUMBER >= 0x30000000L @@ -1815,4 +1871,4 @@ #if OPENSSL_VERSION_NUMBER >= 0x30000000L - result = EVP_default_properties_is_fips_enabled(NULL); + return EVP_default_properties_is_fips_enabled(NULL); #else ERR_clear_error(); @@ -1817,6 +1873,6 @@ #else ERR_clear_error(); - result = FIPS_mode(); + int result = FIPS_mode(); if (result == 0) { // "If the library was built without support of the FIPS Object Module, // then the function will return 0 with an error code of @@ -1985,6 +2041,8 @@ #ifdef PY_OPENSSL_HAS_SHAKE Py_VISIT(state->EVPXOFtype); #endif + Py_VISIT(state->constructs); + Py_VISIT(state->unsupported_digestmod_error); return 0; } @@ -1997,6 +2055,8 @@ #ifdef PY_OPENSSL_HAS_SHAKE Py_CLEAR(state->EVPXOFtype); #endif + Py_CLEAR(state->constructs); + Py_CLEAR(state->unsupported_digestmod_error); return 0; } @@ -2071,6 +2131,74 @@ return 0; } +static int +hashlib_init_constructors(PyObject *module) +{ + /* Create dict from builtin openssl_hash functions to name + * {_hashlib.openssl_sha256: "sha256", ...} + */ + PyModuleDef *mdef; + PyMethodDef *fdef; + PyObject *proxy; + PyObject *func, *name_obj; + _hashlibstate *state = get_hashlib_state(module); + + mdef = PyModule_GetDef(module); + if (mdef == NULL) { + return -1; + } + + state->constructs = PyDict_New(); + if (state->constructs == NULL) { + return -1; + } + + for (fdef = mdef->m_methods; fdef->ml_name != NULL; fdef++) { + if (strncmp(fdef->ml_name, "openssl_", 8)) { + continue; + } + name_obj = PyUnicode_FromString(fdef->ml_name + 8); + if (name_obj == NULL) { + return -1; + } + func = PyObject_GetAttrString(module, fdef->ml_name); + if (func == NULL) { + return -1; + } + if (PyDict_SetItem(state->constructs, func, name_obj) < 0) { + return -1; + } + Py_DECREF(func); + Py_DECREF(name_obj); + } + + proxy = PyDictProxy_New(state->constructs); + if (proxy == NULL) { + return -1; + } + if (PyModule_AddObjectRef(module, "_constructors", proxy) < 0) { + return -1; + } + return 0; +} + +static int +hashlib_exception(PyObject *module) +{ + _hashlibstate *state = get_hashlib_state(module); + state->unsupported_digestmod_error = PyErr_NewException( + "_hashlib.UnsupportedDigestmodError", PyExc_ValueError, NULL); + if (state->unsupported_digestmod_error == NULL) { + return -1; + } + if (PyModule_AddObjectRef(module, "UnsupportedDigestmodError", + state->unsupported_digestmod_error) < 0) { + return -1; + } + return 0; +} + + static PyModuleDef_Slot hashlib_slots[] = { /* OpenSSL 1.0.2 and LibreSSL */ {Py_mod_exec, hashlib_openssl_legacy_init}, @@ -2078,6 +2206,8 @@ {Py_mod_exec, hashlib_init_evpxoftype}, {Py_mod_exec, hashlib_init_hmactype}, {Py_mod_exec, hashlib_md_meth_names}, + {Py_mod_exec, hashlib_init_constructors}, + {Py_mod_exec, hashlib_exception}, {0, NULL} }; diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9faW8vX2lvbW9kdWxlLmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9faW8vX2lvbW9kdWxlLmM= 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -10,6 +10,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "_iomodule.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -33,6 +34,7 @@ PyObject *_PyIO_str_flush = NULL; PyObject *_PyIO_str_getstate = NULL; PyObject *_PyIO_str_isatty = NULL; +PyObject *_PyIO_str_locale = NULL; PyObject *_PyIO_str_newlines = NULL; PyObject *_PyIO_str_nl = NULL; PyObject *_PyIO_str_peek = NULL; @@ -504,6 +506,45 @@ return NULL; } + +/*[clinic input] +_io.text_encoding + encoding: object + stacklevel: int = 2 + / + +A helper function to choose the text encoding. + +When encoding is not None, just return it. +Otherwise, return the default text encoding (i.e. "locale"). + +This function emits an EncodingWarning if encoding is None and +sys.flags.warn_default_encoding is true. + +This can be used in APIs with an encoding=None parameter. +However, please consider using encoding="utf-8" for new APIs. +[clinic start generated code]*/ + +static PyObject * +_io_text_encoding_impl(PyObject *module, PyObject *encoding, int stacklevel) +/*[clinic end generated code: output=91b2cfea6934cc0c input=bf70231213e2a7b4]*/ +{ + if (encoding == NULL || encoding == Py_None) { + PyInterpreterState *interp = _PyInterpreterState_GET(); + if (_PyInterpreterState_GetConfig(interp)->warn_default_encoding) { + if (PyErr_WarnEx(PyExc_EncodingWarning, + "'encoding' argument not specified", stacklevel)) { + return NULL; + } + } + Py_INCREF(_PyIO_str_locale); + return _PyIO_str_locale; + } + Py_INCREF(encoding); + return encoding; +} + + /*[clinic input] _io.open_code @@ -629,6 +670,7 @@ static PyMethodDef module_methods[] = { _IO_OPEN_METHODDEF + _IO_TEXT_ENCODING_METHODDEF _IO_OPEN_CODE_METHODDEF {NULL, NULL} }; @@ -747,6 +789,7 @@ ADD_INTERNED(flush) ADD_INTERNED(getstate) ADD_INTERNED(isatty) + ADD_INTERNED(locale) ADD_INTERNED(newlines) ADD_INTERNED(peek) ADD_INTERNED(read) diff --git a/Modules/_io/clinic/_iomodule.c.h b/Modules/_io/clinic/_iomodule.c.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9faW8vY2xpbmljL19pb21vZHVsZS5jLmg=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9faW8vY2xpbmljL19pb21vZHVsZS5jLmg= 100644 --- a/Modules/_io/clinic/_iomodule.c.h +++ b/Modules/_io/clinic/_iomodule.c.h @@ -272,6 +272,52 @@ return return_value; } +PyDoc_STRVAR(_io_text_encoding__doc__, +"text_encoding($module, encoding, stacklevel=2, /)\n" +"--\n" +"\n" +"A helper function to choose the text encoding.\n" +"\n" +"When encoding is not None, just return it.\n" +"Otherwise, return the default text encoding (i.e. \"locale\").\n" +"\n" +"This function emits an EncodingWarning if encoding is None and\n" +"sys.flags.warn_default_encoding is true.\n" +"\n" +"This can be used in APIs with an encoding=None parameter.\n" +"However, please consider using encoding=\"utf-8\" for new APIs."); + +#define _IO_TEXT_ENCODING_METHODDEF \ + {"text_encoding", (PyCFunction)(void(*)(void))_io_text_encoding, METH_FASTCALL, _io_text_encoding__doc__}, + +static PyObject * +_io_text_encoding_impl(PyObject *module, PyObject *encoding, int stacklevel); + +static PyObject * +_io_text_encoding(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *encoding; + int stacklevel = 2; + + if (!_PyArg_CheckPositional("text_encoding", nargs, 1, 2)) { + goto exit; + } + encoding = args[0]; + if (nargs < 2) { + goto skip_optional; + } + stacklevel = _PyLong_AsInt(args[1]); + if (stacklevel == -1 && PyErr_Occurred()) { + goto exit; + } +skip_optional: + return_value = _io_text_encoding_impl(module, encoding, stacklevel); + +exit: + return return_value; +} + PyDoc_STRVAR(_io_open_code__doc__, "open_code($module, /, path)\n" "--\n" @@ -313,4 +359,4 @@ exit: return return_value; } -/*[clinic end generated code: output=5c0dd7a262c30ebc input=a9049054013a1b77]*/ +/*[clinic end generated code: output=06e055d1d80b835d input=a9049054013a1b77]*/ diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9faW8vdGV4dGlvLmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9faW8vdGV4dGlvLmM= 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -1085,6 +1085,19 @@ self->ok = 0; self->detached = 0; + if (encoding == NULL) { + PyInterpreterState *interp = _PyInterpreterState_GET(); + if (_PyInterpreterState_GetConfig(interp)->warn_default_encoding) { + if (PyErr_WarnEx(PyExc_EncodingWarning, + "'encoding' argument not specified", 1)) { + return -1; + } + } + } + else if (strcmp(encoding, "locale") == 0) { + encoding = NULL; + } + if (errors == Py_None) { errors = _PyUnicode_FromId(&PyId_strict); /* borrowed */ if (errors == NULL) { diff --git a/Modules/_ssl.c b/Modules/_ssl.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fc3NsLmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fc3NsLmM= 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -14,6 +14,13 @@ http://bugs.python.org/issue8108#msg102867 ? */ +/* Don't warn about deprecated functions, */ +#ifndef OPENSSL_API_COMPAT + // 0x10101000L == 1.1.1, 30000 == 3.0.0 + #define OPENSSL_API_COMPAT 0x10101000L +#endif +#define OPENSSL_NO_DEPRECATED 1 + #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -43,14 +50,6 @@ #include <sys/poll.h> #endif -/* Don't warn about deprecated functions */ -#ifdef __GNUC__ -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif -#ifdef __clang__ -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#endif - /* Include OpenSSL header files */ #include "openssl/rsa.h" #include "openssl/crypto.h" @@ -135,4 +134,9 @@ #endif /* Include generated data (error codes) */ +#if (OPENSSL_VERSION_NUMBER >= 0x30000000L) +#include "_ssl_data_300.h" +#elif (OPENSSL_VERSION_NUMBER >= 0x10101000L) && !defined(LIBRESSL_VERSION_NUMBER) +#include "_ssl_data_111.h" +#else #include "_ssl_data.h" @@ -138,7 +142,8 @@ #include "_ssl_data.h" +#endif #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) # define OPENSSL_VERSION_1_1 1 # define PY_OPENSSL_1_1_API 1 #endif @@ -139,12 +144,11 @@ #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !defined(LIBRESSL_VERSION_NUMBER) # define OPENSSL_VERSION_1_1 1 # define PY_OPENSSL_1_1_API 1 #endif -/* OpenSSL API compat */ -#ifdef OPENSSL_API_COMPAT -#if OPENSSL_API_COMPAT >= 0x10100000L - -/* OpenSSL API 1.1.0+ does not include version methods */ +/* OpenSSL API 1.1.0+ does not include version methods. Define the methods + * unless OpenSSL is compiled without the methods. It's the easiest way to + * make 1.0.2, 1.1.0, 1.1.1, and 3.0.0 happy without deprecation warnings. + */ #ifndef OPENSSL_NO_TLS1_METHOD @@ -150,4 +154,4 @@ #ifndef OPENSSL_NO_TLS1_METHOD -#define OPENSSL_NO_TLS1_METHOD 1 +extern const SSL_METHOD *TLSv1_method(void); #endif #ifndef OPENSSL_NO_TLS1_1_METHOD @@ -152,5 +156,5 @@ #endif #ifndef OPENSSL_NO_TLS1_1_METHOD -#define OPENSSL_NO_TLS1_1_METHOD 1 +extern const SSL_METHOD *TLSv1_1_method(void); #endif #ifndef OPENSSL_NO_TLS1_2_METHOD @@ -155,5 +159,5 @@ #endif #ifndef OPENSSL_NO_TLS1_2_METHOD -#define OPENSSL_NO_TLS1_2_METHOD 1 +extern const SSL_METHOD *TLSv1_2_method(void); #endif @@ -158,8 +162,5 @@ #endif -#endif /* >= 1.1.0 compcat */ -#endif /* OPENSSL_API_COMPAT */ - /* LibreSSL 2.7.0 provides necessary OpenSSL 1.1.0 APIs */ #if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x2070000fL # define PY_OPENSSL_1_1_API 1 @@ -2202,6 +2203,11 @@ Py_INCREF(value); Py_SETREF(self->ctx, (PySSLContext *)value); SSL_set_SSL_CTX(self->ssl, self->ctx->ctx); + /* Set SSL* internal msg_callback to state of new context's state */ + SSL_set_msg_callback( + self->ssl, + self->ctx->msg_cb ? _PySSL_msg_callback : NULL + ); #endif } else { PyErr_SetString(PyExc_TypeError, "The value must be a SSLContext"); @@ -3192,6 +3198,10 @@ #ifdef SSL_OP_SINGLE_ECDH_USE options |= SSL_OP_SINGLE_ECDH_USE; #endif +#ifdef SSL_OP_IGNORE_UNEXPECTED_EOF + /* Make OpenSSL 3.0.0 behave like 1.1.1 */ + options |= SSL_OP_IGNORE_UNEXPECTED_EOF; +#endif SSL_CTX_set_options(self->ctx, options); /* A bare minimum cipher list without completely broken cipher suites. @@ -3921,6 +3931,13 @@ PySSL_END_ALLOW_THREADS_S(pw_info->thread_state); + if (pw_info->error) { + /* already failed previously. OpenSSL 3.0.0-alpha14 invokes the + * callback multiple times which can lead to fatal Python error in + * exception check. */ + goto error; + } + if (pw_info->callable) { fn_ret = _PyObject_CallNoArg(pw_info->callable); if (!fn_ret) { @@ -6295,6 +6312,10 @@ PyModule_AddIntConstant(m, "OP_NO_RENEGOTIATION", SSL_OP_NO_RENEGOTIATION); #endif +#ifdef SSL_OP_IGNORE_UNEXPECTED_EOF + PyModule_AddIntConstant(m, "OP_IGNORE_UNEXPECTED_EOF", + SSL_OP_IGNORE_UNEXPECTED_EOF); +#endif #ifdef X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT PyModule_AddIntConstant(m, "HOSTFLAG_ALWAYS_CHECK_SUBJECT", diff --git a/Modules/_ssl/debughelpers.c b/Modules/_ssl/debughelpers.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fc3NsL2RlYnVnaGVscGVycy5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fc3NsL2RlYnVnaGVscGVycy5j 100644 --- a/Modules/_ssl/debughelpers.c +++ b/Modules/_ssl/debughelpers.c @@ -23,6 +23,7 @@ ssl_obj = (PySSLSocket *)SSL_get_app_data(ssl); assert(PySSLSocket_Check(ssl_obj)); if (ssl_obj->ctx->msg_cb == NULL) { + PyGILState_Release(threadstate); return; } diff --git a/Modules/_ssl_data_111.h b/Modules/_ssl_data_111.h new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fc3NsX2RhdGFfMTExLmg= --- /dev/null +++ b/Modules/_ssl_data_111.h @@ -0,0 +1,6525 @@ +/* File generated by Tools/ssl/make_ssl_data.py *//* Generated on 2021-04-09T09:36:21.493286 */ +static struct py_ssl_library_code library_codes[] = { +#ifdef ERR_LIB_ASN1 + {"ASN1", ERR_LIB_ASN1}, +#endif +#ifdef ERR_LIB_ASYNC + {"ASYNC", ERR_LIB_ASYNC}, +#endif +#ifdef ERR_LIB_BIO + {"BIO", ERR_LIB_BIO}, +#endif +#ifdef ERR_LIB_BN + {"BN", ERR_LIB_BN}, +#endif +#ifdef ERR_LIB_BUF + {"BUF", ERR_LIB_BUF}, +#endif +#ifdef ERR_LIB_CMS + {"CMS", ERR_LIB_CMS}, +#endif +#ifdef ERR_LIB_COMP + {"COMP", ERR_LIB_COMP}, +#endif +#ifdef ERR_LIB_CONF + {"CONF", ERR_LIB_CONF}, +#endif +#ifdef ERR_LIB_CRYPTO + {"CRYPTO", ERR_LIB_CRYPTO}, +#endif +#ifdef ERR_LIB_CT + {"CT", ERR_LIB_CT}, +#endif +#ifdef ERR_LIB_DH + {"DH", ERR_LIB_DH}, +#endif +#ifdef ERR_LIB_DSA + {"DSA", ERR_LIB_DSA}, +#endif +#ifdef ERR_LIB_DSO + {"DSO", ERR_LIB_DSO}, +#endif +#ifdef ERR_LIB_EC + {"EC", ERR_LIB_EC}, +#endif +#ifdef ERR_LIB_ECDH + {"ECDH", ERR_LIB_ECDH}, +#endif +#ifdef ERR_LIB_ECDSA + {"ECDSA", ERR_LIB_ECDSA}, +#endif +#ifdef ERR_LIB_ENGINE + {"ENGINE", ERR_LIB_ENGINE}, +#endif +#ifdef ERR_LIB_EVP + {"EVP", ERR_LIB_EVP}, +#endif +#ifdef ERR_LIB_FIPS + {"FIPS", ERR_LIB_FIPS}, +#endif +#ifdef ERR_LIB_HMAC + {"HMAC", ERR_LIB_HMAC}, +#endif +#ifdef ERR_LIB_JPAKE + {"JPAKE", ERR_LIB_JPAKE}, +#endif +#ifdef ERR_LIB_KDF + {"KDF", ERR_LIB_KDF}, +#endif +#ifdef ERR_LIB_METH + {"METH", ERR_LIB_METH}, +#endif +#ifdef ERR_LIB_NONE + {"NONE", ERR_LIB_NONE}, +#endif +#ifdef ERR_LIB_OBJ + {"OBJ", ERR_LIB_OBJ}, +#endif +#ifdef ERR_LIB_OCSP + {"OCSP", ERR_LIB_OCSP}, +#endif +#ifdef ERR_LIB_OSSL_STORE + {"OSSL_STORE", ERR_LIB_OSSL_STORE}, +#endif +#ifdef ERR_LIB_PEM + {"PEM", ERR_LIB_PEM}, +#endif +#ifdef ERR_LIB_PKCS12 + {"PKCS12", ERR_LIB_PKCS12}, +#endif +#ifdef ERR_LIB_PKCS7 + {"PKCS7", ERR_LIB_PKCS7}, +#endif +#ifdef ERR_LIB_PROXY + {"PROXY", ERR_LIB_PROXY}, +#endif +#ifdef ERR_LIB_RAND + {"RAND", ERR_LIB_RAND}, +#endif +#ifdef ERR_LIB_RSA + {"RSA", ERR_LIB_RSA}, +#endif +#ifdef ERR_LIB_RSAREF + {"RSAREF", ERR_LIB_RSAREF}, +#endif +#ifdef ERR_LIB_SM2 + {"SM2", ERR_LIB_SM2}, +#endif +#ifdef ERR_LIB_SSL + {"SSL", ERR_LIB_SSL}, +#endif +#ifdef ERR_LIB_SSL2 + {"SSL2", ERR_LIB_SSL2}, +#endif +#ifdef ERR_LIB_SSL23 + {"SSL23", ERR_LIB_SSL23}, +#endif +#ifdef ERR_LIB_SSL3 + {"SSL3", ERR_LIB_SSL3}, +#endif +#ifdef ERR_LIB_SYS + {"SYS", ERR_LIB_SYS}, +#endif +#ifdef ERR_LIB_TS + {"TS", ERR_LIB_TS}, +#endif +#ifdef ERR_LIB_UI + {"UI", ERR_LIB_UI}, +#endif +#ifdef ERR_LIB_USER + {"USER", ERR_LIB_USER}, +#endif +#ifdef ERR_LIB_X509 + {"X509", ERR_LIB_X509}, +#endif +#ifdef ERR_LIB_X509V3 + {"X509V3", ERR_LIB_X509V3}, +#endif + { NULL } +}; + + +static struct py_ssl_error_code error_codes[] = { + #ifdef ASN1_R_ADDING_OBJECT + {"ADDING_OBJECT", ERR_LIB_ASN1, ASN1_R_ADDING_OBJECT}, + #else + {"ADDING_OBJECT", 13, 171}, + #endif + #ifdef ASN1_R_ASN1_PARSE_ERROR + {"ASN1_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_PARSE_ERROR}, + #else + {"ASN1_PARSE_ERROR", 13, 203}, + #endif + #ifdef ASN1_R_ASN1_SIG_PARSE_ERROR + {"ASN1_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_SIG_PARSE_ERROR}, + #else + {"ASN1_SIG_PARSE_ERROR", 13, 204}, + #endif + #ifdef ASN1_R_AUX_ERROR + {"AUX_ERROR", ERR_LIB_ASN1, ASN1_R_AUX_ERROR}, + #else + {"AUX_ERROR", 13, 100}, + #endif + #ifdef ASN1_R_BAD_OBJECT_HEADER + {"BAD_OBJECT_HEADER", ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER}, + #else + {"BAD_OBJECT_HEADER", 13, 102}, + #endif + #ifdef ASN1_R_BAD_TEMPLATE + {"BAD_TEMPLATE", ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE}, + #else + {"BAD_TEMPLATE", 13, 230}, + #endif + #ifdef ASN1_R_BMPSTRING_IS_WRONG_LENGTH + {"BMPSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH}, + #else + {"BMPSTRING_IS_WRONG_LENGTH", 13, 214}, + #endif + #ifdef ASN1_R_BN_LIB + {"BN_LIB", ERR_LIB_ASN1, ASN1_R_BN_LIB}, + #else + {"BN_LIB", 13, 105}, + #endif + #ifdef ASN1_R_BOOLEAN_IS_WRONG_LENGTH + {"BOOLEAN_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH}, + #else + {"BOOLEAN_IS_WRONG_LENGTH", 13, 106}, + #endif + #ifdef ASN1_R_BUFFER_TOO_SMALL + {"BUFFER_TOO_SMALL", ERR_LIB_ASN1, ASN1_R_BUFFER_TOO_SMALL}, + #else + {"BUFFER_TOO_SMALL", 13, 107}, + #endif + #ifdef ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_ASN1, ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER}, + #else + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 13, 108}, + #endif + #ifdef ASN1_R_CONTEXT_NOT_INITIALISED + {"CONTEXT_NOT_INITIALISED", ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED}, + #else + {"CONTEXT_NOT_INITIALISED", 13, 217}, + #endif + #ifdef ASN1_R_DATA_IS_WRONG + {"DATA_IS_WRONG", ERR_LIB_ASN1, ASN1_R_DATA_IS_WRONG}, + #else + {"DATA_IS_WRONG", 13, 109}, + #endif + #ifdef ASN1_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_ASN1, ASN1_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", 13, 110}, + #endif + #ifdef ASN1_R_DEPTH_EXCEEDED + {"DEPTH_EXCEEDED", ERR_LIB_ASN1, ASN1_R_DEPTH_EXCEEDED}, + #else + {"DEPTH_EXCEEDED", 13, 174}, + #endif + #ifdef ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED + {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED}, + #else + {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", 13, 198}, + #endif + #ifdef ASN1_R_ENCODE_ERROR + {"ENCODE_ERROR", ERR_LIB_ASN1, ASN1_R_ENCODE_ERROR}, + #else + {"ENCODE_ERROR", 13, 112}, + #endif + #ifdef ASN1_R_ERROR_GETTING_TIME + {"ERROR_GETTING_TIME", ERR_LIB_ASN1, ASN1_R_ERROR_GETTING_TIME}, + #else + {"ERROR_GETTING_TIME", 13, 173}, + #endif + #ifdef ASN1_R_ERROR_LOADING_SECTION + {"ERROR_LOADING_SECTION", ERR_LIB_ASN1, ASN1_R_ERROR_LOADING_SECTION}, + #else + {"ERROR_LOADING_SECTION", 13, 172}, + #endif + #ifdef ASN1_R_ERROR_SETTING_CIPHER_PARAMS + {"ERROR_SETTING_CIPHER_PARAMS", ERR_LIB_ASN1, ASN1_R_ERROR_SETTING_CIPHER_PARAMS}, + #else + {"ERROR_SETTING_CIPHER_PARAMS", 13, 114}, + #endif + #ifdef ASN1_R_EXPECTING_AN_INTEGER + {"EXPECTING_AN_INTEGER", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_INTEGER}, + #else + {"EXPECTING_AN_INTEGER", 13, 115}, + #endif + #ifdef ASN1_R_EXPECTING_AN_OBJECT + {"EXPECTING_AN_OBJECT", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_OBJECT}, + #else + {"EXPECTING_AN_OBJECT", 13, 116}, + #endif + #ifdef ASN1_R_EXPLICIT_LENGTH_MISMATCH + {"EXPLICIT_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH}, + #else + {"EXPLICIT_LENGTH_MISMATCH", 13, 119}, + #endif + #ifdef ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED + {"EXPLICIT_TAG_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED}, + #else + {"EXPLICIT_TAG_NOT_CONSTRUCTED", 13, 120}, + #endif + #ifdef ASN1_R_FIELD_MISSING + {"FIELD_MISSING", ERR_LIB_ASN1, ASN1_R_FIELD_MISSING}, + #else + {"FIELD_MISSING", 13, 121}, + #endif + #ifdef ASN1_R_FIRST_NUM_TOO_LARGE + {"FIRST_NUM_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_FIRST_NUM_TOO_LARGE}, + #else + {"FIRST_NUM_TOO_LARGE", 13, 122}, + #endif + #ifdef ASN1_R_HEADER_TOO_LONG + {"HEADER_TOO_LONG", ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG}, + #else + {"HEADER_TOO_LONG", 13, 123}, + #endif + #ifdef ASN1_R_ILLEGAL_BITSTRING_FORMAT + {"ILLEGAL_BITSTRING_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BITSTRING_FORMAT}, + #else + {"ILLEGAL_BITSTRING_FORMAT", 13, 175}, + #endif + #ifdef ASN1_R_ILLEGAL_BOOLEAN + {"ILLEGAL_BOOLEAN", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BOOLEAN}, + #else + {"ILLEGAL_BOOLEAN", 13, 176}, + #endif + #ifdef ASN1_R_ILLEGAL_CHARACTERS + {"ILLEGAL_CHARACTERS", ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS}, + #else + {"ILLEGAL_CHARACTERS", 13, 124}, + #endif + #ifdef ASN1_R_ILLEGAL_FORMAT + {"ILLEGAL_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_FORMAT}, + #else + {"ILLEGAL_FORMAT", 13, 177}, + #endif + #ifdef ASN1_R_ILLEGAL_HEX + {"ILLEGAL_HEX", ERR_LIB_ASN1, ASN1_R_ILLEGAL_HEX}, + #else + {"ILLEGAL_HEX", 13, 178}, + #endif + #ifdef ASN1_R_ILLEGAL_IMPLICIT_TAG + {"ILLEGAL_IMPLICIT_TAG", ERR_LIB_ASN1, ASN1_R_ILLEGAL_IMPLICIT_TAG}, + #else + {"ILLEGAL_IMPLICIT_TAG", 13, 179}, + #endif + #ifdef ASN1_R_ILLEGAL_INTEGER + {"ILLEGAL_INTEGER", ERR_LIB_ASN1, ASN1_R_ILLEGAL_INTEGER}, + #else + {"ILLEGAL_INTEGER", 13, 180}, + #endif + #ifdef ASN1_R_ILLEGAL_NEGATIVE_VALUE + {"ILLEGAL_NEGATIVE_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE}, + #else + {"ILLEGAL_NEGATIVE_VALUE", 13, 226}, + #endif + #ifdef ASN1_R_ILLEGAL_NESTED_TAGGING + {"ILLEGAL_NESTED_TAGGING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NESTED_TAGGING}, + #else + {"ILLEGAL_NESTED_TAGGING", 13, 181}, + #endif + #ifdef ASN1_R_ILLEGAL_NULL + {"ILLEGAL_NULL", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL}, + #else + {"ILLEGAL_NULL", 13, 125}, + #endif + #ifdef ASN1_R_ILLEGAL_NULL_VALUE + {"ILLEGAL_NULL_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL_VALUE}, + #else + {"ILLEGAL_NULL_VALUE", 13, 182}, + #endif + #ifdef ASN1_R_ILLEGAL_OBJECT + {"ILLEGAL_OBJECT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OBJECT}, + #else + {"ILLEGAL_OBJECT", 13, 183}, + #endif + #ifdef ASN1_R_ILLEGAL_OPTIONAL_ANY + {"ILLEGAL_OPTIONAL_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY}, + #else + {"ILLEGAL_OPTIONAL_ANY", 13, 126}, + #endif + #ifdef ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE + {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE}, + #else + {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", 13, 170}, + #endif + #ifdef ASN1_R_ILLEGAL_PADDING + {"ILLEGAL_PADDING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING}, + #else + {"ILLEGAL_PADDING", 13, 221}, + #endif + #ifdef ASN1_R_ILLEGAL_TAGGED_ANY + {"ILLEGAL_TAGGED_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TAGGED_ANY}, + #else + {"ILLEGAL_TAGGED_ANY", 13, 127}, + #endif + #ifdef ASN1_R_ILLEGAL_TIME_VALUE + {"ILLEGAL_TIME_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TIME_VALUE}, + #else + {"ILLEGAL_TIME_VALUE", 13, 184}, + #endif + #ifdef ASN1_R_ILLEGAL_ZERO_CONTENT + {"ILLEGAL_ZERO_CONTENT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT}, + #else + {"ILLEGAL_ZERO_CONTENT", 13, 222}, + #endif + #ifdef ASN1_R_INTEGER_NOT_ASCII_FORMAT + {"INTEGER_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_INTEGER_NOT_ASCII_FORMAT}, + #else + {"INTEGER_NOT_ASCII_FORMAT", 13, 185}, + #endif + #ifdef ASN1_R_INTEGER_TOO_LARGE_FOR_LONG + {"INTEGER_TOO_LARGE_FOR_LONG", ERR_LIB_ASN1, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG}, + #else + {"INTEGER_TOO_LARGE_FOR_LONG", 13, 128}, + #endif + #ifdef ASN1_R_INVALID_BIT_STRING_BITS_LEFT + {"INVALID_BIT_STRING_BITS_LEFT", ERR_LIB_ASN1, ASN1_R_INVALID_BIT_STRING_BITS_LEFT}, + #else + {"INVALID_BIT_STRING_BITS_LEFT", 13, 220}, + #endif + #ifdef ASN1_R_INVALID_BMPSTRING_LENGTH + {"INVALID_BMPSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH}, + #else + {"INVALID_BMPSTRING_LENGTH", 13, 129}, + #endif + #ifdef ASN1_R_INVALID_DIGIT + {"INVALID_DIGIT", ERR_LIB_ASN1, ASN1_R_INVALID_DIGIT}, + #else + {"INVALID_DIGIT", 13, 130}, + #endif + #ifdef ASN1_R_INVALID_MIME_TYPE + {"INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_INVALID_MIME_TYPE}, + #else + {"INVALID_MIME_TYPE", 13, 205}, + #endif + #ifdef ASN1_R_INVALID_MODIFIER + {"INVALID_MODIFIER", ERR_LIB_ASN1, ASN1_R_INVALID_MODIFIER}, + #else + {"INVALID_MODIFIER", 13, 186}, + #endif + #ifdef ASN1_R_INVALID_NUMBER + {"INVALID_NUMBER", ERR_LIB_ASN1, ASN1_R_INVALID_NUMBER}, + #else + {"INVALID_NUMBER", 13, 187}, + #endif + #ifdef ASN1_R_INVALID_OBJECT_ENCODING + {"INVALID_OBJECT_ENCODING", ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING}, + #else + {"INVALID_OBJECT_ENCODING", 13, 216}, + #endif + #ifdef ASN1_R_INVALID_SCRYPT_PARAMETERS + {"INVALID_SCRYPT_PARAMETERS", ERR_LIB_ASN1, ASN1_R_INVALID_SCRYPT_PARAMETERS}, + #else + {"INVALID_SCRYPT_PARAMETERS", 13, 227}, + #endif + #ifdef ASN1_R_INVALID_SEPARATOR + {"INVALID_SEPARATOR", ERR_LIB_ASN1, ASN1_R_INVALID_SEPARATOR}, + #else + {"INVALID_SEPARATOR", 13, 131}, + #endif + #ifdef ASN1_R_INVALID_STRING_TABLE_VALUE + {"INVALID_STRING_TABLE_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_STRING_TABLE_VALUE}, + #else + {"INVALID_STRING_TABLE_VALUE", 13, 218}, + #endif + #ifdef ASN1_R_INVALID_UNIVERSALSTRING_LENGTH + {"INVALID_UNIVERSALSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH}, + #else + {"INVALID_UNIVERSALSTRING_LENGTH", 13, 133}, + #endif + #ifdef ASN1_R_INVALID_UTF8STRING + {"INVALID_UTF8STRING", ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING}, + #else + {"INVALID_UTF8STRING", 13, 134}, + #endif + #ifdef ASN1_R_INVALID_VALUE + {"INVALID_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_VALUE}, + #else + {"INVALID_VALUE", 13, 219}, + #endif + #ifdef ASN1_R_LIST_ERROR + {"LIST_ERROR", ERR_LIB_ASN1, ASN1_R_LIST_ERROR}, + #else + {"LIST_ERROR", 13, 188}, + #endif + #ifdef ASN1_R_MIME_NO_CONTENT_TYPE + {"MIME_NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_MIME_NO_CONTENT_TYPE}, + #else + {"MIME_NO_CONTENT_TYPE", 13, 206}, + #endif + #ifdef ASN1_R_MIME_PARSE_ERROR + {"MIME_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_PARSE_ERROR}, + #else + {"MIME_PARSE_ERROR", 13, 207}, + #endif + #ifdef ASN1_R_MIME_SIG_PARSE_ERROR + {"MIME_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_SIG_PARSE_ERROR}, + #else + {"MIME_SIG_PARSE_ERROR", 13, 208}, + #endif + #ifdef ASN1_R_MISSING_EOC + {"MISSING_EOC", ERR_LIB_ASN1, ASN1_R_MISSING_EOC}, + #else + {"MISSING_EOC", 13, 137}, + #endif + #ifdef ASN1_R_MISSING_SECOND_NUMBER + {"MISSING_SECOND_NUMBER", ERR_LIB_ASN1, ASN1_R_MISSING_SECOND_NUMBER}, + #else + {"MISSING_SECOND_NUMBER", 13, 138}, + #endif + #ifdef ASN1_R_MISSING_VALUE + {"MISSING_VALUE", ERR_LIB_ASN1, ASN1_R_MISSING_VALUE}, + #else + {"MISSING_VALUE", 13, 189}, + #endif + #ifdef ASN1_R_MSTRING_NOT_UNIVERSAL + {"MSTRING_NOT_UNIVERSAL", ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL}, + #else + {"MSTRING_NOT_UNIVERSAL", 13, 139}, + #endif + #ifdef ASN1_R_MSTRING_WRONG_TAG + {"MSTRING_WRONG_TAG", ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG}, + #else + {"MSTRING_WRONG_TAG", 13, 140}, + #endif + #ifdef ASN1_R_NESTED_ASN1_STRING + {"NESTED_ASN1_STRING", ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING}, + #else + {"NESTED_ASN1_STRING", 13, 197}, + #endif + #ifdef ASN1_R_NESTED_TOO_DEEP + {"NESTED_TOO_DEEP", ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP}, + #else + {"NESTED_TOO_DEEP", 13, 201}, + #endif + #ifdef ASN1_R_NON_HEX_CHARACTERS + {"NON_HEX_CHARACTERS", ERR_LIB_ASN1, ASN1_R_NON_HEX_CHARACTERS}, + #else + {"NON_HEX_CHARACTERS", 13, 141}, + #endif + #ifdef ASN1_R_NOT_ASCII_FORMAT + {"NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_NOT_ASCII_FORMAT}, + #else + {"NOT_ASCII_FORMAT", 13, 190}, + #endif + #ifdef ASN1_R_NOT_ENOUGH_DATA + {"NOT_ENOUGH_DATA", ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA}, + #else + {"NOT_ENOUGH_DATA", 13, 142}, + #endif + #ifdef ASN1_R_NO_CONTENT_TYPE + {"NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_CONTENT_TYPE}, + #else + {"NO_CONTENT_TYPE", 13, 209}, + #endif + #ifdef ASN1_R_NO_MATCHING_CHOICE_TYPE + {"NO_MATCHING_CHOICE_TYPE", ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE}, + #else + {"NO_MATCHING_CHOICE_TYPE", 13, 143}, + #endif + #ifdef ASN1_R_NO_MULTIPART_BODY_FAILURE + {"NO_MULTIPART_BODY_FAILURE", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BODY_FAILURE}, + #else + {"NO_MULTIPART_BODY_FAILURE", 13, 210}, + #endif + #ifdef ASN1_R_NO_MULTIPART_BOUNDARY + {"NO_MULTIPART_BOUNDARY", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BOUNDARY}, + #else + {"NO_MULTIPART_BOUNDARY", 13, 211}, + #endif + #ifdef ASN1_R_NO_SIG_CONTENT_TYPE + {"NO_SIG_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_SIG_CONTENT_TYPE}, + #else + {"NO_SIG_CONTENT_TYPE", 13, 212}, + #endif + #ifdef ASN1_R_NULL_IS_WRONG_LENGTH + {"NULL_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH}, + #else + {"NULL_IS_WRONG_LENGTH", 13, 144}, + #endif + #ifdef ASN1_R_OBJECT_NOT_ASCII_FORMAT + {"OBJECT_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_OBJECT_NOT_ASCII_FORMAT}, + #else + {"OBJECT_NOT_ASCII_FORMAT", 13, 191}, + #endif + #ifdef ASN1_R_ODD_NUMBER_OF_CHARS + {"ODD_NUMBER_OF_CHARS", ERR_LIB_ASN1, ASN1_R_ODD_NUMBER_OF_CHARS}, + #else + {"ODD_NUMBER_OF_CHARS", 13, 145}, + #endif + #ifdef ASN1_R_SECOND_NUMBER_TOO_LARGE + {"SECOND_NUMBER_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_SECOND_NUMBER_TOO_LARGE}, + #else + {"SECOND_NUMBER_TOO_LARGE", 13, 147}, + #endif + #ifdef ASN1_R_SEQUENCE_LENGTH_MISMATCH + {"SEQUENCE_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH}, + #else + {"SEQUENCE_LENGTH_MISMATCH", 13, 148}, + #endif + #ifdef ASN1_R_SEQUENCE_NOT_CONSTRUCTED + {"SEQUENCE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED}, + #else + {"SEQUENCE_NOT_CONSTRUCTED", 13, 149}, + #endif + #ifdef ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG + {"SEQUENCE_OR_SET_NEEDS_CONFIG", ERR_LIB_ASN1, ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG}, + #else + {"SEQUENCE_OR_SET_NEEDS_CONFIG", 13, 192}, + #endif + #ifdef ASN1_R_SHORT_LINE + {"SHORT_LINE", ERR_LIB_ASN1, ASN1_R_SHORT_LINE}, + #else + {"SHORT_LINE", 13, 150}, + #endif + #ifdef ASN1_R_SIG_INVALID_MIME_TYPE + {"SIG_INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_SIG_INVALID_MIME_TYPE}, + #else + {"SIG_INVALID_MIME_TYPE", 13, 213}, + #endif + #ifdef ASN1_R_STREAMING_NOT_SUPPORTED + {"STREAMING_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_STREAMING_NOT_SUPPORTED}, + #else + {"STREAMING_NOT_SUPPORTED", 13, 202}, + #endif + #ifdef ASN1_R_STRING_TOO_LONG + {"STRING_TOO_LONG", ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG}, + #else + {"STRING_TOO_LONG", 13, 151}, + #endif + #ifdef ASN1_R_STRING_TOO_SHORT + {"STRING_TOO_SHORT", ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT}, + #else + {"STRING_TOO_SHORT", 13, 152}, + #endif + #ifdef ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_ASN1, ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD}, + #else + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 13, 154}, + #endif + #ifdef ASN1_R_TIME_NOT_ASCII_FORMAT + {"TIME_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_TIME_NOT_ASCII_FORMAT}, + #else + {"TIME_NOT_ASCII_FORMAT", 13, 193}, + #endif + #ifdef ASN1_R_TOO_LARGE + {"TOO_LARGE", ERR_LIB_ASN1, ASN1_R_TOO_LARGE}, + #else + {"TOO_LARGE", 13, 223}, + #endif + #ifdef ASN1_R_TOO_LONG + {"TOO_LONG", ERR_LIB_ASN1, ASN1_R_TOO_LONG}, + #else + {"TOO_LONG", 13, 155}, + #endif + #ifdef ASN1_R_TOO_SMALL + {"TOO_SMALL", ERR_LIB_ASN1, ASN1_R_TOO_SMALL}, + #else + {"TOO_SMALL", 13, 224}, + #endif + #ifdef ASN1_R_TYPE_NOT_CONSTRUCTED + {"TYPE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED}, + #else + {"TYPE_NOT_CONSTRUCTED", 13, 156}, + #endif + #ifdef ASN1_R_TYPE_NOT_PRIMITIVE + {"TYPE_NOT_PRIMITIVE", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE}, + #else + {"TYPE_NOT_PRIMITIVE", 13, 195}, + #endif + #ifdef ASN1_R_UNEXPECTED_EOC + {"UNEXPECTED_EOC", ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC}, + #else + {"UNEXPECTED_EOC", 13, 159}, + #endif + #ifdef ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH + {"UNIVERSALSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH}, + #else + {"UNIVERSALSTRING_IS_WRONG_LENGTH", 13, 215}, + #endif + #ifdef ASN1_R_UNKNOWN_FORMAT + {"UNKNOWN_FORMAT", ERR_LIB_ASN1, ASN1_R_UNKNOWN_FORMAT}, + #else + {"UNKNOWN_FORMAT", 13, 160}, + #endif + #ifdef ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM + {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM}, + #else + {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", 13, 161}, + #endif + #ifdef ASN1_R_UNKNOWN_OBJECT_TYPE + {"UNKNOWN_OBJECT_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_OBJECT_TYPE}, + #else + {"UNKNOWN_OBJECT_TYPE", 13, 162}, + #endif + #ifdef ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE + {"UNKNOWN_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE}, + #else + {"UNKNOWN_PUBLIC_KEY_TYPE", 13, 163}, + #endif + #ifdef ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM + {"UNKNOWN_SIGNATURE_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM}, + #else + {"UNKNOWN_SIGNATURE_ALGORITHM", 13, 199}, + #endif + #ifdef ASN1_R_UNKNOWN_TAG + {"UNKNOWN_TAG", ERR_LIB_ASN1, ASN1_R_UNKNOWN_TAG}, + #else + {"UNKNOWN_TAG", 13, 194}, + #endif + #ifdef ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE + {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE}, + #else + {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", 13, 164}, + #endif + #ifdef ASN1_R_UNSUPPORTED_CIPHER + {"UNSUPPORTED_CIPHER", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_CIPHER}, + #else + {"UNSUPPORTED_CIPHER", 13, 228}, + #endif + #ifdef ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE + {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE}, + #else + {"UNSUPPORTED_PUBLIC_KEY_TYPE", 13, 167}, + #endif + #ifdef ASN1_R_UNSUPPORTED_TYPE + {"UNSUPPORTED_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_TYPE}, + #else + {"UNSUPPORTED_TYPE", 13, 196}, + #endif + #ifdef ASN1_R_WRONG_INTEGER_TYPE + {"WRONG_INTEGER_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE}, + #else + {"WRONG_INTEGER_TYPE", 13, 225}, + #endif + #ifdef ASN1_R_WRONG_PUBLIC_KEY_TYPE + {"WRONG_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE}, + #else + {"WRONG_PUBLIC_KEY_TYPE", 13, 200}, + #endif + #ifdef ASN1_R_WRONG_TAG + {"WRONG_TAG", ERR_LIB_ASN1, ASN1_R_WRONG_TAG}, + #else + {"WRONG_TAG", 13, 168}, + #endif + #ifdef ASYNC_R_FAILED_TO_SET_POOL + {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SET_POOL}, + #else + {"FAILED_TO_SET_POOL", 51, 101}, + #endif + #ifdef ASYNC_R_FAILED_TO_SWAP_CONTEXT + {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SWAP_CONTEXT}, + #else + {"FAILED_TO_SWAP_CONTEXT", 51, 102}, + #endif + #ifdef ASYNC_R_INIT_FAILED + {"INIT_FAILED", ERR_LIB_ASYNC, ASYNC_R_INIT_FAILED}, + #else + {"INIT_FAILED", 51, 105}, + #endif + #ifdef ASYNC_R_INVALID_POOL_SIZE + {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, ASYNC_R_INVALID_POOL_SIZE}, + #else + {"INVALID_POOL_SIZE", 51, 103}, + #endif + #ifdef BIO_R_ACCEPT_ERROR + {"ACCEPT_ERROR", ERR_LIB_BIO, BIO_R_ACCEPT_ERROR}, + #else + {"ACCEPT_ERROR", 32, 100}, + #endif + #ifdef BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET + {"ADDRINFO_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET}, + #else + {"ADDRINFO_ADDR_IS_NOT_AF_INET", 32, 141}, + #endif + #ifdef BIO_R_AMBIGUOUS_HOST_OR_SERVICE + {"AMBIGUOUS_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_AMBIGUOUS_HOST_OR_SERVICE}, + #else + {"AMBIGUOUS_HOST_OR_SERVICE", 32, 129}, + #endif + #ifdef BIO_R_BAD_FOPEN_MODE + {"BAD_FOPEN_MODE", ERR_LIB_BIO, BIO_R_BAD_FOPEN_MODE}, + #else + {"BAD_FOPEN_MODE", 32, 101}, + #endif + #ifdef BIO_R_BROKEN_PIPE + {"BROKEN_PIPE", ERR_LIB_BIO, BIO_R_BROKEN_PIPE}, + #else + {"BROKEN_PIPE", 32, 124}, + #endif + #ifdef BIO_R_CONNECT_ERROR + {"CONNECT_ERROR", ERR_LIB_BIO, BIO_R_CONNECT_ERROR}, + #else + {"CONNECT_ERROR", 32, 103}, + #endif + #ifdef BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET + {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET}, + #else + {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", 32, 107}, + #endif + #ifdef BIO_R_GETSOCKNAME_ERROR + {"GETSOCKNAME_ERROR", ERR_LIB_BIO, BIO_R_GETSOCKNAME_ERROR}, + #else + {"GETSOCKNAME_ERROR", 32, 132}, + #endif + #ifdef BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS + {"GETSOCKNAME_TRUNCATED_ADDRESS", ERR_LIB_BIO, BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS}, + #else + {"GETSOCKNAME_TRUNCATED_ADDRESS", 32, 133}, + #endif + #ifdef BIO_R_GETTING_SOCKTYPE + {"GETTING_SOCKTYPE", ERR_LIB_BIO, BIO_R_GETTING_SOCKTYPE}, + #else + {"GETTING_SOCKTYPE", 32, 134}, + #endif + #ifdef BIO_R_INVALID_ARGUMENT + {"INVALID_ARGUMENT", ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT}, + #else + {"INVALID_ARGUMENT", 32, 125}, + #endif + #ifdef BIO_R_INVALID_SOCKET + {"INVALID_SOCKET", ERR_LIB_BIO, BIO_R_INVALID_SOCKET}, + #else + {"INVALID_SOCKET", 32, 135}, + #endif + #ifdef BIO_R_IN_USE + {"IN_USE", ERR_LIB_BIO, BIO_R_IN_USE}, + #else + {"IN_USE", 32, 123}, + #endif + #ifdef BIO_R_LENGTH_TOO_LONG + {"LENGTH_TOO_LONG", ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG}, + #else + {"LENGTH_TOO_LONG", 32, 102}, + #endif + #ifdef BIO_R_LISTEN_V6_ONLY + {"LISTEN_V6_ONLY", ERR_LIB_BIO, BIO_R_LISTEN_V6_ONLY}, + #else + {"LISTEN_V6_ONLY", 32, 136}, + #endif + #ifdef BIO_R_LOOKUP_RETURNED_NOTHING + {"LOOKUP_RETURNED_NOTHING", ERR_LIB_BIO, BIO_R_LOOKUP_RETURNED_NOTHING}, + #else + {"LOOKUP_RETURNED_NOTHING", 32, 142}, + #endif + #ifdef BIO_R_MALFORMED_HOST_OR_SERVICE + {"MALFORMED_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_MALFORMED_HOST_OR_SERVICE}, + #else + {"MALFORMED_HOST_OR_SERVICE", 32, 130}, + #endif + #ifdef BIO_R_NBIO_CONNECT_ERROR + {"NBIO_CONNECT_ERROR", ERR_LIB_BIO, BIO_R_NBIO_CONNECT_ERROR}, + #else + {"NBIO_CONNECT_ERROR", 32, 110}, + #endif + #ifdef BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED + {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED}, + #else + {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", 32, 143}, + #endif + #ifdef BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED + {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED}, + #else + {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", 32, 144}, + #endif + #ifdef BIO_R_NO_PORT_DEFINED + {"NO_PORT_DEFINED", ERR_LIB_BIO, BIO_R_NO_PORT_DEFINED}, + #else + {"NO_PORT_DEFINED", 32, 113}, + #endif + #ifdef BIO_R_NO_SUCH_FILE + {"NO_SUCH_FILE", ERR_LIB_BIO, BIO_R_NO_SUCH_FILE}, + #else + {"NO_SUCH_FILE", 32, 128}, + #endif + #ifdef BIO_R_NULL_PARAMETER + {"NULL_PARAMETER", ERR_LIB_BIO, BIO_R_NULL_PARAMETER}, + #else + {"NULL_PARAMETER", 32, 115}, + #endif + #ifdef BIO_R_UNABLE_TO_BIND_SOCKET + {"UNABLE_TO_BIND_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_BIND_SOCKET}, + #else + {"UNABLE_TO_BIND_SOCKET", 32, 117}, + #endif + #ifdef BIO_R_UNABLE_TO_CREATE_SOCKET + {"UNABLE_TO_CREATE_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_CREATE_SOCKET}, + #else + {"UNABLE_TO_CREATE_SOCKET", 32, 118}, + #endif + #ifdef BIO_R_UNABLE_TO_KEEPALIVE + {"UNABLE_TO_KEEPALIVE", ERR_LIB_BIO, BIO_R_UNABLE_TO_KEEPALIVE}, + #else + {"UNABLE_TO_KEEPALIVE", 32, 137}, + #endif + #ifdef BIO_R_UNABLE_TO_LISTEN_SOCKET + {"UNABLE_TO_LISTEN_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_LISTEN_SOCKET}, + #else + {"UNABLE_TO_LISTEN_SOCKET", 32, 119}, + #endif + #ifdef BIO_R_UNABLE_TO_NODELAY + {"UNABLE_TO_NODELAY", ERR_LIB_BIO, BIO_R_UNABLE_TO_NODELAY}, + #else + {"UNABLE_TO_NODELAY", 32, 138}, + #endif + #ifdef BIO_R_UNABLE_TO_REUSEADDR + {"UNABLE_TO_REUSEADDR", ERR_LIB_BIO, BIO_R_UNABLE_TO_REUSEADDR}, + #else + {"UNABLE_TO_REUSEADDR", 32, 139}, + #endif + #ifdef BIO_R_UNAVAILABLE_IP_FAMILY + {"UNAVAILABLE_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNAVAILABLE_IP_FAMILY}, + #else + {"UNAVAILABLE_IP_FAMILY", 32, 145}, + #endif + #ifdef BIO_R_UNINITIALIZED + {"UNINITIALIZED", ERR_LIB_BIO, BIO_R_UNINITIALIZED}, + #else + {"UNINITIALIZED", 32, 120}, + #endif + #ifdef BIO_R_UNKNOWN_INFO_TYPE + {"UNKNOWN_INFO_TYPE", ERR_LIB_BIO, BIO_R_UNKNOWN_INFO_TYPE}, + #else + {"UNKNOWN_INFO_TYPE", 32, 140}, + #endif + #ifdef BIO_R_UNSUPPORTED_IP_FAMILY + {"UNSUPPORTED_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_IP_FAMILY}, + #else + {"UNSUPPORTED_IP_FAMILY", 32, 146}, + #endif + #ifdef BIO_R_UNSUPPORTED_METHOD + {"UNSUPPORTED_METHOD", ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD}, + #else + {"UNSUPPORTED_METHOD", 32, 121}, + #endif + #ifdef BIO_R_UNSUPPORTED_PROTOCOL_FAMILY + {"UNSUPPORTED_PROTOCOL_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_PROTOCOL_FAMILY}, + #else + {"UNSUPPORTED_PROTOCOL_FAMILY", 32, 131}, + #endif + #ifdef BIO_R_WRITE_TO_READ_ONLY_BIO + {"WRITE_TO_READ_ONLY_BIO", ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO}, + #else + {"WRITE_TO_READ_ONLY_BIO", 32, 126}, + #endif + #ifdef BIO_R_WSASTARTUP + {"WSASTARTUP", ERR_LIB_BIO, BIO_R_WSASTARTUP}, + #else + {"WSASTARTUP", 32, 122}, + #endif + #ifdef BN_R_ARG2_LT_ARG3 + {"ARG2_LT_ARG3", ERR_LIB_BN, BN_R_ARG2_LT_ARG3}, + #else + {"ARG2_LT_ARG3", 3, 100}, + #endif + #ifdef BN_R_BAD_RECIPROCAL + {"BAD_RECIPROCAL", ERR_LIB_BN, BN_R_BAD_RECIPROCAL}, + #else + {"BAD_RECIPROCAL", 3, 101}, + #endif + #ifdef BN_R_BIGNUM_TOO_LONG + {"BIGNUM_TOO_LONG", ERR_LIB_BN, BN_R_BIGNUM_TOO_LONG}, + #else + {"BIGNUM_TOO_LONG", 3, 114}, + #endif + #ifdef BN_R_BITS_TOO_SMALL + {"BITS_TOO_SMALL", ERR_LIB_BN, BN_R_BITS_TOO_SMALL}, + #else + {"BITS_TOO_SMALL", 3, 118}, + #endif + #ifdef BN_R_CALLED_WITH_EVEN_MODULUS + {"CALLED_WITH_EVEN_MODULUS", ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS}, + #else + {"CALLED_WITH_EVEN_MODULUS", 3, 102}, + #endif + #ifdef BN_R_DIV_BY_ZERO + {"DIV_BY_ZERO", ERR_LIB_BN, BN_R_DIV_BY_ZERO}, + #else + {"DIV_BY_ZERO", 3, 103}, + #endif + #ifdef BN_R_ENCODING_ERROR + {"ENCODING_ERROR", ERR_LIB_BN, BN_R_ENCODING_ERROR}, + #else + {"ENCODING_ERROR", 3, 104}, + #endif + #ifdef BN_R_EXPAND_ON_STATIC_BIGNUM_DATA + {"EXPAND_ON_STATIC_BIGNUM_DATA", ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA}, + #else + {"EXPAND_ON_STATIC_BIGNUM_DATA", 3, 105}, + #endif + #ifdef BN_R_INPUT_NOT_REDUCED + {"INPUT_NOT_REDUCED", ERR_LIB_BN, BN_R_INPUT_NOT_REDUCED}, + #else + {"INPUT_NOT_REDUCED", 3, 110}, + #endif + #ifdef BN_R_INVALID_LENGTH + {"INVALID_LENGTH", ERR_LIB_BN, BN_R_INVALID_LENGTH}, + #else + {"INVALID_LENGTH", 3, 106}, + #endif + #ifdef BN_R_INVALID_RANGE + {"INVALID_RANGE", ERR_LIB_BN, BN_R_INVALID_RANGE}, + #else + {"INVALID_RANGE", 3, 115}, + #endif + #ifdef BN_R_INVALID_SHIFT + {"INVALID_SHIFT", ERR_LIB_BN, BN_R_INVALID_SHIFT}, + #else + {"INVALID_SHIFT", 3, 119}, + #endif + #ifdef BN_R_NOT_A_SQUARE + {"NOT_A_SQUARE", ERR_LIB_BN, BN_R_NOT_A_SQUARE}, + #else + {"NOT_A_SQUARE", 3, 111}, + #endif + #ifdef BN_R_NOT_INITIALIZED + {"NOT_INITIALIZED", ERR_LIB_BN, BN_R_NOT_INITIALIZED}, + #else + {"NOT_INITIALIZED", 3, 107}, + #endif + #ifdef BN_R_NO_INVERSE + {"NO_INVERSE", ERR_LIB_BN, BN_R_NO_INVERSE}, + #else + {"NO_INVERSE", 3, 108}, + #endif + #ifdef BN_R_NO_SOLUTION + {"NO_SOLUTION", ERR_LIB_BN, BN_R_NO_SOLUTION}, + #else + {"NO_SOLUTION", 3, 116}, + #endif + #ifdef BN_R_PRIVATE_KEY_TOO_LARGE + {"PRIVATE_KEY_TOO_LARGE", ERR_LIB_BN, BN_R_PRIVATE_KEY_TOO_LARGE}, + #else + {"PRIVATE_KEY_TOO_LARGE", 3, 117}, + #endif + #ifdef BN_R_P_IS_NOT_PRIME + {"P_IS_NOT_PRIME", ERR_LIB_BN, BN_R_P_IS_NOT_PRIME}, + #else + {"P_IS_NOT_PRIME", 3, 112}, + #endif + #ifdef BN_R_TOO_MANY_ITERATIONS + {"TOO_MANY_ITERATIONS", ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS}, + #else + {"TOO_MANY_ITERATIONS", 3, 113}, + #endif + #ifdef BN_R_TOO_MANY_TEMPORARY_VARIABLES + {"TOO_MANY_TEMPORARY_VARIABLES", ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES}, + #else + {"TOO_MANY_TEMPORARY_VARIABLES", 3, 109}, + #endif + #ifdef CMS_R_ADD_SIGNER_ERROR + {"ADD_SIGNER_ERROR", ERR_LIB_CMS, CMS_R_ADD_SIGNER_ERROR}, + #else + {"ADD_SIGNER_ERROR", 46, 99}, + #endif + #ifdef CMS_R_ATTRIBUTE_ERROR + {"ATTRIBUTE_ERROR", ERR_LIB_CMS, CMS_R_ATTRIBUTE_ERROR}, + #else + {"ATTRIBUTE_ERROR", 46, 161}, + #endif + #ifdef CMS_R_CERTIFICATE_ALREADY_PRESENT + {"CERTIFICATE_ALREADY_PRESENT", ERR_LIB_CMS, CMS_R_CERTIFICATE_ALREADY_PRESENT}, + #else + {"CERTIFICATE_ALREADY_PRESENT", 46, 175}, + #endif + #ifdef CMS_R_CERTIFICATE_HAS_NO_KEYID + {"CERTIFICATE_HAS_NO_KEYID", ERR_LIB_CMS, CMS_R_CERTIFICATE_HAS_NO_KEYID}, + #else + {"CERTIFICATE_HAS_NO_KEYID", 46, 160}, + #endif + #ifdef CMS_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CERTIFICATE_VERIFY_ERROR}, + #else + {"CERTIFICATE_VERIFY_ERROR", 46, 100}, + #endif + #ifdef CMS_R_CIPHER_INITIALISATION_ERROR + {"CIPHER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_INITIALISATION_ERROR}, + #else + {"CIPHER_INITIALISATION_ERROR", 46, 101}, + #endif + #ifdef CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR + {"CIPHER_PARAMETER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR}, + #else + {"CIPHER_PARAMETER_INITIALISATION_ERROR", 46, 102}, + #endif + #ifdef CMS_R_CMS_DATAFINAL_ERROR + {"CMS_DATAFINAL_ERROR", ERR_LIB_CMS, CMS_R_CMS_DATAFINAL_ERROR}, + #else + {"CMS_DATAFINAL_ERROR", 46, 103}, + #endif + #ifdef CMS_R_CMS_LIB + {"CMS_LIB", ERR_LIB_CMS, CMS_R_CMS_LIB}, + #else + {"CMS_LIB", 46, 104}, + #endif + #ifdef CMS_R_CONTENTIDENTIFIER_MISMATCH + {"CONTENTIDENTIFIER_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENTIDENTIFIER_MISMATCH}, + #else + {"CONTENTIDENTIFIER_MISMATCH", 46, 170}, + #endif + #ifdef CMS_R_CONTENT_NOT_FOUND + {"CONTENT_NOT_FOUND", ERR_LIB_CMS, CMS_R_CONTENT_NOT_FOUND}, + #else + {"CONTENT_NOT_FOUND", 46, 105}, + #endif + #ifdef CMS_R_CONTENT_TYPE_MISMATCH + {"CONTENT_TYPE_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_MISMATCH}, + #else + {"CONTENT_TYPE_MISMATCH", 46, 171}, + #endif + #ifdef CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA + {"CONTENT_TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA}, + #else + {"CONTENT_TYPE_NOT_COMPRESSED_DATA", 46, 106}, + #endif + #ifdef CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA + {"CONTENT_TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA}, + #else + {"CONTENT_TYPE_NOT_ENVELOPED_DATA", 46, 107}, + #endif + #ifdef CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA + {"CONTENT_TYPE_NOT_SIGNED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA}, + #else + {"CONTENT_TYPE_NOT_SIGNED_DATA", 46, 108}, + #endif + #ifdef CMS_R_CONTENT_VERIFY_ERROR + {"CONTENT_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CONTENT_VERIFY_ERROR}, + #else + {"CONTENT_VERIFY_ERROR", 46, 109}, + #endif + #ifdef CMS_R_CTRL_ERROR + {"CTRL_ERROR", ERR_LIB_CMS, CMS_R_CTRL_ERROR}, + #else + {"CTRL_ERROR", 46, 110}, + #endif + #ifdef CMS_R_CTRL_FAILURE + {"CTRL_FAILURE", ERR_LIB_CMS, CMS_R_CTRL_FAILURE}, + #else + {"CTRL_FAILURE", 46, 111}, + #endif + #ifdef CMS_R_DECRYPT_ERROR + {"DECRYPT_ERROR", ERR_LIB_CMS, CMS_R_DECRYPT_ERROR}, + #else + {"DECRYPT_ERROR", 46, 112}, + #endif + #ifdef CMS_R_ERROR_GETTING_PUBLIC_KEY + {"ERROR_GETTING_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_ERROR_GETTING_PUBLIC_KEY}, + #else + {"ERROR_GETTING_PUBLIC_KEY", 46, 113}, + #endif + #ifdef CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE + {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", ERR_LIB_CMS, CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE}, + #else + {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", 46, 114}, + #endif + #ifdef CMS_R_ERROR_SETTING_KEY + {"ERROR_SETTING_KEY", ERR_LIB_CMS, CMS_R_ERROR_SETTING_KEY}, + #else + {"ERROR_SETTING_KEY", 46, 115}, + #endif + #ifdef CMS_R_ERROR_SETTING_RECIPIENTINFO + {"ERROR_SETTING_RECIPIENTINFO", ERR_LIB_CMS, CMS_R_ERROR_SETTING_RECIPIENTINFO}, + #else + {"ERROR_SETTING_RECIPIENTINFO", 46, 116}, + #endif + #ifdef CMS_R_INVALID_ENCRYPTED_KEY_LENGTH + {"INVALID_ENCRYPTED_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_ENCRYPTED_KEY_LENGTH}, + #else + {"INVALID_ENCRYPTED_KEY_LENGTH", 46, 117}, + #endif + #ifdef CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER + {"INVALID_KEY_ENCRYPTION_PARAMETER", ERR_LIB_CMS, CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER}, + #else + {"INVALID_KEY_ENCRYPTION_PARAMETER", 46, 176}, + #endif + #ifdef CMS_R_INVALID_KEY_LENGTH + {"INVALID_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_KEY_LENGTH}, + #else + {"INVALID_KEY_LENGTH", 46, 118}, + #endif + #ifdef CMS_R_MD_BIO_INIT_ERROR + {"MD_BIO_INIT_ERROR", ERR_LIB_CMS, CMS_R_MD_BIO_INIT_ERROR}, + #else + {"MD_BIO_INIT_ERROR", 46, 119}, + #endif + #ifdef CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH + {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH}, + #else + {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", 46, 120}, + #endif + #ifdef CMS_R_MESSAGEDIGEST_WRONG_LENGTH + {"MESSAGEDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_WRONG_LENGTH}, + #else + {"MESSAGEDIGEST_WRONG_LENGTH", 46, 121}, + #endif + #ifdef CMS_R_MSGSIGDIGEST_ERROR + {"MSGSIGDIGEST_ERROR", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_ERROR}, + #else + {"MSGSIGDIGEST_ERROR", 46, 172}, + #endif + #ifdef CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE + {"MSGSIGDIGEST_VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE}, + #else + {"MSGSIGDIGEST_VERIFICATION_FAILURE", 46, 162}, + #endif + #ifdef CMS_R_MSGSIGDIGEST_WRONG_LENGTH + {"MSGSIGDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_WRONG_LENGTH}, + #else + {"MSGSIGDIGEST_WRONG_LENGTH", 46, 163}, + #endif + #ifdef CMS_R_NEED_ONE_SIGNER + {"NEED_ONE_SIGNER", ERR_LIB_CMS, CMS_R_NEED_ONE_SIGNER}, + #else + {"NEED_ONE_SIGNER", 46, 164}, + #endif + #ifdef CMS_R_NOT_A_SIGNED_RECEIPT + {"NOT_A_SIGNED_RECEIPT", ERR_LIB_CMS, CMS_R_NOT_A_SIGNED_RECEIPT}, + #else + {"NOT_A_SIGNED_RECEIPT", 46, 165}, + #endif + #ifdef CMS_R_NOT_ENCRYPTED_DATA + {"NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_NOT_ENCRYPTED_DATA}, + #else + {"NOT_ENCRYPTED_DATA", 46, 122}, + #endif + #ifdef CMS_R_NOT_KEK + {"NOT_KEK", ERR_LIB_CMS, CMS_R_NOT_KEK}, + #else + {"NOT_KEK", 46, 123}, + #endif + #ifdef CMS_R_NOT_KEY_AGREEMENT + {"NOT_KEY_AGREEMENT", ERR_LIB_CMS, CMS_R_NOT_KEY_AGREEMENT}, + #else + {"NOT_KEY_AGREEMENT", 46, 181}, + #endif + #ifdef CMS_R_NOT_KEY_TRANSPORT + {"NOT_KEY_TRANSPORT", ERR_LIB_CMS, CMS_R_NOT_KEY_TRANSPORT}, + #else + {"NOT_KEY_TRANSPORT", 46, 124}, + #endif + #ifdef CMS_R_NOT_PWRI + {"NOT_PWRI", ERR_LIB_CMS, CMS_R_NOT_PWRI}, + #else + {"NOT_PWRI", 46, 177}, + #endif + #ifdef CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE + {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_CMS, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, + #else + {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 46, 125}, + #endif + #ifdef CMS_R_NO_CIPHER + {"NO_CIPHER", ERR_LIB_CMS, CMS_R_NO_CIPHER}, + #else + {"NO_CIPHER", 46, 126}, + #endif + #ifdef CMS_R_NO_CONTENT + {"NO_CONTENT", ERR_LIB_CMS, CMS_R_NO_CONTENT}, + #else + {"NO_CONTENT", 46, 127}, + #endif + #ifdef CMS_R_NO_CONTENT_TYPE + {"NO_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_NO_CONTENT_TYPE}, + #else + {"NO_CONTENT_TYPE", 46, 173}, + #endif + #ifdef CMS_R_NO_DEFAULT_DIGEST + {"NO_DEFAULT_DIGEST", ERR_LIB_CMS, CMS_R_NO_DEFAULT_DIGEST}, + #else + {"NO_DEFAULT_DIGEST", 46, 128}, + #endif + #ifdef CMS_R_NO_DIGEST_SET + {"NO_DIGEST_SET", ERR_LIB_CMS, CMS_R_NO_DIGEST_SET}, + #else + {"NO_DIGEST_SET", 46, 129}, + #endif + #ifdef CMS_R_NO_KEY + {"NO_KEY", ERR_LIB_CMS, CMS_R_NO_KEY}, + #else + {"NO_KEY", 46, 130}, + #endif + #ifdef CMS_R_NO_KEY_OR_CERT + {"NO_KEY_OR_CERT", ERR_LIB_CMS, CMS_R_NO_KEY_OR_CERT}, + #else + {"NO_KEY_OR_CERT", 46, 174}, + #endif + #ifdef CMS_R_NO_MATCHING_DIGEST + {"NO_MATCHING_DIGEST", ERR_LIB_CMS, CMS_R_NO_MATCHING_DIGEST}, + #else + {"NO_MATCHING_DIGEST", 46, 131}, + #endif + #ifdef CMS_R_NO_MATCHING_RECIPIENT + {"NO_MATCHING_RECIPIENT", ERR_LIB_CMS, CMS_R_NO_MATCHING_RECIPIENT}, + #else + {"NO_MATCHING_RECIPIENT", 46, 132}, + #endif + #ifdef CMS_R_NO_MATCHING_SIGNATURE + {"NO_MATCHING_SIGNATURE", ERR_LIB_CMS, CMS_R_NO_MATCHING_SIGNATURE}, + #else + {"NO_MATCHING_SIGNATURE", 46, 166}, + #endif + #ifdef CMS_R_NO_MSGSIGDIGEST + {"NO_MSGSIGDIGEST", ERR_LIB_CMS, CMS_R_NO_MSGSIGDIGEST}, + #else + {"NO_MSGSIGDIGEST", 46, 167}, + #endif + #ifdef CMS_R_NO_PASSWORD + {"NO_PASSWORD", ERR_LIB_CMS, CMS_R_NO_PASSWORD}, + #else + {"NO_PASSWORD", 46, 178}, + #endif + #ifdef CMS_R_NO_PRIVATE_KEY + {"NO_PRIVATE_KEY", ERR_LIB_CMS, CMS_R_NO_PRIVATE_KEY}, + #else + {"NO_PRIVATE_KEY", 46, 133}, + #endif + #ifdef CMS_R_NO_PUBLIC_KEY + {"NO_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_NO_PUBLIC_KEY}, + #else + {"NO_PUBLIC_KEY", 46, 134}, + #endif + #ifdef CMS_R_NO_RECEIPT_REQUEST + {"NO_RECEIPT_REQUEST", ERR_LIB_CMS, CMS_R_NO_RECEIPT_REQUEST}, + #else + {"NO_RECEIPT_REQUEST", 46, 168}, + #endif + #ifdef CMS_R_NO_SIGNERS + {"NO_SIGNERS", ERR_LIB_CMS, CMS_R_NO_SIGNERS}, + #else + {"NO_SIGNERS", 46, 135}, + #endif + #ifdef CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_CMS, CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, + #else + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 46, 136}, + #endif + #ifdef CMS_R_RECEIPT_DECODE_ERROR + {"RECEIPT_DECODE_ERROR", ERR_LIB_CMS, CMS_R_RECEIPT_DECODE_ERROR}, + #else + {"RECEIPT_DECODE_ERROR", 46, 169}, + #endif + #ifdef CMS_R_RECIPIENT_ERROR + {"RECIPIENT_ERROR", ERR_LIB_CMS, CMS_R_RECIPIENT_ERROR}, + #else + {"RECIPIENT_ERROR", 46, 137}, + #endif + #ifdef CMS_R_SIGNER_CERTIFICATE_NOT_FOUND + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_CMS, CMS_R_SIGNER_CERTIFICATE_NOT_FOUND}, + #else + {"SIGNER_CERTIFICATE_NOT_FOUND", 46, 138}, + #endif + #ifdef CMS_R_SIGNFINAL_ERROR + {"SIGNFINAL_ERROR", ERR_LIB_CMS, CMS_R_SIGNFINAL_ERROR}, + #else + {"SIGNFINAL_ERROR", 46, 139}, + #endif + #ifdef CMS_R_SMIME_TEXT_ERROR + {"SMIME_TEXT_ERROR", ERR_LIB_CMS, CMS_R_SMIME_TEXT_ERROR}, + #else + {"SMIME_TEXT_ERROR", 46, 140}, + #endif + #ifdef CMS_R_STORE_INIT_ERROR + {"STORE_INIT_ERROR", ERR_LIB_CMS, CMS_R_STORE_INIT_ERROR}, + #else + {"STORE_INIT_ERROR", 46, 141}, + #endif + #ifdef CMS_R_TYPE_NOT_COMPRESSED_DATA + {"TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_COMPRESSED_DATA}, + #else + {"TYPE_NOT_COMPRESSED_DATA", 46, 142}, + #endif + #ifdef CMS_R_TYPE_NOT_DATA + {"TYPE_NOT_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DATA}, + #else + {"TYPE_NOT_DATA", 46, 143}, + #endif + #ifdef CMS_R_TYPE_NOT_DIGESTED_DATA + {"TYPE_NOT_DIGESTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DIGESTED_DATA}, + #else + {"TYPE_NOT_DIGESTED_DATA", 46, 144}, + #endif + #ifdef CMS_R_TYPE_NOT_ENCRYPTED_DATA + {"TYPE_NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENCRYPTED_DATA}, + #else + {"TYPE_NOT_ENCRYPTED_DATA", 46, 145}, + #endif + #ifdef CMS_R_TYPE_NOT_ENVELOPED_DATA + {"TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENVELOPED_DATA}, + #else + {"TYPE_NOT_ENVELOPED_DATA", 46, 146}, + #endif + #ifdef CMS_R_UNABLE_TO_FINALIZE_CONTEXT + {"UNABLE_TO_FINALIZE_CONTEXT", ERR_LIB_CMS, CMS_R_UNABLE_TO_FINALIZE_CONTEXT}, + #else + {"UNABLE_TO_FINALIZE_CONTEXT", 46, 147}, + #endif + #ifdef CMS_R_UNKNOWN_CIPHER + {"UNKNOWN_CIPHER", ERR_LIB_CMS, CMS_R_UNKNOWN_CIPHER}, + #else + {"UNKNOWN_CIPHER", 46, 148}, + #endif + #ifdef CMS_R_UNKNOWN_DIGEST_ALGORITHM + {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_CMS, CMS_R_UNKNOWN_DIGEST_ALGORITHM}, + #else + {"UNKNOWN_DIGEST_ALGORITHM", 46, 149}, + #endif + #ifdef CMS_R_UNKNOWN_ID + {"UNKNOWN_ID", ERR_LIB_CMS, CMS_R_UNKNOWN_ID}, + #else + {"UNKNOWN_ID", 46, 150}, + #endif + #ifdef CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM + {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM}, + #else + {"UNSUPPORTED_COMPRESSION_ALGORITHM", 46, 151}, + #endif + #ifdef CMS_R_UNSUPPORTED_CONTENT_TYPE + {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_TYPE}, + #else + {"UNSUPPORTED_CONTENT_TYPE", 46, 152}, + #endif + #ifdef CMS_R_UNSUPPORTED_KEK_ALGORITHM + {"UNSUPPORTED_KEK_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEK_ALGORITHM}, + #else + {"UNSUPPORTED_KEK_ALGORITHM", 46, 153}, + #endif + #ifdef CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM + {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM}, + #else + {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", 46, 179}, + #endif + #ifdef CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE + {"UNSUPPORTED_RECIPIENTINFO_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE}, + #else + {"UNSUPPORTED_RECIPIENTINFO_TYPE", 46, 155}, + #endif + #ifdef CMS_R_UNSUPPORTED_RECIPIENT_TYPE + {"UNSUPPORTED_RECIPIENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENT_TYPE}, + #else + {"UNSUPPORTED_RECIPIENT_TYPE", 46, 154}, + #endif + #ifdef CMS_R_UNSUPPORTED_TYPE + {"UNSUPPORTED_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_TYPE}, + #else + {"UNSUPPORTED_TYPE", 46, 156}, + #endif + #ifdef CMS_R_UNWRAP_ERROR + {"UNWRAP_ERROR", ERR_LIB_CMS, CMS_R_UNWRAP_ERROR}, + #else + {"UNWRAP_ERROR", 46, 157}, + #endif + #ifdef CMS_R_UNWRAP_FAILURE + {"UNWRAP_FAILURE", ERR_LIB_CMS, CMS_R_UNWRAP_FAILURE}, + #else + {"UNWRAP_FAILURE", 46, 180}, + #endif + #ifdef CMS_R_VERIFICATION_FAILURE + {"VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_VERIFICATION_FAILURE}, + #else + {"VERIFICATION_FAILURE", 46, 158}, + #endif + #ifdef CMS_R_WRAP_ERROR + {"WRAP_ERROR", ERR_LIB_CMS, CMS_R_WRAP_ERROR}, + #else + {"WRAP_ERROR", 46, 159}, + #endif + #ifdef COMP_R_ZLIB_DEFLATE_ERROR + {"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR}, + #else + {"ZLIB_DEFLATE_ERROR", 41, 99}, + #endif + #ifdef COMP_R_ZLIB_INFLATE_ERROR + {"ZLIB_INFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_INFLATE_ERROR}, + #else + {"ZLIB_INFLATE_ERROR", 41, 100}, + #endif + #ifdef COMP_R_ZLIB_NOT_SUPPORTED + {"ZLIB_NOT_SUPPORTED", ERR_LIB_COMP, COMP_R_ZLIB_NOT_SUPPORTED}, + #else + {"ZLIB_NOT_SUPPORTED", 41, 101}, + #endif + #ifdef CONF_R_ERROR_LOADING_DSO + {"ERROR_LOADING_DSO", ERR_LIB_CONF, CONF_R_ERROR_LOADING_DSO}, + #else + {"ERROR_LOADING_DSO", 14, 110}, + #endif + #ifdef CONF_R_LIST_CANNOT_BE_NULL + {"LIST_CANNOT_BE_NULL", ERR_LIB_CONF, CONF_R_LIST_CANNOT_BE_NULL}, + #else + {"LIST_CANNOT_BE_NULL", 14, 115}, + #endif + #ifdef CONF_R_MISSING_CLOSE_SQUARE_BRACKET + {"MISSING_CLOSE_SQUARE_BRACKET", ERR_LIB_CONF, CONF_R_MISSING_CLOSE_SQUARE_BRACKET}, + #else + {"MISSING_CLOSE_SQUARE_BRACKET", 14, 100}, + #endif + #ifdef CONF_R_MISSING_EQUAL_SIGN + {"MISSING_EQUAL_SIGN", ERR_LIB_CONF, CONF_R_MISSING_EQUAL_SIGN}, + #else + {"MISSING_EQUAL_SIGN", 14, 101}, + #endif + #ifdef CONF_R_MISSING_INIT_FUNCTION + {"MISSING_INIT_FUNCTION", ERR_LIB_CONF, CONF_R_MISSING_INIT_FUNCTION}, + #else + {"MISSING_INIT_FUNCTION", 14, 112}, + #endif + #ifdef CONF_R_MODULE_INITIALIZATION_ERROR + {"MODULE_INITIALIZATION_ERROR", ERR_LIB_CONF, CONF_R_MODULE_INITIALIZATION_ERROR}, + #else + {"MODULE_INITIALIZATION_ERROR", 14, 109}, + #endif + #ifdef CONF_R_NO_CLOSE_BRACE + {"NO_CLOSE_BRACE", ERR_LIB_CONF, CONF_R_NO_CLOSE_BRACE}, + #else + {"NO_CLOSE_BRACE", 14, 102}, + #endif + #ifdef CONF_R_NO_CONF + {"NO_CONF", ERR_LIB_CONF, CONF_R_NO_CONF}, + #else + {"NO_CONF", 14, 105}, + #endif + #ifdef CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE + {"NO_CONF_OR_ENVIRONMENT_VARIABLE", ERR_LIB_CONF, CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE}, + #else + {"NO_CONF_OR_ENVIRONMENT_VARIABLE", 14, 106}, + #endif + #ifdef CONF_R_NO_SECTION + {"NO_SECTION", ERR_LIB_CONF, CONF_R_NO_SECTION}, + #else + {"NO_SECTION", 14, 107}, + #endif + #ifdef CONF_R_NO_SUCH_FILE + {"NO_SUCH_FILE", ERR_LIB_CONF, CONF_R_NO_SUCH_FILE}, + #else + {"NO_SUCH_FILE", 14, 114}, + #endif + #ifdef CONF_R_NO_VALUE + {"NO_VALUE", ERR_LIB_CONF, CONF_R_NO_VALUE}, + #else + {"NO_VALUE", 14, 108}, + #endif + #ifdef CONF_R_NUMBER_TOO_LARGE + {"NUMBER_TOO_LARGE", ERR_LIB_CONF, CONF_R_NUMBER_TOO_LARGE}, + #else + {"NUMBER_TOO_LARGE", 14, 121}, + #endif + #ifdef CONF_R_RECURSIVE_DIRECTORY_INCLUDE + {"RECURSIVE_DIRECTORY_INCLUDE", ERR_LIB_CONF, CONF_R_RECURSIVE_DIRECTORY_INCLUDE}, + #else + {"RECURSIVE_DIRECTORY_INCLUDE", 14, 111}, + #endif + #ifdef CONF_R_SSL_COMMAND_SECTION_EMPTY + {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_EMPTY}, + #else + {"SSL_COMMAND_SECTION_EMPTY", 14, 117}, + #endif + #ifdef CONF_R_SSL_COMMAND_SECTION_NOT_FOUND + {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_NOT_FOUND}, + #else + {"SSL_COMMAND_SECTION_NOT_FOUND", 14, 118}, + #endif + #ifdef CONF_R_SSL_SECTION_EMPTY + {"SSL_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_SECTION_EMPTY}, + #else + {"SSL_SECTION_EMPTY", 14, 119}, + #endif + #ifdef CONF_R_SSL_SECTION_NOT_FOUND + {"SSL_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_SECTION_NOT_FOUND}, + #else + {"SSL_SECTION_NOT_FOUND", 14, 120}, + #endif + #ifdef CONF_R_UNABLE_TO_CREATE_NEW_SECTION + {"UNABLE_TO_CREATE_NEW_SECTION", ERR_LIB_CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION}, + #else + {"UNABLE_TO_CREATE_NEW_SECTION", 14, 103}, + #endif + #ifdef CONF_R_UNKNOWN_MODULE_NAME + {"UNKNOWN_MODULE_NAME", ERR_LIB_CONF, CONF_R_UNKNOWN_MODULE_NAME}, + #else + {"UNKNOWN_MODULE_NAME", 14, 113}, + #endif + #ifdef CONF_R_VARIABLE_EXPANSION_TOO_LONG + {"VARIABLE_EXPANSION_TOO_LONG", ERR_LIB_CONF, CONF_R_VARIABLE_EXPANSION_TOO_LONG}, + #else + {"VARIABLE_EXPANSION_TOO_LONG", 14, 116}, + #endif + #ifdef CONF_R_VARIABLE_HAS_NO_VALUE + {"VARIABLE_HAS_NO_VALUE", ERR_LIB_CONF, CONF_R_VARIABLE_HAS_NO_VALUE}, + #else + {"VARIABLE_HAS_NO_VALUE", 14, 104}, + #endif + #ifdef CRYPTO_R_FIPS_MODE_NOT_SUPPORTED + {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_CRYPTO, CRYPTO_R_FIPS_MODE_NOT_SUPPORTED}, + #else + {"FIPS_MODE_NOT_SUPPORTED", 15, 101}, + #endif + #ifdef CRYPTO_R_ILLEGAL_HEX_DIGIT + {"ILLEGAL_HEX_DIGIT", ERR_LIB_CRYPTO, CRYPTO_R_ILLEGAL_HEX_DIGIT}, + #else + {"ILLEGAL_HEX_DIGIT", 15, 102}, + #endif + #ifdef CRYPTO_R_ODD_NUMBER_OF_DIGITS + {"ODD_NUMBER_OF_DIGITS", ERR_LIB_CRYPTO, CRYPTO_R_ODD_NUMBER_OF_DIGITS}, + #else + {"ODD_NUMBER_OF_DIGITS", 15, 103}, + #endif + #ifdef CT_R_BASE64_DECODE_ERROR + {"BASE64_DECODE_ERROR", ERR_LIB_CT, CT_R_BASE64_DECODE_ERROR}, + #else + {"BASE64_DECODE_ERROR", 50, 108}, + #endif + #ifdef CT_R_INVALID_LOG_ID_LENGTH + {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, CT_R_INVALID_LOG_ID_LENGTH}, + #else + {"INVALID_LOG_ID_LENGTH", 50, 100}, + #endif + #ifdef CT_R_LOG_CONF_INVALID + {"LOG_CONF_INVALID", ERR_LIB_CT, CT_R_LOG_CONF_INVALID}, + #else + {"LOG_CONF_INVALID", 50, 109}, + #endif + #ifdef CT_R_LOG_CONF_INVALID_KEY + {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, CT_R_LOG_CONF_INVALID_KEY}, + #else + {"LOG_CONF_INVALID_KEY", 50, 110}, + #endif + #ifdef CT_R_LOG_CONF_MISSING_DESCRIPTION + {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_DESCRIPTION}, + #else + {"LOG_CONF_MISSING_DESCRIPTION", 50, 111}, + #endif + #ifdef CT_R_LOG_CONF_MISSING_KEY + {"LOG_CONF_MISSING_KEY", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_KEY}, + #else + {"LOG_CONF_MISSING_KEY", 50, 112}, + #endif + #ifdef CT_R_LOG_KEY_INVALID + {"LOG_KEY_INVALID", ERR_LIB_CT, CT_R_LOG_KEY_INVALID}, + #else + {"LOG_KEY_INVALID", 50, 113}, + #endif + #ifdef CT_R_SCT_FUTURE_TIMESTAMP + {"SCT_FUTURE_TIMESTAMP", ERR_LIB_CT, CT_R_SCT_FUTURE_TIMESTAMP}, + #else + {"SCT_FUTURE_TIMESTAMP", 50, 116}, + #endif + #ifdef CT_R_SCT_INVALID + {"SCT_INVALID", ERR_LIB_CT, CT_R_SCT_INVALID}, + #else + {"SCT_INVALID", 50, 104}, + #endif + #ifdef CT_R_SCT_INVALID_SIGNATURE + {"SCT_INVALID_SIGNATURE", ERR_LIB_CT, CT_R_SCT_INVALID_SIGNATURE}, + #else + {"SCT_INVALID_SIGNATURE", 50, 107}, + #endif + #ifdef CT_R_SCT_LIST_INVALID + {"SCT_LIST_INVALID", ERR_LIB_CT, CT_R_SCT_LIST_INVALID}, + #else + {"SCT_LIST_INVALID", 50, 105}, + #endif + #ifdef CT_R_SCT_LOG_ID_MISMATCH + {"SCT_LOG_ID_MISMATCH", ERR_LIB_CT, CT_R_SCT_LOG_ID_MISMATCH}, + #else + {"SCT_LOG_ID_MISMATCH", 50, 114}, + #endif + #ifdef CT_R_SCT_NOT_SET + {"SCT_NOT_SET", ERR_LIB_CT, CT_R_SCT_NOT_SET}, + #else + {"SCT_NOT_SET", 50, 106}, + #endif + #ifdef CT_R_SCT_UNSUPPORTED_VERSION + {"SCT_UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_SCT_UNSUPPORTED_VERSION}, + #else + {"SCT_UNSUPPORTED_VERSION", 50, 115}, + #endif + #ifdef CT_R_UNRECOGNIZED_SIGNATURE_NID + {"UNRECOGNIZED_SIGNATURE_NID", ERR_LIB_CT, CT_R_UNRECOGNIZED_SIGNATURE_NID}, + #else + {"UNRECOGNIZED_SIGNATURE_NID", 50, 101}, + #endif + #ifdef CT_R_UNSUPPORTED_ENTRY_TYPE + {"UNSUPPORTED_ENTRY_TYPE", ERR_LIB_CT, CT_R_UNSUPPORTED_ENTRY_TYPE}, + #else + {"UNSUPPORTED_ENTRY_TYPE", 50, 102}, + #endif + #ifdef CT_R_UNSUPPORTED_VERSION + {"UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_UNSUPPORTED_VERSION}, + #else + {"UNSUPPORTED_VERSION", 50, 103}, + #endif + #ifdef DH_R_BAD_GENERATOR + {"BAD_GENERATOR", ERR_LIB_DH, DH_R_BAD_GENERATOR}, + #else + {"BAD_GENERATOR", 5, 101}, + #endif + #ifdef DH_R_BN_DECODE_ERROR + {"BN_DECODE_ERROR", ERR_LIB_DH, DH_R_BN_DECODE_ERROR}, + #else + {"BN_DECODE_ERROR", 5, 109}, + #endif + #ifdef DH_R_BN_ERROR + {"BN_ERROR", ERR_LIB_DH, DH_R_BN_ERROR}, + #else + {"BN_ERROR", 5, 106}, + #endif + #ifdef DH_R_CHECK_INVALID_J_VALUE + {"CHECK_INVALID_J_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_J_VALUE}, + #else + {"CHECK_INVALID_J_VALUE", 5, 115}, + #endif + #ifdef DH_R_CHECK_INVALID_Q_VALUE + {"CHECK_INVALID_Q_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_Q_VALUE}, + #else + {"CHECK_INVALID_Q_VALUE", 5, 116}, + #endif + #ifdef DH_R_CHECK_PUBKEY_INVALID + {"CHECK_PUBKEY_INVALID", ERR_LIB_DH, DH_R_CHECK_PUBKEY_INVALID}, + #else + {"CHECK_PUBKEY_INVALID", 5, 122}, + #endif + #ifdef DH_R_CHECK_PUBKEY_TOO_LARGE + {"CHECK_PUBKEY_TOO_LARGE", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_LARGE}, + #else + {"CHECK_PUBKEY_TOO_LARGE", 5, 123}, + #endif + #ifdef DH_R_CHECK_PUBKEY_TOO_SMALL + {"CHECK_PUBKEY_TOO_SMALL", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_SMALL}, + #else + {"CHECK_PUBKEY_TOO_SMALL", 5, 124}, + #endif + #ifdef DH_R_CHECK_P_NOT_PRIME + {"CHECK_P_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_PRIME}, + #else + {"CHECK_P_NOT_PRIME", 5, 117}, + #endif + #ifdef DH_R_CHECK_P_NOT_SAFE_PRIME + {"CHECK_P_NOT_SAFE_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_SAFE_PRIME}, + #else + {"CHECK_P_NOT_SAFE_PRIME", 5, 118}, + #endif + #ifdef DH_R_CHECK_Q_NOT_PRIME + {"CHECK_Q_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_Q_NOT_PRIME}, + #else + {"CHECK_Q_NOT_PRIME", 5, 119}, + #endif + #ifdef DH_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_DH, DH_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", 5, 104}, + #endif + #ifdef DH_R_INVALID_PARAMETER_NAME + {"INVALID_PARAMETER_NAME", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NAME}, + #else + {"INVALID_PARAMETER_NAME", 5, 110}, + #endif + #ifdef DH_R_INVALID_PARAMETER_NID + {"INVALID_PARAMETER_NID", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NID}, + #else + {"INVALID_PARAMETER_NID", 5, 114}, + #endif + #ifdef DH_R_INVALID_PUBKEY + {"INVALID_PUBKEY", ERR_LIB_DH, DH_R_INVALID_PUBKEY}, + #else + {"INVALID_PUBKEY", 5, 102}, + #endif + #ifdef DH_R_KDF_PARAMETER_ERROR + {"KDF_PARAMETER_ERROR", ERR_LIB_DH, DH_R_KDF_PARAMETER_ERROR}, + #else + {"KDF_PARAMETER_ERROR", 5, 112}, + #endif + #ifdef DH_R_KEYS_NOT_SET + {"KEYS_NOT_SET", ERR_LIB_DH, DH_R_KEYS_NOT_SET}, + #else + {"KEYS_NOT_SET", 5, 108}, + #endif + #ifdef DH_R_MISSING_PUBKEY + {"MISSING_PUBKEY", ERR_LIB_DH, DH_R_MISSING_PUBKEY}, + #else + {"MISSING_PUBKEY", 5, 125}, + #endif + #ifdef DH_R_MODULUS_TOO_LARGE + {"MODULUS_TOO_LARGE", ERR_LIB_DH, DH_R_MODULUS_TOO_LARGE}, + #else + {"MODULUS_TOO_LARGE", 5, 103}, + #endif + #ifdef DH_R_NOT_SUITABLE_GENERATOR + {"NOT_SUITABLE_GENERATOR", ERR_LIB_DH, DH_R_NOT_SUITABLE_GENERATOR}, + #else + {"NOT_SUITABLE_GENERATOR", 5, 120}, + #endif + #ifdef DH_R_NO_PARAMETERS_SET + {"NO_PARAMETERS_SET", ERR_LIB_DH, DH_R_NO_PARAMETERS_SET}, + #else + {"NO_PARAMETERS_SET", 5, 107}, + #endif + #ifdef DH_R_NO_PRIVATE_VALUE + {"NO_PRIVATE_VALUE", ERR_LIB_DH, DH_R_NO_PRIVATE_VALUE}, + #else + {"NO_PRIVATE_VALUE", 5, 100}, + #endif + #ifdef DH_R_PARAMETER_ENCODING_ERROR + {"PARAMETER_ENCODING_ERROR", ERR_LIB_DH, DH_R_PARAMETER_ENCODING_ERROR}, + #else + {"PARAMETER_ENCODING_ERROR", 5, 105}, + #endif + #ifdef DH_R_PEER_KEY_ERROR + {"PEER_KEY_ERROR", ERR_LIB_DH, DH_R_PEER_KEY_ERROR}, + #else + {"PEER_KEY_ERROR", 5, 111}, + #endif + #ifdef DH_R_SHARED_INFO_ERROR + {"SHARED_INFO_ERROR", ERR_LIB_DH, DH_R_SHARED_INFO_ERROR}, + #else + {"SHARED_INFO_ERROR", 5, 113}, + #endif + #ifdef DH_R_UNABLE_TO_CHECK_GENERATOR + {"UNABLE_TO_CHECK_GENERATOR", ERR_LIB_DH, DH_R_UNABLE_TO_CHECK_GENERATOR}, + #else + {"UNABLE_TO_CHECK_GENERATOR", 5, 121}, + #endif + #ifdef DSA_R_BAD_Q_VALUE + {"BAD_Q_VALUE", ERR_LIB_DSA, DSA_R_BAD_Q_VALUE}, + #else + {"BAD_Q_VALUE", 10, 102}, + #endif + #ifdef DSA_R_BN_DECODE_ERROR + {"BN_DECODE_ERROR", ERR_LIB_DSA, DSA_R_BN_DECODE_ERROR}, + #else + {"BN_DECODE_ERROR", 10, 108}, + #endif + #ifdef DSA_R_BN_ERROR + {"BN_ERROR", ERR_LIB_DSA, DSA_R_BN_ERROR}, + #else + {"BN_ERROR", 10, 109}, + #endif + #ifdef DSA_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_DSA, DSA_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", 10, 104}, + #endif + #ifdef DSA_R_INVALID_DIGEST_TYPE + {"INVALID_DIGEST_TYPE", ERR_LIB_DSA, DSA_R_INVALID_DIGEST_TYPE}, + #else + {"INVALID_DIGEST_TYPE", 10, 106}, + #endif + #ifdef DSA_R_INVALID_PARAMETERS + {"INVALID_PARAMETERS", ERR_LIB_DSA, DSA_R_INVALID_PARAMETERS}, + #else + {"INVALID_PARAMETERS", 10, 112}, + #endif + #ifdef DSA_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_DSA, DSA_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", 10, 101}, + #endif + #ifdef DSA_R_MISSING_PRIVATE_KEY + {"MISSING_PRIVATE_KEY", ERR_LIB_DSA, DSA_R_MISSING_PRIVATE_KEY}, + #else + {"MISSING_PRIVATE_KEY", 10, 111}, + #endif + #ifdef DSA_R_MODULUS_TOO_LARGE + {"MODULUS_TOO_LARGE", ERR_LIB_DSA, DSA_R_MODULUS_TOO_LARGE}, + #else + {"MODULUS_TOO_LARGE", 10, 103}, + #endif + #ifdef DSA_R_NO_PARAMETERS_SET + {"NO_PARAMETERS_SET", ERR_LIB_DSA, DSA_R_NO_PARAMETERS_SET}, + #else + {"NO_PARAMETERS_SET", 10, 107}, + #endif + #ifdef DSA_R_PARAMETER_ENCODING_ERROR + {"PARAMETER_ENCODING_ERROR", ERR_LIB_DSA, DSA_R_PARAMETER_ENCODING_ERROR}, + #else + {"PARAMETER_ENCODING_ERROR", 10, 105}, + #endif + #ifdef DSA_R_Q_NOT_PRIME + {"Q_NOT_PRIME", ERR_LIB_DSA, DSA_R_Q_NOT_PRIME}, + #else + {"Q_NOT_PRIME", 10, 113}, + #endif + #ifdef DSA_R_SEED_LEN_SMALL + {"SEED_LEN_SMALL", ERR_LIB_DSA, DSA_R_SEED_LEN_SMALL}, + #else + {"SEED_LEN_SMALL", 10, 110}, + #endif + #ifdef DSO_R_CTRL_FAILED + {"CTRL_FAILED", ERR_LIB_DSO, DSO_R_CTRL_FAILED}, + #else + {"CTRL_FAILED", 37, 100}, + #endif + #ifdef DSO_R_DSO_ALREADY_LOADED + {"DSO_ALREADY_LOADED", ERR_LIB_DSO, DSO_R_DSO_ALREADY_LOADED}, + #else + {"DSO_ALREADY_LOADED", 37, 110}, + #endif + #ifdef DSO_R_EMPTY_FILE_STRUCTURE + {"EMPTY_FILE_STRUCTURE", ERR_LIB_DSO, DSO_R_EMPTY_FILE_STRUCTURE}, + #else + {"EMPTY_FILE_STRUCTURE", 37, 113}, + #endif + #ifdef DSO_R_FAILURE + {"FAILURE", ERR_LIB_DSO, DSO_R_FAILURE}, + #else + {"FAILURE", 37, 114}, + #endif + #ifdef DSO_R_FILENAME_TOO_BIG + {"FILENAME_TOO_BIG", ERR_LIB_DSO, DSO_R_FILENAME_TOO_BIG}, + #else + {"FILENAME_TOO_BIG", 37, 101}, + #endif + #ifdef DSO_R_FINISH_FAILED + {"FINISH_FAILED", ERR_LIB_DSO, DSO_R_FINISH_FAILED}, + #else + {"FINISH_FAILED", 37, 102}, + #endif + #ifdef DSO_R_INCORRECT_FILE_SYNTAX + {"INCORRECT_FILE_SYNTAX", ERR_LIB_DSO, DSO_R_INCORRECT_FILE_SYNTAX}, + #else + {"INCORRECT_FILE_SYNTAX", 37, 115}, + #endif + #ifdef DSO_R_LOAD_FAILED + {"LOAD_FAILED", ERR_LIB_DSO, DSO_R_LOAD_FAILED}, + #else + {"LOAD_FAILED", 37, 103}, + #endif + #ifdef DSO_R_NAME_TRANSLATION_FAILED + {"NAME_TRANSLATION_FAILED", ERR_LIB_DSO, DSO_R_NAME_TRANSLATION_FAILED}, + #else + {"NAME_TRANSLATION_FAILED", 37, 109}, + #endif + #ifdef DSO_R_NO_FILENAME + {"NO_FILENAME", ERR_LIB_DSO, DSO_R_NO_FILENAME}, + #else + {"NO_FILENAME", 37, 111}, + #endif + #ifdef DSO_R_NULL_HANDLE + {"NULL_HANDLE", ERR_LIB_DSO, DSO_R_NULL_HANDLE}, + #else + {"NULL_HANDLE", 37, 104}, + #endif + #ifdef DSO_R_SET_FILENAME_FAILED + {"SET_FILENAME_FAILED", ERR_LIB_DSO, DSO_R_SET_FILENAME_FAILED}, + #else + {"SET_FILENAME_FAILED", 37, 112}, + #endif + #ifdef DSO_R_STACK_ERROR + {"STACK_ERROR", ERR_LIB_DSO, DSO_R_STACK_ERROR}, + #else + {"STACK_ERROR", 37, 105}, + #endif + #ifdef DSO_R_SYM_FAILURE + {"SYM_FAILURE", ERR_LIB_DSO, DSO_R_SYM_FAILURE}, + #else + {"SYM_FAILURE", 37, 106}, + #endif + #ifdef DSO_R_UNLOAD_FAILED + {"UNLOAD_FAILED", ERR_LIB_DSO, DSO_R_UNLOAD_FAILED}, + #else + {"UNLOAD_FAILED", 37, 107}, + #endif + #ifdef DSO_R_UNSUPPORTED + {"UNSUPPORTED", ERR_LIB_DSO, DSO_R_UNSUPPORTED}, + #else + {"UNSUPPORTED", 37, 108}, + #endif + #ifdef EC_R_ASN1_ERROR + {"ASN1_ERROR", ERR_LIB_EC, EC_R_ASN1_ERROR}, + #else + {"ASN1_ERROR", 16, 115}, + #endif + #ifdef EC_R_BAD_SIGNATURE + {"BAD_SIGNATURE", ERR_LIB_EC, EC_R_BAD_SIGNATURE}, + #else + {"BAD_SIGNATURE", 16, 156}, + #endif + #ifdef EC_R_BIGNUM_OUT_OF_RANGE + {"BIGNUM_OUT_OF_RANGE", ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE}, + #else + {"BIGNUM_OUT_OF_RANGE", 16, 144}, + #endif + #ifdef EC_R_BUFFER_TOO_SMALL + {"BUFFER_TOO_SMALL", ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL}, + #else + {"BUFFER_TOO_SMALL", 16, 100}, + #endif + #ifdef EC_R_CANNOT_INVERT + {"CANNOT_INVERT", ERR_LIB_EC, EC_R_CANNOT_INVERT}, + #else + {"CANNOT_INVERT", 16, 165}, + #endif + #ifdef EC_R_COORDINATES_OUT_OF_RANGE + {"COORDINATES_OUT_OF_RANGE", ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE}, + #else + {"COORDINATES_OUT_OF_RANGE", 16, 146}, + #endif + #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_ECDH + {"CURVE_DOES_NOT_SUPPORT_ECDH", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_ECDH}, + #else + {"CURVE_DOES_NOT_SUPPORT_ECDH", 16, 160}, + #endif + #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING + {"CURVE_DOES_NOT_SUPPORT_SIGNING", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING}, + #else + {"CURVE_DOES_NOT_SUPPORT_SIGNING", 16, 159}, + #endif + #ifdef EC_R_D2I_ECPKPARAMETERS_FAILURE + {"D2I_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_D2I_ECPKPARAMETERS_FAILURE}, + #else + {"D2I_ECPKPARAMETERS_FAILURE", 16, 117}, + #endif + #ifdef EC_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_EC, EC_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", 16, 142}, + #endif + #ifdef EC_R_DISCRIMINANT_IS_ZERO + {"DISCRIMINANT_IS_ZERO", ERR_LIB_EC, EC_R_DISCRIMINANT_IS_ZERO}, + #else + {"DISCRIMINANT_IS_ZERO", 16, 118}, + #endif + #ifdef EC_R_EC_GROUP_NEW_BY_NAME_FAILURE + {"EC_GROUP_NEW_BY_NAME_FAILURE", ERR_LIB_EC, EC_R_EC_GROUP_NEW_BY_NAME_FAILURE}, + #else + {"EC_GROUP_NEW_BY_NAME_FAILURE", 16, 119}, + #endif + #ifdef EC_R_FIELD_TOO_LARGE + {"FIELD_TOO_LARGE", ERR_LIB_EC, EC_R_FIELD_TOO_LARGE}, + #else + {"FIELD_TOO_LARGE", 16, 143}, + #endif + #ifdef EC_R_GF2M_NOT_SUPPORTED + {"GF2M_NOT_SUPPORTED", ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED}, + #else + {"GF2M_NOT_SUPPORTED", 16, 147}, + #endif + #ifdef EC_R_GROUP2PKPARAMETERS_FAILURE + {"GROUP2PKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_GROUP2PKPARAMETERS_FAILURE}, + #else + {"GROUP2PKPARAMETERS_FAILURE", 16, 120}, + #endif + #ifdef EC_R_I2D_ECPKPARAMETERS_FAILURE + {"I2D_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_I2D_ECPKPARAMETERS_FAILURE}, + #else + {"I2D_ECPKPARAMETERS_FAILURE", 16, 121}, + #endif + #ifdef EC_R_INCOMPATIBLE_OBJECTS + {"INCOMPATIBLE_OBJECTS", ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS}, + #else + {"INCOMPATIBLE_OBJECTS", 16, 101}, + #endif + #ifdef EC_R_INVALID_ARGUMENT + {"INVALID_ARGUMENT", ERR_LIB_EC, EC_R_INVALID_ARGUMENT}, + #else + {"INVALID_ARGUMENT", 16, 112}, + #endif + #ifdef EC_R_INVALID_COMPRESSED_POINT + {"INVALID_COMPRESSED_POINT", ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT}, + #else + {"INVALID_COMPRESSED_POINT", 16, 110}, + #endif + #ifdef EC_R_INVALID_COMPRESSION_BIT + {"INVALID_COMPRESSION_BIT", ERR_LIB_EC, EC_R_INVALID_COMPRESSION_BIT}, + #else + {"INVALID_COMPRESSION_BIT", 16, 109}, + #endif + #ifdef EC_R_INVALID_CURVE + {"INVALID_CURVE", ERR_LIB_EC, EC_R_INVALID_CURVE}, + #else + {"INVALID_CURVE", 16, 141}, + #endif + #ifdef EC_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_EC, EC_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", 16, 151}, + #endif + #ifdef EC_R_INVALID_DIGEST_TYPE + {"INVALID_DIGEST_TYPE", ERR_LIB_EC, EC_R_INVALID_DIGEST_TYPE}, + #else + {"INVALID_DIGEST_TYPE", 16, 138}, + #endif + #ifdef EC_R_INVALID_ENCODING + {"INVALID_ENCODING", ERR_LIB_EC, EC_R_INVALID_ENCODING}, + #else + {"INVALID_ENCODING", 16, 102}, + #endif + #ifdef EC_R_INVALID_FIELD + {"INVALID_FIELD", ERR_LIB_EC, EC_R_INVALID_FIELD}, + #else + {"INVALID_FIELD", 16, 103}, + #endif + #ifdef EC_R_INVALID_FORM + {"INVALID_FORM", ERR_LIB_EC, EC_R_INVALID_FORM}, + #else + {"INVALID_FORM", 16, 104}, + #endif + #ifdef EC_R_INVALID_GROUP_ORDER + {"INVALID_GROUP_ORDER", ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER}, + #else + {"INVALID_GROUP_ORDER", 16, 122}, + #endif + #ifdef EC_R_INVALID_KEY + {"INVALID_KEY", ERR_LIB_EC, EC_R_INVALID_KEY}, + #else + {"INVALID_KEY", 16, 116}, + #endif + #ifdef EC_R_INVALID_OUTPUT_LENGTH + {"INVALID_OUTPUT_LENGTH", ERR_LIB_EC, EC_R_INVALID_OUTPUT_LENGTH}, + #else + {"INVALID_OUTPUT_LENGTH", 16, 161}, + #endif + #ifdef EC_R_INVALID_PEER_KEY + {"INVALID_PEER_KEY", ERR_LIB_EC, EC_R_INVALID_PEER_KEY}, + #else + {"INVALID_PEER_KEY", 16, 133}, + #endif + #ifdef EC_R_INVALID_PENTANOMIAL_BASIS + {"INVALID_PENTANOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_PENTANOMIAL_BASIS}, + #else + {"INVALID_PENTANOMIAL_BASIS", 16, 132}, + #endif + #ifdef EC_R_INVALID_PRIVATE_KEY + {"INVALID_PRIVATE_KEY", ERR_LIB_EC, EC_R_INVALID_PRIVATE_KEY}, + #else + {"INVALID_PRIVATE_KEY", 16, 123}, + #endif + #ifdef EC_R_INVALID_TRINOMIAL_BASIS + {"INVALID_TRINOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_TRINOMIAL_BASIS}, + #else + {"INVALID_TRINOMIAL_BASIS", 16, 137}, + #endif + #ifdef EC_R_KDF_PARAMETER_ERROR + {"KDF_PARAMETER_ERROR", ERR_LIB_EC, EC_R_KDF_PARAMETER_ERROR}, + #else + {"KDF_PARAMETER_ERROR", 16, 148}, + #endif + #ifdef EC_R_KEYS_NOT_SET + {"KEYS_NOT_SET", ERR_LIB_EC, EC_R_KEYS_NOT_SET}, + #else + {"KEYS_NOT_SET", 16, 140}, + #endif + #ifdef EC_R_LADDER_POST_FAILURE + {"LADDER_POST_FAILURE", ERR_LIB_EC, EC_R_LADDER_POST_FAILURE}, + #else + {"LADDER_POST_FAILURE", 16, 136}, + #endif + #ifdef EC_R_LADDER_PRE_FAILURE + {"LADDER_PRE_FAILURE", ERR_LIB_EC, EC_R_LADDER_PRE_FAILURE}, + #else + {"LADDER_PRE_FAILURE", 16, 153}, + #endif + #ifdef EC_R_LADDER_STEP_FAILURE + {"LADDER_STEP_FAILURE", ERR_LIB_EC, EC_R_LADDER_STEP_FAILURE}, + #else + {"LADDER_STEP_FAILURE", 16, 162}, + #endif + #ifdef EC_R_MISSING_OID + {"MISSING_OID", ERR_LIB_EC, EC_R_MISSING_OID}, + #else + {"MISSING_OID", 16, 167}, + #endif + #ifdef EC_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_EC, EC_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", 16, 124}, + #endif + #ifdef EC_R_MISSING_PRIVATE_KEY + {"MISSING_PRIVATE_KEY", ERR_LIB_EC, EC_R_MISSING_PRIVATE_KEY}, + #else + {"MISSING_PRIVATE_KEY", 16, 125}, + #endif + #ifdef EC_R_NEED_NEW_SETUP_VALUES + {"NEED_NEW_SETUP_VALUES", ERR_LIB_EC, EC_R_NEED_NEW_SETUP_VALUES}, + #else + {"NEED_NEW_SETUP_VALUES", 16, 157}, + #endif + #ifdef EC_R_NOT_A_NIST_PRIME + {"NOT_A_NIST_PRIME", ERR_LIB_EC, EC_R_NOT_A_NIST_PRIME}, + #else + {"NOT_A_NIST_PRIME", 16, 135}, + #endif + #ifdef EC_R_NOT_IMPLEMENTED + {"NOT_IMPLEMENTED", ERR_LIB_EC, EC_R_NOT_IMPLEMENTED}, + #else + {"NOT_IMPLEMENTED", 16, 126}, + #endif + #ifdef EC_R_NOT_INITIALIZED + {"NOT_INITIALIZED", ERR_LIB_EC, EC_R_NOT_INITIALIZED}, + #else + {"NOT_INITIALIZED", 16, 111}, + #endif + #ifdef EC_R_NO_PARAMETERS_SET + {"NO_PARAMETERS_SET", ERR_LIB_EC, EC_R_NO_PARAMETERS_SET}, + #else + {"NO_PARAMETERS_SET", 16, 139}, + #endif + #ifdef EC_R_NO_PRIVATE_VALUE + {"NO_PRIVATE_VALUE", ERR_LIB_EC, EC_R_NO_PRIVATE_VALUE}, + #else + {"NO_PRIVATE_VALUE", 16, 154}, + #endif + #ifdef EC_R_OPERATION_NOT_SUPPORTED + {"OPERATION_NOT_SUPPORTED", ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED}, + #else + {"OPERATION_NOT_SUPPORTED", 16, 152}, + #endif + #ifdef EC_R_PASSED_NULL_PARAMETER + {"PASSED_NULL_PARAMETER", ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER}, + #else + {"PASSED_NULL_PARAMETER", 16, 134}, + #endif + #ifdef EC_R_PEER_KEY_ERROR + {"PEER_KEY_ERROR", ERR_LIB_EC, EC_R_PEER_KEY_ERROR}, + #else + {"PEER_KEY_ERROR", 16, 149}, + #endif + #ifdef EC_R_PKPARAMETERS2GROUP_FAILURE + {"PKPARAMETERS2GROUP_FAILURE", ERR_LIB_EC, EC_R_PKPARAMETERS2GROUP_FAILURE}, + #else + {"PKPARAMETERS2GROUP_FAILURE", 16, 127}, + #endif + #ifdef EC_R_POINT_ARITHMETIC_FAILURE + {"POINT_ARITHMETIC_FAILURE", ERR_LIB_EC, EC_R_POINT_ARITHMETIC_FAILURE}, + #else + {"POINT_ARITHMETIC_FAILURE", 16, 155}, + #endif + #ifdef EC_R_POINT_AT_INFINITY + {"POINT_AT_INFINITY", ERR_LIB_EC, EC_R_POINT_AT_INFINITY}, + #else + {"POINT_AT_INFINITY", 16, 106}, + #endif + #ifdef EC_R_POINT_COORDINATES_BLIND_FAILURE + {"POINT_COORDINATES_BLIND_FAILURE", ERR_LIB_EC, EC_R_POINT_COORDINATES_BLIND_FAILURE}, + #else + {"POINT_COORDINATES_BLIND_FAILURE", 16, 163}, + #endif + #ifdef EC_R_POINT_IS_NOT_ON_CURVE + {"POINT_IS_NOT_ON_CURVE", ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE}, + #else + {"POINT_IS_NOT_ON_CURVE", 16, 107}, + #endif + #ifdef EC_R_RANDOM_NUMBER_GENERATION_FAILED + {"RANDOM_NUMBER_GENERATION_FAILED", ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED}, + #else + {"RANDOM_NUMBER_GENERATION_FAILED", 16, 158}, + #endif + #ifdef EC_R_SHARED_INFO_ERROR + {"SHARED_INFO_ERROR", ERR_LIB_EC, EC_R_SHARED_INFO_ERROR}, + #else + {"SHARED_INFO_ERROR", 16, 150}, + #endif + #ifdef EC_R_SLOT_FULL + {"SLOT_FULL", ERR_LIB_EC, EC_R_SLOT_FULL}, + #else + {"SLOT_FULL", 16, 108}, + #endif + #ifdef EC_R_UNDEFINED_GENERATOR + {"UNDEFINED_GENERATOR", ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR}, + #else + {"UNDEFINED_GENERATOR", 16, 113}, + #endif + #ifdef EC_R_UNDEFINED_ORDER + {"UNDEFINED_ORDER", ERR_LIB_EC, EC_R_UNDEFINED_ORDER}, + #else + {"UNDEFINED_ORDER", 16, 128}, + #endif + #ifdef EC_R_UNKNOWN_COFACTOR + {"UNKNOWN_COFACTOR", ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR}, + #else + {"UNKNOWN_COFACTOR", 16, 164}, + #endif + #ifdef EC_R_UNKNOWN_GROUP + {"UNKNOWN_GROUP", ERR_LIB_EC, EC_R_UNKNOWN_GROUP}, + #else + {"UNKNOWN_GROUP", 16, 129}, + #endif + #ifdef EC_R_UNKNOWN_ORDER + {"UNKNOWN_ORDER", ERR_LIB_EC, EC_R_UNKNOWN_ORDER}, + #else + {"UNKNOWN_ORDER", 16, 114}, + #endif + #ifdef EC_R_UNSUPPORTED_FIELD + {"UNSUPPORTED_FIELD", ERR_LIB_EC, EC_R_UNSUPPORTED_FIELD}, + #else + {"UNSUPPORTED_FIELD", 16, 131}, + #endif + #ifdef EC_R_WRONG_CURVE_PARAMETERS + {"WRONG_CURVE_PARAMETERS", ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS}, + #else + {"WRONG_CURVE_PARAMETERS", 16, 145}, + #endif + #ifdef EC_R_WRONG_ORDER + {"WRONG_ORDER", ERR_LIB_EC, EC_R_WRONG_ORDER}, + #else + {"WRONG_ORDER", 16, 130}, + #endif + #ifdef ENGINE_R_ALREADY_LOADED + {"ALREADY_LOADED", ERR_LIB_ENGINE, ENGINE_R_ALREADY_LOADED}, + #else + {"ALREADY_LOADED", 38, 100}, + #endif + #ifdef ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER + {"ARGUMENT_IS_NOT_A_NUMBER", ERR_LIB_ENGINE, ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER}, + #else + {"ARGUMENT_IS_NOT_A_NUMBER", 38, 133}, + #endif + #ifdef ENGINE_R_CMD_NOT_EXECUTABLE + {"CMD_NOT_EXECUTABLE", ERR_LIB_ENGINE, ENGINE_R_CMD_NOT_EXECUTABLE}, + #else + {"CMD_NOT_EXECUTABLE", 38, 134}, + #endif + #ifdef ENGINE_R_COMMAND_TAKES_INPUT + {"COMMAND_TAKES_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_INPUT}, + #else + {"COMMAND_TAKES_INPUT", 38, 135}, + #endif + #ifdef ENGINE_R_COMMAND_TAKES_NO_INPUT + {"COMMAND_TAKES_NO_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_NO_INPUT}, + #else + {"COMMAND_TAKES_NO_INPUT", 38, 136}, + #endif + #ifdef ENGINE_R_CONFLICTING_ENGINE_ID + {"CONFLICTING_ENGINE_ID", ERR_LIB_ENGINE, ENGINE_R_CONFLICTING_ENGINE_ID}, + #else + {"CONFLICTING_ENGINE_ID", 38, 103}, + #endif + #ifdef ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED + {"CTRL_COMMAND_NOT_IMPLEMENTED", ERR_LIB_ENGINE, ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED}, + #else + {"CTRL_COMMAND_NOT_IMPLEMENTED", 38, 119}, + #endif + #ifdef ENGINE_R_DSO_FAILURE + {"DSO_FAILURE", ERR_LIB_ENGINE, ENGINE_R_DSO_FAILURE}, + #else + {"DSO_FAILURE", 38, 104}, + #endif + #ifdef ENGINE_R_DSO_NOT_FOUND + {"DSO_NOT_FOUND", ERR_LIB_ENGINE, ENGINE_R_DSO_NOT_FOUND}, + #else + {"DSO_NOT_FOUND", 38, 132}, + #endif + #ifdef ENGINE_R_ENGINES_SECTION_ERROR + {"ENGINES_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINES_SECTION_ERROR}, + #else + {"ENGINES_SECTION_ERROR", 38, 148}, + #endif + #ifdef ENGINE_R_ENGINE_CONFIGURATION_ERROR + {"ENGINE_CONFIGURATION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_CONFIGURATION_ERROR}, + #else + {"ENGINE_CONFIGURATION_ERROR", 38, 102}, + #endif + #ifdef ENGINE_R_ENGINE_IS_NOT_IN_LIST + {"ENGINE_IS_NOT_IN_LIST", ERR_LIB_ENGINE, ENGINE_R_ENGINE_IS_NOT_IN_LIST}, + #else + {"ENGINE_IS_NOT_IN_LIST", 38, 105}, + #endif + #ifdef ENGINE_R_ENGINE_SECTION_ERROR + {"ENGINE_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_SECTION_ERROR}, + #else + {"ENGINE_SECTION_ERROR", 38, 149}, + #endif + #ifdef ENGINE_R_FAILED_LOADING_PRIVATE_KEY + {"FAILED_LOADING_PRIVATE_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PRIVATE_KEY}, + #else + {"FAILED_LOADING_PRIVATE_KEY", 38, 128}, + #endif + #ifdef ENGINE_R_FAILED_LOADING_PUBLIC_KEY + {"FAILED_LOADING_PUBLIC_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PUBLIC_KEY}, + #else + {"FAILED_LOADING_PUBLIC_KEY", 38, 129}, + #endif + #ifdef ENGINE_R_FINISH_FAILED + {"FINISH_FAILED", ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED}, + #else + {"FINISH_FAILED", 38, 106}, + #endif + #ifdef ENGINE_R_ID_OR_NAME_MISSING + {"ID_OR_NAME_MISSING", ERR_LIB_ENGINE, ENGINE_R_ID_OR_NAME_MISSING}, + #else + {"ID_OR_NAME_MISSING", 38, 108}, + #endif + #ifdef ENGINE_R_INIT_FAILED + {"INIT_FAILED", ERR_LIB_ENGINE, ENGINE_R_INIT_FAILED}, + #else + {"INIT_FAILED", 38, 109}, + #endif + #ifdef ENGINE_R_INTERNAL_LIST_ERROR + {"INTERNAL_LIST_ERROR", ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR}, + #else + {"INTERNAL_LIST_ERROR", 38, 110}, + #endif + #ifdef ENGINE_R_INVALID_ARGUMENT + {"INVALID_ARGUMENT", ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT}, + #else + {"INVALID_ARGUMENT", 38, 143}, + #endif + #ifdef ENGINE_R_INVALID_CMD_NAME + {"INVALID_CMD_NAME", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME}, + #else + {"INVALID_CMD_NAME", 38, 137}, + #endif + #ifdef ENGINE_R_INVALID_CMD_NUMBER + {"INVALID_CMD_NUMBER", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NUMBER}, + #else + {"INVALID_CMD_NUMBER", 38, 138}, + #endif + #ifdef ENGINE_R_INVALID_INIT_VALUE + {"INVALID_INIT_VALUE", ERR_LIB_ENGINE, ENGINE_R_INVALID_INIT_VALUE}, + #else + {"INVALID_INIT_VALUE", 38, 151}, + #endif + #ifdef ENGINE_R_INVALID_STRING + {"INVALID_STRING", ERR_LIB_ENGINE, ENGINE_R_INVALID_STRING}, + #else + {"INVALID_STRING", 38, 150}, + #endif + #ifdef ENGINE_R_NOT_INITIALISED + {"NOT_INITIALISED", ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED}, + #else + {"NOT_INITIALISED", 38, 117}, + #endif + #ifdef ENGINE_R_NOT_LOADED + {"NOT_LOADED", ERR_LIB_ENGINE, ENGINE_R_NOT_LOADED}, + #else + {"NOT_LOADED", 38, 112}, + #endif + #ifdef ENGINE_R_NO_CONTROL_FUNCTION + {"NO_CONTROL_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_CONTROL_FUNCTION}, + #else + {"NO_CONTROL_FUNCTION", 38, 120}, + #endif + #ifdef ENGINE_R_NO_INDEX + {"NO_INDEX", ERR_LIB_ENGINE, ENGINE_R_NO_INDEX}, + #else + {"NO_INDEX", 38, 144}, + #endif + #ifdef ENGINE_R_NO_LOAD_FUNCTION + {"NO_LOAD_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION}, + #else + {"NO_LOAD_FUNCTION", 38, 125}, + #endif + #ifdef ENGINE_R_NO_REFERENCE + {"NO_REFERENCE", ERR_LIB_ENGINE, ENGINE_R_NO_REFERENCE}, + #else + {"NO_REFERENCE", 38, 130}, + #endif + #ifdef ENGINE_R_NO_SUCH_ENGINE + {"NO_SUCH_ENGINE", ERR_LIB_ENGINE, ENGINE_R_NO_SUCH_ENGINE}, + #else + {"NO_SUCH_ENGINE", 38, 116}, + #endif + #ifdef ENGINE_R_UNIMPLEMENTED_CIPHER + {"UNIMPLEMENTED_CIPHER", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_CIPHER}, + #else + {"UNIMPLEMENTED_CIPHER", 38, 146}, + #endif + #ifdef ENGINE_R_UNIMPLEMENTED_DIGEST + {"UNIMPLEMENTED_DIGEST", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_DIGEST}, + #else + {"UNIMPLEMENTED_DIGEST", 38, 147}, + #endif + #ifdef ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD + {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD}, + #else + {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", 38, 101}, + #endif + #ifdef ENGINE_R_VERSION_INCOMPATIBILITY + {"VERSION_INCOMPATIBILITY", ERR_LIB_ENGINE, ENGINE_R_VERSION_INCOMPATIBILITY}, + #else + {"VERSION_INCOMPATIBILITY", 38, 145}, + #endif + #ifdef EVP_R_AES_KEY_SETUP_FAILED + {"AES_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_AES_KEY_SETUP_FAILED}, + #else + {"AES_KEY_SETUP_FAILED", 6, 143}, + #endif + #ifdef EVP_R_ARIA_KEY_SETUP_FAILED + {"ARIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED}, + #else + {"ARIA_KEY_SETUP_FAILED", 6, 176}, + #endif + #ifdef EVP_R_BAD_DECRYPT + {"BAD_DECRYPT", ERR_LIB_EVP, EVP_R_BAD_DECRYPT}, + #else + {"BAD_DECRYPT", 6, 100}, + #endif + #ifdef EVP_R_BAD_KEY_LENGTH + {"BAD_KEY_LENGTH", ERR_LIB_EVP, EVP_R_BAD_KEY_LENGTH}, + #else + {"BAD_KEY_LENGTH", 6, 195}, + #endif + #ifdef EVP_R_BUFFER_TOO_SMALL + {"BUFFER_TOO_SMALL", ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL}, + #else + {"BUFFER_TOO_SMALL", 6, 155}, + #endif + #ifdef EVP_R_CAMELLIA_KEY_SETUP_FAILED + {"CAMELLIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_CAMELLIA_KEY_SETUP_FAILED}, + #else + {"CAMELLIA_KEY_SETUP_FAILED", 6, 157}, + #endif + #ifdef EVP_R_CIPHER_PARAMETER_ERROR + {"CIPHER_PARAMETER_ERROR", ERR_LIB_EVP, EVP_R_CIPHER_PARAMETER_ERROR}, + #else + {"CIPHER_PARAMETER_ERROR", 6, 122}, + #endif + #ifdef EVP_R_COMMAND_NOT_SUPPORTED + {"COMMAND_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED}, + #else + {"COMMAND_NOT_SUPPORTED", 6, 147}, + #endif + #ifdef EVP_R_COPY_ERROR + {"COPY_ERROR", ERR_LIB_EVP, EVP_R_COPY_ERROR}, + #else + {"COPY_ERROR", 6, 173}, + #endif + #ifdef EVP_R_CTRL_NOT_IMPLEMENTED + {"CTRL_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED}, + #else + {"CTRL_NOT_IMPLEMENTED", 6, 132}, + #endif + #ifdef EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED + {"CTRL_OPERATION_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED}, + #else + {"CTRL_OPERATION_NOT_IMPLEMENTED", 6, 133}, + #endif + #ifdef EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH + {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH}, + #else + {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", 6, 138}, + #endif + #ifdef EVP_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_EVP, EVP_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", 6, 114}, + #endif + #ifdef EVP_R_DIFFERENT_KEY_TYPES + {"DIFFERENT_KEY_TYPES", ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES}, + #else + {"DIFFERENT_KEY_TYPES", 6, 101}, + #endif + #ifdef EVP_R_DIFFERENT_PARAMETERS + {"DIFFERENT_PARAMETERS", ERR_LIB_EVP, EVP_R_DIFFERENT_PARAMETERS}, + #else + {"DIFFERENT_PARAMETERS", 6, 153}, + #endif + #ifdef EVP_R_ERROR_LOADING_SECTION + {"ERROR_LOADING_SECTION", ERR_LIB_EVP, EVP_R_ERROR_LOADING_SECTION}, + #else + {"ERROR_LOADING_SECTION", 6, 165}, + #endif + #ifdef EVP_R_ERROR_SETTING_FIPS_MODE + {"ERROR_SETTING_FIPS_MODE", ERR_LIB_EVP, EVP_R_ERROR_SETTING_FIPS_MODE}, + #else + {"ERROR_SETTING_FIPS_MODE", 6, 166}, + #endif + #ifdef EVP_R_EXPECTING_AN_HMAC_KEY + {"EXPECTING_AN_HMAC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_HMAC_KEY}, + #else + {"EXPECTING_AN_HMAC_KEY", 6, 174}, + #endif + #ifdef EVP_R_EXPECTING_AN_RSA_KEY + {"EXPECTING_AN_RSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_RSA_KEY}, + #else + {"EXPECTING_AN_RSA_KEY", 6, 127}, + #endif + #ifdef EVP_R_EXPECTING_A_DH_KEY + {"EXPECTING_A_DH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DH_KEY}, + #else + {"EXPECTING_A_DH_KEY", 6, 128}, + #endif + #ifdef EVP_R_EXPECTING_A_DSA_KEY + {"EXPECTING_A_DSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DSA_KEY}, + #else + {"EXPECTING_A_DSA_KEY", 6, 129}, + #endif + #ifdef EVP_R_EXPECTING_A_EC_KEY + {"EXPECTING_A_EC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_EC_KEY}, + #else + {"EXPECTING_A_EC_KEY", 6, 142}, + #endif + #ifdef EVP_R_EXPECTING_A_POLY1305_KEY + {"EXPECTING_A_POLY1305_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_POLY1305_KEY}, + #else + {"EXPECTING_A_POLY1305_KEY", 6, 164}, + #endif + #ifdef EVP_R_EXPECTING_A_SIPHASH_KEY + {"EXPECTING_A_SIPHASH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_SIPHASH_KEY}, + #else + {"EXPECTING_A_SIPHASH_KEY", 6, 175}, + #endif + #ifdef EVP_R_FIPS_MODE_NOT_SUPPORTED + {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_FIPS_MODE_NOT_SUPPORTED}, + #else + {"FIPS_MODE_NOT_SUPPORTED", 6, 167}, + #endif + #ifdef EVP_R_GET_RAW_KEY_FAILED + {"GET_RAW_KEY_FAILED", ERR_LIB_EVP, EVP_R_GET_RAW_KEY_FAILED}, + #else + {"GET_RAW_KEY_FAILED", 6, 182}, + #endif + #ifdef EVP_R_ILLEGAL_SCRYPT_PARAMETERS + {"ILLEGAL_SCRYPT_PARAMETERS", ERR_LIB_EVP, EVP_R_ILLEGAL_SCRYPT_PARAMETERS}, + #else + {"ILLEGAL_SCRYPT_PARAMETERS", 6, 171}, + #endif + #ifdef EVP_R_INITIALIZATION_ERROR + {"INITIALIZATION_ERROR", ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR}, + #else + {"INITIALIZATION_ERROR", 6, 134}, + #endif + #ifdef EVP_R_INPUT_NOT_INITIALIZED + {"INPUT_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_INPUT_NOT_INITIALIZED}, + #else + {"INPUT_NOT_INITIALIZED", 6, 111}, + #endif + #ifdef EVP_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_EVP, EVP_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", 6, 152}, + #endif + #ifdef EVP_R_INVALID_FIPS_MODE + {"INVALID_FIPS_MODE", ERR_LIB_EVP, EVP_R_INVALID_FIPS_MODE}, + #else + {"INVALID_FIPS_MODE", 6, 168}, + #endif + #ifdef EVP_R_INVALID_IV_LENGTH + {"INVALID_IV_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH}, + #else + {"INVALID_IV_LENGTH", 6, 194}, + #endif + #ifdef EVP_R_INVALID_KEY + {"INVALID_KEY", ERR_LIB_EVP, EVP_R_INVALID_KEY}, + #else + {"INVALID_KEY", 6, 163}, + #endif + #ifdef EVP_R_INVALID_KEY_LENGTH + {"INVALID_KEY_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH}, + #else + {"INVALID_KEY_LENGTH", 6, 130}, + #endif + #ifdef EVP_R_INVALID_OPERATION + {"INVALID_OPERATION", ERR_LIB_EVP, EVP_R_INVALID_OPERATION}, + #else + {"INVALID_OPERATION", 6, 148}, + #endif + #ifdef EVP_R_KEYGEN_FAILURE + {"KEYGEN_FAILURE", ERR_LIB_EVP, EVP_R_KEYGEN_FAILURE}, + #else + {"KEYGEN_FAILURE", 6, 120}, + #endif + #ifdef EVP_R_KEY_SETUP_FAILED + {"KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED}, + #else + {"KEY_SETUP_FAILED", 6, 180}, + #endif + #ifdef EVP_R_MEMORY_LIMIT_EXCEEDED + {"MEMORY_LIMIT_EXCEEDED", ERR_LIB_EVP, EVP_R_MEMORY_LIMIT_EXCEEDED}, + #else + {"MEMORY_LIMIT_EXCEEDED", 6, 172}, + #endif + #ifdef EVP_R_MESSAGE_DIGEST_IS_NULL + {"MESSAGE_DIGEST_IS_NULL", ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL}, + #else + {"MESSAGE_DIGEST_IS_NULL", 6, 159}, + #endif + #ifdef EVP_R_METHOD_NOT_SUPPORTED + {"METHOD_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED}, + #else + {"METHOD_NOT_SUPPORTED", 6, 144}, + #endif + #ifdef EVP_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_EVP, EVP_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", 6, 103}, + #endif + #ifdef EVP_R_NOT_XOF_OR_INVALID_LENGTH + {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_EVP, EVP_R_NOT_XOF_OR_INVALID_LENGTH}, + #else + {"NOT_XOF_OR_INVALID_LENGTH", 6, 178}, + #endif + #ifdef EVP_R_NO_CIPHER_SET + {"NO_CIPHER_SET", ERR_LIB_EVP, EVP_R_NO_CIPHER_SET}, + #else + {"NO_CIPHER_SET", 6, 131}, + #endif + #ifdef EVP_R_NO_DEFAULT_DIGEST + {"NO_DEFAULT_DIGEST", ERR_LIB_EVP, EVP_R_NO_DEFAULT_DIGEST}, + #else + {"NO_DEFAULT_DIGEST", 6, 158}, + #endif + #ifdef EVP_R_NO_DIGEST_SET + {"NO_DIGEST_SET", ERR_LIB_EVP, EVP_R_NO_DIGEST_SET}, + #else + {"NO_DIGEST_SET", 6, 139}, + #endif + #ifdef EVP_R_NO_KEY_SET + {"NO_KEY_SET", ERR_LIB_EVP, EVP_R_NO_KEY_SET}, + #else + {"NO_KEY_SET", 6, 154}, + #endif + #ifdef EVP_R_NO_OPERATION_SET + {"NO_OPERATION_SET", ERR_LIB_EVP, EVP_R_NO_OPERATION_SET}, + #else + {"NO_OPERATION_SET", 6, 149}, + #endif + #ifdef EVP_R_ONLY_ONESHOT_SUPPORTED + {"ONLY_ONESHOT_SUPPORTED", ERR_LIB_EVP, EVP_R_ONLY_ONESHOT_SUPPORTED}, + #else + {"ONLY_ONESHOT_SUPPORTED", 6, 177}, + #endif + #ifdef EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE}, + #else + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 6, 150}, + #endif + #ifdef EVP_R_OPERATON_NOT_INITIALIZED + {"OPERATON_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_OPERATON_NOT_INITIALIZED}, + #else + {"OPERATON_NOT_INITIALIZED", 6, 151}, + #endif + #ifdef EVP_R_OUTPUT_WOULD_OVERFLOW + {"OUTPUT_WOULD_OVERFLOW", ERR_LIB_EVP, EVP_R_OUTPUT_WOULD_OVERFLOW}, + #else + {"OUTPUT_WOULD_OVERFLOW", 6, 184}, + #endif + #ifdef EVP_R_PARTIALLY_OVERLAPPING + {"PARTIALLY_OVERLAPPING", ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING}, + #else + {"PARTIALLY_OVERLAPPING", 6, 162}, + #endif + #ifdef EVP_R_PBKDF2_ERROR + {"PBKDF2_ERROR", ERR_LIB_EVP, EVP_R_PBKDF2_ERROR}, + #else + {"PBKDF2_ERROR", 6, 181}, + #endif + #ifdef EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED + {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", ERR_LIB_EVP, EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED}, + #else + {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", 6, 179}, + #endif + #ifdef EVP_R_PRIVATE_KEY_DECODE_ERROR + {"PRIVATE_KEY_DECODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_DECODE_ERROR}, + #else + {"PRIVATE_KEY_DECODE_ERROR", 6, 145}, + #endif + #ifdef EVP_R_PRIVATE_KEY_ENCODE_ERROR + {"PRIVATE_KEY_ENCODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_ENCODE_ERROR}, + #else + {"PRIVATE_KEY_ENCODE_ERROR", 6, 146}, + #endif + #ifdef EVP_R_PUBLIC_KEY_NOT_RSA + {"PUBLIC_KEY_NOT_RSA", ERR_LIB_EVP, EVP_R_PUBLIC_KEY_NOT_RSA}, + #else + {"PUBLIC_KEY_NOT_RSA", 6, 106}, + #endif + #ifdef EVP_R_UNKNOWN_CIPHER + {"UNKNOWN_CIPHER", ERR_LIB_EVP, EVP_R_UNKNOWN_CIPHER}, + #else + {"UNKNOWN_CIPHER", 6, 160}, + #endif + #ifdef EVP_R_UNKNOWN_DIGEST + {"UNKNOWN_DIGEST", ERR_LIB_EVP, EVP_R_UNKNOWN_DIGEST}, + #else + {"UNKNOWN_DIGEST", 6, 161}, + #endif + #ifdef EVP_R_UNKNOWN_OPTION + {"UNKNOWN_OPTION", ERR_LIB_EVP, EVP_R_UNKNOWN_OPTION}, + #else + {"UNKNOWN_OPTION", 6, 169}, + #endif + #ifdef EVP_R_UNKNOWN_PBE_ALGORITHM + {"UNKNOWN_PBE_ALGORITHM", ERR_LIB_EVP, EVP_R_UNKNOWN_PBE_ALGORITHM}, + #else + {"UNKNOWN_PBE_ALGORITHM", 6, 121}, + #endif + #ifdef EVP_R_UNSUPPORTED_ALGORITHM + {"UNSUPPORTED_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM}, + #else + {"UNSUPPORTED_ALGORITHM", 6, 156}, + #endif + #ifdef EVP_R_UNSUPPORTED_CIPHER + {"UNSUPPORTED_CIPHER", ERR_LIB_EVP, EVP_R_UNSUPPORTED_CIPHER}, + #else + {"UNSUPPORTED_CIPHER", 6, 107}, + #endif + #ifdef EVP_R_UNSUPPORTED_KEYLENGTH + {"UNSUPPORTED_KEYLENGTH", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEYLENGTH}, + #else + {"UNSUPPORTED_KEYLENGTH", 6, 123}, + #endif + #ifdef EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION + {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION}, + #else + {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", 6, 124}, + #endif + #ifdef EVP_R_UNSUPPORTED_KEY_SIZE + {"UNSUPPORTED_KEY_SIZE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_SIZE}, + #else + {"UNSUPPORTED_KEY_SIZE", 6, 108}, + #endif + #ifdef EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS + {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_EVP, EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS}, + #else + {"UNSUPPORTED_NUMBER_OF_ROUNDS", 6, 135}, + #endif + #ifdef EVP_R_UNSUPPORTED_PRF + {"UNSUPPORTED_PRF", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRF}, + #else + {"UNSUPPORTED_PRF", 6, 125}, + #endif + #ifdef EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM + {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM}, + #else + {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", 6, 118}, + #endif + #ifdef EVP_R_UNSUPPORTED_SALT_TYPE + {"UNSUPPORTED_SALT_TYPE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_SALT_TYPE}, + #else + {"UNSUPPORTED_SALT_TYPE", 6, 126}, + #endif + #ifdef EVP_R_WRAP_MODE_NOT_ALLOWED + {"WRAP_MODE_NOT_ALLOWED", ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED}, + #else + {"WRAP_MODE_NOT_ALLOWED", 6, 170}, + #endif + #ifdef EVP_R_WRONG_FINAL_BLOCK_LENGTH + {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_WRONG_FINAL_BLOCK_LENGTH}, + #else + {"WRONG_FINAL_BLOCK_LENGTH", 6, 109}, + #endif + #ifdef EVP_R_XTS_DUPLICATED_KEYS + {"XTS_DUPLICATED_KEYS", ERR_LIB_EVP, EVP_R_XTS_DUPLICATED_KEYS}, + #else + {"XTS_DUPLICATED_KEYS", 6, 183}, + #endif + #ifdef KDF_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_KDF, KDF_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", 52, 100}, + #endif + #ifdef KDF_R_MISSING_ITERATION_COUNT + {"MISSING_ITERATION_COUNT", ERR_LIB_KDF, KDF_R_MISSING_ITERATION_COUNT}, + #else + {"MISSING_ITERATION_COUNT", 52, 109}, + #endif + #ifdef KDF_R_MISSING_KEY + {"MISSING_KEY", ERR_LIB_KDF, KDF_R_MISSING_KEY}, + #else + {"MISSING_KEY", 52, 104}, + #endif + #ifdef KDF_R_MISSING_MESSAGE_DIGEST + {"MISSING_MESSAGE_DIGEST", ERR_LIB_KDF, KDF_R_MISSING_MESSAGE_DIGEST}, + #else + {"MISSING_MESSAGE_DIGEST", 52, 105}, + #endif + #ifdef KDF_R_MISSING_PARAMETER + {"MISSING_PARAMETER", ERR_LIB_KDF, KDF_R_MISSING_PARAMETER}, + #else + {"MISSING_PARAMETER", 52, 101}, + #endif + #ifdef KDF_R_MISSING_PASS + {"MISSING_PASS", ERR_LIB_KDF, KDF_R_MISSING_PASS}, + #else + {"MISSING_PASS", 52, 110}, + #endif + #ifdef KDF_R_MISSING_SALT + {"MISSING_SALT", ERR_LIB_KDF, KDF_R_MISSING_SALT}, + #else + {"MISSING_SALT", 52, 111}, + #endif + #ifdef KDF_R_MISSING_SECRET + {"MISSING_SECRET", ERR_LIB_KDF, KDF_R_MISSING_SECRET}, + #else + {"MISSING_SECRET", 52, 107}, + #endif + #ifdef KDF_R_MISSING_SEED + {"MISSING_SEED", ERR_LIB_KDF, KDF_R_MISSING_SEED}, + #else + {"MISSING_SEED", 52, 106}, + #endif + #ifdef KDF_R_UNKNOWN_PARAMETER_TYPE + {"UNKNOWN_PARAMETER_TYPE", ERR_LIB_KDF, KDF_R_UNKNOWN_PARAMETER_TYPE}, + #else + {"UNKNOWN_PARAMETER_TYPE", 52, 103}, + #endif + #ifdef KDF_R_VALUE_ERROR + {"VALUE_ERROR", ERR_LIB_KDF, KDF_R_VALUE_ERROR}, + #else + {"VALUE_ERROR", 52, 108}, + #endif + #ifdef KDF_R_VALUE_MISSING + {"VALUE_MISSING", ERR_LIB_KDF, KDF_R_VALUE_MISSING}, + #else + {"VALUE_MISSING", 52, 102}, + #endif + #ifdef OBJ_R_OID_EXISTS + {"OID_EXISTS", ERR_LIB_OBJ, OBJ_R_OID_EXISTS}, + #else + {"OID_EXISTS", 8, 102}, + #endif + #ifdef OBJ_R_UNKNOWN_NID + {"UNKNOWN_NID", ERR_LIB_OBJ, OBJ_R_UNKNOWN_NID}, + #else + {"UNKNOWN_NID", 8, 101}, + #endif + #ifdef OCSP_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_OCSP, OCSP_R_CERTIFICATE_VERIFY_ERROR}, + #else + {"CERTIFICATE_VERIFY_ERROR", 39, 101}, + #endif + #ifdef OCSP_R_DIGEST_ERR + {"DIGEST_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_ERR}, + #else + {"DIGEST_ERR", 39, 102}, + #endif + #ifdef OCSP_R_ERROR_IN_NEXTUPDATE_FIELD + {"ERROR_IN_NEXTUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_NEXTUPDATE_FIELD}, + #else + {"ERROR_IN_NEXTUPDATE_FIELD", 39, 122}, + #endif + #ifdef OCSP_R_ERROR_IN_THISUPDATE_FIELD + {"ERROR_IN_THISUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_THISUPDATE_FIELD}, + #else + {"ERROR_IN_THISUPDATE_FIELD", 39, 123}, + #endif + #ifdef OCSP_R_ERROR_PARSING_URL + {"ERROR_PARSING_URL", ERR_LIB_OCSP, OCSP_R_ERROR_PARSING_URL}, + #else + {"ERROR_PARSING_URL", 39, 121}, + #endif + #ifdef OCSP_R_MISSING_OCSPSIGNING_USAGE + {"MISSING_OCSPSIGNING_USAGE", ERR_LIB_OCSP, OCSP_R_MISSING_OCSPSIGNING_USAGE}, + #else + {"MISSING_OCSPSIGNING_USAGE", 39, 103}, + #endif + #ifdef OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE + {"NEXTUPDATE_BEFORE_THISUPDATE", ERR_LIB_OCSP, OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE}, + #else + {"NEXTUPDATE_BEFORE_THISUPDATE", 39, 124}, + #endif + #ifdef OCSP_R_NOT_BASIC_RESPONSE + {"NOT_BASIC_RESPONSE", ERR_LIB_OCSP, OCSP_R_NOT_BASIC_RESPONSE}, + #else + {"NOT_BASIC_RESPONSE", 39, 104}, + #endif + #ifdef OCSP_R_NO_CERTIFICATES_IN_CHAIN + {"NO_CERTIFICATES_IN_CHAIN", ERR_LIB_OCSP, OCSP_R_NO_CERTIFICATES_IN_CHAIN}, + #else + {"NO_CERTIFICATES_IN_CHAIN", 39, 105}, + #endif + #ifdef OCSP_R_NO_RESPONSE_DATA + {"NO_RESPONSE_DATA", ERR_LIB_OCSP, OCSP_R_NO_RESPONSE_DATA}, + #else + {"NO_RESPONSE_DATA", 39, 108}, + #endif + #ifdef OCSP_R_NO_REVOKED_TIME + {"NO_REVOKED_TIME", ERR_LIB_OCSP, OCSP_R_NO_REVOKED_TIME}, + #else + {"NO_REVOKED_TIME", 39, 109}, + #endif + #ifdef OCSP_R_NO_SIGNER_KEY + {"NO_SIGNER_KEY", ERR_LIB_OCSP, OCSP_R_NO_SIGNER_KEY}, + #else + {"NO_SIGNER_KEY", 39, 130}, + #endif + #ifdef OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_OCSP, OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, + #else + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 39, 110}, + #endif + #ifdef OCSP_R_REQUEST_NOT_SIGNED + {"REQUEST_NOT_SIGNED", ERR_LIB_OCSP, OCSP_R_REQUEST_NOT_SIGNED}, + #else + {"REQUEST_NOT_SIGNED", 39, 128}, + #endif + #ifdef OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA + {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", ERR_LIB_OCSP, OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA}, + #else + {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", 39, 111}, + #endif + #ifdef OCSP_R_ROOT_CA_NOT_TRUSTED + {"ROOT_CA_NOT_TRUSTED", ERR_LIB_OCSP, OCSP_R_ROOT_CA_NOT_TRUSTED}, + #else + {"ROOT_CA_NOT_TRUSTED", 39, 112}, + #endif + #ifdef OCSP_R_SERVER_RESPONSE_ERROR + {"SERVER_RESPONSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_ERROR}, + #else + {"SERVER_RESPONSE_ERROR", 39, 114}, + #endif + #ifdef OCSP_R_SERVER_RESPONSE_PARSE_ERROR + {"SERVER_RESPONSE_PARSE_ERROR", ERR_LIB_OCSP, OCSP_R_SERVER_RESPONSE_PARSE_ERROR}, + #else + {"SERVER_RESPONSE_PARSE_ERROR", 39, 115}, + #endif + #ifdef OCSP_R_SIGNATURE_FAILURE + {"SIGNATURE_FAILURE", ERR_LIB_OCSP, OCSP_R_SIGNATURE_FAILURE}, + #else + {"SIGNATURE_FAILURE", 39, 117}, + #endif + #ifdef OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_OCSP, OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND}, + #else + {"SIGNER_CERTIFICATE_NOT_FOUND", 39, 118}, + #endif + #ifdef OCSP_R_STATUS_EXPIRED + {"STATUS_EXPIRED", ERR_LIB_OCSP, OCSP_R_STATUS_EXPIRED}, + #else + {"STATUS_EXPIRED", 39, 125}, + #endif + #ifdef OCSP_R_STATUS_NOT_YET_VALID + {"STATUS_NOT_YET_VALID", ERR_LIB_OCSP, OCSP_R_STATUS_NOT_YET_VALID}, + #else + {"STATUS_NOT_YET_VALID", 39, 126}, + #endif + #ifdef OCSP_R_STATUS_TOO_OLD + {"STATUS_TOO_OLD", ERR_LIB_OCSP, OCSP_R_STATUS_TOO_OLD}, + #else + {"STATUS_TOO_OLD", 39, 127}, + #endif + #ifdef OCSP_R_UNKNOWN_MESSAGE_DIGEST + {"UNKNOWN_MESSAGE_DIGEST", ERR_LIB_OCSP, OCSP_R_UNKNOWN_MESSAGE_DIGEST}, + #else + {"UNKNOWN_MESSAGE_DIGEST", 39, 119}, + #endif + #ifdef OCSP_R_UNKNOWN_NID + {"UNKNOWN_NID", ERR_LIB_OCSP, OCSP_R_UNKNOWN_NID}, + #else + {"UNKNOWN_NID", 39, 120}, + #endif + #ifdef OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE + {"UNSUPPORTED_REQUESTORNAME_TYPE", ERR_LIB_OCSP, OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE}, + #else + {"UNSUPPORTED_REQUESTORNAME_TYPE", 39, 129}, + #endif + #ifdef OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE + {"AMBIGUOUS_CONTENT_TYPE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE}, + #else + {"AMBIGUOUS_CONTENT_TYPE", 44, 107}, + #endif + #ifdef OSSL_STORE_R_BAD_PASSWORD_READ + {"BAD_PASSWORD_READ", ERR_LIB_OSSL_STORE, OSSL_STORE_R_BAD_PASSWORD_READ}, + #else + {"BAD_PASSWORD_READ", 44, 115}, + #endif + #ifdef OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC + {"ERROR_VERIFYING_PKCS12_MAC", ERR_LIB_OSSL_STORE, OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC}, + #else + {"ERROR_VERIFYING_PKCS12_MAC", 44, 113}, + #endif + #ifdef OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST + {"FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST", ERR_LIB_OSSL_STORE, OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST}, + #else + {"FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST", 44, 121}, + #endif + #ifdef OSSL_STORE_R_INVALID_SCHEME + {"INVALID_SCHEME", ERR_LIB_OSSL_STORE, OSSL_STORE_R_INVALID_SCHEME}, + #else + {"INVALID_SCHEME", 44, 106}, + #endif + #ifdef OSSL_STORE_R_IS_NOT_A + {"IS_NOT_A", ERR_LIB_OSSL_STORE, OSSL_STORE_R_IS_NOT_A}, + #else + {"IS_NOT_A", 44, 112}, + #endif + #ifdef OSSL_STORE_R_LOADER_INCOMPLETE + {"LOADER_INCOMPLETE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_LOADER_INCOMPLETE}, + #else + {"LOADER_INCOMPLETE", 44, 116}, + #endif + #ifdef OSSL_STORE_R_LOADING_STARTED + {"LOADING_STARTED", ERR_LIB_OSSL_STORE, OSSL_STORE_R_LOADING_STARTED}, + #else + {"LOADING_STARTED", 44, 117}, + #endif + #ifdef OSSL_STORE_R_NOT_A_CERTIFICATE + {"NOT_A_CERTIFICATE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_CERTIFICATE}, + #else + {"NOT_A_CERTIFICATE", 44, 100}, + #endif + #ifdef OSSL_STORE_R_NOT_A_CRL + {"NOT_A_CRL", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_CRL}, + #else + {"NOT_A_CRL", 44, 101}, + #endif + #ifdef OSSL_STORE_R_NOT_A_KEY + {"NOT_A_KEY", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_KEY}, + #else + {"NOT_A_KEY", 44, 102}, + #endif + #ifdef OSSL_STORE_R_NOT_A_NAME + {"NOT_A_NAME", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_NAME}, + #else + {"NOT_A_NAME", 44, 103}, + #endif + #ifdef OSSL_STORE_R_NOT_PARAMETERS + {"NOT_PARAMETERS", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_PARAMETERS}, + #else + {"NOT_PARAMETERS", 44, 104}, + #endif + #ifdef OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR + {"PASSPHRASE_CALLBACK_ERROR", ERR_LIB_OSSL_STORE, OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR}, + #else + {"PASSPHRASE_CALLBACK_ERROR", 44, 114}, + #endif + #ifdef OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE + {"PATH_MUST_BE_ABSOLUTE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE}, + #else + {"PATH_MUST_BE_ABSOLUTE", 44, 108}, + #endif + #ifdef OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES + {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", ERR_LIB_OSSL_STORE, OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES}, + #else + {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", 44, 119}, + #endif + #ifdef OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED + {"UI_PROCESS_INTERRUPTED_OR_CANCELLED", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED}, + #else + {"UI_PROCESS_INTERRUPTED_OR_CANCELLED", 44, 109}, + #endif + #ifdef OSSL_STORE_R_UNREGISTERED_SCHEME + {"UNREGISTERED_SCHEME", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNREGISTERED_SCHEME}, + #else + {"UNREGISTERED_SCHEME", 44, 105}, + #endif + #ifdef OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE + {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE}, + #else + {"UNSUPPORTED_CONTENT_TYPE", 44, 110}, + #endif + #ifdef OSSL_STORE_R_UNSUPPORTED_OPERATION + {"UNSUPPORTED_OPERATION", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNSUPPORTED_OPERATION}, + #else + {"UNSUPPORTED_OPERATION", 44, 118}, + #endif + #ifdef OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE + {"UNSUPPORTED_SEARCH_TYPE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE}, + #else + {"UNSUPPORTED_SEARCH_TYPE", 44, 120}, + #endif + #ifdef OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED + {"URI_AUTHORITY_UNSUPPORTED", ERR_LIB_OSSL_STORE, OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED}, + #else + {"URI_AUTHORITY_UNSUPPORTED", 44, 111}, + #endif + #ifdef PEM_R_BAD_BASE64_DECODE + {"BAD_BASE64_DECODE", ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE}, + #else + {"BAD_BASE64_DECODE", 9, 100}, + #endif + #ifdef PEM_R_BAD_DECRYPT + {"BAD_DECRYPT", ERR_LIB_PEM, PEM_R_BAD_DECRYPT}, + #else + {"BAD_DECRYPT", 9, 101}, + #endif + #ifdef PEM_R_BAD_END_LINE + {"BAD_END_LINE", ERR_LIB_PEM, PEM_R_BAD_END_LINE}, + #else + {"BAD_END_LINE", 9, 102}, + #endif + #ifdef PEM_R_BAD_IV_CHARS + {"BAD_IV_CHARS", ERR_LIB_PEM, PEM_R_BAD_IV_CHARS}, + #else + {"BAD_IV_CHARS", 9, 103}, + #endif + #ifdef PEM_R_BAD_MAGIC_NUMBER + {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, PEM_R_BAD_MAGIC_NUMBER}, + #else + {"BAD_MAGIC_NUMBER", 9, 116}, + #endif + #ifdef PEM_R_BAD_PASSWORD_READ + {"BAD_PASSWORD_READ", ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ}, + #else + {"BAD_PASSWORD_READ", 9, 104}, + #endif + #ifdef PEM_R_BAD_VERSION_NUMBER + {"BAD_VERSION_NUMBER", ERR_LIB_PEM, PEM_R_BAD_VERSION_NUMBER}, + #else + {"BAD_VERSION_NUMBER", 9, 117}, + #endif + #ifdef PEM_R_BIO_WRITE_FAILURE + {"BIO_WRITE_FAILURE", ERR_LIB_PEM, PEM_R_BIO_WRITE_FAILURE}, + #else + {"BIO_WRITE_FAILURE", 9, 118}, + #endif + #ifdef PEM_R_CIPHER_IS_NULL + {"CIPHER_IS_NULL", ERR_LIB_PEM, PEM_R_CIPHER_IS_NULL}, + #else + {"CIPHER_IS_NULL", 9, 127}, + #endif + #ifdef PEM_R_ERROR_CONVERTING_PRIVATE_KEY + {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, PEM_R_ERROR_CONVERTING_PRIVATE_KEY}, + #else + {"ERROR_CONVERTING_PRIVATE_KEY", 9, 115}, + #endif + #ifdef PEM_R_EXPECTING_PRIVATE_KEY_BLOB + {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PRIVATE_KEY_BLOB}, + #else + {"EXPECTING_PRIVATE_KEY_BLOB", 9, 119}, + #endif + #ifdef PEM_R_EXPECTING_PUBLIC_KEY_BLOB + {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PUBLIC_KEY_BLOB}, + #else + {"EXPECTING_PUBLIC_KEY_BLOB", 9, 120}, + #endif + #ifdef PEM_R_HEADER_TOO_LONG + {"HEADER_TOO_LONG", ERR_LIB_PEM, PEM_R_HEADER_TOO_LONG}, + #else + {"HEADER_TOO_LONG", 9, 128}, + #endif + #ifdef PEM_R_INCONSISTENT_HEADER + {"INCONSISTENT_HEADER", ERR_LIB_PEM, PEM_R_INCONSISTENT_HEADER}, + #else + {"INCONSISTENT_HEADER", 9, 121}, + #endif + #ifdef PEM_R_KEYBLOB_HEADER_PARSE_ERROR + {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, PEM_R_KEYBLOB_HEADER_PARSE_ERROR}, + #else + {"KEYBLOB_HEADER_PARSE_ERROR", 9, 122}, + #endif + #ifdef PEM_R_KEYBLOB_TOO_SHORT + {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, PEM_R_KEYBLOB_TOO_SHORT}, + #else + {"KEYBLOB_TOO_SHORT", 9, 123}, + #endif + #ifdef PEM_R_MISSING_DEK_IV + {"MISSING_DEK_IV", ERR_LIB_PEM, PEM_R_MISSING_DEK_IV}, + #else + {"MISSING_DEK_IV", 9, 129}, + #endif + #ifdef PEM_R_NOT_DEK_INFO + {"NOT_DEK_INFO", ERR_LIB_PEM, PEM_R_NOT_DEK_INFO}, + #else + {"NOT_DEK_INFO", 9, 105}, + #endif + #ifdef PEM_R_NOT_ENCRYPTED + {"NOT_ENCRYPTED", ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED}, + #else + {"NOT_ENCRYPTED", 9, 106}, + #endif + #ifdef PEM_R_NOT_PROC_TYPE + {"NOT_PROC_TYPE", ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE}, + #else + {"NOT_PROC_TYPE", 9, 107}, + #endif + #ifdef PEM_R_NO_START_LINE + {"NO_START_LINE", ERR_LIB_PEM, PEM_R_NO_START_LINE}, + #else + {"NO_START_LINE", 9, 108}, + #endif + #ifdef PEM_R_PROBLEMS_GETTING_PASSWORD + {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, PEM_R_PROBLEMS_GETTING_PASSWORD}, + #else + {"PROBLEMS_GETTING_PASSWORD", 9, 109}, + #endif + #ifdef PEM_R_PVK_DATA_TOO_SHORT + {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_DATA_TOO_SHORT}, + #else + {"PVK_DATA_TOO_SHORT", 9, 124}, + #endif + #ifdef PEM_R_PVK_TOO_SHORT + {"PVK_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_TOO_SHORT}, + #else + {"PVK_TOO_SHORT", 9, 125}, + #endif + #ifdef PEM_R_READ_KEY + {"READ_KEY", ERR_LIB_PEM, PEM_R_READ_KEY}, + #else + {"READ_KEY", 9, 111}, + #endif + #ifdef PEM_R_SHORT_HEADER + {"SHORT_HEADER", ERR_LIB_PEM, PEM_R_SHORT_HEADER}, + #else + {"SHORT_HEADER", 9, 112}, + #endif + #ifdef PEM_R_UNEXPECTED_DEK_IV + {"UNEXPECTED_DEK_IV", ERR_LIB_PEM, PEM_R_UNEXPECTED_DEK_IV}, + #else + {"UNEXPECTED_DEK_IV", 9, 130}, + #endif + #ifdef PEM_R_UNSUPPORTED_CIPHER + {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER}, + #else + {"UNSUPPORTED_CIPHER", 9, 113}, + #endif + #ifdef PEM_R_UNSUPPORTED_ENCRYPTION + {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION}, + #else + {"UNSUPPORTED_ENCRYPTION", 9, 114}, + #endif + #ifdef PEM_R_UNSUPPORTED_KEY_COMPONENTS + {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, PEM_R_UNSUPPORTED_KEY_COMPONENTS}, + #else + {"UNSUPPORTED_KEY_COMPONENTS", 9, 126}, + #endif + #ifdef PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE + {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_PEM, PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE}, + #else + {"UNSUPPORTED_PUBLIC_KEY_TYPE", 9, 110}, + #endif + #ifdef PKCS12_R_CANT_PACK_STRUCTURE + {"CANT_PACK_STRUCTURE", ERR_LIB_PKCS12, PKCS12_R_CANT_PACK_STRUCTURE}, + #else + {"CANT_PACK_STRUCTURE", 35, 100}, + #endif + #ifdef PKCS12_R_CONTENT_TYPE_NOT_DATA + {"CONTENT_TYPE_NOT_DATA", ERR_LIB_PKCS12, PKCS12_R_CONTENT_TYPE_NOT_DATA}, + #else + {"CONTENT_TYPE_NOT_DATA", 35, 121}, + #endif + #ifdef PKCS12_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", 35, 101}, + #endif + #ifdef PKCS12_R_ENCODE_ERROR + {"ENCODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCODE_ERROR}, + #else + {"ENCODE_ERROR", 35, 102}, + #endif + #ifdef PKCS12_R_ENCRYPT_ERROR + {"ENCRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCRYPT_ERROR}, + #else + {"ENCRYPT_ERROR", 35, 103}, + #endif + #ifdef PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE + {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", ERR_LIB_PKCS12, PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE}, + #else + {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", 35, 120}, + #endif + #ifdef PKCS12_R_INVALID_NULL_ARGUMENT + {"INVALID_NULL_ARGUMENT", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_ARGUMENT}, + #else + {"INVALID_NULL_ARGUMENT", 35, 104}, + #endif + #ifdef PKCS12_R_INVALID_NULL_PKCS12_POINTER + {"INVALID_NULL_PKCS12_POINTER", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_PKCS12_POINTER}, + #else + {"INVALID_NULL_PKCS12_POINTER", 35, 105}, + #endif + #ifdef PKCS12_R_IV_GEN_ERROR + {"IV_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_IV_GEN_ERROR}, + #else + {"IV_GEN_ERROR", 35, 106}, + #endif + #ifdef PKCS12_R_KEY_GEN_ERROR + {"KEY_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_KEY_GEN_ERROR}, + #else + {"KEY_GEN_ERROR", 35, 107}, + #endif + #ifdef PKCS12_R_MAC_ABSENT + {"MAC_ABSENT", ERR_LIB_PKCS12, PKCS12_R_MAC_ABSENT}, + #else + {"MAC_ABSENT", 35, 108}, + #endif + #ifdef PKCS12_R_MAC_GENERATION_ERROR + {"MAC_GENERATION_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_GENERATION_ERROR}, + #else + {"MAC_GENERATION_ERROR", 35, 109}, + #endif + #ifdef PKCS12_R_MAC_SETUP_ERROR + {"MAC_SETUP_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_SETUP_ERROR}, + #else + {"MAC_SETUP_ERROR", 35, 110}, + #endif + #ifdef PKCS12_R_MAC_STRING_SET_ERROR + {"MAC_STRING_SET_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_STRING_SET_ERROR}, + #else + {"MAC_STRING_SET_ERROR", 35, 111}, + #endif + #ifdef PKCS12_R_MAC_VERIFY_FAILURE + {"MAC_VERIFY_FAILURE", ERR_LIB_PKCS12, PKCS12_R_MAC_VERIFY_FAILURE}, + #else + {"MAC_VERIFY_FAILURE", 35, 113}, + #endif + #ifdef PKCS12_R_PARSE_ERROR + {"PARSE_ERROR", ERR_LIB_PKCS12, PKCS12_R_PARSE_ERROR}, + #else + {"PARSE_ERROR", 35, 114}, + #endif + #ifdef PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR + {"PKCS12_ALGOR_CIPHERINIT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR}, + #else + {"PKCS12_ALGOR_CIPHERINIT_ERROR", 35, 115}, + #endif + #ifdef PKCS12_R_PKCS12_CIPHERFINAL_ERROR + {"PKCS12_CIPHERFINAL_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_CIPHERFINAL_ERROR}, + #else + {"PKCS12_CIPHERFINAL_ERROR", 35, 116}, + #endif + #ifdef PKCS12_R_PKCS12_PBE_CRYPT_ERROR + {"PKCS12_PBE_CRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_PBE_CRYPT_ERROR}, + #else + {"PKCS12_PBE_CRYPT_ERROR", 35, 117}, + #endif + #ifdef PKCS12_R_UNKNOWN_DIGEST_ALGORITHM + {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_PKCS12, PKCS12_R_UNKNOWN_DIGEST_ALGORITHM}, + #else + {"UNKNOWN_DIGEST_ALGORITHM", 35, 118}, + #endif + #ifdef PKCS12_R_UNSUPPORTED_PKCS12_MODE + {"UNSUPPORTED_PKCS12_MODE", ERR_LIB_PKCS12, PKCS12_R_UNSUPPORTED_PKCS12_MODE}, + #else + {"UNSUPPORTED_PKCS12_MODE", 35, 119}, + #endif + #ifdef PKCS7_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_PKCS7, PKCS7_R_CERTIFICATE_VERIFY_ERROR}, + #else + {"CERTIFICATE_VERIFY_ERROR", 33, 117}, + #endif + #ifdef PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_PKCS7, PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER}, + #else + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 33, 144}, + #endif + #ifdef PKCS7_R_CIPHER_NOT_INITIALIZED + {"CIPHER_NOT_INITIALIZED", ERR_LIB_PKCS7, PKCS7_R_CIPHER_NOT_INITIALIZED}, + #else + {"CIPHER_NOT_INITIALIZED", 33, 116}, + #endif + #ifdef PKCS7_R_CONTENT_AND_DATA_PRESENT + {"CONTENT_AND_DATA_PRESENT", ERR_LIB_PKCS7, PKCS7_R_CONTENT_AND_DATA_PRESENT}, + #else + {"CONTENT_AND_DATA_PRESENT", 33, 118}, + #endif + #ifdef PKCS7_R_CTRL_ERROR + {"CTRL_ERROR", ERR_LIB_PKCS7, PKCS7_R_CTRL_ERROR}, + #else + {"CTRL_ERROR", 33, 152}, + #endif + #ifdef PKCS7_R_DECRYPT_ERROR + {"DECRYPT_ERROR", ERR_LIB_PKCS7, PKCS7_R_DECRYPT_ERROR}, + #else + {"DECRYPT_ERROR", 33, 119}, + #endif + #ifdef PKCS7_R_DIGEST_FAILURE + {"DIGEST_FAILURE", ERR_LIB_PKCS7, PKCS7_R_DIGEST_FAILURE}, + #else + {"DIGEST_FAILURE", 33, 101}, + #endif + #ifdef PKCS7_R_ENCRYPTION_CTRL_FAILURE + {"ENCRYPTION_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_CTRL_FAILURE}, + #else + {"ENCRYPTION_CTRL_FAILURE", 33, 149}, + #endif + #ifdef PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE + {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, + #else + {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 150}, + #endif + #ifdef PKCS7_R_ERROR_ADDING_RECIPIENT + {"ERROR_ADDING_RECIPIENT", ERR_LIB_PKCS7, PKCS7_R_ERROR_ADDING_RECIPIENT}, + #else + {"ERROR_ADDING_RECIPIENT", 33, 120}, + #endif + #ifdef PKCS7_R_ERROR_SETTING_CIPHER + {"ERROR_SETTING_CIPHER", ERR_LIB_PKCS7, PKCS7_R_ERROR_SETTING_CIPHER}, + #else + {"ERROR_SETTING_CIPHER", 33, 121}, + #endif + #ifdef PKCS7_R_INVALID_NULL_POINTER + {"INVALID_NULL_POINTER", ERR_LIB_PKCS7, PKCS7_R_INVALID_NULL_POINTER}, + #else + {"INVALID_NULL_POINTER", 33, 143}, + #endif + #ifdef PKCS7_R_INVALID_SIGNED_DATA_TYPE + {"INVALID_SIGNED_DATA_TYPE", ERR_LIB_PKCS7, PKCS7_R_INVALID_SIGNED_DATA_TYPE}, + #else + {"INVALID_SIGNED_DATA_TYPE", 33, 155}, + #endif + #ifdef PKCS7_R_NO_CONTENT + {"NO_CONTENT", ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT}, + #else + {"NO_CONTENT", 33, 122}, + #endif + #ifdef PKCS7_R_NO_DEFAULT_DIGEST + {"NO_DEFAULT_DIGEST", ERR_LIB_PKCS7, PKCS7_R_NO_DEFAULT_DIGEST}, + #else + {"NO_DEFAULT_DIGEST", 33, 151}, + #endif + #ifdef PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND + {"NO_MATCHING_DIGEST_TYPE_FOUND", ERR_LIB_PKCS7, PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND}, + #else + {"NO_MATCHING_DIGEST_TYPE_FOUND", 33, 154}, + #endif + #ifdef PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE + {"NO_RECIPIENT_MATCHES_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE}, + #else + {"NO_RECIPIENT_MATCHES_CERTIFICATE", 33, 115}, + #endif + #ifdef PKCS7_R_NO_SIGNATURES_ON_DATA + {"NO_SIGNATURES_ON_DATA", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNATURES_ON_DATA}, + #else + {"NO_SIGNATURES_ON_DATA", 33, 123}, + #endif + #ifdef PKCS7_R_NO_SIGNERS + {"NO_SIGNERS", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNERS}, + #else + {"NO_SIGNERS", 33, 142}, + #endif + #ifdef PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE + {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", ERR_LIB_PKCS7, PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE}, + #else + {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", 33, 104}, + #endif + #ifdef PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR + {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR}, + #else + {"PKCS7_ADD_SIGNATURE_ERROR", 33, 124}, + #endif + #ifdef PKCS7_R_PKCS7_ADD_SIGNER_ERROR + {"PKCS7_ADD_SIGNER_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNER_ERROR}, + #else + {"PKCS7_ADD_SIGNER_ERROR", 33, 153}, + #endif + #ifdef PKCS7_R_PKCS7_DATASIGN + {"PKCS7_DATASIGN", ERR_LIB_PKCS7, PKCS7_R_PKCS7_DATASIGN}, + #else + {"PKCS7_DATASIGN", 33, 145}, + #endif + #ifdef PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, + #else + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 33, 127}, + #endif + #ifdef PKCS7_R_SIGNATURE_FAILURE + {"SIGNATURE_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNATURE_FAILURE}, + #else + {"SIGNATURE_FAILURE", 33, 105}, + #endif + #ifdef PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_PKCS7, PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND}, + #else + {"SIGNER_CERTIFICATE_NOT_FOUND", 33, 128}, + #endif + #ifdef PKCS7_R_SIGNING_CTRL_FAILURE + {"SIGNING_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_CTRL_FAILURE}, + #else + {"SIGNING_CTRL_FAILURE", 33, 147}, + #endif + #ifdef PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE + {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, + #else + {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 148}, + #endif + #ifdef PKCS7_R_SMIME_TEXT_ERROR + {"SMIME_TEXT_ERROR", ERR_LIB_PKCS7, PKCS7_R_SMIME_TEXT_ERROR}, + #else + {"SMIME_TEXT_ERROR", 33, 129}, + #endif + #ifdef PKCS7_R_UNABLE_TO_FIND_CERTIFICATE + {"UNABLE_TO_FIND_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_CERTIFICATE}, + #else + {"UNABLE_TO_FIND_CERTIFICATE", 33, 106}, + #endif + #ifdef PKCS7_R_UNABLE_TO_FIND_MEM_BIO + {"UNABLE_TO_FIND_MEM_BIO", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MEM_BIO}, + #else + {"UNABLE_TO_FIND_MEM_BIO", 33, 107}, + #endif + #ifdef PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST + {"UNABLE_TO_FIND_MESSAGE_DIGEST", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST}, + #else + {"UNABLE_TO_FIND_MESSAGE_DIGEST", 33, 108}, + #endif + #ifdef PKCS7_R_UNKNOWN_DIGEST_TYPE + {"UNKNOWN_DIGEST_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_DIGEST_TYPE}, + #else + {"UNKNOWN_DIGEST_TYPE", 33, 109}, + #endif + #ifdef PKCS7_R_UNKNOWN_OPERATION + {"UNKNOWN_OPERATION", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_OPERATION}, + #else + {"UNKNOWN_OPERATION", 33, 110}, + #endif + #ifdef PKCS7_R_UNSUPPORTED_CIPHER_TYPE + {"UNSUPPORTED_CIPHER_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CIPHER_TYPE}, + #else + {"UNSUPPORTED_CIPHER_TYPE", 33, 111}, + #endif + #ifdef PKCS7_R_UNSUPPORTED_CONTENT_TYPE + {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CONTENT_TYPE}, + #else + {"UNSUPPORTED_CONTENT_TYPE", 33, 112}, + #endif + #ifdef PKCS7_R_WRONG_CONTENT_TYPE + {"WRONG_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_CONTENT_TYPE}, + #else + {"WRONG_CONTENT_TYPE", 33, 113}, + #endif + #ifdef PKCS7_R_WRONG_PKCS7_TYPE + {"WRONG_PKCS7_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_PKCS7_TYPE}, + #else + {"WRONG_PKCS7_TYPE", 33, 114}, + #endif + #ifdef RAND_R_ADDITIONAL_INPUT_TOO_LONG + {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ADDITIONAL_INPUT_TOO_LONG}, + #else + {"ADDITIONAL_INPUT_TOO_LONG", 36, 102}, + #endif + #ifdef RAND_R_ALREADY_INSTANTIATED + {"ALREADY_INSTANTIATED", ERR_LIB_RAND, RAND_R_ALREADY_INSTANTIATED}, + #else + {"ALREADY_INSTANTIATED", 36, 103}, + #endif + #ifdef RAND_R_ARGUMENT_OUT_OF_RANGE + {"ARGUMENT_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE}, + #else + {"ARGUMENT_OUT_OF_RANGE", 36, 105}, + #endif + #ifdef RAND_R_CANNOT_OPEN_FILE + {"CANNOT_OPEN_FILE", ERR_LIB_RAND, RAND_R_CANNOT_OPEN_FILE}, + #else + {"CANNOT_OPEN_FILE", 36, 121}, + #endif + #ifdef RAND_R_DRBG_ALREADY_INITIALIZED + {"DRBG_ALREADY_INITIALIZED", ERR_LIB_RAND, RAND_R_DRBG_ALREADY_INITIALIZED}, + #else + {"DRBG_ALREADY_INITIALIZED", 36, 129}, + #endif + #ifdef RAND_R_DRBG_NOT_INITIALISED + {"DRBG_NOT_INITIALISED", ERR_LIB_RAND, RAND_R_DRBG_NOT_INITIALISED}, + #else + {"DRBG_NOT_INITIALISED", 36, 104}, + #endif + #ifdef RAND_R_ENTROPY_INPUT_TOO_LONG + {"ENTROPY_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ENTROPY_INPUT_TOO_LONG}, + #else + {"ENTROPY_INPUT_TOO_LONG", 36, 106}, + #endif + #ifdef RAND_R_ENTROPY_OUT_OF_RANGE + {"ENTROPY_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ENTROPY_OUT_OF_RANGE}, + #else + {"ENTROPY_OUT_OF_RANGE", 36, 124}, + #endif + #ifdef RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED + {"ERROR_ENTROPY_POOL_WAS_IGNORED", ERR_LIB_RAND, RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED}, + #else + {"ERROR_ENTROPY_POOL_WAS_IGNORED", 36, 127}, + #endif + #ifdef RAND_R_ERROR_INITIALISING_DRBG + {"ERROR_INITIALISING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INITIALISING_DRBG}, + #else + {"ERROR_INITIALISING_DRBG", 36, 107}, + #endif + #ifdef RAND_R_ERROR_INSTANTIATING_DRBG + {"ERROR_INSTANTIATING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG}, + #else + {"ERROR_INSTANTIATING_DRBG", 36, 108}, + #endif + #ifdef RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT + {"ERROR_RETRIEVING_ADDITIONAL_INPUT", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT}, + #else + {"ERROR_RETRIEVING_ADDITIONAL_INPUT", 36, 109}, + #endif + #ifdef RAND_R_ERROR_RETRIEVING_ENTROPY + {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ENTROPY}, + #else + {"ERROR_RETRIEVING_ENTROPY", 36, 110}, + #endif + #ifdef RAND_R_ERROR_RETRIEVING_NONCE + {"ERROR_RETRIEVING_NONCE", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_NONCE}, + #else + {"ERROR_RETRIEVING_NONCE", 36, 111}, + #endif + #ifdef RAND_R_FAILED_TO_CREATE_LOCK + {"FAILED_TO_CREATE_LOCK", ERR_LIB_RAND, RAND_R_FAILED_TO_CREATE_LOCK}, + #else + {"FAILED_TO_CREATE_LOCK", 36, 126}, + #endif + #ifdef RAND_R_FUNC_NOT_IMPLEMENTED + {"FUNC_NOT_IMPLEMENTED", ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED}, + #else + {"FUNC_NOT_IMPLEMENTED", 36, 101}, + #endif + #ifdef RAND_R_FWRITE_ERROR + {"FWRITE_ERROR", ERR_LIB_RAND, RAND_R_FWRITE_ERROR}, + #else + {"FWRITE_ERROR", 36, 123}, + #endif + #ifdef RAND_R_GENERATE_ERROR + {"GENERATE_ERROR", ERR_LIB_RAND, RAND_R_GENERATE_ERROR}, + #else + {"GENERATE_ERROR", 36, 112}, + #endif + #ifdef RAND_R_INTERNAL_ERROR + {"INTERNAL_ERROR", ERR_LIB_RAND, RAND_R_INTERNAL_ERROR}, + #else + {"INTERNAL_ERROR", 36, 113}, + #endif + #ifdef RAND_R_IN_ERROR_STATE + {"IN_ERROR_STATE", ERR_LIB_RAND, RAND_R_IN_ERROR_STATE}, + #else + {"IN_ERROR_STATE", 36, 114}, + #endif + #ifdef RAND_R_NOT_A_REGULAR_FILE + {"NOT_A_REGULAR_FILE", ERR_LIB_RAND, RAND_R_NOT_A_REGULAR_FILE}, + #else + {"NOT_A_REGULAR_FILE", 36, 122}, + #endif + #ifdef RAND_R_NOT_INSTANTIATED + {"NOT_INSTANTIATED", ERR_LIB_RAND, RAND_R_NOT_INSTANTIATED}, + #else + {"NOT_INSTANTIATED", 36, 115}, + #endif + #ifdef RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED + {"NO_DRBG_IMPLEMENTATION_SELECTED", ERR_LIB_RAND, RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED}, + #else + {"NO_DRBG_IMPLEMENTATION_SELECTED", 36, 128}, + #endif + #ifdef RAND_R_PARENT_LOCKING_NOT_ENABLED + {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_RAND, RAND_R_PARENT_LOCKING_NOT_ENABLED}, + #else + {"PARENT_LOCKING_NOT_ENABLED", 36, 130}, + #endif + #ifdef RAND_R_PARENT_STRENGTH_TOO_WEAK + {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_RAND, RAND_R_PARENT_STRENGTH_TOO_WEAK}, + #else + {"PARENT_STRENGTH_TOO_WEAK", 36, 131}, + #endif + #ifdef RAND_R_PERSONALISATION_STRING_TOO_LONG + {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_RAND, RAND_R_PERSONALISATION_STRING_TOO_LONG}, + #else + {"PERSONALISATION_STRING_TOO_LONG", 36, 116}, + #endif + #ifdef RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED + {"PREDICTION_RESISTANCE_NOT_SUPPORTED", ERR_LIB_RAND, RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED}, + #else + {"PREDICTION_RESISTANCE_NOT_SUPPORTED", 36, 133}, + #endif + #ifdef RAND_R_PRNG_NOT_SEEDED + {"PRNG_NOT_SEEDED", ERR_LIB_RAND, RAND_R_PRNG_NOT_SEEDED}, + #else + {"PRNG_NOT_SEEDED", 36, 100}, + #endif + #ifdef RAND_R_RANDOM_POOL_OVERFLOW + {"RANDOM_POOL_OVERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW}, + #else + {"RANDOM_POOL_OVERFLOW", 36, 125}, + #endif + #ifdef RAND_R_RANDOM_POOL_UNDERFLOW + {"RANDOM_POOL_UNDERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_UNDERFLOW}, + #else + {"RANDOM_POOL_UNDERFLOW", 36, 134}, + #endif + #ifdef RAND_R_REQUEST_TOO_LARGE_FOR_DRBG + {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_RAND, RAND_R_REQUEST_TOO_LARGE_FOR_DRBG}, + #else + {"REQUEST_TOO_LARGE_FOR_DRBG", 36, 117}, + #endif + #ifdef RAND_R_RESEED_ERROR + {"RESEED_ERROR", ERR_LIB_RAND, RAND_R_RESEED_ERROR}, + #else + {"RESEED_ERROR", 36, 118}, + #endif + #ifdef RAND_R_SELFTEST_FAILURE + {"SELFTEST_FAILURE", ERR_LIB_RAND, RAND_R_SELFTEST_FAILURE}, + #else + {"SELFTEST_FAILURE", 36, 119}, + #endif + #ifdef RAND_R_TOO_LITTLE_NONCE_REQUESTED + {"TOO_LITTLE_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_LITTLE_NONCE_REQUESTED}, + #else + {"TOO_LITTLE_NONCE_REQUESTED", 36, 135}, + #endif + #ifdef RAND_R_TOO_MUCH_NONCE_REQUESTED + {"TOO_MUCH_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_MUCH_NONCE_REQUESTED}, + #else + {"TOO_MUCH_NONCE_REQUESTED", 36, 136}, + #endif + #ifdef RAND_R_UNSUPPORTED_DRBG_FLAGS + {"UNSUPPORTED_DRBG_FLAGS", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_FLAGS}, + #else + {"UNSUPPORTED_DRBG_FLAGS", 36, 132}, + #endif + #ifdef RAND_R_UNSUPPORTED_DRBG_TYPE + {"UNSUPPORTED_DRBG_TYPE", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_TYPE}, + #else + {"UNSUPPORTED_DRBG_TYPE", 36, 120}, + #endif + #ifdef RSA_R_ALGORITHM_MISMATCH + {"ALGORITHM_MISMATCH", ERR_LIB_RSA, RSA_R_ALGORITHM_MISMATCH}, + #else + {"ALGORITHM_MISMATCH", 4, 100}, + #endif + #ifdef RSA_R_BAD_E_VALUE + {"BAD_E_VALUE", ERR_LIB_RSA, RSA_R_BAD_E_VALUE}, + #else + {"BAD_E_VALUE", 4, 101}, + #endif + #ifdef RSA_R_BAD_FIXED_HEADER_DECRYPT + {"BAD_FIXED_HEADER_DECRYPT", ERR_LIB_RSA, RSA_R_BAD_FIXED_HEADER_DECRYPT}, + #else + {"BAD_FIXED_HEADER_DECRYPT", 4, 102}, + #endif + #ifdef RSA_R_BAD_PAD_BYTE_COUNT + {"BAD_PAD_BYTE_COUNT", ERR_LIB_RSA, RSA_R_BAD_PAD_BYTE_COUNT}, + #else + {"BAD_PAD_BYTE_COUNT", 4, 103}, + #endif + #ifdef RSA_R_BAD_SIGNATURE + {"BAD_SIGNATURE", ERR_LIB_RSA, RSA_R_BAD_SIGNATURE}, + #else + {"BAD_SIGNATURE", 4, 104}, + #endif + #ifdef RSA_R_BLOCK_TYPE_IS_NOT_01 + {"BLOCK_TYPE_IS_NOT_01", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_01}, + #else + {"BLOCK_TYPE_IS_NOT_01", 4, 106}, + #endif + #ifdef RSA_R_BLOCK_TYPE_IS_NOT_02 + {"BLOCK_TYPE_IS_NOT_02", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_02}, + #else + {"BLOCK_TYPE_IS_NOT_02", 4, 107}, + #endif + #ifdef RSA_R_DATA_GREATER_THAN_MOD_LEN + {"DATA_GREATER_THAN_MOD_LEN", ERR_LIB_RSA, RSA_R_DATA_GREATER_THAN_MOD_LEN}, + #else + {"DATA_GREATER_THAN_MOD_LEN", 4, 108}, + #endif + #ifdef RSA_R_DATA_TOO_LARGE + {"DATA_TOO_LARGE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE}, + #else + {"DATA_TOO_LARGE", 4, 109}, + #endif + #ifdef RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE + {"DATA_TOO_LARGE_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE}, + #else + {"DATA_TOO_LARGE_FOR_KEY_SIZE", 4, 110}, + #endif + #ifdef RSA_R_DATA_TOO_LARGE_FOR_MODULUS + {"DATA_TOO_LARGE_FOR_MODULUS", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS}, + #else + {"DATA_TOO_LARGE_FOR_MODULUS", 4, 132}, + #endif + #ifdef RSA_R_DATA_TOO_SMALL + {"DATA_TOO_SMALL", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL}, + #else + {"DATA_TOO_SMALL", 4, 111}, + #endif + #ifdef RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE + {"DATA_TOO_SMALL_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE}, + #else + {"DATA_TOO_SMALL_FOR_KEY_SIZE", 4, 122}, + #endif + #ifdef RSA_R_DIGEST_DOES_NOT_MATCH + {"DIGEST_DOES_NOT_MATCH", ERR_LIB_RSA, RSA_R_DIGEST_DOES_NOT_MATCH}, + #else + {"DIGEST_DOES_NOT_MATCH", 4, 158}, + #endif + #ifdef RSA_R_DIGEST_NOT_ALLOWED + {"DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_DIGEST_NOT_ALLOWED}, + #else + {"DIGEST_NOT_ALLOWED", 4, 145}, + #endif + #ifdef RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY + {"DIGEST_TOO_BIG_FOR_RSA_KEY", ERR_LIB_RSA, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY}, + #else + {"DIGEST_TOO_BIG_FOR_RSA_KEY", 4, 112}, + #endif + #ifdef RSA_R_DMP1_NOT_CONGRUENT_TO_D + {"DMP1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMP1_NOT_CONGRUENT_TO_D}, + #else + {"DMP1_NOT_CONGRUENT_TO_D", 4, 124}, + #endif + #ifdef RSA_R_DMQ1_NOT_CONGRUENT_TO_D + {"DMQ1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMQ1_NOT_CONGRUENT_TO_D}, + #else + {"DMQ1_NOT_CONGRUENT_TO_D", 4, 125}, + #endif + #ifdef RSA_R_D_E_NOT_CONGRUENT_TO_1 + {"D_E_NOT_CONGRUENT_TO_1", ERR_LIB_RSA, RSA_R_D_E_NOT_CONGRUENT_TO_1}, + #else + {"D_E_NOT_CONGRUENT_TO_1", 4, 123}, + #endif + #ifdef RSA_R_FIRST_OCTET_INVALID + {"FIRST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_FIRST_OCTET_INVALID}, + #else + {"FIRST_OCTET_INVALID", 4, 133}, + #endif + #ifdef RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE + {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_RSA, RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE}, + #else + {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", 4, 144}, + #endif + #ifdef RSA_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", 4, 157}, + #endif + #ifdef RSA_R_INVALID_DIGEST_LENGTH + {"INVALID_DIGEST_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH}, + #else + {"INVALID_DIGEST_LENGTH", 4, 143}, + #endif + #ifdef RSA_R_INVALID_HEADER + {"INVALID_HEADER", ERR_LIB_RSA, RSA_R_INVALID_HEADER}, + #else + {"INVALID_HEADER", 4, 137}, + #endif + #ifdef RSA_R_INVALID_LABEL + {"INVALID_LABEL", ERR_LIB_RSA, RSA_R_INVALID_LABEL}, + #else + {"INVALID_LABEL", 4, 160}, + #endif + #ifdef RSA_R_INVALID_MESSAGE_LENGTH + {"INVALID_MESSAGE_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_MESSAGE_LENGTH}, + #else + {"INVALID_MESSAGE_LENGTH", 4, 131}, + #endif + #ifdef RSA_R_INVALID_MGF1_MD + {"INVALID_MGF1_MD", ERR_LIB_RSA, RSA_R_INVALID_MGF1_MD}, + #else + {"INVALID_MGF1_MD", 4, 156}, + #endif + #ifdef RSA_R_INVALID_MULTI_PRIME_KEY + {"INVALID_MULTI_PRIME_KEY", ERR_LIB_RSA, RSA_R_INVALID_MULTI_PRIME_KEY}, + #else + {"INVALID_MULTI_PRIME_KEY", 4, 167}, + #endif + #ifdef RSA_R_INVALID_OAEP_PARAMETERS + {"INVALID_OAEP_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_OAEP_PARAMETERS}, + #else + {"INVALID_OAEP_PARAMETERS", 4, 161}, + #endif + #ifdef RSA_R_INVALID_PADDING + {"INVALID_PADDING", ERR_LIB_RSA, RSA_R_INVALID_PADDING}, + #else + {"INVALID_PADDING", 4, 138}, + #endif + #ifdef RSA_R_INVALID_PADDING_MODE + {"INVALID_PADDING_MODE", ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE}, + #else + {"INVALID_PADDING_MODE", 4, 141}, + #endif + #ifdef RSA_R_INVALID_PSS_PARAMETERS + {"INVALID_PSS_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS}, + #else + {"INVALID_PSS_PARAMETERS", 4, 149}, + #endif + #ifdef RSA_R_INVALID_PSS_SALTLEN + {"INVALID_PSS_SALTLEN", ERR_LIB_RSA, RSA_R_INVALID_PSS_SALTLEN}, + #else + {"INVALID_PSS_SALTLEN", 4, 146}, + #endif + #ifdef RSA_R_INVALID_SALT_LENGTH + {"INVALID_SALT_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_SALT_LENGTH}, + #else + {"INVALID_SALT_LENGTH", 4, 150}, + #endif + #ifdef RSA_R_INVALID_TRAILER + {"INVALID_TRAILER", ERR_LIB_RSA, RSA_R_INVALID_TRAILER}, + #else + {"INVALID_TRAILER", 4, 139}, + #endif + #ifdef RSA_R_INVALID_X931_DIGEST + {"INVALID_X931_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_X931_DIGEST}, + #else + {"INVALID_X931_DIGEST", 4, 142}, + #endif + #ifdef RSA_R_IQMP_NOT_INVERSE_OF_Q + {"IQMP_NOT_INVERSE_OF_Q", ERR_LIB_RSA, RSA_R_IQMP_NOT_INVERSE_OF_Q}, + #else + {"IQMP_NOT_INVERSE_OF_Q", 4, 126}, + #endif + #ifdef RSA_R_KEY_PRIME_NUM_INVALID + {"KEY_PRIME_NUM_INVALID", ERR_LIB_RSA, RSA_R_KEY_PRIME_NUM_INVALID}, + #else + {"KEY_PRIME_NUM_INVALID", 4, 165}, + #endif + #ifdef RSA_R_KEY_SIZE_TOO_SMALL + {"KEY_SIZE_TOO_SMALL", ERR_LIB_RSA, RSA_R_KEY_SIZE_TOO_SMALL}, + #else + {"KEY_SIZE_TOO_SMALL", 4, 120}, + #endif + #ifdef RSA_R_LAST_OCTET_INVALID + {"LAST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_LAST_OCTET_INVALID}, + #else + {"LAST_OCTET_INVALID", 4, 134}, + #endif + #ifdef RSA_R_MGF1_DIGEST_NOT_ALLOWED + {"MGF1_DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_MGF1_DIGEST_NOT_ALLOWED}, + #else + {"MGF1_DIGEST_NOT_ALLOWED", 4, 152}, + #endif + #ifdef RSA_R_MISSING_PRIVATE_KEY + {"MISSING_PRIVATE_KEY", ERR_LIB_RSA, RSA_R_MISSING_PRIVATE_KEY}, + #else + {"MISSING_PRIVATE_KEY", 4, 179}, + #endif + #ifdef RSA_R_MODULUS_TOO_LARGE + {"MODULUS_TOO_LARGE", ERR_LIB_RSA, RSA_R_MODULUS_TOO_LARGE}, + #else + {"MODULUS_TOO_LARGE", 4, 105}, + #endif + #ifdef RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R + {"MP_COEFFICIENT_NOT_INVERSE_OF_R", ERR_LIB_RSA, RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R}, + #else + {"MP_COEFFICIENT_NOT_INVERSE_OF_R", 4, 168}, + #endif + #ifdef RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D + {"MP_EXPONENT_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D}, + #else + {"MP_EXPONENT_NOT_CONGRUENT_TO_D", 4, 169}, + #endif + #ifdef RSA_R_MP_R_NOT_PRIME + {"MP_R_NOT_PRIME", ERR_LIB_RSA, RSA_R_MP_R_NOT_PRIME}, + #else + {"MP_R_NOT_PRIME", 4, 170}, + #endif + #ifdef RSA_R_NO_PUBLIC_EXPONENT + {"NO_PUBLIC_EXPONENT", ERR_LIB_RSA, RSA_R_NO_PUBLIC_EXPONENT}, + #else + {"NO_PUBLIC_EXPONENT", 4, 140}, + #endif + #ifdef RSA_R_NULL_BEFORE_BLOCK_MISSING + {"NULL_BEFORE_BLOCK_MISSING", ERR_LIB_RSA, RSA_R_NULL_BEFORE_BLOCK_MISSING}, + #else + {"NULL_BEFORE_BLOCK_MISSING", 4, 113}, + #endif + #ifdef RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES + {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES}, + #else + {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", 4, 172}, + #endif + #ifdef RSA_R_N_DOES_NOT_EQUAL_P_Q + {"N_DOES_NOT_EQUAL_P_Q", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_P_Q}, + #else + {"N_DOES_NOT_EQUAL_P_Q", 4, 127}, + #endif + #ifdef RSA_R_OAEP_DECODING_ERROR + {"OAEP_DECODING_ERROR", ERR_LIB_RSA, RSA_R_OAEP_DECODING_ERROR}, + #else + {"OAEP_DECODING_ERROR", 4, 121}, + #endif + #ifdef RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_RSA, RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE}, + #else + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 4, 148}, + #endif + #ifdef RSA_R_PADDING_CHECK_FAILED + {"PADDING_CHECK_FAILED", ERR_LIB_RSA, RSA_R_PADDING_CHECK_FAILED}, + #else + {"PADDING_CHECK_FAILED", 4, 114}, + #endif + #ifdef RSA_R_PKCS_DECODING_ERROR + {"PKCS_DECODING_ERROR", ERR_LIB_RSA, RSA_R_PKCS_DECODING_ERROR}, + #else + {"PKCS_DECODING_ERROR", 4, 159}, + #endif + #ifdef RSA_R_PSS_SALTLEN_TOO_SMALL + {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_RSA, RSA_R_PSS_SALTLEN_TOO_SMALL}, + #else + {"PSS_SALTLEN_TOO_SMALL", 4, 164}, + #endif + #ifdef RSA_R_P_NOT_PRIME + {"P_NOT_PRIME", ERR_LIB_RSA, RSA_R_P_NOT_PRIME}, + #else + {"P_NOT_PRIME", 4, 128}, + #endif + #ifdef RSA_R_Q_NOT_PRIME + {"Q_NOT_PRIME", ERR_LIB_RSA, RSA_R_Q_NOT_PRIME}, + #else + {"Q_NOT_PRIME", 4, 129}, + #endif + #ifdef RSA_R_RSA_OPERATIONS_NOT_SUPPORTED + {"RSA_OPERATIONS_NOT_SUPPORTED", ERR_LIB_RSA, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED}, + #else + {"RSA_OPERATIONS_NOT_SUPPORTED", 4, 130}, + #endif + #ifdef RSA_R_SLEN_CHECK_FAILED + {"SLEN_CHECK_FAILED", ERR_LIB_RSA, RSA_R_SLEN_CHECK_FAILED}, + #else + {"SLEN_CHECK_FAILED", 4, 136}, + #endif + #ifdef RSA_R_SLEN_RECOVERY_FAILED + {"SLEN_RECOVERY_FAILED", ERR_LIB_RSA, RSA_R_SLEN_RECOVERY_FAILED}, + #else + {"SLEN_RECOVERY_FAILED", 4, 135}, + #endif + #ifdef RSA_R_SSLV3_ROLLBACK_ATTACK + {"SSLV3_ROLLBACK_ATTACK", ERR_LIB_RSA, RSA_R_SSLV3_ROLLBACK_ATTACK}, + #else + {"SSLV3_ROLLBACK_ATTACK", 4, 115}, + #endif + #ifdef RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_RSA, RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD}, + #else + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 4, 116}, + #endif + #ifdef RSA_R_UNKNOWN_ALGORITHM_TYPE + {"UNKNOWN_ALGORITHM_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_ALGORITHM_TYPE}, + #else + {"UNKNOWN_ALGORITHM_TYPE", 4, 117}, + #endif + #ifdef RSA_R_UNKNOWN_DIGEST + {"UNKNOWN_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_DIGEST}, + #else + {"UNKNOWN_DIGEST", 4, 166}, + #endif + #ifdef RSA_R_UNKNOWN_MASK_DIGEST + {"UNKNOWN_MASK_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_MASK_DIGEST}, + #else + {"UNKNOWN_MASK_DIGEST", 4, 151}, + #endif + #ifdef RSA_R_UNKNOWN_PADDING_TYPE + {"UNKNOWN_PADDING_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE}, + #else + {"UNKNOWN_PADDING_TYPE", 4, 118}, + #endif + #ifdef RSA_R_UNSUPPORTED_ENCRYPTION_TYPE + {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_ENCRYPTION_TYPE}, + #else + {"UNSUPPORTED_ENCRYPTION_TYPE", 4, 162}, + #endif + #ifdef RSA_R_UNSUPPORTED_LABEL_SOURCE + {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_LABEL_SOURCE}, + #else + {"UNSUPPORTED_LABEL_SOURCE", 4, 163}, + #endif + #ifdef RSA_R_UNSUPPORTED_MASK_ALGORITHM + {"UNSUPPORTED_MASK_ALGORITHM", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_ALGORITHM}, + #else + {"UNSUPPORTED_MASK_ALGORITHM", 4, 153}, + #endif + #ifdef RSA_R_UNSUPPORTED_MASK_PARAMETER + {"UNSUPPORTED_MASK_PARAMETER", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_PARAMETER}, + #else + {"UNSUPPORTED_MASK_PARAMETER", 4, 154}, + #endif + #ifdef RSA_R_UNSUPPORTED_SIGNATURE_TYPE + {"UNSUPPORTED_SIGNATURE_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_SIGNATURE_TYPE}, + #else + {"UNSUPPORTED_SIGNATURE_TYPE", 4, 155}, + #endif + #ifdef RSA_R_VALUE_MISSING + {"VALUE_MISSING", ERR_LIB_RSA, RSA_R_VALUE_MISSING}, + #else + {"VALUE_MISSING", 4, 147}, + #endif + #ifdef RSA_R_WRONG_SIGNATURE_LENGTH + {"WRONG_SIGNATURE_LENGTH", ERR_LIB_RSA, RSA_R_WRONG_SIGNATURE_LENGTH}, + #else + {"WRONG_SIGNATURE_LENGTH", 4, 119}, + #endif + #ifdef SM2_R_ASN1_ERROR + {"ASN1_ERROR", ERR_LIB_SM2, SM2_R_ASN1_ERROR}, + #else + {"ASN1_ERROR", 53, 100}, + #endif + #ifdef SM2_R_BAD_SIGNATURE + {"BAD_SIGNATURE", ERR_LIB_SM2, SM2_R_BAD_SIGNATURE}, + #else + {"BAD_SIGNATURE", 53, 101}, + #endif + #ifdef SM2_R_BUFFER_TOO_SMALL + {"BUFFER_TOO_SMALL", ERR_LIB_SM2, SM2_R_BUFFER_TOO_SMALL}, + #else + {"BUFFER_TOO_SMALL", 53, 107}, + #endif + #ifdef SM2_R_DIST_ID_TOO_LARGE + {"DIST_ID_TOO_LARGE", ERR_LIB_SM2, SM2_R_DIST_ID_TOO_LARGE}, + #else + {"DIST_ID_TOO_LARGE", 53, 110}, + #endif + #ifdef SM2_R_ID_NOT_SET + {"ID_NOT_SET", ERR_LIB_SM2, SM2_R_ID_NOT_SET}, + #else + {"ID_NOT_SET", 53, 112}, + #endif + #ifdef SM2_R_ID_TOO_LARGE + {"ID_TOO_LARGE", ERR_LIB_SM2, SM2_R_ID_TOO_LARGE}, + #else + {"ID_TOO_LARGE", 53, 111}, + #endif + #ifdef SM2_R_INVALID_CURVE + {"INVALID_CURVE", ERR_LIB_SM2, SM2_R_INVALID_CURVE}, + #else + {"INVALID_CURVE", 53, 108}, + #endif + #ifdef SM2_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_SM2, SM2_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", 53, 102}, + #endif + #ifdef SM2_R_INVALID_DIGEST_TYPE + {"INVALID_DIGEST_TYPE", ERR_LIB_SM2, SM2_R_INVALID_DIGEST_TYPE}, + #else + {"INVALID_DIGEST_TYPE", 53, 103}, + #endif + #ifdef SM2_R_INVALID_ENCODING + {"INVALID_ENCODING", ERR_LIB_SM2, SM2_R_INVALID_ENCODING}, + #else + {"INVALID_ENCODING", 53, 104}, + #endif + #ifdef SM2_R_INVALID_FIELD + {"INVALID_FIELD", ERR_LIB_SM2, SM2_R_INVALID_FIELD}, + #else + {"INVALID_FIELD", 53, 105}, + #endif + #ifdef SM2_R_NO_PARAMETERS_SET + {"NO_PARAMETERS_SET", ERR_LIB_SM2, SM2_R_NO_PARAMETERS_SET}, + #else + {"NO_PARAMETERS_SET", 53, 109}, + #endif + #ifdef SM2_R_USER_ID_TOO_LARGE + {"USER_ID_TOO_LARGE", ERR_LIB_SM2, SM2_R_USER_ID_TOO_LARGE}, + #else + {"USER_ID_TOO_LARGE", 53, 106}, + #endif + #ifdef SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY + {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", ERR_LIB_SSL, SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY}, + #else + {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", 20, 291}, + #endif + #ifdef SSL_R_APP_DATA_IN_HANDSHAKE + {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, SSL_R_APP_DATA_IN_HANDSHAKE}, + #else + {"APP_DATA_IN_HANDSHAKE", 20, 100}, + #endif + #ifdef SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT + {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT}, + #else + {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", 20, 272}, + #endif + #ifdef SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE + {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE}, + #else + {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", 20, 143}, + #endif + #ifdef SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE + {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE}, + #else + {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", 20, 158}, + #endif + #ifdef SSL_R_BAD_CHANGE_CIPHER_SPEC + {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC}, + #else + {"BAD_CHANGE_CIPHER_SPEC", 20, 103}, + #endif + #ifdef SSL_R_BAD_CIPHER + {"BAD_CIPHER", ERR_LIB_SSL, SSL_R_BAD_CIPHER}, + #else + {"BAD_CIPHER", 20, 186}, + #endif + #ifdef SSL_R_BAD_DATA + {"BAD_DATA", ERR_LIB_SSL, SSL_R_BAD_DATA}, + #else + {"BAD_DATA", 20, 390}, + #endif + #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK + {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, SSL_R_BAD_DATA_RETURNED_BY_CALLBACK}, + #else + {"BAD_DATA_RETURNED_BY_CALLBACK", 20, 106}, + #endif + #ifdef SSL_R_BAD_DECOMPRESSION + {"BAD_DECOMPRESSION", ERR_LIB_SSL, SSL_R_BAD_DECOMPRESSION}, + #else + {"BAD_DECOMPRESSION", 20, 107}, + #endif + #ifdef SSL_R_BAD_DH_VALUE + {"BAD_DH_VALUE", ERR_LIB_SSL, SSL_R_BAD_DH_VALUE}, + #else + {"BAD_DH_VALUE", 20, 102}, + #endif + #ifdef SSL_R_BAD_DIGEST_LENGTH + {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DIGEST_LENGTH}, + #else + {"BAD_DIGEST_LENGTH", 20, 111}, + #endif + #ifdef SSL_R_BAD_EARLY_DATA + {"BAD_EARLY_DATA", ERR_LIB_SSL, SSL_R_BAD_EARLY_DATA}, + #else + {"BAD_EARLY_DATA", 20, 233}, + #endif + #ifdef SSL_R_BAD_ECC_CERT + {"BAD_ECC_CERT", ERR_LIB_SSL, SSL_R_BAD_ECC_CERT}, + #else + {"BAD_ECC_CERT", 20, 304}, + #endif + #ifdef SSL_R_BAD_ECPOINT + {"BAD_ECPOINT", ERR_LIB_SSL, SSL_R_BAD_ECPOINT}, + #else + {"BAD_ECPOINT", 20, 306}, + #endif + #ifdef SSL_R_BAD_EXTENSION + {"BAD_EXTENSION", ERR_LIB_SSL, SSL_R_BAD_EXTENSION}, + #else + {"BAD_EXTENSION", 20, 110}, + #endif + #ifdef SSL_R_BAD_HANDSHAKE_LENGTH + {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_LENGTH}, + #else + {"BAD_HANDSHAKE_LENGTH", 20, 332}, + #endif + #ifdef SSL_R_BAD_HANDSHAKE_STATE + {"BAD_HANDSHAKE_STATE", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_STATE}, + #else + {"BAD_HANDSHAKE_STATE", 20, 236}, + #endif + #ifdef SSL_R_BAD_HELLO_REQUEST + {"BAD_HELLO_REQUEST", ERR_LIB_SSL, SSL_R_BAD_HELLO_REQUEST}, + #else + {"BAD_HELLO_REQUEST", 20, 105}, + #endif + #ifdef SSL_R_BAD_HRR_VERSION + {"BAD_HRR_VERSION", ERR_LIB_SSL, SSL_R_BAD_HRR_VERSION}, + #else + {"BAD_HRR_VERSION", 20, 263}, + #endif + #ifdef SSL_R_BAD_KEY_SHARE + {"BAD_KEY_SHARE", ERR_LIB_SSL, SSL_R_BAD_KEY_SHARE}, + #else + {"BAD_KEY_SHARE", 20, 108}, + #endif + #ifdef SSL_R_BAD_KEY_UPDATE + {"BAD_KEY_UPDATE", ERR_LIB_SSL, SSL_R_BAD_KEY_UPDATE}, + #else + {"BAD_KEY_UPDATE", 20, 122}, + #endif + #ifdef SSL_R_BAD_LEGACY_VERSION + {"BAD_LEGACY_VERSION", ERR_LIB_SSL, SSL_R_BAD_LEGACY_VERSION}, + #else + {"BAD_LEGACY_VERSION", 20, 292}, + #endif + #ifdef SSL_R_BAD_LENGTH + {"BAD_LENGTH", ERR_LIB_SSL, SSL_R_BAD_LENGTH}, + #else + {"BAD_LENGTH", 20, 271}, + #endif + #ifdef SSL_R_BAD_PACKET + {"BAD_PACKET", ERR_LIB_SSL, SSL_R_BAD_PACKET}, + #else + {"BAD_PACKET", 20, 240}, + #endif + #ifdef SSL_R_BAD_PACKET_LENGTH + {"BAD_PACKET_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PACKET_LENGTH}, + #else + {"BAD_PACKET_LENGTH", 20, 115}, + #endif + #ifdef SSL_R_BAD_PROTOCOL_VERSION_NUMBER + {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_BAD_PROTOCOL_VERSION_NUMBER}, + #else + {"BAD_PROTOCOL_VERSION_NUMBER", 20, 116}, + #endif + #ifdef SSL_R_BAD_PSK + {"BAD_PSK", ERR_LIB_SSL, SSL_R_BAD_PSK}, + #else + {"BAD_PSK", 20, 219}, + #endif + #ifdef SSL_R_BAD_PSK_IDENTITY + {"BAD_PSK_IDENTITY", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY}, + #else + {"BAD_PSK_IDENTITY", 20, 114}, + #endif + #ifdef SSL_R_BAD_RECORD_TYPE + {"BAD_RECORD_TYPE", ERR_LIB_SSL, SSL_R_BAD_RECORD_TYPE}, + #else + {"BAD_RECORD_TYPE", 20, 443}, + #endif + #ifdef SSL_R_BAD_RSA_ENCRYPT + {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_ENCRYPT}, + #else + {"BAD_RSA_ENCRYPT", 20, 119}, + #endif + #ifdef SSL_R_BAD_SIGNATURE + {"BAD_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_SIGNATURE}, + #else + {"BAD_SIGNATURE", 20, 123}, + #endif + #ifdef SSL_R_BAD_SRP_A_LENGTH + {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_A_LENGTH}, + #else + {"BAD_SRP_A_LENGTH", 20, 347}, + #endif + #ifdef SSL_R_BAD_SRP_PARAMETERS + {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, SSL_R_BAD_SRP_PARAMETERS}, + #else + {"BAD_SRP_PARAMETERS", 20, 371}, + #endif + #ifdef SSL_R_BAD_SRTP_MKI_VALUE + {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, SSL_R_BAD_SRTP_MKI_VALUE}, + #else + {"BAD_SRTP_MKI_VALUE", 20, 352}, + #endif + #ifdef SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST + {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST}, + #else + {"BAD_SRTP_PROTECTION_PROFILE_LIST", 20, 353}, + #endif + #ifdef SSL_R_BAD_SSL_FILETYPE + {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE}, + #else + {"BAD_SSL_FILETYPE", 20, 124}, + #endif + #ifdef SSL_R_BAD_VALUE + {"BAD_VALUE", ERR_LIB_SSL, SSL_R_BAD_VALUE}, + #else + {"BAD_VALUE", 20, 384}, + #endif + #ifdef SSL_R_BAD_WRITE_RETRY + {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY}, + #else + {"BAD_WRITE_RETRY", 20, 127}, + #endif + #ifdef SSL_R_BINDER_DOES_NOT_VERIFY + {"BINDER_DOES_NOT_VERIFY", ERR_LIB_SSL, SSL_R_BINDER_DOES_NOT_VERIFY}, + #else + {"BINDER_DOES_NOT_VERIFY", 20, 253}, + #endif + #ifdef SSL_R_BIO_NOT_SET + {"BIO_NOT_SET", ERR_LIB_SSL, SSL_R_BIO_NOT_SET}, + #else + {"BIO_NOT_SET", 20, 128}, + #endif + #ifdef SSL_R_BLOCK_CIPHER_PAD_IS_WRONG + {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG}, + #else + {"BLOCK_CIPHER_PAD_IS_WRONG", 20, 129}, + #endif + #ifdef SSL_R_BN_LIB + {"BN_LIB", ERR_LIB_SSL, SSL_R_BN_LIB}, + #else + {"BN_LIB", 20, 130}, + #endif + #ifdef SSL_R_CALLBACK_FAILED + {"CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_CALLBACK_FAILED}, + #else + {"CALLBACK_FAILED", 20, 234}, + #endif + #ifdef SSL_R_CANNOT_CHANGE_CIPHER + {"CANNOT_CHANGE_CIPHER", ERR_LIB_SSL, SSL_R_CANNOT_CHANGE_CIPHER}, + #else + {"CANNOT_CHANGE_CIPHER", 20, 109}, + #endif + #ifdef SSL_R_CA_DN_LENGTH_MISMATCH + {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CA_DN_LENGTH_MISMATCH}, + #else + {"CA_DN_LENGTH_MISMATCH", 20, 131}, + #endif + #ifdef SSL_R_CA_KEY_TOO_SMALL + {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_CA_KEY_TOO_SMALL}, + #else + {"CA_KEY_TOO_SMALL", 20, 397}, + #endif + #ifdef SSL_R_CA_MD_TOO_WEAK + {"CA_MD_TOO_WEAK", ERR_LIB_SSL, SSL_R_CA_MD_TOO_WEAK}, + #else + {"CA_MD_TOO_WEAK", 20, 398}, + #endif + #ifdef SSL_R_CCS_RECEIVED_EARLY + {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY}, + #else + {"CCS_RECEIVED_EARLY", 20, 133}, + #endif + #ifdef SSL_R_CERTIFICATE_VERIFY_FAILED + {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, SSL_R_CERTIFICATE_VERIFY_FAILED}, + #else + {"CERTIFICATE_VERIFY_FAILED", 20, 134}, + #endif + #ifdef SSL_R_CERT_CB_ERROR + {"CERT_CB_ERROR", ERR_LIB_SSL, SSL_R_CERT_CB_ERROR}, + #else + {"CERT_CB_ERROR", 20, 377}, + #endif + #ifdef SSL_R_CERT_LENGTH_MISMATCH + {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH}, + #else + {"CERT_LENGTH_MISMATCH", 20, 135}, + #endif + #ifdef SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED + {"CIPHERSUITE_DIGEST_HAS_CHANGED", ERR_LIB_SSL, SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED}, + #else + {"CIPHERSUITE_DIGEST_HAS_CHANGED", 20, 218}, + #endif + #ifdef SSL_R_CIPHER_CODE_WRONG_LENGTH + {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, SSL_R_CIPHER_CODE_WRONG_LENGTH}, + #else + {"CIPHER_CODE_WRONG_LENGTH", 20, 137}, + #endif + #ifdef SSL_R_CIPHER_OR_HASH_UNAVAILABLE + {"CIPHER_OR_HASH_UNAVAILABLE", ERR_LIB_SSL, SSL_R_CIPHER_OR_HASH_UNAVAILABLE}, + #else + {"CIPHER_OR_HASH_UNAVAILABLE", 20, 138}, + #endif + #ifdef SSL_R_CLIENTHELLO_TLSEXT + {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_CLIENTHELLO_TLSEXT}, + #else + {"CLIENTHELLO_TLSEXT", 20, 226}, + #endif + #ifdef SSL_R_COMPRESSED_LENGTH_TOO_LONG + {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_COMPRESSED_LENGTH_TOO_LONG}, + #else + {"COMPRESSED_LENGTH_TOO_LONG", 20, 140}, + #endif + #ifdef SSL_R_COMPRESSION_DISABLED + {"COMPRESSION_DISABLED", ERR_LIB_SSL, SSL_R_COMPRESSION_DISABLED}, + #else + {"COMPRESSION_DISABLED", 20, 343}, + #endif + #ifdef SSL_R_COMPRESSION_FAILURE + {"COMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_COMPRESSION_FAILURE}, + #else + {"COMPRESSION_FAILURE", 20, 141}, + #endif + #ifdef SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE + {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE}, + #else + {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", 20, 307}, + #endif + #ifdef SSL_R_COMPRESSION_LIBRARY_ERROR + {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, SSL_R_COMPRESSION_LIBRARY_ERROR}, + #else + {"COMPRESSION_LIBRARY_ERROR", 20, 142}, + #endif + #ifdef SSL_R_CONNECTION_TYPE_NOT_SET + {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET}, + #else + {"CONNECTION_TYPE_NOT_SET", 20, 144}, + #endif + #ifdef SSL_R_CONTEXT_NOT_DANE_ENABLED + {"CONTEXT_NOT_DANE_ENABLED", ERR_LIB_SSL, SSL_R_CONTEXT_NOT_DANE_ENABLED}, + #else + {"CONTEXT_NOT_DANE_ENABLED", 20, 167}, + #endif + #ifdef SSL_R_COOKIE_GEN_CALLBACK_FAILURE + {"COOKIE_GEN_CALLBACK_FAILURE", ERR_LIB_SSL, SSL_R_COOKIE_GEN_CALLBACK_FAILURE}, + #else + {"COOKIE_GEN_CALLBACK_FAILURE", 20, 400}, + #endif + #ifdef SSL_R_COOKIE_MISMATCH + {"COOKIE_MISMATCH", ERR_LIB_SSL, SSL_R_COOKIE_MISMATCH}, + #else + {"COOKIE_MISMATCH", 20, 308}, + #endif + #ifdef SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED + {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", ERR_LIB_SSL, SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED}, + #else + {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", 20, 206}, + #endif + #ifdef SSL_R_DANE_ALREADY_ENABLED + {"DANE_ALREADY_ENABLED", ERR_LIB_SSL, SSL_R_DANE_ALREADY_ENABLED}, + #else + {"DANE_ALREADY_ENABLED", 20, 172}, + #endif + #ifdef SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL + {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", ERR_LIB_SSL, SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL}, + #else + {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", 20, 173}, + #endif + #ifdef SSL_R_DANE_NOT_ENABLED + {"DANE_NOT_ENABLED", ERR_LIB_SSL, SSL_R_DANE_NOT_ENABLED}, + #else + {"DANE_NOT_ENABLED", 20, 175}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE + {"DANE_TLSA_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE}, + #else + {"DANE_TLSA_BAD_CERTIFICATE", 20, 180}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE + {"DANE_TLSA_BAD_CERTIFICATE_USAGE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE}, + #else + {"DANE_TLSA_BAD_CERTIFICATE_USAGE", 20, 184}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_DATA_LENGTH + {"DANE_TLSA_BAD_DATA_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DATA_LENGTH}, + #else + {"DANE_TLSA_BAD_DATA_LENGTH", 20, 189}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH + {"DANE_TLSA_BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH}, + #else + {"DANE_TLSA_BAD_DIGEST_LENGTH", 20, 192}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_MATCHING_TYPE + {"DANE_TLSA_BAD_MATCHING_TYPE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE}, + #else + {"DANE_TLSA_BAD_MATCHING_TYPE", 20, 200}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_PUBLIC_KEY + {"DANE_TLSA_BAD_PUBLIC_KEY", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_PUBLIC_KEY}, + #else + {"DANE_TLSA_BAD_PUBLIC_KEY", 20, 201}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_SELECTOR + {"DANE_TLSA_BAD_SELECTOR", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_SELECTOR}, + #else + {"DANE_TLSA_BAD_SELECTOR", 20, 202}, + #endif + #ifdef SSL_R_DANE_TLSA_NULL_DATA + {"DANE_TLSA_NULL_DATA", ERR_LIB_SSL, SSL_R_DANE_TLSA_NULL_DATA}, + #else + {"DANE_TLSA_NULL_DATA", 20, 203}, + #endif + #ifdef SSL_R_DATA_BETWEEN_CCS_AND_FINISHED + {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, SSL_R_DATA_BETWEEN_CCS_AND_FINISHED}, + #else + {"DATA_BETWEEN_CCS_AND_FINISHED", 20, 145}, + #endif + #ifdef SSL_R_DATA_LENGTH_TOO_LONG + {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_DATA_LENGTH_TOO_LONG}, + #else + {"DATA_LENGTH_TOO_LONG", 20, 146}, + #endif + #ifdef SSL_R_DECRYPTION_FAILED + {"DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED}, + #else + {"DECRYPTION_FAILED", 20, 147}, + #endif + #ifdef SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC + {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC}, + #else + {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", 20, 281}, + #endif + #ifdef SSL_R_DH_KEY_TOO_SMALL + {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_DH_KEY_TOO_SMALL}, + #else + {"DH_KEY_TOO_SMALL", 20, 394}, + #endif + #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG + {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG}, + #else + {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", 20, 148}, + #endif + #ifdef SSL_R_DIGEST_CHECK_FAILED + {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, SSL_R_DIGEST_CHECK_FAILED}, + #else + {"DIGEST_CHECK_FAILED", 20, 149}, + #endif + #ifdef SSL_R_DTLS_MESSAGE_TOO_BIG + {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, SSL_R_DTLS_MESSAGE_TOO_BIG}, + #else + {"DTLS_MESSAGE_TOO_BIG", 20, 334}, + #endif + #ifdef SSL_R_DUPLICATE_COMPRESSION_ID + {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, SSL_R_DUPLICATE_COMPRESSION_ID}, + #else + {"DUPLICATE_COMPRESSION_ID", 20, 309}, + #endif + #ifdef SSL_R_ECC_CERT_NOT_FOR_SIGNING + {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING}, + #else + {"ECC_CERT_NOT_FOR_SIGNING", 20, 318}, + #endif + #ifdef SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE + {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE}, + #else + {"ECDH_REQUIRED_FOR_SUITEB_MODE", 20, 374}, + #endif + #ifdef SSL_R_EE_KEY_TOO_SMALL + {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_EE_KEY_TOO_SMALL}, + #else + {"EE_KEY_TOO_SMALL", 20, 399}, + #endif + #ifdef SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST + {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST}, + #else + {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", 20, 354}, + #endif + #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG + {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG}, + #else + {"ENCRYPTED_LENGTH_TOO_LONG", 20, 150}, + #endif + #ifdef SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST + {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST}, + #else + {"ERROR_IN_RECEIVED_CIPHER_LIST", 20, 151}, + #endif + #ifdef SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN + {"ERROR_SETTING_TLSA_BASE_DOMAIN", ERR_LIB_SSL, SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN}, + #else + {"ERROR_SETTING_TLSA_BASE_DOMAIN", 20, 204}, + #endif + #ifdef SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE + {"EXCEEDS_MAX_FRAGMENT_SIZE", ERR_LIB_SSL, SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE}, + #else + {"EXCEEDS_MAX_FRAGMENT_SIZE", 20, 194}, + #endif + #ifdef SSL_R_EXCESSIVE_MESSAGE_SIZE + {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE}, + #else + {"EXCESSIVE_MESSAGE_SIZE", 20, 152}, + #endif + #ifdef SSL_R_EXTENSION_NOT_RECEIVED + {"EXTENSION_NOT_RECEIVED", ERR_LIB_SSL, SSL_R_EXTENSION_NOT_RECEIVED}, + #else + {"EXTENSION_NOT_RECEIVED", 20, 279}, + #endif + #ifdef SSL_R_EXTRA_DATA_IN_MESSAGE + {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, SSL_R_EXTRA_DATA_IN_MESSAGE}, + #else + {"EXTRA_DATA_IN_MESSAGE", 20, 153}, + #endif + #ifdef SSL_R_EXT_LENGTH_MISMATCH + {"EXT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_EXT_LENGTH_MISMATCH}, + #else + {"EXT_LENGTH_MISMATCH", 20, 163}, + #endif + #ifdef SSL_R_FAILED_TO_INIT_ASYNC + {"FAILED_TO_INIT_ASYNC", ERR_LIB_SSL, SSL_R_FAILED_TO_INIT_ASYNC}, + #else + {"FAILED_TO_INIT_ASYNC", 20, 405}, + #endif + #ifdef SSL_R_FRAGMENTED_CLIENT_HELLO + {"FRAGMENTED_CLIENT_HELLO", ERR_LIB_SSL, SSL_R_FRAGMENTED_CLIENT_HELLO}, + #else + {"FRAGMENTED_CLIENT_HELLO", 20, 401}, + #endif + #ifdef SSL_R_GOT_A_FIN_BEFORE_A_CCS + {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_A_FIN_BEFORE_A_CCS}, + #else + {"GOT_A_FIN_BEFORE_A_CCS", 20, 154}, + #endif + #ifdef SSL_R_HTTPS_PROXY_REQUEST + {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST}, + #else + {"HTTPS_PROXY_REQUEST", 20, 155}, + #endif + #ifdef SSL_R_HTTP_REQUEST + {"HTTP_REQUEST", ERR_LIB_SSL, SSL_R_HTTP_REQUEST}, + #else + {"HTTP_REQUEST", 20, 156}, + #endif + #ifdef SSL_R_ILLEGAL_POINT_COMPRESSION + {"ILLEGAL_POINT_COMPRESSION", ERR_LIB_SSL, SSL_R_ILLEGAL_POINT_COMPRESSION}, + #else + {"ILLEGAL_POINT_COMPRESSION", 20, 162}, + #endif + #ifdef SSL_R_ILLEGAL_SUITEB_DIGEST + {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, SSL_R_ILLEGAL_SUITEB_DIGEST}, + #else + {"ILLEGAL_SUITEB_DIGEST", 20, 380}, + #endif + #ifdef SSL_R_INAPPROPRIATE_FALLBACK + {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_INAPPROPRIATE_FALLBACK}, + #else + {"INAPPROPRIATE_FALLBACK", 20, 373}, + #endif + #ifdef SSL_R_INCONSISTENT_COMPRESSION + {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, SSL_R_INCONSISTENT_COMPRESSION}, + #else + {"INCONSISTENT_COMPRESSION", 20, 340}, + #endif + #ifdef SSL_R_INCONSISTENT_EARLY_DATA_ALPN + {"INCONSISTENT_EARLY_DATA_ALPN", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_ALPN}, + #else + {"INCONSISTENT_EARLY_DATA_ALPN", 20, 222}, + #endif + #ifdef SSL_R_INCONSISTENT_EARLY_DATA_SNI + {"INCONSISTENT_EARLY_DATA_SNI", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_SNI}, + #else + {"INCONSISTENT_EARLY_DATA_SNI", 20, 231}, + #endif + #ifdef SSL_R_INCONSISTENT_EXTMS + {"INCONSISTENT_EXTMS", ERR_LIB_SSL, SSL_R_INCONSISTENT_EXTMS}, + #else + {"INCONSISTENT_EXTMS", 20, 104}, + #endif + #ifdef SSL_R_INSUFFICIENT_SECURITY + {"INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_INSUFFICIENT_SECURITY}, + #else + {"INSUFFICIENT_SECURITY", 20, 241}, + #endif + #ifdef SSL_R_INVALID_ALERT + {"INVALID_ALERT", ERR_LIB_SSL, SSL_R_INVALID_ALERT}, + #else + {"INVALID_ALERT", 20, 205}, + #endif + #ifdef SSL_R_INVALID_CCS_MESSAGE + {"INVALID_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_INVALID_CCS_MESSAGE}, + #else + {"INVALID_CCS_MESSAGE", 20, 260}, + #endif + #ifdef SSL_R_INVALID_CERTIFICATE_OR_ALG + {"INVALID_CERTIFICATE_OR_ALG", ERR_LIB_SSL, SSL_R_INVALID_CERTIFICATE_OR_ALG}, + #else + {"INVALID_CERTIFICATE_OR_ALG", 20, 238}, + #endif + #ifdef SSL_R_INVALID_COMMAND + {"INVALID_COMMAND", ERR_LIB_SSL, SSL_R_INVALID_COMMAND}, + #else + {"INVALID_COMMAND", 20, 280}, + #endif + #ifdef SSL_R_INVALID_COMPRESSION_ALGORITHM + {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_INVALID_COMPRESSION_ALGORITHM}, + #else + {"INVALID_COMPRESSION_ALGORITHM", 20, 341}, + #endif + #ifdef SSL_R_INVALID_CONFIG + {"INVALID_CONFIG", ERR_LIB_SSL, SSL_R_INVALID_CONFIG}, + #else + {"INVALID_CONFIG", 20, 283}, + #endif + #ifdef SSL_R_INVALID_CONFIGURATION_NAME + {"INVALID_CONFIGURATION_NAME", ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME}, + #else + {"INVALID_CONFIGURATION_NAME", 20, 113}, + #endif + #ifdef SSL_R_INVALID_CONTEXT + {"INVALID_CONTEXT", ERR_LIB_SSL, SSL_R_INVALID_CONTEXT}, + #else + {"INVALID_CONTEXT", 20, 282}, + #endif + #ifdef SSL_R_INVALID_CT_VALIDATION_TYPE + {"INVALID_CT_VALIDATION_TYPE", ERR_LIB_SSL, SSL_R_INVALID_CT_VALIDATION_TYPE}, + #else + {"INVALID_CT_VALIDATION_TYPE", 20, 212}, + #endif + #ifdef SSL_R_INVALID_KEY_UPDATE_TYPE + {"INVALID_KEY_UPDATE_TYPE", ERR_LIB_SSL, SSL_R_INVALID_KEY_UPDATE_TYPE}, + #else + {"INVALID_KEY_UPDATE_TYPE", 20, 120}, + #endif + #ifdef SSL_R_INVALID_MAX_EARLY_DATA + {"INVALID_MAX_EARLY_DATA", ERR_LIB_SSL, SSL_R_INVALID_MAX_EARLY_DATA}, + #else + {"INVALID_MAX_EARLY_DATA", 20, 174}, + #endif + #ifdef SSL_R_INVALID_NULL_CMD_NAME + {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, SSL_R_INVALID_NULL_CMD_NAME}, + #else + {"INVALID_NULL_CMD_NAME", 20, 385}, + #endif + #ifdef SSL_R_INVALID_SEQUENCE_NUMBER + {"INVALID_SEQUENCE_NUMBER", ERR_LIB_SSL, SSL_R_INVALID_SEQUENCE_NUMBER}, + #else + {"INVALID_SEQUENCE_NUMBER", 20, 402}, + #endif + #ifdef SSL_R_INVALID_SERVERINFO_DATA + {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, SSL_R_INVALID_SERVERINFO_DATA}, + #else + {"INVALID_SERVERINFO_DATA", 20, 388}, + #endif + #ifdef SSL_R_INVALID_SESSION_ID + {"INVALID_SESSION_ID", ERR_LIB_SSL, SSL_R_INVALID_SESSION_ID}, + #else + {"INVALID_SESSION_ID", 20, 999}, + #endif + #ifdef SSL_R_INVALID_SRP_USERNAME + {"INVALID_SRP_USERNAME", ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME}, + #else + {"INVALID_SRP_USERNAME", 20, 357}, + #endif + #ifdef SSL_R_INVALID_STATUS_RESPONSE + {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE}, + #else + {"INVALID_STATUS_RESPONSE", 20, 328}, + #endif + #ifdef SSL_R_INVALID_TICKET_KEYS_LENGTH + {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH}, + #else + {"INVALID_TICKET_KEYS_LENGTH", 20, 325}, + #endif + #ifdef SSL_R_LENGTH_MISMATCH + {"LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_LENGTH_MISMATCH}, + #else + {"LENGTH_MISMATCH", 20, 159}, + #endif + #ifdef SSL_R_LENGTH_TOO_LONG + {"LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_LENGTH_TOO_LONG}, + #else + {"LENGTH_TOO_LONG", 20, 404}, + #endif + #ifdef SSL_R_LENGTH_TOO_SHORT + {"LENGTH_TOO_SHORT", ERR_LIB_SSL, SSL_R_LENGTH_TOO_SHORT}, + #else + {"LENGTH_TOO_SHORT", 20, 160}, + #endif + #ifdef SSL_R_LIBRARY_BUG + {"LIBRARY_BUG", ERR_LIB_SSL, SSL_R_LIBRARY_BUG}, + #else + {"LIBRARY_BUG", 20, 274}, + #endif + #ifdef SSL_R_LIBRARY_HAS_NO_CIPHERS + {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS}, + #else + {"LIBRARY_HAS_NO_CIPHERS", 20, 161}, + #endif + #ifdef SSL_R_MISSING_DSA_SIGNING_CERT + {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_DSA_SIGNING_CERT}, + #else + {"MISSING_DSA_SIGNING_CERT", 20, 165}, + #endif + #ifdef SSL_R_MISSING_ECDSA_SIGNING_CERT + {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDSA_SIGNING_CERT}, + #else + {"MISSING_ECDSA_SIGNING_CERT", 20, 381}, + #endif + #ifdef SSL_R_MISSING_FATAL + {"MISSING_FATAL", ERR_LIB_SSL, SSL_R_MISSING_FATAL}, + #else + {"MISSING_FATAL", 20, 256}, + #endif + #ifdef SSL_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_SSL, SSL_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", 20, 290}, + #endif + #ifdef SSL_R_MISSING_RSA_CERTIFICATE + {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, SSL_R_MISSING_RSA_CERTIFICATE}, + #else + {"MISSING_RSA_CERTIFICATE", 20, 168}, + #endif + #ifdef SSL_R_MISSING_RSA_ENCRYPTING_CERT + {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_ENCRYPTING_CERT}, + #else + {"MISSING_RSA_ENCRYPTING_CERT", 20, 169}, + #endif + #ifdef SSL_R_MISSING_RSA_SIGNING_CERT + {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_SIGNING_CERT}, + #else + {"MISSING_RSA_SIGNING_CERT", 20, 170}, + #endif + #ifdef SSL_R_MISSING_SIGALGS_EXTENSION + {"MISSING_SIGALGS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SIGALGS_EXTENSION}, + #else + {"MISSING_SIGALGS_EXTENSION", 20, 112}, + #endif + #ifdef SSL_R_MISSING_SIGNING_CERT + {"MISSING_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_SIGNING_CERT}, + #else + {"MISSING_SIGNING_CERT", 20, 221}, + #endif + #ifdef SSL_R_MISSING_SRP_PARAM + {"MISSING_SRP_PARAM", ERR_LIB_SSL, SSL_R_MISSING_SRP_PARAM}, + #else + {"MISSING_SRP_PARAM", 20, 358}, + #endif + #ifdef SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION + {"MISSING_SUPPORTED_GROUPS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION}, + #else + {"MISSING_SUPPORTED_GROUPS_EXTENSION", 20, 209}, + #endif + #ifdef SSL_R_MISSING_TMP_DH_KEY + {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY}, + #else + {"MISSING_TMP_DH_KEY", 20, 171}, + #endif + #ifdef SSL_R_MISSING_TMP_ECDH_KEY + {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_ECDH_KEY}, + #else + {"MISSING_TMP_ECDH_KEY", 20, 311}, + #endif + #ifdef SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA + {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", ERR_LIB_SSL, SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA}, + #else + {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", 20, 293}, + #endif + #ifdef SSL_R_NOT_ON_RECORD_BOUNDARY + {"NOT_ON_RECORD_BOUNDARY", ERR_LIB_SSL, SSL_R_NOT_ON_RECORD_BOUNDARY}, + #else + {"NOT_ON_RECORD_BOUNDARY", 20, 182}, + #endif + #ifdef SSL_R_NOT_REPLACING_CERTIFICATE + {"NOT_REPLACING_CERTIFICATE", ERR_LIB_SSL, SSL_R_NOT_REPLACING_CERTIFICATE}, + #else + {"NOT_REPLACING_CERTIFICATE", 20, 289}, + #endif + #ifdef SSL_R_NOT_SERVER + {"NOT_SERVER", ERR_LIB_SSL, SSL_R_NOT_SERVER}, + #else + {"NOT_SERVER", 20, 284}, + #endif + #ifdef SSL_R_NO_APPLICATION_PROTOCOL + {"NO_APPLICATION_PROTOCOL", ERR_LIB_SSL, SSL_R_NO_APPLICATION_PROTOCOL}, + #else + {"NO_APPLICATION_PROTOCOL", 20, 235}, + #endif + #ifdef SSL_R_NO_CERTIFICATES_RETURNED + {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATES_RETURNED}, + #else + {"NO_CERTIFICATES_RETURNED", 20, 176}, + #endif + #ifdef SSL_R_NO_CERTIFICATE_ASSIGNED + {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_ASSIGNED}, + #else + {"NO_CERTIFICATE_ASSIGNED", 20, 177}, + #endif + #ifdef SSL_R_NO_CERTIFICATE_SET + {"NO_CERTIFICATE_SET", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SET}, + #else + {"NO_CERTIFICATE_SET", 20, 179}, + #endif + #ifdef SSL_R_NO_CHANGE_FOLLOWING_HRR + {"NO_CHANGE_FOLLOWING_HRR", ERR_LIB_SSL, SSL_R_NO_CHANGE_FOLLOWING_HRR}, + #else + {"NO_CHANGE_FOLLOWING_HRR", 20, 214}, + #endif + #ifdef SSL_R_NO_CIPHERS_AVAILABLE + {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_CIPHERS_AVAILABLE}, + #else + {"NO_CIPHERS_AVAILABLE", 20, 181}, + #endif + #ifdef SSL_R_NO_CIPHERS_SPECIFIED + {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_SPECIFIED}, + #else + {"NO_CIPHERS_SPECIFIED", 20, 183}, + #endif + #ifdef SSL_R_NO_CIPHER_MATCH + {"NO_CIPHER_MATCH", ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH}, + #else + {"NO_CIPHER_MATCH", 20, 185}, + #endif + #ifdef SSL_R_NO_CLIENT_CERT_METHOD + {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD}, + #else + {"NO_CLIENT_CERT_METHOD", 20, 331}, + #endif + #ifdef SSL_R_NO_COMPRESSION_SPECIFIED + {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_COMPRESSION_SPECIFIED}, + #else + {"NO_COMPRESSION_SPECIFIED", 20, 187}, + #endif + #ifdef SSL_R_NO_COOKIE_CALLBACK_SET + {"NO_COOKIE_CALLBACK_SET", ERR_LIB_SSL, SSL_R_NO_COOKIE_CALLBACK_SET}, + #else + {"NO_COOKIE_CALLBACK_SET", 20, 287}, + #endif + #ifdef SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER + {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER}, + #else + {"NO_GOST_CERTIFICATE_SENT_BY_PEER", 20, 330}, + #endif + #ifdef SSL_R_NO_METHOD_SPECIFIED + {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED}, + #else + {"NO_METHOD_SPECIFIED", 20, 188}, + #endif + #ifdef SSL_R_NO_PEM_EXTENSIONS + {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, SSL_R_NO_PEM_EXTENSIONS}, + #else + {"NO_PEM_EXTENSIONS", 20, 389}, + #endif + #ifdef SSL_R_NO_PRIVATE_KEY_ASSIGNED + {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED}, + #else + {"NO_PRIVATE_KEY_ASSIGNED", 20, 190}, + #endif + #ifdef SSL_R_NO_PROTOCOLS_AVAILABLE + {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_PROTOCOLS_AVAILABLE}, + #else + {"NO_PROTOCOLS_AVAILABLE", 20, 191}, + #endif + #ifdef SSL_R_NO_RENEGOTIATION + {"NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_NO_RENEGOTIATION}, + #else + {"NO_RENEGOTIATION", 20, 339}, + #endif + #ifdef SSL_R_NO_REQUIRED_DIGEST + {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, SSL_R_NO_REQUIRED_DIGEST}, + #else + {"NO_REQUIRED_DIGEST", 20, 324}, + #endif + #ifdef SSL_R_NO_SHARED_CIPHER + {"NO_SHARED_CIPHER", ERR_LIB_SSL, SSL_R_NO_SHARED_CIPHER}, + #else + {"NO_SHARED_CIPHER", 20, 193}, + #endif + #ifdef SSL_R_NO_SHARED_GROUPS + {"NO_SHARED_GROUPS", ERR_LIB_SSL, SSL_R_NO_SHARED_GROUPS}, + #else + {"NO_SHARED_GROUPS", 20, 410}, + #endif + #ifdef SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS + {"NO_SHARED_SIGNATURE_ALGORITHMS", ERR_LIB_SSL, SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS}, + #else + {"NO_SHARED_SIGNATURE_ALGORITHMS", 20, 376}, + #endif + #ifdef SSL_R_NO_SRTP_PROFILES + {"NO_SRTP_PROFILES", ERR_LIB_SSL, SSL_R_NO_SRTP_PROFILES}, + #else + {"NO_SRTP_PROFILES", 20, 359}, + #endif + #ifdef SSL_R_NO_SUITABLE_KEY_SHARE + {"NO_SUITABLE_KEY_SHARE", ERR_LIB_SSL, SSL_R_NO_SUITABLE_KEY_SHARE}, + #else + {"NO_SUITABLE_KEY_SHARE", 20, 101}, + #endif + #ifdef SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM + {"NO_SUITABLE_SIGNATURE_ALGORITHM", ERR_LIB_SSL, SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM}, + #else + {"NO_SUITABLE_SIGNATURE_ALGORITHM", 20, 118}, + #endif + #ifdef SSL_R_NO_VALID_SCTS + {"NO_VALID_SCTS", ERR_LIB_SSL, SSL_R_NO_VALID_SCTS}, + #else + {"NO_VALID_SCTS", 20, 216}, + #endif + #ifdef SSL_R_NO_VERIFY_COOKIE_CALLBACK + {"NO_VERIFY_COOKIE_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_COOKIE_CALLBACK}, + #else + {"NO_VERIFY_COOKIE_CALLBACK", 20, 403}, + #endif + #ifdef SSL_R_NULL_SSL_CTX + {"NULL_SSL_CTX", ERR_LIB_SSL, SSL_R_NULL_SSL_CTX}, + #else + {"NULL_SSL_CTX", 20, 195}, + #endif + #ifdef SSL_R_NULL_SSL_METHOD_PASSED + {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED}, + #else + {"NULL_SSL_METHOD_PASSED", 20, 196}, + #endif + #ifdef SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED + {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED}, + #else + {"OLD_SESSION_CIPHER_NOT_RETURNED", 20, 197}, + #endif + #ifdef SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED + {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED}, + #else + {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", 20, 344}, + #endif + #ifdef SSL_R_OVERFLOW_ERROR + {"OVERFLOW_ERROR", ERR_LIB_SSL, SSL_R_OVERFLOW_ERROR}, + #else + {"OVERFLOW_ERROR", 20, 237}, + #endif + #ifdef SSL_R_PACKET_LENGTH_TOO_LONG + {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PACKET_LENGTH_TOO_LONG}, + #else + {"PACKET_LENGTH_TOO_LONG", 20, 198}, + #endif + #ifdef SSL_R_PARSE_TLSEXT + {"PARSE_TLSEXT", ERR_LIB_SSL, SSL_R_PARSE_TLSEXT}, + #else + {"PARSE_TLSEXT", 20, 227}, + #endif + #ifdef SSL_R_PATH_TOO_LONG + {"PATH_TOO_LONG", ERR_LIB_SSL, SSL_R_PATH_TOO_LONG}, + #else + {"PATH_TOO_LONG", 20, 270}, + #endif + #ifdef SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE + {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE}, + #else + {"PEER_DID_NOT_RETURN_A_CERTIFICATE", 20, 199}, + #endif + #ifdef SSL_R_PEM_NAME_BAD_PREFIX + {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, SSL_R_PEM_NAME_BAD_PREFIX}, + #else + {"PEM_NAME_BAD_PREFIX", 20, 391}, + #endif + #ifdef SSL_R_PEM_NAME_TOO_SHORT + {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, SSL_R_PEM_NAME_TOO_SHORT}, + #else + {"PEM_NAME_TOO_SHORT", 20, 392}, + #endif + #ifdef SSL_R_PIPELINE_FAILURE + {"PIPELINE_FAILURE", ERR_LIB_SSL, SSL_R_PIPELINE_FAILURE}, + #else + {"PIPELINE_FAILURE", 20, 406}, + #endif + #ifdef SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR + {"POST_HANDSHAKE_AUTH_ENCODING_ERR", ERR_LIB_SSL, SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR}, + #else + {"POST_HANDSHAKE_AUTH_ENCODING_ERR", 20, 278}, + #endif + #ifdef SSL_R_PRIVATE_KEY_MISMATCH + {"PRIVATE_KEY_MISMATCH", ERR_LIB_SSL, SSL_R_PRIVATE_KEY_MISMATCH}, + #else + {"PRIVATE_KEY_MISMATCH", 20, 288}, + #endif + #ifdef SSL_R_PROTOCOL_IS_SHUTDOWN + {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN}, + #else + {"PROTOCOL_IS_SHUTDOWN", 20, 207}, + #endif + #ifdef SSL_R_PSK_IDENTITY_NOT_FOUND + {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, SSL_R_PSK_IDENTITY_NOT_FOUND}, + #else + {"PSK_IDENTITY_NOT_FOUND", 20, 223}, + #endif + #ifdef SSL_R_PSK_NO_CLIENT_CB + {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, SSL_R_PSK_NO_CLIENT_CB}, + #else + {"PSK_NO_CLIENT_CB", 20, 224}, + #endif + #ifdef SSL_R_PSK_NO_SERVER_CB + {"PSK_NO_SERVER_CB", ERR_LIB_SSL, SSL_R_PSK_NO_SERVER_CB}, + #else + {"PSK_NO_SERVER_CB", 20, 225}, + #endif + #ifdef SSL_R_READ_BIO_NOT_SET + {"READ_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_READ_BIO_NOT_SET}, + #else + {"READ_BIO_NOT_SET", 20, 211}, + #endif + #ifdef SSL_R_READ_TIMEOUT_EXPIRED + {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, SSL_R_READ_TIMEOUT_EXPIRED}, + #else + {"READ_TIMEOUT_EXPIRED", 20, 312}, + #endif + #ifdef SSL_R_RECORD_LENGTH_MISMATCH + {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_RECORD_LENGTH_MISMATCH}, + #else + {"RECORD_LENGTH_MISMATCH", 20, 213}, + #endif + #ifdef SSL_R_RECORD_TOO_SMALL + {"RECORD_TOO_SMALL", ERR_LIB_SSL, SSL_R_RECORD_TOO_SMALL}, + #else + {"RECORD_TOO_SMALL", 20, 298}, + #endif + #ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG + {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, SSL_R_RENEGOTIATE_EXT_TOO_LONG}, + #else + {"RENEGOTIATE_EXT_TOO_LONG", 20, 335}, + #endif + #ifdef SSL_R_RENEGOTIATION_ENCODING_ERR + {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, SSL_R_RENEGOTIATION_ENCODING_ERR}, + #else + {"RENEGOTIATION_ENCODING_ERR", 20, 336}, + #endif + #ifdef SSL_R_RENEGOTIATION_MISMATCH + {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, SSL_R_RENEGOTIATION_MISMATCH}, + #else + {"RENEGOTIATION_MISMATCH", 20, 337}, + #endif + #ifdef SSL_R_REQUEST_PENDING + {"REQUEST_PENDING", ERR_LIB_SSL, SSL_R_REQUEST_PENDING}, + #else + {"REQUEST_PENDING", 20, 285}, + #endif + #ifdef SSL_R_REQUEST_SENT + {"REQUEST_SENT", ERR_LIB_SSL, SSL_R_REQUEST_SENT}, + #else + {"REQUEST_SENT", 20, 286}, + #endif + #ifdef SSL_R_REQUIRED_CIPHER_MISSING + {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_CIPHER_MISSING}, + #else + {"REQUIRED_CIPHER_MISSING", 20, 215}, + #endif + #ifdef SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING + {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING}, + #else + {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", 20, 342}, + #endif + #ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING + {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING}, + #else + {"SCSV_RECEIVED_WHEN_RENEGOTIATING", 20, 345}, + #endif + #ifdef SSL_R_SCT_VERIFICATION_FAILED + {"SCT_VERIFICATION_FAILED", ERR_LIB_SSL, SSL_R_SCT_VERIFICATION_FAILED}, + #else + {"SCT_VERIFICATION_FAILED", 20, 208}, + #endif + #ifdef SSL_R_SERVERHELLO_TLSEXT + {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_SERVERHELLO_TLSEXT}, + #else + {"SERVERHELLO_TLSEXT", 20, 275}, + #endif + #ifdef SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED + {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED}, + #else + {"SESSION_ID_CONTEXT_UNINITIALIZED", 20, 277}, + #endif + #ifdef SSL_R_SHUTDOWN_WHILE_IN_INIT + {"SHUTDOWN_WHILE_IN_INIT", ERR_LIB_SSL, SSL_R_SHUTDOWN_WHILE_IN_INIT}, + #else + {"SHUTDOWN_WHILE_IN_INIT", 20, 407}, + #endif + #ifdef SSL_R_SIGNATURE_ALGORITHMS_ERROR + {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, SSL_R_SIGNATURE_ALGORITHMS_ERROR}, + #else + {"SIGNATURE_ALGORITHMS_ERROR", 20, 360}, + #endif + #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE + {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE}, + #else + {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", 20, 220}, + #endif + #ifdef SSL_R_SRP_A_CALC + {"SRP_A_CALC", ERR_LIB_SSL, SSL_R_SRP_A_CALC}, + #else + {"SRP_A_CALC", 20, 361}, + #endif + #ifdef SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES + {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES}, + #else + {"SRTP_COULD_NOT_ALLOCATE_PROFILES", 20, 362}, + #endif + #ifdef SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG + {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG}, + #else + {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", 20, 363}, + #endif + #ifdef SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE + {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE}, + #else + {"SRTP_UNKNOWN_PROTECTION_PROFILE", 20, 364}, + #endif + #ifdef SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH + {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH}, + #else + {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", 20, 232}, + #endif + #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME + {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME}, + #else + {"SSL3_EXT_INVALID_SERVERNAME", 20, 319}, + #endif + #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE + {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE}, + #else + {"SSL3_EXT_INVALID_SERVERNAME_TYPE", 20, 320}, + #endif + #ifdef SSL_R_SSL3_SESSION_ID_TOO_LONG + {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_LONG}, + #else + {"SSL3_SESSION_ID_TOO_LONG", 20, 300}, + #endif + #ifdef SSL_R_SSLV3_ALERT_BAD_CERTIFICATE + {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_CERTIFICATE}, + #else + {"SSLV3_ALERT_BAD_CERTIFICATE", 20, 1042}, + #endif + #ifdef SSL_R_SSLV3_ALERT_BAD_RECORD_MAC + {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_RECORD_MAC}, + #else + {"SSLV3_ALERT_BAD_RECORD_MAC", 20, 1020}, + #endif + #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED + {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED}, + #else + {"SSLV3_ALERT_CERTIFICATE_EXPIRED", 20, 1045}, + #endif + #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED + {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED}, + #else + {"SSLV3_ALERT_CERTIFICATE_REVOKED", 20, 1044}, + #endif + #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN + {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN}, + #else + {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", 20, 1046}, + #endif + #ifdef SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE + {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE}, + #else + {"SSLV3_ALERT_DECOMPRESSION_FAILURE", 20, 1030}, + #endif + #ifdef SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE + {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE}, + #else + {"SSLV3_ALERT_HANDSHAKE_FAILURE", 20, 1040}, + #endif + #ifdef SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER + {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER}, + #else + {"SSLV3_ALERT_ILLEGAL_PARAMETER", 20, 1047}, + #endif + #ifdef SSL_R_SSLV3_ALERT_NO_CERTIFICATE + {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_NO_CERTIFICATE}, + #else + {"SSLV3_ALERT_NO_CERTIFICATE", 20, 1041}, + #endif + #ifdef SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE + {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE}, + #else + {"SSLV3_ALERT_UNEXPECTED_MESSAGE", 20, 1010}, + #endif + #ifdef SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE + {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE}, + #else + {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", 20, 1043}, + #endif + #ifdef SSL_R_SSL_COMMAND_SECTION_EMPTY + {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_EMPTY}, + #else + {"SSL_COMMAND_SECTION_EMPTY", 20, 117}, + #endif + #ifdef SSL_R_SSL_COMMAND_SECTION_NOT_FOUND + {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_NOT_FOUND}, + #else + {"SSL_COMMAND_SECTION_NOT_FOUND", 20, 125}, + #endif + #ifdef SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION + {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION}, + #else + {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", 20, 228}, + #endif + #ifdef SSL_R_SSL_HANDSHAKE_FAILURE + {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSL_HANDSHAKE_FAILURE}, + #else + {"SSL_HANDSHAKE_FAILURE", 20, 229}, + #endif + #ifdef SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS + {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS}, + #else + {"SSL_LIBRARY_HAS_NO_CIPHERS", 20, 230}, + #endif + #ifdef SSL_R_SSL_NEGATIVE_LENGTH + {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, SSL_R_SSL_NEGATIVE_LENGTH}, + #else + {"SSL_NEGATIVE_LENGTH", 20, 372}, + #endif + #ifdef SSL_R_SSL_SECTION_EMPTY + {"SSL_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_SECTION_EMPTY}, + #else + {"SSL_SECTION_EMPTY", 20, 126}, + #endif + #ifdef SSL_R_SSL_SECTION_NOT_FOUND + {"SSL_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_SECTION_NOT_FOUND}, + #else + {"SSL_SECTION_NOT_FOUND", 20, 136}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED + {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CALLBACK_FAILED}, + #else + {"SSL_SESSION_ID_CALLBACK_FAILED", 20, 301}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_CONFLICT + {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONFLICT}, + #else + {"SSL_SESSION_ID_CONFLICT", 20, 302}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG + {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG}, + #else + {"SSL_SESSION_ID_CONTEXT_TOO_LONG", 20, 273}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH + {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH}, + #else + {"SSL_SESSION_ID_HAS_BAD_LENGTH", 20, 303}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_TOO_LONG + {"SSL_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_TOO_LONG}, + #else + {"SSL_SESSION_ID_TOO_LONG", 20, 408}, + #endif + #ifdef SSL_R_SSL_SESSION_VERSION_MISMATCH + {"SSL_SESSION_VERSION_MISMATCH", ERR_LIB_SSL, SSL_R_SSL_SESSION_VERSION_MISMATCH}, + #else + {"SSL_SESSION_VERSION_MISMATCH", 20, 210}, + #endif + #ifdef SSL_R_STILL_IN_INIT + {"STILL_IN_INIT", ERR_LIB_SSL, SSL_R_STILL_IN_INIT}, + #else + {"STILL_IN_INIT", 20, 121}, + #endif + #ifdef SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED + {"TLSV13_ALERT_CERTIFICATE_REQUIRED", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED}, + #else + {"TLSV13_ALERT_CERTIFICATE_REQUIRED", 20, 1116}, + #endif + #ifdef SSL_R_TLSV13_ALERT_MISSING_EXTENSION + {"TLSV13_ALERT_MISSING_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_MISSING_EXTENSION}, + #else + {"TLSV13_ALERT_MISSING_EXTENSION", 20, 1109}, + #endif + #ifdef SSL_R_TLSV1_ALERT_ACCESS_DENIED + {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_ACCESS_DENIED}, + #else + {"TLSV1_ALERT_ACCESS_DENIED", 20, 1049}, + #endif + #ifdef SSL_R_TLSV1_ALERT_DECODE_ERROR + {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECODE_ERROR}, + #else + {"TLSV1_ALERT_DECODE_ERROR", 20, 1050}, + #endif + #ifdef SSL_R_TLSV1_ALERT_DECRYPTION_FAILED + {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPTION_FAILED}, + #else + {"TLSV1_ALERT_DECRYPTION_FAILED", 20, 1021}, + #endif + #ifdef SSL_R_TLSV1_ALERT_DECRYPT_ERROR + {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPT_ERROR}, + #else + {"TLSV1_ALERT_DECRYPT_ERROR", 20, 1051}, + #endif + #ifdef SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION + {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION}, + #else + {"TLSV1_ALERT_EXPORT_RESTRICTION", 20, 1060}, + #endif + #ifdef SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK + {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK}, + #else + {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", 20, 1086}, + #endif + #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY + {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY}, + #else + {"TLSV1_ALERT_INSUFFICIENT_SECURITY", 20, 1071}, + #endif + #ifdef SSL_R_TLSV1_ALERT_INTERNAL_ERROR + {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INTERNAL_ERROR}, + #else + {"TLSV1_ALERT_INTERNAL_ERROR", 20, 1080}, + #endif + #ifdef SSL_R_TLSV1_ALERT_NO_RENEGOTIATION + {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_NO_RENEGOTIATION}, + #else + {"TLSV1_ALERT_NO_RENEGOTIATION", 20, 1100}, + #endif + #ifdef SSL_R_TLSV1_ALERT_PROTOCOL_VERSION + {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_PROTOCOL_VERSION}, + #else + {"TLSV1_ALERT_PROTOCOL_VERSION", 20, 1070}, + #endif + #ifdef SSL_R_TLSV1_ALERT_RECORD_OVERFLOW + {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_RECORD_OVERFLOW}, + #else + {"TLSV1_ALERT_RECORD_OVERFLOW", 20, 1022}, + #endif + #ifdef SSL_R_TLSV1_ALERT_UNKNOWN_CA + {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_UNKNOWN_CA}, + #else + {"TLSV1_ALERT_UNKNOWN_CA", 20, 1048}, + #endif + #ifdef SSL_R_TLSV1_ALERT_USER_CANCELLED + {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_USER_CANCELLED}, + #else + {"TLSV1_ALERT_USER_CANCELLED", 20, 1090}, + #endif + #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE + {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE}, + #else + {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", 20, 1114}, + #endif + #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE + {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE}, + #else + {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", 20, 1113}, + #endif + #ifdef SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE + {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE}, + #else + {"TLSV1_CERTIFICATE_UNOBTAINABLE", 20, 1111}, + #endif + #ifdef SSL_R_TLSV1_UNRECOGNIZED_NAME + {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, SSL_R_TLSV1_UNRECOGNIZED_NAME}, + #else + {"TLSV1_UNRECOGNIZED_NAME", 20, 1112}, + #endif + #ifdef SSL_R_TLSV1_UNSUPPORTED_EXTENSION + {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV1_UNSUPPORTED_EXTENSION}, + #else + {"TLSV1_UNSUPPORTED_EXTENSION", 20, 1110}, + #endif + #ifdef SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT + {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT}, + #else + {"TLS_HEARTBEAT_PEER_DOESNT_ACCEPT", 20, 365}, + #endif + #ifdef SSL_R_TLS_HEARTBEAT_PENDING + {"TLS_HEARTBEAT_PENDING", ERR_LIB_SSL, SSL_R_TLS_HEARTBEAT_PENDING}, + #else + {"TLS_HEARTBEAT_PENDING", 20, 366}, + #endif + #ifdef SSL_R_TLS_ILLEGAL_EXPORTER_LABEL + {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL}, + #else + {"TLS_ILLEGAL_EXPORTER_LABEL", 20, 367}, + #endif + #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST + {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST}, + #else + {"TLS_INVALID_ECPOINTFORMAT_LIST", 20, 157}, + #endif + #ifdef SSL_R_TOO_MANY_KEY_UPDATES + {"TOO_MANY_KEY_UPDATES", ERR_LIB_SSL, SSL_R_TOO_MANY_KEY_UPDATES}, + #else + {"TOO_MANY_KEY_UPDATES", 20, 132}, + #endif + #ifdef SSL_R_TOO_MANY_WARN_ALERTS + {"TOO_MANY_WARN_ALERTS", ERR_LIB_SSL, SSL_R_TOO_MANY_WARN_ALERTS}, + #else + {"TOO_MANY_WARN_ALERTS", 20, 409}, + #endif + #ifdef SSL_R_TOO_MUCH_EARLY_DATA + {"TOO_MUCH_EARLY_DATA", ERR_LIB_SSL, SSL_R_TOO_MUCH_EARLY_DATA}, + #else + {"TOO_MUCH_EARLY_DATA", 20, 164}, + #endif + #ifdef SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS + {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS}, + #else + {"UNABLE_TO_FIND_ECDH_PARAMETERS", 20, 314}, + #endif + #ifdef SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS + {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS}, + #else + {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", 20, 239}, + #endif + #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES + {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES}, + #else + {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", 20, 242}, + #endif + #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES + {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES}, + #else + {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", 20, 243}, + #endif + #ifdef SSL_R_UNEXPECTED_CCS_MESSAGE + {"UNEXPECTED_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_CCS_MESSAGE}, + #else + {"UNEXPECTED_CCS_MESSAGE", 20, 262}, + #endif + #ifdef SSL_R_UNEXPECTED_END_OF_EARLY_DATA + {"UNEXPECTED_END_OF_EARLY_DATA", ERR_LIB_SSL, SSL_R_UNEXPECTED_END_OF_EARLY_DATA}, + #else + {"UNEXPECTED_END_OF_EARLY_DATA", 20, 178}, + #endif + #ifdef SSL_R_UNEXPECTED_MESSAGE + {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE}, + #else + {"UNEXPECTED_MESSAGE", 20, 244}, + #endif + #ifdef SSL_R_UNEXPECTED_RECORD + {"UNEXPECTED_RECORD", ERR_LIB_SSL, SSL_R_UNEXPECTED_RECORD}, + #else + {"UNEXPECTED_RECORD", 20, 245}, + #endif + #ifdef SSL_R_UNINITIALIZED + {"UNINITIALIZED", ERR_LIB_SSL, SSL_R_UNINITIALIZED}, + #else + {"UNINITIALIZED", 20, 276}, + #endif + #ifdef SSL_R_UNKNOWN_ALERT_TYPE + {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_ALERT_TYPE}, + #else + {"UNKNOWN_ALERT_TYPE", 20, 246}, + #endif + #ifdef SSL_R_UNKNOWN_CERTIFICATE_TYPE + {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE}, + #else + {"UNKNOWN_CERTIFICATE_TYPE", 20, 247}, + #endif + #ifdef SSL_R_UNKNOWN_CIPHER_RETURNED + {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_RETURNED}, + #else + {"UNKNOWN_CIPHER_RETURNED", 20, 248}, + #endif + #ifdef SSL_R_UNKNOWN_CIPHER_TYPE + {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_TYPE}, + #else + {"UNKNOWN_CIPHER_TYPE", 20, 249}, + #endif + #ifdef SSL_R_UNKNOWN_CMD_NAME + {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, SSL_R_UNKNOWN_CMD_NAME}, + #else + {"UNKNOWN_CMD_NAME", 20, 386}, + #endif + #ifdef SSL_R_UNKNOWN_COMMAND + {"UNKNOWN_COMMAND", ERR_LIB_SSL, SSL_R_UNKNOWN_COMMAND}, + #else + {"UNKNOWN_COMMAND", 20, 139}, + #endif + #ifdef SSL_R_UNKNOWN_DIGEST + {"UNKNOWN_DIGEST", ERR_LIB_SSL, SSL_R_UNKNOWN_DIGEST}, + #else + {"UNKNOWN_DIGEST", 20, 368}, + #endif + #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE + {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE}, + #else + {"UNKNOWN_KEY_EXCHANGE_TYPE", 20, 250}, + #endif + #ifdef SSL_R_UNKNOWN_PKEY_TYPE + {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_PKEY_TYPE}, + #else + {"UNKNOWN_PKEY_TYPE", 20, 251}, + #endif + #ifdef SSL_R_UNKNOWN_PROTOCOL + {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, SSL_R_UNKNOWN_PROTOCOL}, + #else + {"UNKNOWN_PROTOCOL", 20, 252}, + #endif + #ifdef SSL_R_UNKNOWN_SSL_VERSION + {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION}, + #else + {"UNKNOWN_SSL_VERSION", 20, 254}, + #endif + #ifdef SSL_R_UNKNOWN_STATE + {"UNKNOWN_STATE", ERR_LIB_SSL, SSL_R_UNKNOWN_STATE}, + #else + {"UNKNOWN_STATE", 20, 255}, + #endif + #ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED + {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED}, + #else + {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", 20, 338}, + #endif + #ifdef SSL_R_UNSOLICITED_EXTENSION + {"UNSOLICITED_EXTENSION", ERR_LIB_SSL, SSL_R_UNSOLICITED_EXTENSION}, + #else + {"UNSOLICITED_EXTENSION", 20, 217}, + #endif + #ifdef SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM + {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM}, + #else + {"UNSUPPORTED_COMPRESSION_ALGORITHM", 20, 257}, + #endif + #ifdef SSL_R_UNSUPPORTED_ELLIPTIC_CURVE + {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_ELLIPTIC_CURVE}, + #else + {"UNSUPPORTED_ELLIPTIC_CURVE", 20, 315}, + #endif + #ifdef SSL_R_UNSUPPORTED_PROTOCOL + {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL}, + #else + {"UNSUPPORTED_PROTOCOL", 20, 258}, + #endif + #ifdef SSL_R_UNSUPPORTED_SSL_VERSION + {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION}, + #else + {"UNSUPPORTED_SSL_VERSION", 20, 259}, + #endif + #ifdef SSL_R_UNSUPPORTED_STATUS_TYPE + {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_STATUS_TYPE}, + #else + {"UNSUPPORTED_STATUS_TYPE", 20, 329}, + #endif + #ifdef SSL_R_USE_SRTP_NOT_NEGOTIATED + {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, SSL_R_USE_SRTP_NOT_NEGOTIATED}, + #else + {"USE_SRTP_NOT_NEGOTIATED", 20, 369}, + #endif + #ifdef SSL_R_VERSION_TOO_HIGH + {"VERSION_TOO_HIGH", ERR_LIB_SSL, SSL_R_VERSION_TOO_HIGH}, + #else + {"VERSION_TOO_HIGH", 20, 166}, + #endif + #ifdef SSL_R_VERSION_TOO_LOW + {"VERSION_TOO_LOW", ERR_LIB_SSL, SSL_R_VERSION_TOO_LOW}, + #else + {"VERSION_TOO_LOW", 20, 396}, + #endif + #ifdef SSL_R_WRONG_CERTIFICATE_TYPE + {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_CERTIFICATE_TYPE}, + #else + {"WRONG_CERTIFICATE_TYPE", 20, 383}, + #endif + #ifdef SSL_R_WRONG_CIPHER_RETURNED + {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED}, + #else + {"WRONG_CIPHER_RETURNED", 20, 261}, + #endif + #ifdef SSL_R_WRONG_CURVE + {"WRONG_CURVE", ERR_LIB_SSL, SSL_R_WRONG_CURVE}, + #else + {"WRONG_CURVE", 20, 378}, + #endif + #ifdef SSL_R_WRONG_SIGNATURE_LENGTH + {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_LENGTH}, + #else + {"WRONG_SIGNATURE_LENGTH", 20, 264}, + #endif + #ifdef SSL_R_WRONG_SIGNATURE_SIZE + {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_SIZE}, + #else + {"WRONG_SIGNATURE_SIZE", 20, 265}, + #endif + #ifdef SSL_R_WRONG_SIGNATURE_TYPE + {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_TYPE}, + #else + {"WRONG_SIGNATURE_TYPE", 20, 370}, + #endif + #ifdef SSL_R_WRONG_SSL_VERSION + {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION}, + #else + {"WRONG_SSL_VERSION", 20, 266}, + #endif + #ifdef SSL_R_WRONG_VERSION_NUMBER + {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_WRONG_VERSION_NUMBER}, + #else + {"WRONG_VERSION_NUMBER", 20, 267}, + #endif + #ifdef SSL_R_X509_LIB + {"X509_LIB", ERR_LIB_SSL, SSL_R_X509_LIB}, + #else + {"X509_LIB", 20, 268}, + #endif + #ifdef SSL_R_X509_VERIFICATION_SETUP_PROBLEMS + {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS}, + #else + {"X509_VERIFICATION_SETUP_PROBLEMS", 20, 269}, + #endif + #ifdef TS_R_BAD_PKCS7_TYPE + {"BAD_PKCS7_TYPE", ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE}, + #else + {"BAD_PKCS7_TYPE", 47, 132}, + #endif + #ifdef TS_R_BAD_TYPE + {"BAD_TYPE", ERR_LIB_TS, TS_R_BAD_TYPE}, + #else + {"BAD_TYPE", 47, 133}, + #endif + #ifdef TS_R_CANNOT_LOAD_CERT + {"CANNOT_LOAD_CERT", ERR_LIB_TS, TS_R_CANNOT_LOAD_CERT}, + #else + {"CANNOT_LOAD_CERT", 47, 137}, + #endif + #ifdef TS_R_CANNOT_LOAD_KEY + {"CANNOT_LOAD_KEY", ERR_LIB_TS, TS_R_CANNOT_LOAD_KEY}, + #else + {"CANNOT_LOAD_KEY", 47, 138}, + #endif + #ifdef TS_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_TS, TS_R_CERTIFICATE_VERIFY_ERROR}, + #else + {"CERTIFICATE_VERIFY_ERROR", 47, 100}, + #endif + #ifdef TS_R_COULD_NOT_SET_ENGINE + {"COULD_NOT_SET_ENGINE", ERR_LIB_TS, TS_R_COULD_NOT_SET_ENGINE}, + #else + {"COULD_NOT_SET_ENGINE", 47, 127}, + #endif + #ifdef TS_R_COULD_NOT_SET_TIME + {"COULD_NOT_SET_TIME", ERR_LIB_TS, TS_R_COULD_NOT_SET_TIME}, + #else + {"COULD_NOT_SET_TIME", 47, 115}, + #endif + #ifdef TS_R_DETACHED_CONTENT + {"DETACHED_CONTENT", ERR_LIB_TS, TS_R_DETACHED_CONTENT}, + #else + {"DETACHED_CONTENT", 47, 134}, + #endif + #ifdef TS_R_ESS_ADD_SIGNING_CERT_ERROR + {"ESS_ADD_SIGNING_CERT_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_ERROR}, + #else + {"ESS_ADD_SIGNING_CERT_ERROR", 47, 116}, + #endif + #ifdef TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR + {"ESS_ADD_SIGNING_CERT_V2_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR}, + #else + {"ESS_ADD_SIGNING_CERT_V2_ERROR", 47, 139}, + #endif + #ifdef TS_R_ESS_SIGNING_CERTIFICATE_ERROR + {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_TS, TS_R_ESS_SIGNING_CERTIFICATE_ERROR}, + #else + {"ESS_SIGNING_CERTIFICATE_ERROR", 47, 101}, + #endif + #ifdef TS_R_INVALID_NULL_POINTER + {"INVALID_NULL_POINTER", ERR_LIB_TS, TS_R_INVALID_NULL_POINTER}, + #else + {"INVALID_NULL_POINTER", 47, 102}, + #endif + #ifdef TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE + {"INVALID_SIGNER_CERTIFICATE_PURPOSE", ERR_LIB_TS, TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE}, + #else + {"INVALID_SIGNER_CERTIFICATE_PURPOSE", 47, 117}, + #endif + #ifdef TS_R_MESSAGE_IMPRINT_MISMATCH + {"MESSAGE_IMPRINT_MISMATCH", ERR_LIB_TS, TS_R_MESSAGE_IMPRINT_MISMATCH}, + #else + {"MESSAGE_IMPRINT_MISMATCH", 47, 103}, + #endif + #ifdef TS_R_NONCE_MISMATCH + {"NONCE_MISMATCH", ERR_LIB_TS, TS_R_NONCE_MISMATCH}, + #else + {"NONCE_MISMATCH", 47, 104}, + #endif + #ifdef TS_R_NONCE_NOT_RETURNED + {"NONCE_NOT_RETURNED", ERR_LIB_TS, TS_R_NONCE_NOT_RETURNED}, + #else + {"NONCE_NOT_RETURNED", 47, 105}, + #endif + #ifdef TS_R_NO_CONTENT + {"NO_CONTENT", ERR_LIB_TS, TS_R_NO_CONTENT}, + #else + {"NO_CONTENT", 47, 106}, + #endif + #ifdef TS_R_NO_TIME_STAMP_TOKEN + {"NO_TIME_STAMP_TOKEN", ERR_LIB_TS, TS_R_NO_TIME_STAMP_TOKEN}, + #else + {"NO_TIME_STAMP_TOKEN", 47, 107}, + #endif + #ifdef TS_R_PKCS7_ADD_SIGNATURE_ERROR + {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNATURE_ERROR}, + #else + {"PKCS7_ADD_SIGNATURE_ERROR", 47, 118}, + #endif + #ifdef TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR + {"PKCS7_ADD_SIGNED_ATTR_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR}, + #else + {"PKCS7_ADD_SIGNED_ATTR_ERROR", 47, 119}, + #endif + #ifdef TS_R_PKCS7_TO_TS_TST_INFO_FAILED + {"PKCS7_TO_TS_TST_INFO_FAILED", ERR_LIB_TS, TS_R_PKCS7_TO_TS_TST_INFO_FAILED}, + #else + {"PKCS7_TO_TS_TST_INFO_FAILED", 47, 129}, + #endif + #ifdef TS_R_POLICY_MISMATCH + {"POLICY_MISMATCH", ERR_LIB_TS, TS_R_POLICY_MISMATCH}, + #else + {"POLICY_MISMATCH", 47, 108}, + #endif + #ifdef TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_TS, TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, + #else + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 47, 120}, + #endif + #ifdef TS_R_RESPONSE_SETUP_ERROR + {"RESPONSE_SETUP_ERROR", ERR_LIB_TS, TS_R_RESPONSE_SETUP_ERROR}, + #else + {"RESPONSE_SETUP_ERROR", 47, 121}, + #endif + #ifdef TS_R_SIGNATURE_FAILURE + {"SIGNATURE_FAILURE", ERR_LIB_TS, TS_R_SIGNATURE_FAILURE}, + #else + {"SIGNATURE_FAILURE", 47, 109}, + #endif + #ifdef TS_R_THERE_MUST_BE_ONE_SIGNER + {"THERE_MUST_BE_ONE_SIGNER", ERR_LIB_TS, TS_R_THERE_MUST_BE_ONE_SIGNER}, + #else + {"THERE_MUST_BE_ONE_SIGNER", 47, 110}, + #endif + #ifdef TS_R_TIME_SYSCALL_ERROR + {"TIME_SYSCALL_ERROR", ERR_LIB_TS, TS_R_TIME_SYSCALL_ERROR}, + #else + {"TIME_SYSCALL_ERROR", 47, 122}, + #endif + #ifdef TS_R_TOKEN_NOT_PRESENT + {"TOKEN_NOT_PRESENT", ERR_LIB_TS, TS_R_TOKEN_NOT_PRESENT}, + #else + {"TOKEN_NOT_PRESENT", 47, 130}, + #endif + #ifdef TS_R_TOKEN_PRESENT + {"TOKEN_PRESENT", ERR_LIB_TS, TS_R_TOKEN_PRESENT}, + #else + {"TOKEN_PRESENT", 47, 131}, + #endif + #ifdef TS_R_TSA_NAME_MISMATCH + {"TSA_NAME_MISMATCH", ERR_LIB_TS, TS_R_TSA_NAME_MISMATCH}, + #else + {"TSA_NAME_MISMATCH", 47, 111}, + #endif + #ifdef TS_R_TSA_UNTRUSTED + {"TSA_UNTRUSTED", ERR_LIB_TS, TS_R_TSA_UNTRUSTED}, + #else + {"TSA_UNTRUSTED", 47, 112}, + #endif + #ifdef TS_R_TST_INFO_SETUP_ERROR + {"TST_INFO_SETUP_ERROR", ERR_LIB_TS, TS_R_TST_INFO_SETUP_ERROR}, + #else + {"TST_INFO_SETUP_ERROR", 47, 123}, + #endif + #ifdef TS_R_TS_DATASIGN + {"TS_DATASIGN", ERR_LIB_TS, TS_R_TS_DATASIGN}, + #else + {"TS_DATASIGN", 47, 124}, + #endif + #ifdef TS_R_UNACCEPTABLE_POLICY + {"UNACCEPTABLE_POLICY", ERR_LIB_TS, TS_R_UNACCEPTABLE_POLICY}, + #else + {"UNACCEPTABLE_POLICY", 47, 125}, + #endif + #ifdef TS_R_UNSUPPORTED_MD_ALGORITHM + {"UNSUPPORTED_MD_ALGORITHM", ERR_LIB_TS, TS_R_UNSUPPORTED_MD_ALGORITHM}, + #else + {"UNSUPPORTED_MD_ALGORITHM", 47, 126}, + #endif + #ifdef TS_R_UNSUPPORTED_VERSION + {"UNSUPPORTED_VERSION", ERR_LIB_TS, TS_R_UNSUPPORTED_VERSION}, + #else + {"UNSUPPORTED_VERSION", 47, 113}, + #endif + #ifdef TS_R_VAR_BAD_VALUE + {"VAR_BAD_VALUE", ERR_LIB_TS, TS_R_VAR_BAD_VALUE}, + #else + {"VAR_BAD_VALUE", 47, 135}, + #endif + #ifdef TS_R_VAR_LOOKUP_FAILURE + {"VAR_LOOKUP_FAILURE", ERR_LIB_TS, TS_R_VAR_LOOKUP_FAILURE}, + #else + {"VAR_LOOKUP_FAILURE", 47, 136}, + #endif + #ifdef TS_R_WRONG_CONTENT_TYPE + {"WRONG_CONTENT_TYPE", ERR_LIB_TS, TS_R_WRONG_CONTENT_TYPE}, + #else + {"WRONG_CONTENT_TYPE", 47, 114}, + #endif + #ifdef UI_R_COMMON_OK_AND_CANCEL_CHARACTERS + {"COMMON_OK_AND_CANCEL_CHARACTERS", ERR_LIB_UI, UI_R_COMMON_OK_AND_CANCEL_CHARACTERS}, + #else + {"COMMON_OK_AND_CANCEL_CHARACTERS", 40, 104}, + #endif + #ifdef UI_R_INDEX_TOO_LARGE + {"INDEX_TOO_LARGE", ERR_LIB_UI, UI_R_INDEX_TOO_LARGE}, + #else + {"INDEX_TOO_LARGE", 40, 102}, + #endif + #ifdef UI_R_INDEX_TOO_SMALL + {"INDEX_TOO_SMALL", ERR_LIB_UI, UI_R_INDEX_TOO_SMALL}, + #else + {"INDEX_TOO_SMALL", 40, 103}, + #endif + #ifdef UI_R_NO_RESULT_BUFFER + {"NO_RESULT_BUFFER", ERR_LIB_UI, UI_R_NO_RESULT_BUFFER}, + #else + {"NO_RESULT_BUFFER", 40, 105}, + #endif + #ifdef UI_R_PROCESSING_ERROR + {"PROCESSING_ERROR", ERR_LIB_UI, UI_R_PROCESSING_ERROR}, + #else + {"PROCESSING_ERROR", 40, 107}, + #endif + #ifdef UI_R_RESULT_TOO_LARGE + {"RESULT_TOO_LARGE", ERR_LIB_UI, UI_R_RESULT_TOO_LARGE}, + #else + {"RESULT_TOO_LARGE", 40, 100}, + #endif + #ifdef UI_R_RESULT_TOO_SMALL + {"RESULT_TOO_SMALL", ERR_LIB_UI, UI_R_RESULT_TOO_SMALL}, + #else + {"RESULT_TOO_SMALL", 40, 101}, + #endif + #ifdef UI_R_SYSASSIGN_ERROR + {"SYSASSIGN_ERROR", ERR_LIB_UI, UI_R_SYSASSIGN_ERROR}, + #else + {"SYSASSIGN_ERROR", 40, 109}, + #endif + #ifdef UI_R_SYSDASSGN_ERROR + {"SYSDASSGN_ERROR", ERR_LIB_UI, UI_R_SYSDASSGN_ERROR}, + #else + {"SYSDASSGN_ERROR", 40, 110}, + #endif + #ifdef UI_R_SYSQIOW_ERROR + {"SYSQIOW_ERROR", ERR_LIB_UI, UI_R_SYSQIOW_ERROR}, + #else + {"SYSQIOW_ERROR", 40, 111}, + #endif + #ifdef UI_R_UNKNOWN_CONTROL_COMMAND + {"UNKNOWN_CONTROL_COMMAND", ERR_LIB_UI, UI_R_UNKNOWN_CONTROL_COMMAND}, + #else + {"UNKNOWN_CONTROL_COMMAND", 40, 106}, + #endif + #ifdef UI_R_UNKNOWN_TTYGET_ERRNO_VALUE + {"UNKNOWN_TTYGET_ERRNO_VALUE", ERR_LIB_UI, UI_R_UNKNOWN_TTYGET_ERRNO_VALUE}, + #else + {"UNKNOWN_TTYGET_ERRNO_VALUE", 40, 108}, + #endif + #ifdef UI_R_USER_DATA_DUPLICATION_UNSUPPORTED + {"USER_DATA_DUPLICATION_UNSUPPORTED", ERR_LIB_UI, UI_R_USER_DATA_DUPLICATION_UNSUPPORTED}, + #else + {"USER_DATA_DUPLICATION_UNSUPPORTED", 40, 112}, + #endif + #ifdef X509V3_R_BAD_IP_ADDRESS + {"BAD_IP_ADDRESS", ERR_LIB_X509V3, X509V3_R_BAD_IP_ADDRESS}, + #else + {"BAD_IP_ADDRESS", 34, 118}, + #endif + #ifdef X509V3_R_BAD_OBJECT + {"BAD_OBJECT", ERR_LIB_X509V3, X509V3_R_BAD_OBJECT}, + #else + {"BAD_OBJECT", 34, 119}, + #endif + #ifdef X509V3_R_BN_DEC2BN_ERROR + {"BN_DEC2BN_ERROR", ERR_LIB_X509V3, X509V3_R_BN_DEC2BN_ERROR}, + #else + {"BN_DEC2BN_ERROR", 34, 100}, + #endif + #ifdef X509V3_R_BN_TO_ASN1_INTEGER_ERROR + {"BN_TO_ASN1_INTEGER_ERROR", ERR_LIB_X509V3, X509V3_R_BN_TO_ASN1_INTEGER_ERROR}, + #else + {"BN_TO_ASN1_INTEGER_ERROR", 34, 101}, + #endif + #ifdef X509V3_R_DIRNAME_ERROR + {"DIRNAME_ERROR", ERR_LIB_X509V3, X509V3_R_DIRNAME_ERROR}, + #else + {"DIRNAME_ERROR", 34, 149}, + #endif + #ifdef X509V3_R_DISTPOINT_ALREADY_SET + {"DISTPOINT_ALREADY_SET", ERR_LIB_X509V3, X509V3_R_DISTPOINT_ALREADY_SET}, + #else + {"DISTPOINT_ALREADY_SET", 34, 160}, + #endif + #ifdef X509V3_R_DUPLICATE_ZONE_ID + {"DUPLICATE_ZONE_ID", ERR_LIB_X509V3, X509V3_R_DUPLICATE_ZONE_ID}, + #else + {"DUPLICATE_ZONE_ID", 34, 133}, + #endif + #ifdef X509V3_R_ERROR_CONVERTING_ZONE + {"ERROR_CONVERTING_ZONE", ERR_LIB_X509V3, X509V3_R_ERROR_CONVERTING_ZONE}, + #else + {"ERROR_CONVERTING_ZONE", 34, 131}, + #endif + #ifdef X509V3_R_ERROR_CREATING_EXTENSION + {"ERROR_CREATING_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_CREATING_EXTENSION}, + #else + {"ERROR_CREATING_EXTENSION", 34, 144}, + #endif + #ifdef X509V3_R_ERROR_IN_EXTENSION + {"ERROR_IN_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_IN_EXTENSION}, + #else + {"ERROR_IN_EXTENSION", 34, 128}, + #endif + #ifdef X509V3_R_EXPECTED_A_SECTION_NAME + {"EXPECTED_A_SECTION_NAME", ERR_LIB_X509V3, X509V3_R_EXPECTED_A_SECTION_NAME}, + #else + {"EXPECTED_A_SECTION_NAME", 34, 137}, + #endif + #ifdef X509V3_R_EXTENSION_EXISTS + {"EXTENSION_EXISTS", ERR_LIB_X509V3, X509V3_R_EXTENSION_EXISTS}, + #else + {"EXTENSION_EXISTS", 34, 145}, + #endif + #ifdef X509V3_R_EXTENSION_NAME_ERROR + {"EXTENSION_NAME_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_NAME_ERROR}, + #else + {"EXTENSION_NAME_ERROR", 34, 115}, + #endif + #ifdef X509V3_R_EXTENSION_NOT_FOUND + {"EXTENSION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_EXTENSION_NOT_FOUND}, + #else + {"EXTENSION_NOT_FOUND", 34, 102}, + #endif + #ifdef X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED + {"EXTENSION_SETTING_NOT_SUPPORTED", ERR_LIB_X509V3, X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED}, + #else + {"EXTENSION_SETTING_NOT_SUPPORTED", 34, 103}, + #endif + #ifdef X509V3_R_EXTENSION_VALUE_ERROR + {"EXTENSION_VALUE_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR}, + #else + {"EXTENSION_VALUE_ERROR", 34, 116}, + #endif + #ifdef X509V3_R_ILLEGAL_EMPTY_EXTENSION + {"ILLEGAL_EMPTY_EXTENSION", ERR_LIB_X509V3, X509V3_R_ILLEGAL_EMPTY_EXTENSION}, + #else + {"ILLEGAL_EMPTY_EXTENSION", 34, 151}, + #endif + #ifdef X509V3_R_INCORRECT_POLICY_SYNTAX_TAG + {"INCORRECT_POLICY_SYNTAX_TAG", ERR_LIB_X509V3, X509V3_R_INCORRECT_POLICY_SYNTAX_TAG}, + #else + {"INCORRECT_POLICY_SYNTAX_TAG", 34, 152}, + #endif + #ifdef X509V3_R_INVALID_ASNUMBER + {"INVALID_ASNUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_ASNUMBER}, + #else + {"INVALID_ASNUMBER", 34, 162}, + #endif + #ifdef X509V3_R_INVALID_ASRANGE + {"INVALID_ASRANGE", ERR_LIB_X509V3, X509V3_R_INVALID_ASRANGE}, + #else + {"INVALID_ASRANGE", 34, 163}, + #endif + #ifdef X509V3_R_INVALID_BOOLEAN_STRING + {"INVALID_BOOLEAN_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_BOOLEAN_STRING}, + #else + {"INVALID_BOOLEAN_STRING", 34, 104}, + #endif + #ifdef X509V3_R_INVALID_EXTENSION_STRING + {"INVALID_EXTENSION_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_EXTENSION_STRING}, + #else + {"INVALID_EXTENSION_STRING", 34, 105}, + #endif + #ifdef X509V3_R_INVALID_INHERITANCE + {"INVALID_INHERITANCE", ERR_LIB_X509V3, X509V3_R_INVALID_INHERITANCE}, + #else + {"INVALID_INHERITANCE", 34, 165}, + #endif + #ifdef X509V3_R_INVALID_IPADDRESS + {"INVALID_IPADDRESS", ERR_LIB_X509V3, X509V3_R_INVALID_IPADDRESS}, + #else + {"INVALID_IPADDRESS", 34, 166}, + #endif + #ifdef X509V3_R_INVALID_MULTIPLE_RDNS + {"INVALID_MULTIPLE_RDNS", ERR_LIB_X509V3, X509V3_R_INVALID_MULTIPLE_RDNS}, + #else + {"INVALID_MULTIPLE_RDNS", 34, 161}, + #endif + #ifdef X509V3_R_INVALID_NAME + {"INVALID_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NAME}, + #else + {"INVALID_NAME", 34, 106}, + #endif + #ifdef X509V3_R_INVALID_NULL_ARGUMENT + {"INVALID_NULL_ARGUMENT", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_ARGUMENT}, + #else + {"INVALID_NULL_ARGUMENT", 34, 107}, + #endif + #ifdef X509V3_R_INVALID_NULL_NAME + {"INVALID_NULL_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_NAME}, + #else + {"INVALID_NULL_NAME", 34, 108}, + #endif + #ifdef X509V3_R_INVALID_NULL_VALUE + {"INVALID_NULL_VALUE", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_VALUE}, + #else + {"INVALID_NULL_VALUE", 34, 109}, + #endif + #ifdef X509V3_R_INVALID_NUMBER + {"INVALID_NUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBER}, + #else + {"INVALID_NUMBER", 34, 140}, + #endif + #ifdef X509V3_R_INVALID_NUMBERS + {"INVALID_NUMBERS", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBERS}, + #else + {"INVALID_NUMBERS", 34, 141}, + #endif + #ifdef X509V3_R_INVALID_OBJECT_IDENTIFIER + {"INVALID_OBJECT_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER}, + #else + {"INVALID_OBJECT_IDENTIFIER", 34, 110}, + #endif + #ifdef X509V3_R_INVALID_OPTION + {"INVALID_OPTION", ERR_LIB_X509V3, X509V3_R_INVALID_OPTION}, + #else + {"INVALID_OPTION", 34, 138}, + #endif + #ifdef X509V3_R_INVALID_POLICY_IDENTIFIER + {"INVALID_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_POLICY_IDENTIFIER}, + #else + {"INVALID_POLICY_IDENTIFIER", 34, 134}, + #endif + #ifdef X509V3_R_INVALID_PROXY_POLICY_SETTING + {"INVALID_PROXY_POLICY_SETTING", ERR_LIB_X509V3, X509V3_R_INVALID_PROXY_POLICY_SETTING}, + #else + {"INVALID_PROXY_POLICY_SETTING", 34, 153}, + #endif + #ifdef X509V3_R_INVALID_PURPOSE + {"INVALID_PURPOSE", ERR_LIB_X509V3, X509V3_R_INVALID_PURPOSE}, + #else + {"INVALID_PURPOSE", 34, 146}, + #endif + #ifdef X509V3_R_INVALID_SAFI + {"INVALID_SAFI", ERR_LIB_X509V3, X509V3_R_INVALID_SAFI}, + #else + {"INVALID_SAFI", 34, 164}, + #endif + #ifdef X509V3_R_INVALID_SECTION + {"INVALID_SECTION", ERR_LIB_X509V3, X509V3_R_INVALID_SECTION}, + #else + {"INVALID_SECTION", 34, 135}, + #endif + #ifdef X509V3_R_INVALID_SYNTAX + {"INVALID_SYNTAX", ERR_LIB_X509V3, X509V3_R_INVALID_SYNTAX}, + #else + {"INVALID_SYNTAX", 34, 143}, + #endif + #ifdef X509V3_R_ISSUER_DECODE_ERROR + {"ISSUER_DECODE_ERROR", ERR_LIB_X509V3, X509V3_R_ISSUER_DECODE_ERROR}, + #else + {"ISSUER_DECODE_ERROR", 34, 126}, + #endif + #ifdef X509V3_R_MISSING_VALUE + {"MISSING_VALUE", ERR_LIB_X509V3, X509V3_R_MISSING_VALUE}, + #else + {"MISSING_VALUE", 34, 124}, + #endif + #ifdef X509V3_R_NEED_ORGANIZATION_AND_NUMBERS + {"NEED_ORGANIZATION_AND_NUMBERS", ERR_LIB_X509V3, X509V3_R_NEED_ORGANIZATION_AND_NUMBERS}, + #else + {"NEED_ORGANIZATION_AND_NUMBERS", 34, 142}, + #endif + #ifdef X509V3_R_NO_CONFIG_DATABASE + {"NO_CONFIG_DATABASE", ERR_LIB_X509V3, X509V3_R_NO_CONFIG_DATABASE}, + #else + {"NO_CONFIG_DATABASE", 34, 136}, + #endif + #ifdef X509V3_R_NO_ISSUER_CERTIFICATE + {"NO_ISSUER_CERTIFICATE", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_CERTIFICATE}, + #else + {"NO_ISSUER_CERTIFICATE", 34, 121}, + #endif + #ifdef X509V3_R_NO_ISSUER_DETAILS + {"NO_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_DETAILS}, + #else + {"NO_ISSUER_DETAILS", 34, 127}, + #endif + #ifdef X509V3_R_NO_POLICY_IDENTIFIER + {"NO_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_NO_POLICY_IDENTIFIER}, + #else + {"NO_POLICY_IDENTIFIER", 34, 139}, + #endif + #ifdef X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED + {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", ERR_LIB_X509V3, X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED}, + #else + {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", 34, 154}, + #endif + #ifdef X509V3_R_NO_PUBLIC_KEY + {"NO_PUBLIC_KEY", ERR_LIB_X509V3, X509V3_R_NO_PUBLIC_KEY}, + #else + {"NO_PUBLIC_KEY", 34, 114}, + #endif + #ifdef X509V3_R_NO_SUBJECT_DETAILS + {"NO_SUBJECT_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_SUBJECT_DETAILS}, + #else + {"NO_SUBJECT_DETAILS", 34, 125}, + #endif + #ifdef X509V3_R_OPERATION_NOT_DEFINED + {"OPERATION_NOT_DEFINED", ERR_LIB_X509V3, X509V3_R_OPERATION_NOT_DEFINED}, + #else + {"OPERATION_NOT_DEFINED", 34, 148}, + #endif + #ifdef X509V3_R_OTHERNAME_ERROR + {"OTHERNAME_ERROR", ERR_LIB_X509V3, X509V3_R_OTHERNAME_ERROR}, + #else + {"OTHERNAME_ERROR", 34, 147}, + #endif + #ifdef X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED + {"POLICY_LANGUAGE_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED}, + #else + {"POLICY_LANGUAGE_ALREADY_DEFINED", 34, 155}, + #endif + #ifdef X509V3_R_POLICY_PATH_LENGTH + {"POLICY_PATH_LENGTH", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH}, + #else + {"POLICY_PATH_LENGTH", 34, 156}, + #endif + #ifdef X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED + {"POLICY_PATH_LENGTH_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED}, + #else + {"POLICY_PATH_LENGTH_ALREADY_DEFINED", 34, 157}, + #endif + #ifdef X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY + {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", ERR_LIB_X509V3, X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY}, + #else + {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", 34, 159}, + #endif + #ifdef X509V3_R_SECTION_NOT_FOUND + {"SECTION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_SECTION_NOT_FOUND}, + #else + {"SECTION_NOT_FOUND", 34, 150}, + #endif + #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS + {"UNABLE_TO_GET_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS}, + #else + {"UNABLE_TO_GET_ISSUER_DETAILS", 34, 122}, + #endif + #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_KEYID + {"UNABLE_TO_GET_ISSUER_KEYID", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_KEYID}, + #else + {"UNABLE_TO_GET_ISSUER_KEYID", 34, 123}, + #endif + #ifdef X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT + {"UNKNOWN_BIT_STRING_ARGUMENT", ERR_LIB_X509V3, X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT}, + #else + {"UNKNOWN_BIT_STRING_ARGUMENT", 34, 111}, + #endif + #ifdef X509V3_R_UNKNOWN_EXTENSION + {"UNKNOWN_EXTENSION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION}, + #else + {"UNKNOWN_EXTENSION", 34, 129}, + #endif + #ifdef X509V3_R_UNKNOWN_EXTENSION_NAME + {"UNKNOWN_EXTENSION_NAME", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION_NAME}, + #else + {"UNKNOWN_EXTENSION_NAME", 34, 130}, + #endif + #ifdef X509V3_R_UNKNOWN_OPTION + {"UNKNOWN_OPTION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_OPTION}, + #else + {"UNKNOWN_OPTION", 34, 120}, + #endif + #ifdef X509V3_R_UNSUPPORTED_OPTION + {"UNSUPPORTED_OPTION", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_OPTION}, + #else + {"UNSUPPORTED_OPTION", 34, 117}, + #endif + #ifdef X509V3_R_UNSUPPORTED_TYPE + {"UNSUPPORTED_TYPE", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_TYPE}, + #else + {"UNSUPPORTED_TYPE", 34, 167}, + #endif + #ifdef X509V3_R_USER_TOO_LONG + {"USER_TOO_LONG", ERR_LIB_X509V3, X509V3_R_USER_TOO_LONG}, + #else + {"USER_TOO_LONG", 34, 132}, + #endif + #ifdef X509_R_AKID_MISMATCH + {"AKID_MISMATCH", ERR_LIB_X509, X509_R_AKID_MISMATCH}, + #else + {"AKID_MISMATCH", 11, 110}, + #endif + #ifdef X509_R_BAD_SELECTOR + {"BAD_SELECTOR", ERR_LIB_X509, X509_R_BAD_SELECTOR}, + #else + {"BAD_SELECTOR", 11, 133}, + #endif + #ifdef X509_R_BAD_X509_FILETYPE + {"BAD_X509_FILETYPE", ERR_LIB_X509, X509_R_BAD_X509_FILETYPE}, + #else + {"BAD_X509_FILETYPE", 11, 100}, + #endif + #ifdef X509_R_BASE64_DECODE_ERROR + {"BASE64_DECODE_ERROR", ERR_LIB_X509, X509_R_BASE64_DECODE_ERROR}, + #else + {"BASE64_DECODE_ERROR", 11, 118}, + #endif + #ifdef X509_R_CANT_CHECK_DH_KEY + {"CANT_CHECK_DH_KEY", ERR_LIB_X509, X509_R_CANT_CHECK_DH_KEY}, + #else + {"CANT_CHECK_DH_KEY", 11, 114}, + #endif + #ifdef X509_R_CERT_ALREADY_IN_HASH_TABLE + {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509, X509_R_CERT_ALREADY_IN_HASH_TABLE}, + #else + {"CERT_ALREADY_IN_HASH_TABLE", 11, 101}, + #endif + #ifdef X509_R_CRL_ALREADY_DELTA + {"CRL_ALREADY_DELTA", ERR_LIB_X509, X509_R_CRL_ALREADY_DELTA}, + #else + {"CRL_ALREADY_DELTA", 11, 127}, + #endif + #ifdef X509_R_CRL_VERIFY_FAILURE + {"CRL_VERIFY_FAILURE", ERR_LIB_X509, X509_R_CRL_VERIFY_FAILURE}, + #else + {"CRL_VERIFY_FAILURE", 11, 131}, + #endif + #ifdef X509_R_IDP_MISMATCH + {"IDP_MISMATCH", ERR_LIB_X509, X509_R_IDP_MISMATCH}, + #else + {"IDP_MISMATCH", 11, 128}, + #endif + #ifdef X509_R_INVALID_ATTRIBUTES + {"INVALID_ATTRIBUTES", ERR_LIB_X509, X509_R_INVALID_ATTRIBUTES}, + #else + {"INVALID_ATTRIBUTES", 11, 138}, + #endif + #ifdef X509_R_INVALID_DIRECTORY + {"INVALID_DIRECTORY", ERR_LIB_X509, X509_R_INVALID_DIRECTORY}, + #else + {"INVALID_DIRECTORY", 11, 113}, + #endif + #ifdef X509_R_INVALID_FIELD_NAME + {"INVALID_FIELD_NAME", ERR_LIB_X509, X509_R_INVALID_FIELD_NAME}, + #else + {"INVALID_FIELD_NAME", 11, 119}, + #endif + #ifdef X509_R_INVALID_TRUST + {"INVALID_TRUST", ERR_LIB_X509, X509_R_INVALID_TRUST}, + #else + {"INVALID_TRUST", 11, 123}, + #endif + #ifdef X509_R_ISSUER_MISMATCH + {"ISSUER_MISMATCH", ERR_LIB_X509, X509_R_ISSUER_MISMATCH}, + #else + {"ISSUER_MISMATCH", 11, 129}, + #endif + #ifdef X509_R_KEY_TYPE_MISMATCH + {"KEY_TYPE_MISMATCH", ERR_LIB_X509, X509_R_KEY_TYPE_MISMATCH}, + #else + {"KEY_TYPE_MISMATCH", 11, 115}, + #endif + #ifdef X509_R_KEY_VALUES_MISMATCH + {"KEY_VALUES_MISMATCH", ERR_LIB_X509, X509_R_KEY_VALUES_MISMATCH}, + #else + {"KEY_VALUES_MISMATCH", 11, 116}, + #endif + #ifdef X509_R_LOADING_CERT_DIR + {"LOADING_CERT_DIR", ERR_LIB_X509, X509_R_LOADING_CERT_DIR}, + #else + {"LOADING_CERT_DIR", 11, 103}, + #endif + #ifdef X509_R_LOADING_DEFAULTS + {"LOADING_DEFAULTS", ERR_LIB_X509, X509_R_LOADING_DEFAULTS}, + #else + {"LOADING_DEFAULTS", 11, 104}, + #endif + #ifdef X509_R_METHOD_NOT_SUPPORTED + {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, X509_R_METHOD_NOT_SUPPORTED}, + #else + {"METHOD_NOT_SUPPORTED", 11, 124}, + #endif + #ifdef X509_R_NAME_TOO_LONG + {"NAME_TOO_LONG", ERR_LIB_X509, X509_R_NAME_TOO_LONG}, + #else + {"NAME_TOO_LONG", 11, 134}, + #endif + #ifdef X509_R_NEWER_CRL_NOT_NEWER + {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, X509_R_NEWER_CRL_NOT_NEWER}, + #else + {"NEWER_CRL_NOT_NEWER", 11, 132}, + #endif + #ifdef X509_R_NO_CERTIFICATE_FOUND + {"NO_CERTIFICATE_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_FOUND}, + #else + {"NO_CERTIFICATE_FOUND", 11, 135}, + #endif + #ifdef X509_R_NO_CERTIFICATE_OR_CRL_FOUND + {"NO_CERTIFICATE_OR_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_OR_CRL_FOUND}, + #else + {"NO_CERTIFICATE_OR_CRL_FOUND", 11, 136}, + #endif + #ifdef X509_R_NO_CERT_SET_FOR_US_TO_VERIFY + {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY}, + #else + {"NO_CERT_SET_FOR_US_TO_VERIFY", 11, 105}, + #endif + #ifdef X509_R_NO_CRL_FOUND + {"NO_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CRL_FOUND}, + #else + {"NO_CRL_FOUND", 11, 137}, + #endif + #ifdef X509_R_NO_CRL_NUMBER + {"NO_CRL_NUMBER", ERR_LIB_X509, X509_R_NO_CRL_NUMBER}, + #else + {"NO_CRL_NUMBER", 11, 130}, + #endif + #ifdef X509_R_PUBLIC_KEY_DECODE_ERROR + {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_DECODE_ERROR}, + #else + {"PUBLIC_KEY_DECODE_ERROR", 11, 125}, + #endif + #ifdef X509_R_PUBLIC_KEY_ENCODE_ERROR + {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_ENCODE_ERROR}, + #else + {"PUBLIC_KEY_ENCODE_ERROR", 11, 126}, + #endif + #ifdef X509_R_SHOULD_RETRY + {"SHOULD_RETRY", ERR_LIB_X509, X509_R_SHOULD_RETRY}, + #else + {"SHOULD_RETRY", 11, 106}, + #endif + #ifdef X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN + {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509, X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN}, + #else + {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", 11, 107}, + #endif + #ifdef X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY + {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509, X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY}, + #else + {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", 11, 108}, + #endif + #ifdef X509_R_UNKNOWN_KEY_TYPE + {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, X509_R_UNKNOWN_KEY_TYPE}, + #else + {"UNKNOWN_KEY_TYPE", 11, 117}, + #endif + #ifdef X509_R_UNKNOWN_NID + {"UNKNOWN_NID", ERR_LIB_X509, X509_R_UNKNOWN_NID}, + #else + {"UNKNOWN_NID", 11, 109}, + #endif + #ifdef X509_R_UNKNOWN_PURPOSE_ID + {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, X509_R_UNKNOWN_PURPOSE_ID}, + #else + {"UNKNOWN_PURPOSE_ID", 11, 121}, + #endif + #ifdef X509_R_UNKNOWN_TRUST_ID + {"UNKNOWN_TRUST_ID", ERR_LIB_X509, X509_R_UNKNOWN_TRUST_ID}, + #else + {"UNKNOWN_TRUST_ID", 11, 120}, + #endif + #ifdef X509_R_UNSUPPORTED_ALGORITHM + {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, X509_R_UNSUPPORTED_ALGORITHM}, + #else + {"UNSUPPORTED_ALGORITHM", 11, 111}, + #endif + #ifdef X509_R_WRONG_LOOKUP_TYPE + {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, X509_R_WRONG_LOOKUP_TYPE}, + #else + {"WRONG_LOOKUP_TYPE", 11, 112}, + #endif + #ifdef X509_R_WRONG_TYPE + {"WRONG_TYPE", ERR_LIB_X509, X509_R_WRONG_TYPE}, + #else + {"WRONG_TYPE", 11, 122}, + #endif + { NULL } +}; + diff --git a/Modules/_ssl_data_300.h b/Modules/_ssl_data_300.h new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fc3NsX2RhdGFfMzAwLmg= --- /dev/null +++ b/Modules/_ssl_data_300.h @@ -0,0 +1,8435 @@ +/* File generated by Tools/ssl/make_ssl_data.py *//* Generated on 2021-04-09T09:44:43.288448 */ +static struct py_ssl_library_code library_codes[] = { +#ifdef ERR_LIB_ASN1 + {"ASN1", ERR_LIB_ASN1}, +#endif +#ifdef ERR_LIB_ASYNC + {"ASYNC", ERR_LIB_ASYNC}, +#endif +#ifdef ERR_LIB_BIO + {"BIO", ERR_LIB_BIO}, +#endif +#ifdef ERR_LIB_BN + {"BN", ERR_LIB_BN}, +#endif +#ifdef ERR_LIB_BUF + {"BUF", ERR_LIB_BUF}, +#endif +#ifdef ERR_LIB_CMP + {"CMP", ERR_LIB_CMP}, +#endif +#ifdef ERR_LIB_CMS + {"CMS", ERR_LIB_CMS}, +#endif +#ifdef ERR_LIB_COMP + {"COMP", ERR_LIB_COMP}, +#endif +#ifdef ERR_LIB_CONF + {"CONF", ERR_LIB_CONF}, +#endif +#ifdef ERR_LIB_CRMF + {"CRMF", ERR_LIB_CRMF}, +#endif +#ifdef ERR_LIB_CRYPTO + {"CRYPTO", ERR_LIB_CRYPTO}, +#endif +#ifdef ERR_LIB_CT + {"CT", ERR_LIB_CT}, +#endif +#ifdef ERR_LIB_DH + {"DH", ERR_LIB_DH}, +#endif +#ifdef ERR_LIB_DSA + {"DSA", ERR_LIB_DSA}, +#endif +#ifdef ERR_LIB_DSO + {"DSO", ERR_LIB_DSO}, +#endif +#ifdef ERR_LIB_EC + {"EC", ERR_LIB_EC}, +#endif +#ifdef ERR_LIB_ECDH + {"ECDH", ERR_LIB_ECDH}, +#endif +#ifdef ERR_LIB_ECDSA + {"ECDSA", ERR_LIB_ECDSA}, +#endif +#ifdef ERR_LIB_ENGINE + {"ENGINE", ERR_LIB_ENGINE}, +#endif +#ifdef ERR_LIB_ESS + {"ESS", ERR_LIB_ESS}, +#endif +#ifdef ERR_LIB_EVP + {"EVP", ERR_LIB_EVP}, +#endif +#ifdef ERR_LIB_FIPS + {"FIPS", ERR_LIB_FIPS}, +#endif +#ifdef ERR_LIB_HMAC + {"HMAC", ERR_LIB_HMAC}, +#endif +#ifdef ERR_LIB_HTTP + {"HTTP", ERR_LIB_HTTP}, +#endif +#ifdef ERR_LIB_JPAKE + {"JPAKE", ERR_LIB_JPAKE}, +#endif +#ifdef ERR_LIB_KDF + {"KDF", ERR_LIB_KDF}, +#endif +#ifdef ERR_LIB_MASK + {"MASK", ERR_LIB_MASK}, +#endif +#ifdef ERR_LIB_METH + {"METH", ERR_LIB_METH}, +#endif +#ifdef ERR_LIB_NONE + {"NONE", ERR_LIB_NONE}, +#endif +#ifdef ERR_LIB_OBJ + {"OBJ", ERR_LIB_OBJ}, +#endif +#ifdef ERR_LIB_OCSP + {"OCSP", ERR_LIB_OCSP}, +#endif +#ifdef ERR_LIB_OFFSET + {"OFFSET", ERR_LIB_OFFSET}, +#endif +#ifdef ERR_LIB_OSSL_DECODER + {"OSSL_DECODER", ERR_LIB_OSSL_DECODER}, +#endif +#ifdef ERR_LIB_OSSL_ENCODER + {"OSSL_ENCODER", ERR_LIB_OSSL_ENCODER}, +#endif +#ifdef ERR_LIB_OSSL_STORE + {"OSSL_STORE", ERR_LIB_OSSL_STORE}, +#endif +#ifdef ERR_LIB_PEM + {"PEM", ERR_LIB_PEM}, +#endif +#ifdef ERR_LIB_PKCS12 + {"PKCS12", ERR_LIB_PKCS12}, +#endif +#ifdef ERR_LIB_PKCS7 + {"PKCS7", ERR_LIB_PKCS7}, +#endif +#ifdef ERR_LIB_PROP + {"PROP", ERR_LIB_PROP}, +#endif +#ifdef ERR_LIB_PROV + {"PROV", ERR_LIB_PROV}, +#endif +#ifdef ERR_LIB_PROXY + {"PROXY", ERR_LIB_PROXY}, +#endif +#ifdef ERR_LIB_RAND + {"RAND", ERR_LIB_RAND}, +#endif +#ifdef ERR_LIB_RSA + {"RSA", ERR_LIB_RSA}, +#endif +#ifdef ERR_LIB_RSAREF + {"RSAREF", ERR_LIB_RSAREF}, +#endif +#ifdef ERR_LIB_SM2 + {"SM2", ERR_LIB_SM2}, +#endif +#ifdef ERR_LIB_SSL + {"SSL", ERR_LIB_SSL}, +#endif +#ifdef ERR_LIB_SSL2 + {"SSL2", ERR_LIB_SSL2}, +#endif +#ifdef ERR_LIB_SSL23 + {"SSL23", ERR_LIB_SSL23}, +#endif +#ifdef ERR_LIB_SSL3 + {"SSL3", ERR_LIB_SSL3}, +#endif +#ifdef ERR_LIB_SYS + {"SYS", ERR_LIB_SYS}, +#endif +#ifdef ERR_LIB_TS + {"TS", ERR_LIB_TS}, +#endif +#ifdef ERR_LIB_UI + {"UI", ERR_LIB_UI}, +#endif +#ifdef ERR_LIB_USER + {"USER", ERR_LIB_USER}, +#endif +#ifdef ERR_LIB_X509 + {"X509", ERR_LIB_X509}, +#endif +#ifdef ERR_LIB_X509V3 + {"X509V3", ERR_LIB_X509V3}, +#endif + { NULL } +}; + + +static struct py_ssl_error_code error_codes[] = { + #ifdef ASN1_R_ADDING_OBJECT + {"ADDING_OBJECT", ERR_LIB_ASN1, ASN1_R_ADDING_OBJECT}, + #else + {"ADDING_OBJECT", 13, 171}, + #endif + #ifdef ASN1_R_ASN1_PARSE_ERROR + {"ASN1_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_PARSE_ERROR}, + #else + {"ASN1_PARSE_ERROR", 13, 203}, + #endif + #ifdef ASN1_R_ASN1_SIG_PARSE_ERROR + {"ASN1_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_ASN1_SIG_PARSE_ERROR}, + #else + {"ASN1_SIG_PARSE_ERROR", 13, 204}, + #endif + #ifdef ASN1_R_AUX_ERROR + {"AUX_ERROR", ERR_LIB_ASN1, ASN1_R_AUX_ERROR}, + #else + {"AUX_ERROR", 13, 100}, + #endif + #ifdef ASN1_R_BAD_OBJECT_HEADER + {"BAD_OBJECT_HEADER", ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER}, + #else + {"BAD_OBJECT_HEADER", 13, 102}, + #endif + #ifdef ASN1_R_BAD_TEMPLATE + {"BAD_TEMPLATE", ERR_LIB_ASN1, ASN1_R_BAD_TEMPLATE}, + #else + {"BAD_TEMPLATE", 13, 230}, + #endif + #ifdef ASN1_R_BMPSTRING_IS_WRONG_LENGTH + {"BMPSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BMPSTRING_IS_WRONG_LENGTH}, + #else + {"BMPSTRING_IS_WRONG_LENGTH", 13, 214}, + #endif + #ifdef ASN1_R_BN_LIB + {"BN_LIB", ERR_LIB_ASN1, ASN1_R_BN_LIB}, + #else + {"BN_LIB", 13, 105}, + #endif + #ifdef ASN1_R_BOOLEAN_IS_WRONG_LENGTH + {"BOOLEAN_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_BOOLEAN_IS_WRONG_LENGTH}, + #else + {"BOOLEAN_IS_WRONG_LENGTH", 13, 106}, + #endif + #ifdef ASN1_R_BUFFER_TOO_SMALL + {"BUFFER_TOO_SMALL", ERR_LIB_ASN1, ASN1_R_BUFFER_TOO_SMALL}, + #else + {"BUFFER_TOO_SMALL", 13, 107}, + #endif + #ifdef ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_ASN1, ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER}, + #else + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 13, 108}, + #endif + #ifdef ASN1_R_CONTEXT_NOT_INITIALISED + {"CONTEXT_NOT_INITIALISED", ERR_LIB_ASN1, ASN1_R_CONTEXT_NOT_INITIALISED}, + #else + {"CONTEXT_NOT_INITIALISED", 13, 217}, + #endif + #ifdef ASN1_R_DATA_IS_WRONG + {"DATA_IS_WRONG", ERR_LIB_ASN1, ASN1_R_DATA_IS_WRONG}, + #else + {"DATA_IS_WRONG", 13, 109}, + #endif + #ifdef ASN1_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_ASN1, ASN1_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", 13, 110}, + #endif + #ifdef ASN1_R_DEPTH_EXCEEDED + {"DEPTH_EXCEEDED", ERR_LIB_ASN1, ASN1_R_DEPTH_EXCEEDED}, + #else + {"DEPTH_EXCEEDED", 13, 174}, + #endif + #ifdef ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED + {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED}, + #else + {"DIGEST_AND_KEY_TYPE_NOT_SUPPORTED", 13, 198}, + #endif + #ifdef ASN1_R_ENCODE_ERROR + {"ENCODE_ERROR", ERR_LIB_ASN1, ASN1_R_ENCODE_ERROR}, + #else + {"ENCODE_ERROR", 13, 112}, + #endif + #ifdef ASN1_R_ERROR_GETTING_TIME + {"ERROR_GETTING_TIME", ERR_LIB_ASN1, ASN1_R_ERROR_GETTING_TIME}, + #else + {"ERROR_GETTING_TIME", 13, 173}, + #endif + #ifdef ASN1_R_ERROR_LOADING_SECTION + {"ERROR_LOADING_SECTION", ERR_LIB_ASN1, ASN1_R_ERROR_LOADING_SECTION}, + #else + {"ERROR_LOADING_SECTION", 13, 172}, + #endif + #ifdef ASN1_R_ERROR_SETTING_CIPHER_PARAMS + {"ERROR_SETTING_CIPHER_PARAMS", ERR_LIB_ASN1, ASN1_R_ERROR_SETTING_CIPHER_PARAMS}, + #else + {"ERROR_SETTING_CIPHER_PARAMS", 13, 114}, + #endif + #ifdef ASN1_R_EXPECTING_AN_INTEGER + {"EXPECTING_AN_INTEGER", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_INTEGER}, + #else + {"EXPECTING_AN_INTEGER", 13, 115}, + #endif + #ifdef ASN1_R_EXPECTING_AN_OBJECT + {"EXPECTING_AN_OBJECT", ERR_LIB_ASN1, ASN1_R_EXPECTING_AN_OBJECT}, + #else + {"EXPECTING_AN_OBJECT", 13, 116}, + #endif + #ifdef ASN1_R_EXPLICIT_LENGTH_MISMATCH + {"EXPLICIT_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_EXPLICIT_LENGTH_MISMATCH}, + #else + {"EXPLICIT_LENGTH_MISMATCH", 13, 119}, + #endif + #ifdef ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED + {"EXPLICIT_TAG_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED}, + #else + {"EXPLICIT_TAG_NOT_CONSTRUCTED", 13, 120}, + #endif + #ifdef ASN1_R_FIELD_MISSING + {"FIELD_MISSING", ERR_LIB_ASN1, ASN1_R_FIELD_MISSING}, + #else + {"FIELD_MISSING", 13, 121}, + #endif + #ifdef ASN1_R_FIRST_NUM_TOO_LARGE + {"FIRST_NUM_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_FIRST_NUM_TOO_LARGE}, + #else + {"FIRST_NUM_TOO_LARGE", 13, 122}, + #endif + #ifdef ASN1_R_HEADER_TOO_LONG + {"HEADER_TOO_LONG", ERR_LIB_ASN1, ASN1_R_HEADER_TOO_LONG}, + #else + {"HEADER_TOO_LONG", 13, 123}, + #endif + #ifdef ASN1_R_ILLEGAL_BITSTRING_FORMAT + {"ILLEGAL_BITSTRING_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BITSTRING_FORMAT}, + #else + {"ILLEGAL_BITSTRING_FORMAT", 13, 175}, + #endif + #ifdef ASN1_R_ILLEGAL_BOOLEAN + {"ILLEGAL_BOOLEAN", ERR_LIB_ASN1, ASN1_R_ILLEGAL_BOOLEAN}, + #else + {"ILLEGAL_BOOLEAN", 13, 176}, + #endif + #ifdef ASN1_R_ILLEGAL_CHARACTERS + {"ILLEGAL_CHARACTERS", ERR_LIB_ASN1, ASN1_R_ILLEGAL_CHARACTERS}, + #else + {"ILLEGAL_CHARACTERS", 13, 124}, + #endif + #ifdef ASN1_R_ILLEGAL_FORMAT + {"ILLEGAL_FORMAT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_FORMAT}, + #else + {"ILLEGAL_FORMAT", 13, 177}, + #endif + #ifdef ASN1_R_ILLEGAL_HEX + {"ILLEGAL_HEX", ERR_LIB_ASN1, ASN1_R_ILLEGAL_HEX}, + #else + {"ILLEGAL_HEX", 13, 178}, + #endif + #ifdef ASN1_R_ILLEGAL_IMPLICIT_TAG + {"ILLEGAL_IMPLICIT_TAG", ERR_LIB_ASN1, ASN1_R_ILLEGAL_IMPLICIT_TAG}, + #else + {"ILLEGAL_IMPLICIT_TAG", 13, 179}, + #endif + #ifdef ASN1_R_ILLEGAL_INTEGER + {"ILLEGAL_INTEGER", ERR_LIB_ASN1, ASN1_R_ILLEGAL_INTEGER}, + #else + {"ILLEGAL_INTEGER", 13, 180}, + #endif + #ifdef ASN1_R_ILLEGAL_NEGATIVE_VALUE + {"ILLEGAL_NEGATIVE_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NEGATIVE_VALUE}, + #else + {"ILLEGAL_NEGATIVE_VALUE", 13, 226}, + #endif + #ifdef ASN1_R_ILLEGAL_NESTED_TAGGING + {"ILLEGAL_NESTED_TAGGING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NESTED_TAGGING}, + #else + {"ILLEGAL_NESTED_TAGGING", 13, 181}, + #endif + #ifdef ASN1_R_ILLEGAL_NULL + {"ILLEGAL_NULL", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL}, + #else + {"ILLEGAL_NULL", 13, 125}, + #endif + #ifdef ASN1_R_ILLEGAL_NULL_VALUE + {"ILLEGAL_NULL_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_NULL_VALUE}, + #else + {"ILLEGAL_NULL_VALUE", 13, 182}, + #endif + #ifdef ASN1_R_ILLEGAL_OBJECT + {"ILLEGAL_OBJECT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OBJECT}, + #else + {"ILLEGAL_OBJECT", 13, 183}, + #endif + #ifdef ASN1_R_ILLEGAL_OPTIONAL_ANY + {"ILLEGAL_OPTIONAL_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONAL_ANY}, + #else + {"ILLEGAL_OPTIONAL_ANY", 13, 126}, + #endif + #ifdef ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE + {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE}, + #else + {"ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE", 13, 170}, + #endif + #ifdef ASN1_R_ILLEGAL_PADDING + {"ILLEGAL_PADDING", ERR_LIB_ASN1, ASN1_R_ILLEGAL_PADDING}, + #else + {"ILLEGAL_PADDING", 13, 221}, + #endif + #ifdef ASN1_R_ILLEGAL_TAGGED_ANY + {"ILLEGAL_TAGGED_ANY", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TAGGED_ANY}, + #else + {"ILLEGAL_TAGGED_ANY", 13, 127}, + #endif + #ifdef ASN1_R_ILLEGAL_TIME_VALUE + {"ILLEGAL_TIME_VALUE", ERR_LIB_ASN1, ASN1_R_ILLEGAL_TIME_VALUE}, + #else + {"ILLEGAL_TIME_VALUE", 13, 184}, + #endif + #ifdef ASN1_R_ILLEGAL_ZERO_CONTENT + {"ILLEGAL_ZERO_CONTENT", ERR_LIB_ASN1, ASN1_R_ILLEGAL_ZERO_CONTENT}, + #else + {"ILLEGAL_ZERO_CONTENT", 13, 222}, + #endif + #ifdef ASN1_R_INTEGER_NOT_ASCII_FORMAT + {"INTEGER_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_INTEGER_NOT_ASCII_FORMAT}, + #else + {"INTEGER_NOT_ASCII_FORMAT", 13, 185}, + #endif + #ifdef ASN1_R_INTEGER_TOO_LARGE_FOR_LONG + {"INTEGER_TOO_LARGE_FOR_LONG", ERR_LIB_ASN1, ASN1_R_INTEGER_TOO_LARGE_FOR_LONG}, + #else + {"INTEGER_TOO_LARGE_FOR_LONG", 13, 128}, + #endif + #ifdef ASN1_R_INVALID_BIT_STRING_BITS_LEFT + {"INVALID_BIT_STRING_BITS_LEFT", ERR_LIB_ASN1, ASN1_R_INVALID_BIT_STRING_BITS_LEFT}, + #else + {"INVALID_BIT_STRING_BITS_LEFT", 13, 220}, + #endif + #ifdef ASN1_R_INVALID_BMPSTRING_LENGTH + {"INVALID_BMPSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH}, + #else + {"INVALID_BMPSTRING_LENGTH", 13, 129}, + #endif + #ifdef ASN1_R_INVALID_DIGIT + {"INVALID_DIGIT", ERR_LIB_ASN1, ASN1_R_INVALID_DIGIT}, + #else + {"INVALID_DIGIT", 13, 130}, + #endif + #ifdef ASN1_R_INVALID_MIME_TYPE + {"INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_INVALID_MIME_TYPE}, + #else + {"INVALID_MIME_TYPE", 13, 205}, + #endif + #ifdef ASN1_R_INVALID_MODIFIER + {"INVALID_MODIFIER", ERR_LIB_ASN1, ASN1_R_INVALID_MODIFIER}, + #else + {"INVALID_MODIFIER", 13, 186}, + #endif + #ifdef ASN1_R_INVALID_NUMBER + {"INVALID_NUMBER", ERR_LIB_ASN1, ASN1_R_INVALID_NUMBER}, + #else + {"INVALID_NUMBER", 13, 187}, + #endif + #ifdef ASN1_R_INVALID_OBJECT_ENCODING + {"INVALID_OBJECT_ENCODING", ERR_LIB_ASN1, ASN1_R_INVALID_OBJECT_ENCODING}, + #else + {"INVALID_OBJECT_ENCODING", 13, 216}, + #endif + #ifdef ASN1_R_INVALID_SCRYPT_PARAMETERS + {"INVALID_SCRYPT_PARAMETERS", ERR_LIB_ASN1, ASN1_R_INVALID_SCRYPT_PARAMETERS}, + #else + {"INVALID_SCRYPT_PARAMETERS", 13, 227}, + #endif + #ifdef ASN1_R_INVALID_SEPARATOR + {"INVALID_SEPARATOR", ERR_LIB_ASN1, ASN1_R_INVALID_SEPARATOR}, + #else + {"INVALID_SEPARATOR", 13, 131}, + #endif + #ifdef ASN1_R_INVALID_STRING_TABLE_VALUE + {"INVALID_STRING_TABLE_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_STRING_TABLE_VALUE}, + #else + {"INVALID_STRING_TABLE_VALUE", 13, 218}, + #endif + #ifdef ASN1_R_INVALID_UNIVERSALSTRING_LENGTH + {"INVALID_UNIVERSALSTRING_LENGTH", ERR_LIB_ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH}, + #else + {"INVALID_UNIVERSALSTRING_LENGTH", 13, 133}, + #endif + #ifdef ASN1_R_INVALID_UTF8STRING + {"INVALID_UTF8STRING", ERR_LIB_ASN1, ASN1_R_INVALID_UTF8STRING}, + #else + {"INVALID_UTF8STRING", 13, 134}, + #endif + #ifdef ASN1_R_INVALID_VALUE + {"INVALID_VALUE", ERR_LIB_ASN1, ASN1_R_INVALID_VALUE}, + #else + {"INVALID_VALUE", 13, 219}, + #endif + #ifdef ASN1_R_LENGTH_TOO_LONG + {"LENGTH_TOO_LONG", ERR_LIB_ASN1, ASN1_R_LENGTH_TOO_LONG}, + #else + {"LENGTH_TOO_LONG", 13, 231}, + #endif + #ifdef ASN1_R_LIST_ERROR + {"LIST_ERROR", ERR_LIB_ASN1, ASN1_R_LIST_ERROR}, + #else + {"LIST_ERROR", 13, 188}, + #endif + #ifdef ASN1_R_MIME_NO_CONTENT_TYPE + {"MIME_NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_MIME_NO_CONTENT_TYPE}, + #else + {"MIME_NO_CONTENT_TYPE", 13, 206}, + #endif + #ifdef ASN1_R_MIME_PARSE_ERROR + {"MIME_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_PARSE_ERROR}, + #else + {"MIME_PARSE_ERROR", 13, 207}, + #endif + #ifdef ASN1_R_MIME_SIG_PARSE_ERROR + {"MIME_SIG_PARSE_ERROR", ERR_LIB_ASN1, ASN1_R_MIME_SIG_PARSE_ERROR}, + #else + {"MIME_SIG_PARSE_ERROR", 13, 208}, + #endif + #ifdef ASN1_R_MISSING_EOC + {"MISSING_EOC", ERR_LIB_ASN1, ASN1_R_MISSING_EOC}, + #else + {"MISSING_EOC", 13, 137}, + #endif + #ifdef ASN1_R_MISSING_SECOND_NUMBER + {"MISSING_SECOND_NUMBER", ERR_LIB_ASN1, ASN1_R_MISSING_SECOND_NUMBER}, + #else + {"MISSING_SECOND_NUMBER", 13, 138}, + #endif + #ifdef ASN1_R_MISSING_VALUE + {"MISSING_VALUE", ERR_LIB_ASN1, ASN1_R_MISSING_VALUE}, + #else + {"MISSING_VALUE", 13, 189}, + #endif + #ifdef ASN1_R_MSTRING_NOT_UNIVERSAL + {"MSTRING_NOT_UNIVERSAL", ERR_LIB_ASN1, ASN1_R_MSTRING_NOT_UNIVERSAL}, + #else + {"MSTRING_NOT_UNIVERSAL", 13, 139}, + #endif + #ifdef ASN1_R_MSTRING_WRONG_TAG + {"MSTRING_WRONG_TAG", ERR_LIB_ASN1, ASN1_R_MSTRING_WRONG_TAG}, + #else + {"MSTRING_WRONG_TAG", 13, 140}, + #endif + #ifdef ASN1_R_NESTED_ASN1_STRING + {"NESTED_ASN1_STRING", ERR_LIB_ASN1, ASN1_R_NESTED_ASN1_STRING}, + #else + {"NESTED_ASN1_STRING", 13, 197}, + #endif + #ifdef ASN1_R_NESTED_TOO_DEEP + {"NESTED_TOO_DEEP", ERR_LIB_ASN1, ASN1_R_NESTED_TOO_DEEP}, + #else + {"NESTED_TOO_DEEP", 13, 201}, + #endif + #ifdef ASN1_R_NON_HEX_CHARACTERS + {"NON_HEX_CHARACTERS", ERR_LIB_ASN1, ASN1_R_NON_HEX_CHARACTERS}, + #else + {"NON_HEX_CHARACTERS", 13, 141}, + #endif + #ifdef ASN1_R_NOT_ASCII_FORMAT + {"NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_NOT_ASCII_FORMAT}, + #else + {"NOT_ASCII_FORMAT", 13, 190}, + #endif + #ifdef ASN1_R_NOT_ENOUGH_DATA + {"NOT_ENOUGH_DATA", ERR_LIB_ASN1, ASN1_R_NOT_ENOUGH_DATA}, + #else + {"NOT_ENOUGH_DATA", 13, 142}, + #endif + #ifdef ASN1_R_NO_CONTENT_TYPE + {"NO_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_CONTENT_TYPE}, + #else + {"NO_CONTENT_TYPE", 13, 209}, + #endif + #ifdef ASN1_R_NO_MATCHING_CHOICE_TYPE + {"NO_MATCHING_CHOICE_TYPE", ERR_LIB_ASN1, ASN1_R_NO_MATCHING_CHOICE_TYPE}, + #else + {"NO_MATCHING_CHOICE_TYPE", 13, 143}, + #endif + #ifdef ASN1_R_NO_MULTIPART_BODY_FAILURE + {"NO_MULTIPART_BODY_FAILURE", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BODY_FAILURE}, + #else + {"NO_MULTIPART_BODY_FAILURE", 13, 210}, + #endif + #ifdef ASN1_R_NO_MULTIPART_BOUNDARY + {"NO_MULTIPART_BOUNDARY", ERR_LIB_ASN1, ASN1_R_NO_MULTIPART_BOUNDARY}, + #else + {"NO_MULTIPART_BOUNDARY", 13, 211}, + #endif + #ifdef ASN1_R_NO_SIG_CONTENT_TYPE + {"NO_SIG_CONTENT_TYPE", ERR_LIB_ASN1, ASN1_R_NO_SIG_CONTENT_TYPE}, + #else + {"NO_SIG_CONTENT_TYPE", 13, 212}, + #endif + #ifdef ASN1_R_NULL_IS_WRONG_LENGTH + {"NULL_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_NULL_IS_WRONG_LENGTH}, + #else + {"NULL_IS_WRONG_LENGTH", 13, 144}, + #endif + #ifdef ASN1_R_OBJECT_NOT_ASCII_FORMAT + {"OBJECT_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_OBJECT_NOT_ASCII_FORMAT}, + #else + {"OBJECT_NOT_ASCII_FORMAT", 13, 191}, + #endif + #ifdef ASN1_R_ODD_NUMBER_OF_CHARS + {"ODD_NUMBER_OF_CHARS", ERR_LIB_ASN1, ASN1_R_ODD_NUMBER_OF_CHARS}, + #else + {"ODD_NUMBER_OF_CHARS", 13, 145}, + #endif + #ifdef ASN1_R_SECOND_NUMBER_TOO_LARGE + {"SECOND_NUMBER_TOO_LARGE", ERR_LIB_ASN1, ASN1_R_SECOND_NUMBER_TOO_LARGE}, + #else + {"SECOND_NUMBER_TOO_LARGE", 13, 147}, + #endif + #ifdef ASN1_R_SEQUENCE_LENGTH_MISMATCH + {"SEQUENCE_LENGTH_MISMATCH", ERR_LIB_ASN1, ASN1_R_SEQUENCE_LENGTH_MISMATCH}, + #else + {"SEQUENCE_LENGTH_MISMATCH", 13, 148}, + #endif + #ifdef ASN1_R_SEQUENCE_NOT_CONSTRUCTED + {"SEQUENCE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_SEQUENCE_NOT_CONSTRUCTED}, + #else + {"SEQUENCE_NOT_CONSTRUCTED", 13, 149}, + #endif + #ifdef ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG + {"SEQUENCE_OR_SET_NEEDS_CONFIG", ERR_LIB_ASN1, ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG}, + #else + {"SEQUENCE_OR_SET_NEEDS_CONFIG", 13, 192}, + #endif + #ifdef ASN1_R_SHORT_LINE + {"SHORT_LINE", ERR_LIB_ASN1, ASN1_R_SHORT_LINE}, + #else + {"SHORT_LINE", 13, 150}, + #endif + #ifdef ASN1_R_SIG_INVALID_MIME_TYPE + {"SIG_INVALID_MIME_TYPE", ERR_LIB_ASN1, ASN1_R_SIG_INVALID_MIME_TYPE}, + #else + {"SIG_INVALID_MIME_TYPE", 13, 213}, + #endif + #ifdef ASN1_R_STREAMING_NOT_SUPPORTED + {"STREAMING_NOT_SUPPORTED", ERR_LIB_ASN1, ASN1_R_STREAMING_NOT_SUPPORTED}, + #else + {"STREAMING_NOT_SUPPORTED", 13, 202}, + #endif + #ifdef ASN1_R_STRING_TOO_LONG + {"STRING_TOO_LONG", ERR_LIB_ASN1, ASN1_R_STRING_TOO_LONG}, + #else + {"STRING_TOO_LONG", 13, 151}, + #endif + #ifdef ASN1_R_STRING_TOO_SHORT + {"STRING_TOO_SHORT", ERR_LIB_ASN1, ASN1_R_STRING_TOO_SHORT}, + #else + {"STRING_TOO_SHORT", 13, 152}, + #endif + #ifdef ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_ASN1, ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD}, + #else + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 13, 154}, + #endif + #ifdef ASN1_R_TIME_NOT_ASCII_FORMAT + {"TIME_NOT_ASCII_FORMAT", ERR_LIB_ASN1, ASN1_R_TIME_NOT_ASCII_FORMAT}, + #else + {"TIME_NOT_ASCII_FORMAT", 13, 193}, + #endif + #ifdef ASN1_R_TOO_LARGE + {"TOO_LARGE", ERR_LIB_ASN1, ASN1_R_TOO_LARGE}, + #else + {"TOO_LARGE", 13, 223}, + #endif + #ifdef ASN1_R_TOO_LONG + {"TOO_LONG", ERR_LIB_ASN1, ASN1_R_TOO_LONG}, + #else + {"TOO_LONG", 13, 155}, + #endif + #ifdef ASN1_R_TOO_SMALL + {"TOO_SMALL", ERR_LIB_ASN1, ASN1_R_TOO_SMALL}, + #else + {"TOO_SMALL", 13, 224}, + #endif + #ifdef ASN1_R_TYPE_NOT_CONSTRUCTED + {"TYPE_NOT_CONSTRUCTED", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_CONSTRUCTED}, + #else + {"TYPE_NOT_CONSTRUCTED", 13, 156}, + #endif + #ifdef ASN1_R_TYPE_NOT_PRIMITIVE + {"TYPE_NOT_PRIMITIVE", ERR_LIB_ASN1, ASN1_R_TYPE_NOT_PRIMITIVE}, + #else + {"TYPE_NOT_PRIMITIVE", 13, 195}, + #endif + #ifdef ASN1_R_UNEXPECTED_EOC + {"UNEXPECTED_EOC", ERR_LIB_ASN1, ASN1_R_UNEXPECTED_EOC}, + #else + {"UNEXPECTED_EOC", 13, 159}, + #endif + #ifdef ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH + {"UNIVERSALSTRING_IS_WRONG_LENGTH", ERR_LIB_ASN1, ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH}, + #else + {"UNIVERSALSTRING_IS_WRONG_LENGTH", 13, 215}, + #endif + #ifdef ASN1_R_UNKNOWN_DIGEST + {"UNKNOWN_DIGEST", ERR_LIB_ASN1, ASN1_R_UNKNOWN_DIGEST}, + #else + {"UNKNOWN_DIGEST", 13, 229}, + #endif + #ifdef ASN1_R_UNKNOWN_FORMAT + {"UNKNOWN_FORMAT", ERR_LIB_ASN1, ASN1_R_UNKNOWN_FORMAT}, + #else + {"UNKNOWN_FORMAT", 13, 160}, + #endif + #ifdef ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM + {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM}, + #else + {"UNKNOWN_MESSAGE_DIGEST_ALGORITHM", 13, 161}, + #endif + #ifdef ASN1_R_UNKNOWN_OBJECT_TYPE + {"UNKNOWN_OBJECT_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_OBJECT_TYPE}, + #else + {"UNKNOWN_OBJECT_TYPE", 13, 162}, + #endif + #ifdef ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE + {"UNKNOWN_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE}, + #else + {"UNKNOWN_PUBLIC_KEY_TYPE", 13, 163}, + #endif + #ifdef ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM + {"UNKNOWN_SIGNATURE_ALGORITHM", ERR_LIB_ASN1, ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM}, + #else + {"UNKNOWN_SIGNATURE_ALGORITHM", 13, 199}, + #endif + #ifdef ASN1_R_UNKNOWN_TAG + {"UNKNOWN_TAG", ERR_LIB_ASN1, ASN1_R_UNKNOWN_TAG}, + #else + {"UNKNOWN_TAG", 13, 194}, + #endif + #ifdef ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE + {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE}, + #else + {"UNSUPPORTED_ANY_DEFINED_BY_TYPE", 13, 164}, + #endif + #ifdef ASN1_R_UNSUPPORTED_CIPHER + {"UNSUPPORTED_CIPHER", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_CIPHER}, + #else + {"UNSUPPORTED_CIPHER", 13, 228}, + #endif + #ifdef ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE + {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE}, + #else + {"UNSUPPORTED_PUBLIC_KEY_TYPE", 13, 167}, + #endif + #ifdef ASN1_R_UNSUPPORTED_TYPE + {"UNSUPPORTED_TYPE", ERR_LIB_ASN1, ASN1_R_UNSUPPORTED_TYPE}, + #else + {"UNSUPPORTED_TYPE", 13, 196}, + #endif + #ifdef ASN1_R_WRONG_INTEGER_TYPE + {"WRONG_INTEGER_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_INTEGER_TYPE}, + #else + {"WRONG_INTEGER_TYPE", 13, 225}, + #endif + #ifdef ASN1_R_WRONG_PUBLIC_KEY_TYPE + {"WRONG_PUBLIC_KEY_TYPE", ERR_LIB_ASN1, ASN1_R_WRONG_PUBLIC_KEY_TYPE}, + #else + {"WRONG_PUBLIC_KEY_TYPE", 13, 200}, + #endif + #ifdef ASN1_R_WRONG_TAG + {"WRONG_TAG", ERR_LIB_ASN1, ASN1_R_WRONG_TAG}, + #else + {"WRONG_TAG", 13, 168}, + #endif + #ifdef ASYNC_R_FAILED_TO_SET_POOL + {"FAILED_TO_SET_POOL", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SET_POOL}, + #else + {"FAILED_TO_SET_POOL", 51, 101}, + #endif + #ifdef ASYNC_R_FAILED_TO_SWAP_CONTEXT + {"FAILED_TO_SWAP_CONTEXT", ERR_LIB_ASYNC, ASYNC_R_FAILED_TO_SWAP_CONTEXT}, + #else + {"FAILED_TO_SWAP_CONTEXT", 51, 102}, + #endif + #ifdef ASYNC_R_INIT_FAILED + {"INIT_FAILED", ERR_LIB_ASYNC, ASYNC_R_INIT_FAILED}, + #else + {"INIT_FAILED", 51, 105}, + #endif + #ifdef ASYNC_R_INVALID_POOL_SIZE + {"INVALID_POOL_SIZE", ERR_LIB_ASYNC, ASYNC_R_INVALID_POOL_SIZE}, + #else + {"INVALID_POOL_SIZE", 51, 103}, + #endif + #ifdef BIO_R_ACCEPT_ERROR + {"ACCEPT_ERROR", ERR_LIB_BIO, BIO_R_ACCEPT_ERROR}, + #else + {"ACCEPT_ERROR", 32, 100}, + #endif + #ifdef BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET + {"ADDRINFO_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_ADDRINFO_ADDR_IS_NOT_AF_INET}, + #else + {"ADDRINFO_ADDR_IS_NOT_AF_INET", 32, 141}, + #endif + #ifdef BIO_R_AMBIGUOUS_HOST_OR_SERVICE + {"AMBIGUOUS_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_AMBIGUOUS_HOST_OR_SERVICE}, + #else + {"AMBIGUOUS_HOST_OR_SERVICE", 32, 129}, + #endif + #ifdef BIO_R_BAD_FOPEN_MODE + {"BAD_FOPEN_MODE", ERR_LIB_BIO, BIO_R_BAD_FOPEN_MODE}, + #else + {"BAD_FOPEN_MODE", 32, 101}, + #endif + #ifdef BIO_R_BROKEN_PIPE + {"BROKEN_PIPE", ERR_LIB_BIO, BIO_R_BROKEN_PIPE}, + #else + {"BROKEN_PIPE", 32, 124}, + #endif + #ifdef BIO_R_CONNECT_ERROR + {"CONNECT_ERROR", ERR_LIB_BIO, BIO_R_CONNECT_ERROR}, + #else + {"CONNECT_ERROR", 32, 103}, + #endif + #ifdef BIO_R_CONNECT_TIMEOUT + {"CONNECT_TIMEOUT", ERR_LIB_BIO, BIO_R_CONNECT_TIMEOUT}, + #else + {"CONNECT_TIMEOUT", 32, 147}, + #endif + #ifdef BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET + {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", ERR_LIB_BIO, BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET}, + #else + {"GETHOSTBYNAME_ADDR_IS_NOT_AF_INET", 32, 107}, + #endif + #ifdef BIO_R_GETSOCKNAME_ERROR + {"GETSOCKNAME_ERROR", ERR_LIB_BIO, BIO_R_GETSOCKNAME_ERROR}, + #else + {"GETSOCKNAME_ERROR", 32, 132}, + #endif + #ifdef BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS + {"GETSOCKNAME_TRUNCATED_ADDRESS", ERR_LIB_BIO, BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS}, + #else + {"GETSOCKNAME_TRUNCATED_ADDRESS", 32, 133}, + #endif + #ifdef BIO_R_GETTING_SOCKTYPE + {"GETTING_SOCKTYPE", ERR_LIB_BIO, BIO_R_GETTING_SOCKTYPE}, + #else + {"GETTING_SOCKTYPE", 32, 134}, + #endif + #ifdef BIO_R_INVALID_ARGUMENT + {"INVALID_ARGUMENT", ERR_LIB_BIO, BIO_R_INVALID_ARGUMENT}, + #else + {"INVALID_ARGUMENT", 32, 125}, + #endif + #ifdef BIO_R_INVALID_SOCKET + {"INVALID_SOCKET", ERR_LIB_BIO, BIO_R_INVALID_SOCKET}, + #else + {"INVALID_SOCKET", 32, 135}, + #endif + #ifdef BIO_R_IN_USE + {"IN_USE", ERR_LIB_BIO, BIO_R_IN_USE}, + #else + {"IN_USE", 32, 123}, + #endif + #ifdef BIO_R_LENGTH_TOO_LONG + {"LENGTH_TOO_LONG", ERR_LIB_BIO, BIO_R_LENGTH_TOO_LONG}, + #else + {"LENGTH_TOO_LONG", 32, 102}, + #endif + #ifdef BIO_R_LISTEN_V6_ONLY + {"LISTEN_V6_ONLY", ERR_LIB_BIO, BIO_R_LISTEN_V6_ONLY}, + #else + {"LISTEN_V6_ONLY", 32, 136}, + #endif + #ifdef BIO_R_LOOKUP_RETURNED_NOTHING + {"LOOKUP_RETURNED_NOTHING", ERR_LIB_BIO, BIO_R_LOOKUP_RETURNED_NOTHING}, + #else + {"LOOKUP_RETURNED_NOTHING", 32, 142}, + #endif + #ifdef BIO_R_MALFORMED_HOST_OR_SERVICE + {"MALFORMED_HOST_OR_SERVICE", ERR_LIB_BIO, BIO_R_MALFORMED_HOST_OR_SERVICE}, + #else + {"MALFORMED_HOST_OR_SERVICE", 32, 130}, + #endif + #ifdef BIO_R_NBIO_CONNECT_ERROR + {"NBIO_CONNECT_ERROR", ERR_LIB_BIO, BIO_R_NBIO_CONNECT_ERROR}, + #else + {"NBIO_CONNECT_ERROR", 32, 110}, + #endif + #ifdef BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED + {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED}, + #else + {"NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED", 32, 143}, + #endif + #ifdef BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED + {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", ERR_LIB_BIO, BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED}, + #else + {"NO_HOSTNAME_OR_SERVICE_SPECIFIED", 32, 144}, + #endif + #ifdef BIO_R_NO_PORT_DEFINED + {"NO_PORT_DEFINED", ERR_LIB_BIO, BIO_R_NO_PORT_DEFINED}, + #else + {"NO_PORT_DEFINED", 32, 113}, + #endif + #ifdef BIO_R_NO_SUCH_FILE + {"NO_SUCH_FILE", ERR_LIB_BIO, BIO_R_NO_SUCH_FILE}, + #else + {"NO_SUCH_FILE", 32, 128}, + #endif + #ifdef BIO_R_TRANSFER_ERROR + {"TRANSFER_ERROR", ERR_LIB_BIO, BIO_R_TRANSFER_ERROR}, + #else + {"TRANSFER_ERROR", 32, 104}, + #endif + #ifdef BIO_R_TRANSFER_TIMEOUT + {"TRANSFER_TIMEOUT", ERR_LIB_BIO, BIO_R_TRANSFER_TIMEOUT}, + #else + {"TRANSFER_TIMEOUT", 32, 105}, + #endif + #ifdef BIO_R_UNABLE_TO_BIND_SOCKET + {"UNABLE_TO_BIND_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_BIND_SOCKET}, + #else + {"UNABLE_TO_BIND_SOCKET", 32, 117}, + #endif + #ifdef BIO_R_UNABLE_TO_CREATE_SOCKET + {"UNABLE_TO_CREATE_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_CREATE_SOCKET}, + #else + {"UNABLE_TO_CREATE_SOCKET", 32, 118}, + #endif + #ifdef BIO_R_UNABLE_TO_KEEPALIVE + {"UNABLE_TO_KEEPALIVE", ERR_LIB_BIO, BIO_R_UNABLE_TO_KEEPALIVE}, + #else + {"UNABLE_TO_KEEPALIVE", 32, 137}, + #endif + #ifdef BIO_R_UNABLE_TO_LISTEN_SOCKET + {"UNABLE_TO_LISTEN_SOCKET", ERR_LIB_BIO, BIO_R_UNABLE_TO_LISTEN_SOCKET}, + #else + {"UNABLE_TO_LISTEN_SOCKET", 32, 119}, + #endif + #ifdef BIO_R_UNABLE_TO_NODELAY + {"UNABLE_TO_NODELAY", ERR_LIB_BIO, BIO_R_UNABLE_TO_NODELAY}, + #else + {"UNABLE_TO_NODELAY", 32, 138}, + #endif + #ifdef BIO_R_UNABLE_TO_REUSEADDR + {"UNABLE_TO_REUSEADDR", ERR_LIB_BIO, BIO_R_UNABLE_TO_REUSEADDR}, + #else + {"UNABLE_TO_REUSEADDR", 32, 139}, + #endif + #ifdef BIO_R_UNAVAILABLE_IP_FAMILY + {"UNAVAILABLE_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNAVAILABLE_IP_FAMILY}, + #else + {"UNAVAILABLE_IP_FAMILY", 32, 145}, + #endif + #ifdef BIO_R_UNINITIALIZED + {"UNINITIALIZED", ERR_LIB_BIO, BIO_R_UNINITIALIZED}, + #else + {"UNINITIALIZED", 32, 120}, + #endif + #ifdef BIO_R_UNKNOWN_INFO_TYPE + {"UNKNOWN_INFO_TYPE", ERR_LIB_BIO, BIO_R_UNKNOWN_INFO_TYPE}, + #else + {"UNKNOWN_INFO_TYPE", 32, 140}, + #endif + #ifdef BIO_R_UNSUPPORTED_IP_FAMILY + {"UNSUPPORTED_IP_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_IP_FAMILY}, + #else + {"UNSUPPORTED_IP_FAMILY", 32, 146}, + #endif + #ifdef BIO_R_UNSUPPORTED_METHOD + {"UNSUPPORTED_METHOD", ERR_LIB_BIO, BIO_R_UNSUPPORTED_METHOD}, + #else + {"UNSUPPORTED_METHOD", 32, 121}, + #endif + #ifdef BIO_R_UNSUPPORTED_PROTOCOL_FAMILY + {"UNSUPPORTED_PROTOCOL_FAMILY", ERR_LIB_BIO, BIO_R_UNSUPPORTED_PROTOCOL_FAMILY}, + #else + {"UNSUPPORTED_PROTOCOL_FAMILY", 32, 131}, + #endif + #ifdef BIO_R_WRITE_TO_READ_ONLY_BIO + {"WRITE_TO_READ_ONLY_BIO", ERR_LIB_BIO, BIO_R_WRITE_TO_READ_ONLY_BIO}, + #else + {"WRITE_TO_READ_ONLY_BIO", 32, 126}, + #endif + #ifdef BIO_R_WSASTARTUP + {"WSASTARTUP", ERR_LIB_BIO, BIO_R_WSASTARTUP}, + #else + {"WSASTARTUP", 32, 122}, + #endif + #ifdef BN_R_ARG2_LT_ARG3 + {"ARG2_LT_ARG3", ERR_LIB_BN, BN_R_ARG2_LT_ARG3}, + #else + {"ARG2_LT_ARG3", 3, 100}, + #endif + #ifdef BN_R_BAD_RECIPROCAL + {"BAD_RECIPROCAL", ERR_LIB_BN, BN_R_BAD_RECIPROCAL}, + #else + {"BAD_RECIPROCAL", 3, 101}, + #endif + #ifdef BN_R_BIGNUM_TOO_LONG + {"BIGNUM_TOO_LONG", ERR_LIB_BN, BN_R_BIGNUM_TOO_LONG}, + #else + {"BIGNUM_TOO_LONG", 3, 114}, + #endif + #ifdef BN_R_BITS_TOO_SMALL + {"BITS_TOO_SMALL", ERR_LIB_BN, BN_R_BITS_TOO_SMALL}, + #else + {"BITS_TOO_SMALL", 3, 118}, + #endif + #ifdef BN_R_CALLED_WITH_EVEN_MODULUS + {"CALLED_WITH_EVEN_MODULUS", ERR_LIB_BN, BN_R_CALLED_WITH_EVEN_MODULUS}, + #else + {"CALLED_WITH_EVEN_MODULUS", 3, 102}, + #endif + #ifdef BN_R_DIV_BY_ZERO + {"DIV_BY_ZERO", ERR_LIB_BN, BN_R_DIV_BY_ZERO}, + #else + {"DIV_BY_ZERO", 3, 103}, + #endif + #ifdef BN_R_ENCODING_ERROR + {"ENCODING_ERROR", ERR_LIB_BN, BN_R_ENCODING_ERROR}, + #else + {"ENCODING_ERROR", 3, 104}, + #endif + #ifdef BN_R_EXPAND_ON_STATIC_BIGNUM_DATA + {"EXPAND_ON_STATIC_BIGNUM_DATA", ERR_LIB_BN, BN_R_EXPAND_ON_STATIC_BIGNUM_DATA}, + #else + {"EXPAND_ON_STATIC_BIGNUM_DATA", 3, 105}, + #endif + #ifdef BN_R_INPUT_NOT_REDUCED + {"INPUT_NOT_REDUCED", ERR_LIB_BN, BN_R_INPUT_NOT_REDUCED}, + #else + {"INPUT_NOT_REDUCED", 3, 110}, + #endif + #ifdef BN_R_INVALID_LENGTH + {"INVALID_LENGTH", ERR_LIB_BN, BN_R_INVALID_LENGTH}, + #else + {"INVALID_LENGTH", 3, 106}, + #endif + #ifdef BN_R_INVALID_RANGE + {"INVALID_RANGE", ERR_LIB_BN, BN_R_INVALID_RANGE}, + #else + {"INVALID_RANGE", 3, 115}, + #endif + #ifdef BN_R_INVALID_SHIFT + {"INVALID_SHIFT", ERR_LIB_BN, BN_R_INVALID_SHIFT}, + #else + {"INVALID_SHIFT", 3, 119}, + #endif + #ifdef BN_R_NOT_A_SQUARE + {"NOT_A_SQUARE", ERR_LIB_BN, BN_R_NOT_A_SQUARE}, + #else + {"NOT_A_SQUARE", 3, 111}, + #endif + #ifdef BN_R_NOT_INITIALIZED + {"NOT_INITIALIZED", ERR_LIB_BN, BN_R_NOT_INITIALIZED}, + #else + {"NOT_INITIALIZED", 3, 107}, + #endif + #ifdef BN_R_NO_INVERSE + {"NO_INVERSE", ERR_LIB_BN, BN_R_NO_INVERSE}, + #else + {"NO_INVERSE", 3, 108}, + #endif + #ifdef BN_R_NO_SOLUTION + {"NO_SOLUTION", ERR_LIB_BN, BN_R_NO_SOLUTION}, + #else + {"NO_SOLUTION", 3, 116}, + #endif + #ifdef BN_R_NO_SUITABLE_DIGEST + {"NO_SUITABLE_DIGEST", ERR_LIB_BN, BN_R_NO_SUITABLE_DIGEST}, + #else + {"NO_SUITABLE_DIGEST", 3, 120}, + #endif + #ifdef BN_R_PRIVATE_KEY_TOO_LARGE + {"PRIVATE_KEY_TOO_LARGE", ERR_LIB_BN, BN_R_PRIVATE_KEY_TOO_LARGE}, + #else + {"PRIVATE_KEY_TOO_LARGE", 3, 117}, + #endif + #ifdef BN_R_P_IS_NOT_PRIME + {"P_IS_NOT_PRIME", ERR_LIB_BN, BN_R_P_IS_NOT_PRIME}, + #else + {"P_IS_NOT_PRIME", 3, 112}, + #endif + #ifdef BN_R_TOO_MANY_ITERATIONS + {"TOO_MANY_ITERATIONS", ERR_LIB_BN, BN_R_TOO_MANY_ITERATIONS}, + #else + {"TOO_MANY_ITERATIONS", 3, 113}, + #endif + #ifdef BN_R_TOO_MANY_TEMPORARY_VARIABLES + {"TOO_MANY_TEMPORARY_VARIABLES", ERR_LIB_BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES}, + #else + {"TOO_MANY_TEMPORARY_VARIABLES", 3, 109}, + #endif + #ifdef CMP_R_ALGORITHM_NOT_SUPPORTED + {"ALGORITHM_NOT_SUPPORTED", ERR_LIB_CMP, CMP_R_ALGORITHM_NOT_SUPPORTED}, + #else + {"ALGORITHM_NOT_SUPPORTED", 58, 139}, + #endif + #ifdef CMP_R_BAD_CHECKAFTER_IN_POLLREP + {"BAD_CHECKAFTER_IN_POLLREP", ERR_LIB_CMP, CMP_R_BAD_CHECKAFTER_IN_POLLREP}, + #else + {"BAD_CHECKAFTER_IN_POLLREP", 58, 167}, + #endif + #ifdef CMP_R_BAD_REQUEST_ID + {"BAD_REQUEST_ID", ERR_LIB_CMP, CMP_R_BAD_REQUEST_ID}, + #else + {"BAD_REQUEST_ID", 58, 108}, + #endif + #ifdef CMP_R_CERTHASH_UNMATCHED + {"CERTHASH_UNMATCHED", ERR_LIB_CMP, CMP_R_CERTHASH_UNMATCHED}, + #else + {"CERTHASH_UNMATCHED", 58, 156}, + #endif + #ifdef CMP_R_CERTID_NOT_FOUND + {"CERTID_NOT_FOUND", ERR_LIB_CMP, CMP_R_CERTID_NOT_FOUND}, + #else + {"CERTID_NOT_FOUND", 58, 109}, + #endif + #ifdef CMP_R_CERTIFICATE_NOT_ACCEPTED + {"CERTIFICATE_NOT_ACCEPTED", ERR_LIB_CMP, CMP_R_CERTIFICATE_NOT_ACCEPTED}, + #else + {"CERTIFICATE_NOT_ACCEPTED", 58, 169}, + #endif + #ifdef CMP_R_CERTIFICATE_NOT_FOUND + {"CERTIFICATE_NOT_FOUND", ERR_LIB_CMP, CMP_R_CERTIFICATE_NOT_FOUND}, + #else + {"CERTIFICATE_NOT_FOUND", 58, 112}, + #endif + #ifdef CMP_R_CERTREQMSG_NOT_FOUND + {"CERTREQMSG_NOT_FOUND", ERR_LIB_CMP, CMP_R_CERTREQMSG_NOT_FOUND}, + #else + {"CERTREQMSG_NOT_FOUND", 58, 157}, + #endif + #ifdef CMP_R_CERTRESPONSE_NOT_FOUND + {"CERTRESPONSE_NOT_FOUND", ERR_LIB_CMP, CMP_R_CERTRESPONSE_NOT_FOUND}, + #else + {"CERTRESPONSE_NOT_FOUND", 58, 113}, + #endif + #ifdef CMP_R_CERT_AND_KEY_DO_NOT_MATCH + {"CERT_AND_KEY_DO_NOT_MATCH", ERR_LIB_CMP, CMP_R_CERT_AND_KEY_DO_NOT_MATCH}, + #else + {"CERT_AND_KEY_DO_NOT_MATCH", 58, 114}, + #endif + #ifdef CMP_R_CHECKAFTER_OUT_OF_RANGE + {"CHECKAFTER_OUT_OF_RANGE", ERR_LIB_CMP, CMP_R_CHECKAFTER_OUT_OF_RANGE}, + #else + {"CHECKAFTER_OUT_OF_RANGE", 58, 181}, + #endif + #ifdef CMP_R_ENCOUNTERED_KEYUPDATEWARNING + {"ENCOUNTERED_KEYUPDATEWARNING", ERR_LIB_CMP, CMP_R_ENCOUNTERED_KEYUPDATEWARNING}, + #else + {"ENCOUNTERED_KEYUPDATEWARNING", 58, 176}, + #endif + #ifdef CMP_R_ENCOUNTERED_WAITING + {"ENCOUNTERED_WAITING", ERR_LIB_CMP, CMP_R_ENCOUNTERED_WAITING}, + #else + {"ENCOUNTERED_WAITING", 58, 162}, + #endif + #ifdef CMP_R_ERROR_CALCULATING_PROTECTION + {"ERROR_CALCULATING_PROTECTION", ERR_LIB_CMP, CMP_R_ERROR_CALCULATING_PROTECTION}, + #else + {"ERROR_CALCULATING_PROTECTION", 58, 115}, + #endif + #ifdef CMP_R_ERROR_CREATING_CERTCONF + {"ERROR_CREATING_CERTCONF", ERR_LIB_CMP, CMP_R_ERROR_CREATING_CERTCONF}, + #else + {"ERROR_CREATING_CERTCONF", 58, 116}, + #endif + #ifdef CMP_R_ERROR_CREATING_CERTREP + {"ERROR_CREATING_CERTREP", ERR_LIB_CMP, CMP_R_ERROR_CREATING_CERTREP}, + #else + {"ERROR_CREATING_CERTREP", 58, 117}, + #endif + #ifdef CMP_R_ERROR_CREATING_CERTREQ + {"ERROR_CREATING_CERTREQ", ERR_LIB_CMP, CMP_R_ERROR_CREATING_CERTREQ}, + #else + {"ERROR_CREATING_CERTREQ", 58, 163}, + #endif + #ifdef CMP_R_ERROR_CREATING_ERROR + {"ERROR_CREATING_ERROR", ERR_LIB_CMP, CMP_R_ERROR_CREATING_ERROR}, + #else + {"ERROR_CREATING_ERROR", 58, 118}, + #endif + #ifdef CMP_R_ERROR_CREATING_GENM + {"ERROR_CREATING_GENM", ERR_LIB_CMP, CMP_R_ERROR_CREATING_GENM}, + #else + {"ERROR_CREATING_GENM", 58, 119}, + #endif + #ifdef CMP_R_ERROR_CREATING_GENP + {"ERROR_CREATING_GENP", ERR_LIB_CMP, CMP_R_ERROR_CREATING_GENP}, + #else + {"ERROR_CREATING_GENP", 58, 120}, + #endif + #ifdef CMP_R_ERROR_CREATING_PKICONF + {"ERROR_CREATING_PKICONF", ERR_LIB_CMP, CMP_R_ERROR_CREATING_PKICONF}, + #else + {"ERROR_CREATING_PKICONF", 58, 122}, + #endif + #ifdef CMP_R_ERROR_CREATING_POLLREP + {"ERROR_CREATING_POLLREP", ERR_LIB_CMP, CMP_R_ERROR_CREATING_POLLREP}, + #else + {"ERROR_CREATING_POLLREP", 58, 123}, + #endif + #ifdef CMP_R_ERROR_CREATING_POLLREQ + {"ERROR_CREATING_POLLREQ", ERR_LIB_CMP, CMP_R_ERROR_CREATING_POLLREQ}, + #else + {"ERROR_CREATING_POLLREQ", 58, 124}, + #endif + #ifdef CMP_R_ERROR_CREATING_RP + {"ERROR_CREATING_RP", ERR_LIB_CMP, CMP_R_ERROR_CREATING_RP}, + #else + {"ERROR_CREATING_RP", 58, 125}, + #endif + #ifdef CMP_R_ERROR_CREATING_RR + {"ERROR_CREATING_RR", ERR_LIB_CMP, CMP_R_ERROR_CREATING_RR}, + #else + {"ERROR_CREATING_RR", 58, 126}, + #endif + #ifdef CMP_R_ERROR_PARSING_PKISTATUS + {"ERROR_PARSING_PKISTATUS", ERR_LIB_CMP, CMP_R_ERROR_PARSING_PKISTATUS}, + #else + {"ERROR_PARSING_PKISTATUS", 58, 107}, + #endif + #ifdef CMP_R_ERROR_PROCESSING_MESSAGE + {"ERROR_PROCESSING_MESSAGE", ERR_LIB_CMP, CMP_R_ERROR_PROCESSING_MESSAGE}, + #else + {"ERROR_PROCESSING_MESSAGE", 58, 158}, + #endif + #ifdef CMP_R_ERROR_PROTECTING_MESSAGE + {"ERROR_PROTECTING_MESSAGE", ERR_LIB_CMP, CMP_R_ERROR_PROTECTING_MESSAGE}, + #else + {"ERROR_PROTECTING_MESSAGE", 58, 127}, + #endif + #ifdef CMP_R_ERROR_SETTING_CERTHASH + {"ERROR_SETTING_CERTHASH", ERR_LIB_CMP, CMP_R_ERROR_SETTING_CERTHASH}, + #else + {"ERROR_SETTING_CERTHASH", 58, 128}, + #endif + #ifdef CMP_R_ERROR_UNEXPECTED_CERTCONF + {"ERROR_UNEXPECTED_CERTCONF", ERR_LIB_CMP, CMP_R_ERROR_UNEXPECTED_CERTCONF}, + #else + {"ERROR_UNEXPECTED_CERTCONF", 58, 160}, + #endif + #ifdef CMP_R_ERROR_VALIDATING_PROTECTION + {"ERROR_VALIDATING_PROTECTION", ERR_LIB_CMP, CMP_R_ERROR_VALIDATING_PROTECTION}, + #else + {"ERROR_VALIDATING_PROTECTION", 58, 140}, + #endif + #ifdef CMP_R_ERROR_VALIDATING_SIGNATURE + {"ERROR_VALIDATING_SIGNATURE", ERR_LIB_CMP, CMP_R_ERROR_VALIDATING_SIGNATURE}, + #else + {"ERROR_VALIDATING_SIGNATURE", 58, 171}, + #endif + #ifdef CMP_R_FAILED_BUILDING_OWN_CHAIN + {"FAILED_BUILDING_OWN_CHAIN", ERR_LIB_CMP, CMP_R_FAILED_BUILDING_OWN_CHAIN}, + #else + {"FAILED_BUILDING_OWN_CHAIN", 58, 164}, + #endif + #ifdef CMP_R_FAILED_EXTRACTING_PUBKEY + {"FAILED_EXTRACTING_PUBKEY", ERR_LIB_CMP, CMP_R_FAILED_EXTRACTING_PUBKEY}, + #else + {"FAILED_EXTRACTING_PUBKEY", 58, 141}, + #endif + #ifdef CMP_R_FAILURE_OBTAINING_RANDOM + {"FAILURE_OBTAINING_RANDOM", ERR_LIB_CMP, CMP_R_FAILURE_OBTAINING_RANDOM}, + #else + {"FAILURE_OBTAINING_RANDOM", 58, 110}, + #endif + #ifdef CMP_R_FAIL_INFO_OUT_OF_RANGE + {"FAIL_INFO_OUT_OF_RANGE", ERR_LIB_CMP, CMP_R_FAIL_INFO_OUT_OF_RANGE}, + #else + {"FAIL_INFO_OUT_OF_RANGE", 58, 129}, + #endif + #ifdef CMP_R_INVALID_ARGS + {"INVALID_ARGS", ERR_LIB_CMP, CMP_R_INVALID_ARGS}, + #else + {"INVALID_ARGS", 58, 100}, + #endif + #ifdef CMP_R_INVALID_OPTION + {"INVALID_OPTION", ERR_LIB_CMP, CMP_R_INVALID_OPTION}, + #else + {"INVALID_OPTION", 58, 174}, + #endif + #ifdef CMP_R_MISSING_KEY_INPUT_FOR_CREATING_PROTECTION + {"MISSING_KEY_INPUT_FOR_CREATING_PROTECTION", ERR_LIB_CMP, CMP_R_MISSING_KEY_INPUT_FOR_CREATING_PROTECTION}, + #else + {"MISSING_KEY_INPUT_FOR_CREATING_PROTECTION", 58, 130}, + #endif + #ifdef CMP_R_MISSING_KEY_USAGE_DIGITALSIGNATURE + {"MISSING_KEY_USAGE_DIGITALSIGNATURE", ERR_LIB_CMP, CMP_R_MISSING_KEY_USAGE_DIGITALSIGNATURE}, + #else + {"MISSING_KEY_USAGE_DIGITALSIGNATURE", 58, 142}, + #endif + #ifdef CMP_R_MISSING_P10CSR + {"MISSING_P10CSR", ERR_LIB_CMP, CMP_R_MISSING_P10CSR}, + #else + {"MISSING_P10CSR", 58, 121}, + #endif + #ifdef CMP_R_MISSING_PBM_SECRET + {"MISSING_PBM_SECRET", ERR_LIB_CMP, CMP_R_MISSING_PBM_SECRET}, + #else + {"MISSING_PBM_SECRET", 58, 166}, + #endif + #ifdef CMP_R_MISSING_PRIVATE_KEY + {"MISSING_PRIVATE_KEY", ERR_LIB_CMP, CMP_R_MISSING_PRIVATE_KEY}, + #else + {"MISSING_PRIVATE_KEY", 58, 131}, + #endif + #ifdef CMP_R_MISSING_PROTECTION + {"MISSING_PROTECTION", ERR_LIB_CMP, CMP_R_MISSING_PROTECTION}, + #else + {"MISSING_PROTECTION", 58, 143}, + #endif + #ifdef CMP_R_MISSING_REFERENCE_CERT + {"MISSING_REFERENCE_CERT", ERR_LIB_CMP, CMP_R_MISSING_REFERENCE_CERT}, + #else + {"MISSING_REFERENCE_CERT", 58, 168}, + #endif + #ifdef CMP_R_MISSING_SENDER_IDENTIFICATION + {"MISSING_SENDER_IDENTIFICATION", ERR_LIB_CMP, CMP_R_MISSING_SENDER_IDENTIFICATION}, + #else + {"MISSING_SENDER_IDENTIFICATION", 58, 111}, + #endif + #ifdef CMP_R_MISSING_TRUST_STORE + {"MISSING_TRUST_STORE", ERR_LIB_CMP, CMP_R_MISSING_TRUST_STORE}, + #else + {"MISSING_TRUST_STORE", 58, 144}, + #endif + #ifdef CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED + {"MULTIPLE_REQUESTS_NOT_SUPPORTED", ERR_LIB_CMP, CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED}, + #else + {"MULTIPLE_REQUESTS_NOT_SUPPORTED", 58, 161}, + #endif + #ifdef CMP_R_MULTIPLE_RESPONSES_NOT_SUPPORTED + {"MULTIPLE_RESPONSES_NOT_SUPPORTED", ERR_LIB_CMP, CMP_R_MULTIPLE_RESPONSES_NOT_SUPPORTED}, + #else + {"MULTIPLE_RESPONSES_NOT_SUPPORTED", 58, 170}, + #endif + #ifdef CMP_R_MULTIPLE_SAN_SOURCES + {"MULTIPLE_SAN_SOURCES", ERR_LIB_CMP, CMP_R_MULTIPLE_SAN_SOURCES}, + #else + {"MULTIPLE_SAN_SOURCES", 58, 102}, + #endif + #ifdef CMP_R_NO_STDIO + {"NO_STDIO", ERR_LIB_CMP, CMP_R_NO_STDIO}, + #else + {"NO_STDIO", 58, 194}, + #endif + #ifdef CMP_R_NO_SUITABLE_SENDER_CERT + {"NO_SUITABLE_SENDER_CERT", ERR_LIB_CMP, CMP_R_NO_SUITABLE_SENDER_CERT}, + #else + {"NO_SUITABLE_SENDER_CERT", 58, 145}, + #endif + #ifdef CMP_R_NULL_ARGUMENT + {"NULL_ARGUMENT", ERR_LIB_CMP, CMP_R_NULL_ARGUMENT}, + #else + {"NULL_ARGUMENT", 58, 103}, + #endif + #ifdef CMP_R_PKIBODY_ERROR + {"PKIBODY_ERROR", ERR_LIB_CMP, CMP_R_PKIBODY_ERROR}, + #else + {"PKIBODY_ERROR", 58, 146}, + #endif + #ifdef CMP_R_PKISTATUSINFO_NOT_FOUND + {"PKISTATUSINFO_NOT_FOUND", ERR_LIB_CMP, CMP_R_PKISTATUSINFO_NOT_FOUND}, + #else + {"PKISTATUSINFO_NOT_FOUND", 58, 132}, + #endif + #ifdef CMP_R_POLLING_FAILED + {"POLLING_FAILED", ERR_LIB_CMP, CMP_R_POLLING_FAILED}, + #else + {"POLLING_FAILED", 58, 172}, + #endif + #ifdef CMP_R_POTENTIALLY_INVALID_CERTIFICATE + {"POTENTIALLY_INVALID_CERTIFICATE", ERR_LIB_CMP, CMP_R_POTENTIALLY_INVALID_CERTIFICATE}, + #else + {"POTENTIALLY_INVALID_CERTIFICATE", 58, 147}, + #endif + #ifdef CMP_R_RECEIVED_ERROR + {"RECEIVED_ERROR", ERR_LIB_CMP, CMP_R_RECEIVED_ERROR}, + #else + {"RECEIVED_ERROR", 58, 180}, + #endif + #ifdef CMP_R_RECIPNONCE_UNMATCHED + {"RECIPNONCE_UNMATCHED", ERR_LIB_CMP, CMP_R_RECIPNONCE_UNMATCHED}, + #else + {"RECIPNONCE_UNMATCHED", 58, 148}, + #endif + #ifdef CMP_R_REQUEST_NOT_ACCEPTED + {"REQUEST_NOT_ACCEPTED", ERR_LIB_CMP, CMP_R_REQUEST_NOT_ACCEPTED}, + #else + {"REQUEST_NOT_ACCEPTED", 58, 149}, + #endif + #ifdef CMP_R_REQUEST_REJECTED_BY_SERVER + {"REQUEST_REJECTED_BY_SERVER", ERR_LIB_CMP, CMP_R_REQUEST_REJECTED_BY_SERVER}, + #else + {"REQUEST_REJECTED_BY_SERVER", 58, 182}, + #endif + #ifdef CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED + {"SENDER_GENERALNAME_TYPE_NOT_SUPPORTED", ERR_LIB_CMP, CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED}, + #else + {"SENDER_GENERALNAME_TYPE_NOT_SUPPORTED", 58, 150}, + #endif + #ifdef CMP_R_SRVCERT_DOES_NOT_VALIDATE_MSG + {"SRVCERT_DOES_NOT_VALIDATE_MSG", ERR_LIB_CMP, CMP_R_SRVCERT_DOES_NOT_VALIDATE_MSG}, + #else + {"SRVCERT_DOES_NOT_VALIDATE_MSG", 58, 151}, + #endif + #ifdef CMP_R_TOTAL_TIMEOUT + {"TOTAL_TIMEOUT", ERR_LIB_CMP, CMP_R_TOTAL_TIMEOUT}, + #else + {"TOTAL_TIMEOUT", 58, 184}, + #endif + #ifdef CMP_R_TRANSACTIONID_UNMATCHED + {"TRANSACTIONID_UNMATCHED", ERR_LIB_CMP, CMP_R_TRANSACTIONID_UNMATCHED}, + #else + {"TRANSACTIONID_UNMATCHED", 58, 152}, + #endif + #ifdef CMP_R_TRANSFER_ERROR + {"TRANSFER_ERROR", ERR_LIB_CMP, CMP_R_TRANSFER_ERROR}, + #else + {"TRANSFER_ERROR", 58, 159}, + #endif + #ifdef CMP_R_UNEXPECTED_PKIBODY + {"UNEXPECTED_PKIBODY", ERR_LIB_CMP, CMP_R_UNEXPECTED_PKIBODY}, + #else + {"UNEXPECTED_PKIBODY", 58, 133}, + #endif + #ifdef CMP_R_UNEXPECTED_PKISTATUS + {"UNEXPECTED_PKISTATUS", ERR_LIB_CMP, CMP_R_UNEXPECTED_PKISTATUS}, + #else + {"UNEXPECTED_PKISTATUS", 58, 185}, + #endif + #ifdef CMP_R_UNEXPECTED_PVNO + {"UNEXPECTED_PVNO", ERR_LIB_CMP, CMP_R_UNEXPECTED_PVNO}, + #else + {"UNEXPECTED_PVNO", 58, 153}, + #endif + #ifdef CMP_R_UNKNOWN_ALGORITHM_ID + {"UNKNOWN_ALGORITHM_ID", ERR_LIB_CMP, CMP_R_UNKNOWN_ALGORITHM_ID}, + #else + {"UNKNOWN_ALGORITHM_ID", 58, 134}, + #endif + #ifdef CMP_R_UNKNOWN_CERT_TYPE + {"UNKNOWN_CERT_TYPE", ERR_LIB_CMP, CMP_R_UNKNOWN_CERT_TYPE}, + #else + {"UNKNOWN_CERT_TYPE", 58, 135}, + #endif + #ifdef CMP_R_UNKNOWN_PKISTATUS + {"UNKNOWN_PKISTATUS", ERR_LIB_CMP, CMP_R_UNKNOWN_PKISTATUS}, + #else + {"UNKNOWN_PKISTATUS", 58, 186}, + #endif + #ifdef CMP_R_UNSUPPORTED_ALGORITHM + {"UNSUPPORTED_ALGORITHM", ERR_LIB_CMP, CMP_R_UNSUPPORTED_ALGORITHM}, + #else + {"UNSUPPORTED_ALGORITHM", 58, 136}, + #endif + #ifdef CMP_R_UNSUPPORTED_KEY_TYPE + {"UNSUPPORTED_KEY_TYPE", ERR_LIB_CMP, CMP_R_UNSUPPORTED_KEY_TYPE}, + #else + {"UNSUPPORTED_KEY_TYPE", 58, 137}, + #endif + #ifdef CMP_R_UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC + {"UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC", ERR_LIB_CMP, CMP_R_UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC}, + #else + {"UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC", 58, 154}, + #endif + #ifdef CMP_R_VALUE_TOO_LARGE + {"VALUE_TOO_LARGE", ERR_LIB_CMP, CMP_R_VALUE_TOO_LARGE}, + #else + {"VALUE_TOO_LARGE", 58, 175}, + #endif + #ifdef CMP_R_VALUE_TOO_SMALL + {"VALUE_TOO_SMALL", ERR_LIB_CMP, CMP_R_VALUE_TOO_SMALL}, + #else + {"VALUE_TOO_SMALL", 58, 177}, + #endif + #ifdef CMP_R_WRONG_ALGORITHM_OID + {"WRONG_ALGORITHM_OID", ERR_LIB_CMP, CMP_R_WRONG_ALGORITHM_OID}, + #else + {"WRONG_ALGORITHM_OID", 58, 138}, + #endif + #ifdef CMP_R_WRONG_CERTID_IN_RP + {"WRONG_CERTID_IN_RP", ERR_LIB_CMP, CMP_R_WRONG_CERTID_IN_RP}, + #else + {"WRONG_CERTID_IN_RP", 58, 187}, + #endif + #ifdef CMP_R_WRONG_PBM_VALUE + {"WRONG_PBM_VALUE", ERR_LIB_CMP, CMP_R_WRONG_PBM_VALUE}, + #else + {"WRONG_PBM_VALUE", 58, 155}, + #endif + #ifdef CMP_R_WRONG_RP_COMPONENT_COUNT + {"WRONG_RP_COMPONENT_COUNT", ERR_LIB_CMP, CMP_R_WRONG_RP_COMPONENT_COUNT}, + #else + {"WRONG_RP_COMPONENT_COUNT", 58, 188}, + #endif + #ifdef CMP_R_WRONG_SERIAL_IN_RP + {"WRONG_SERIAL_IN_RP", ERR_LIB_CMP, CMP_R_WRONG_SERIAL_IN_RP}, + #else + {"WRONG_SERIAL_IN_RP", 58, 173}, + #endif + #ifdef CMS_R_ADD_SIGNER_ERROR + {"ADD_SIGNER_ERROR", ERR_LIB_CMS, CMS_R_ADD_SIGNER_ERROR}, + #else + {"ADD_SIGNER_ERROR", 46, 99}, + #endif + #ifdef CMS_R_ATTRIBUTE_ERROR + {"ATTRIBUTE_ERROR", ERR_LIB_CMS, CMS_R_ATTRIBUTE_ERROR}, + #else + {"ATTRIBUTE_ERROR", 46, 161}, + #endif + #ifdef CMS_R_CERTIFICATE_ALREADY_PRESENT + {"CERTIFICATE_ALREADY_PRESENT", ERR_LIB_CMS, CMS_R_CERTIFICATE_ALREADY_PRESENT}, + #else + {"CERTIFICATE_ALREADY_PRESENT", 46, 175}, + #endif + #ifdef CMS_R_CERTIFICATE_HAS_NO_KEYID + {"CERTIFICATE_HAS_NO_KEYID", ERR_LIB_CMS, CMS_R_CERTIFICATE_HAS_NO_KEYID}, + #else + {"CERTIFICATE_HAS_NO_KEYID", 46, 160}, + #endif + #ifdef CMS_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CERTIFICATE_VERIFY_ERROR}, + #else + {"CERTIFICATE_VERIFY_ERROR", 46, 100}, + #endif + #ifdef CMS_R_CIPHER_AEAD_SET_TAG_ERROR + {"CIPHER_AEAD_SET_TAG_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_AEAD_SET_TAG_ERROR}, + #else + {"CIPHER_AEAD_SET_TAG_ERROR", 46, 184}, + #endif + #ifdef CMS_R_CIPHER_GET_TAG + {"CIPHER_GET_TAG", ERR_LIB_CMS, CMS_R_CIPHER_GET_TAG}, + #else + {"CIPHER_GET_TAG", 46, 185}, + #endif + #ifdef CMS_R_CIPHER_INITIALISATION_ERROR + {"CIPHER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_INITIALISATION_ERROR}, + #else + {"CIPHER_INITIALISATION_ERROR", 46, 101}, + #endif + #ifdef CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR + {"CIPHER_PARAMETER_INITIALISATION_ERROR", ERR_LIB_CMS, CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR}, + #else + {"CIPHER_PARAMETER_INITIALISATION_ERROR", 46, 102}, + #endif + #ifdef CMS_R_CMS_DATAFINAL_ERROR + {"CMS_DATAFINAL_ERROR", ERR_LIB_CMS, CMS_R_CMS_DATAFINAL_ERROR}, + #else + {"CMS_DATAFINAL_ERROR", 46, 103}, + #endif + #ifdef CMS_R_CMS_LIB + {"CMS_LIB", ERR_LIB_CMS, CMS_R_CMS_LIB}, + #else + {"CMS_LIB", 46, 104}, + #endif + #ifdef CMS_R_CONTENTIDENTIFIER_MISMATCH + {"CONTENTIDENTIFIER_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENTIDENTIFIER_MISMATCH}, + #else + {"CONTENTIDENTIFIER_MISMATCH", 46, 170}, + #endif + #ifdef CMS_R_CONTENT_NOT_FOUND + {"CONTENT_NOT_FOUND", ERR_LIB_CMS, CMS_R_CONTENT_NOT_FOUND}, + #else + {"CONTENT_NOT_FOUND", 46, 105}, + #endif + #ifdef CMS_R_CONTENT_TYPE_MISMATCH + {"CONTENT_TYPE_MISMATCH", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_MISMATCH}, + #else + {"CONTENT_TYPE_MISMATCH", 46, 171}, + #endif + #ifdef CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA + {"CONTENT_TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA}, + #else + {"CONTENT_TYPE_NOT_COMPRESSED_DATA", 46, 106}, + #endif + #ifdef CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA + {"CONTENT_TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA}, + #else + {"CONTENT_TYPE_NOT_ENVELOPED_DATA", 46, 107}, + #endif + #ifdef CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA + {"CONTENT_TYPE_NOT_SIGNED_DATA", ERR_LIB_CMS, CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA}, + #else + {"CONTENT_TYPE_NOT_SIGNED_DATA", 46, 108}, + #endif + #ifdef CMS_R_CONTENT_VERIFY_ERROR + {"CONTENT_VERIFY_ERROR", ERR_LIB_CMS, CMS_R_CONTENT_VERIFY_ERROR}, + #else + {"CONTENT_VERIFY_ERROR", 46, 109}, + #endif + #ifdef CMS_R_CTRL_ERROR + {"CTRL_ERROR", ERR_LIB_CMS, CMS_R_CTRL_ERROR}, + #else + {"CTRL_ERROR", 46, 110}, + #endif + #ifdef CMS_R_CTRL_FAILURE + {"CTRL_FAILURE", ERR_LIB_CMS, CMS_R_CTRL_FAILURE}, + #else + {"CTRL_FAILURE", 46, 111}, + #endif + #ifdef CMS_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_CMS, CMS_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", 46, 187}, + #endif + #ifdef CMS_R_DECRYPT_ERROR + {"DECRYPT_ERROR", ERR_LIB_CMS, CMS_R_DECRYPT_ERROR}, + #else + {"DECRYPT_ERROR", 46, 112}, + #endif + #ifdef CMS_R_ERROR_GETTING_PUBLIC_KEY + {"ERROR_GETTING_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_ERROR_GETTING_PUBLIC_KEY}, + #else + {"ERROR_GETTING_PUBLIC_KEY", 46, 113}, + #endif + #ifdef CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE + {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", ERR_LIB_CMS, CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE}, + #else + {"ERROR_READING_MESSAGEDIGEST_ATTRIBUTE", 46, 114}, + #endif + #ifdef CMS_R_ERROR_SETTING_KEY + {"ERROR_SETTING_KEY", ERR_LIB_CMS, CMS_R_ERROR_SETTING_KEY}, + #else + {"ERROR_SETTING_KEY", 46, 115}, + #endif + #ifdef CMS_R_ERROR_SETTING_RECIPIENTINFO + {"ERROR_SETTING_RECIPIENTINFO", ERR_LIB_CMS, CMS_R_ERROR_SETTING_RECIPIENTINFO}, + #else + {"ERROR_SETTING_RECIPIENTINFO", 46, 116}, + #endif + #ifdef CMS_R_ESS_SIGNING_CERTID_MISMATCH_ERROR + {"ESS_SIGNING_CERTID_MISMATCH_ERROR", ERR_LIB_CMS, CMS_R_ESS_SIGNING_CERTID_MISMATCH_ERROR}, + #else + {"ESS_SIGNING_CERTID_MISMATCH_ERROR", 46, 183}, + #endif + #ifdef CMS_R_INVALID_ENCRYPTED_KEY_LENGTH + {"INVALID_ENCRYPTED_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_ENCRYPTED_KEY_LENGTH}, + #else + {"INVALID_ENCRYPTED_KEY_LENGTH", 46, 117}, + #endif + #ifdef CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER + {"INVALID_KEY_ENCRYPTION_PARAMETER", ERR_LIB_CMS, CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER}, + #else + {"INVALID_KEY_ENCRYPTION_PARAMETER", 46, 176}, + #endif + #ifdef CMS_R_INVALID_KEY_LENGTH + {"INVALID_KEY_LENGTH", ERR_LIB_CMS, CMS_R_INVALID_KEY_LENGTH}, + #else + {"INVALID_KEY_LENGTH", 46, 118}, + #endif + #ifdef CMS_R_INVALID_LABEL + {"INVALID_LABEL", ERR_LIB_CMS, CMS_R_INVALID_LABEL}, + #else + {"INVALID_LABEL", 46, 190}, + #endif + #ifdef CMS_R_INVALID_OAEP_PARAMETERS + {"INVALID_OAEP_PARAMETERS", ERR_LIB_CMS, CMS_R_INVALID_OAEP_PARAMETERS}, + #else + {"INVALID_OAEP_PARAMETERS", 46, 191}, + #endif + #ifdef CMS_R_KDF_PARAMETER_ERROR + {"KDF_PARAMETER_ERROR", ERR_LIB_CMS, CMS_R_KDF_PARAMETER_ERROR}, + #else + {"KDF_PARAMETER_ERROR", 46, 186}, + #endif + #ifdef CMS_R_MD_BIO_INIT_ERROR + {"MD_BIO_INIT_ERROR", ERR_LIB_CMS, CMS_R_MD_BIO_INIT_ERROR}, + #else + {"MD_BIO_INIT_ERROR", 46, 119}, + #endif + #ifdef CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH + {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH}, + #else + {"MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH", 46, 120}, + #endif + #ifdef CMS_R_MESSAGEDIGEST_WRONG_LENGTH + {"MESSAGEDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MESSAGEDIGEST_WRONG_LENGTH}, + #else + {"MESSAGEDIGEST_WRONG_LENGTH", 46, 121}, + #endif + #ifdef CMS_R_MSGSIGDIGEST_ERROR + {"MSGSIGDIGEST_ERROR", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_ERROR}, + #else + {"MSGSIGDIGEST_ERROR", 46, 172}, + #endif + #ifdef CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE + {"MSGSIGDIGEST_VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE}, + #else + {"MSGSIGDIGEST_VERIFICATION_FAILURE", 46, 162}, + #endif + #ifdef CMS_R_MSGSIGDIGEST_WRONG_LENGTH + {"MSGSIGDIGEST_WRONG_LENGTH", ERR_LIB_CMS, CMS_R_MSGSIGDIGEST_WRONG_LENGTH}, + #else + {"MSGSIGDIGEST_WRONG_LENGTH", 46, 163}, + #endif + #ifdef CMS_R_NEED_ONE_SIGNER + {"NEED_ONE_SIGNER", ERR_LIB_CMS, CMS_R_NEED_ONE_SIGNER}, + #else + {"NEED_ONE_SIGNER", 46, 164}, + #endif + #ifdef CMS_R_NOT_A_SIGNED_RECEIPT + {"NOT_A_SIGNED_RECEIPT", ERR_LIB_CMS, CMS_R_NOT_A_SIGNED_RECEIPT}, + #else + {"NOT_A_SIGNED_RECEIPT", 46, 165}, + #endif + #ifdef CMS_R_NOT_ENCRYPTED_DATA + {"NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_NOT_ENCRYPTED_DATA}, + #else + {"NOT_ENCRYPTED_DATA", 46, 122}, + #endif + #ifdef CMS_R_NOT_KEK + {"NOT_KEK", ERR_LIB_CMS, CMS_R_NOT_KEK}, + #else + {"NOT_KEK", 46, 123}, + #endif + #ifdef CMS_R_NOT_KEY_AGREEMENT + {"NOT_KEY_AGREEMENT", ERR_LIB_CMS, CMS_R_NOT_KEY_AGREEMENT}, + #else + {"NOT_KEY_AGREEMENT", 46, 181}, + #endif + #ifdef CMS_R_NOT_KEY_TRANSPORT + {"NOT_KEY_TRANSPORT", ERR_LIB_CMS, CMS_R_NOT_KEY_TRANSPORT}, + #else + {"NOT_KEY_TRANSPORT", 46, 124}, + #endif + #ifdef CMS_R_NOT_PWRI + {"NOT_PWRI", ERR_LIB_CMS, CMS_R_NOT_PWRI}, + #else + {"NOT_PWRI", 46, 177}, + #endif + #ifdef CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE + {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_CMS, CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, + #else + {"NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 46, 125}, + #endif + #ifdef CMS_R_NO_CIPHER + {"NO_CIPHER", ERR_LIB_CMS, CMS_R_NO_CIPHER}, + #else + {"NO_CIPHER", 46, 126}, + #endif + #ifdef CMS_R_NO_CONTENT + {"NO_CONTENT", ERR_LIB_CMS, CMS_R_NO_CONTENT}, + #else + {"NO_CONTENT", 46, 127}, + #endif + #ifdef CMS_R_NO_CONTENT_TYPE + {"NO_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_NO_CONTENT_TYPE}, + #else + {"NO_CONTENT_TYPE", 46, 173}, + #endif + #ifdef CMS_R_NO_DEFAULT_DIGEST + {"NO_DEFAULT_DIGEST", ERR_LIB_CMS, CMS_R_NO_DEFAULT_DIGEST}, + #else + {"NO_DEFAULT_DIGEST", 46, 128}, + #endif + #ifdef CMS_R_NO_DIGEST_SET + {"NO_DIGEST_SET", ERR_LIB_CMS, CMS_R_NO_DIGEST_SET}, + #else + {"NO_DIGEST_SET", 46, 129}, + #endif + #ifdef CMS_R_NO_KEY + {"NO_KEY", ERR_LIB_CMS, CMS_R_NO_KEY}, + #else + {"NO_KEY", 46, 130}, + #endif + #ifdef CMS_R_NO_KEY_OR_CERT + {"NO_KEY_OR_CERT", ERR_LIB_CMS, CMS_R_NO_KEY_OR_CERT}, + #else + {"NO_KEY_OR_CERT", 46, 174}, + #endif + #ifdef CMS_R_NO_MATCHING_DIGEST + {"NO_MATCHING_DIGEST", ERR_LIB_CMS, CMS_R_NO_MATCHING_DIGEST}, + #else + {"NO_MATCHING_DIGEST", 46, 131}, + #endif + #ifdef CMS_R_NO_MATCHING_RECIPIENT + {"NO_MATCHING_RECIPIENT", ERR_LIB_CMS, CMS_R_NO_MATCHING_RECIPIENT}, + #else + {"NO_MATCHING_RECIPIENT", 46, 132}, + #endif + #ifdef CMS_R_NO_MATCHING_SIGNATURE + {"NO_MATCHING_SIGNATURE", ERR_LIB_CMS, CMS_R_NO_MATCHING_SIGNATURE}, + #else + {"NO_MATCHING_SIGNATURE", 46, 166}, + #endif + #ifdef CMS_R_NO_MSGSIGDIGEST + {"NO_MSGSIGDIGEST", ERR_LIB_CMS, CMS_R_NO_MSGSIGDIGEST}, + #else + {"NO_MSGSIGDIGEST", 46, 167}, + #endif + #ifdef CMS_R_NO_PASSWORD + {"NO_PASSWORD", ERR_LIB_CMS, CMS_R_NO_PASSWORD}, + #else + {"NO_PASSWORD", 46, 178}, + #endif + #ifdef CMS_R_NO_PRIVATE_KEY + {"NO_PRIVATE_KEY", ERR_LIB_CMS, CMS_R_NO_PRIVATE_KEY}, + #else + {"NO_PRIVATE_KEY", 46, 133}, + #endif + #ifdef CMS_R_NO_PUBLIC_KEY + {"NO_PUBLIC_KEY", ERR_LIB_CMS, CMS_R_NO_PUBLIC_KEY}, + #else + {"NO_PUBLIC_KEY", 46, 134}, + #endif + #ifdef CMS_R_NO_RECEIPT_REQUEST + {"NO_RECEIPT_REQUEST", ERR_LIB_CMS, CMS_R_NO_RECEIPT_REQUEST}, + #else + {"NO_RECEIPT_REQUEST", 46, 168}, + #endif + #ifdef CMS_R_NO_SIGNERS + {"NO_SIGNERS", ERR_LIB_CMS, CMS_R_NO_SIGNERS}, + #else + {"NO_SIGNERS", 46, 135}, + #endif + #ifdef CMS_R_PEER_KEY_ERROR + {"PEER_KEY_ERROR", ERR_LIB_CMS, CMS_R_PEER_KEY_ERROR}, + #else + {"PEER_KEY_ERROR", 46, 188}, + #endif + #ifdef CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_CMS, CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, + #else + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 46, 136}, + #endif + #ifdef CMS_R_RECEIPT_DECODE_ERROR + {"RECEIPT_DECODE_ERROR", ERR_LIB_CMS, CMS_R_RECEIPT_DECODE_ERROR}, + #else + {"RECEIPT_DECODE_ERROR", 46, 169}, + #endif + #ifdef CMS_R_RECIPIENT_ERROR + {"RECIPIENT_ERROR", ERR_LIB_CMS, CMS_R_RECIPIENT_ERROR}, + #else + {"RECIPIENT_ERROR", 46, 137}, + #endif + #ifdef CMS_R_SHARED_INFO_ERROR + {"SHARED_INFO_ERROR", ERR_LIB_CMS, CMS_R_SHARED_INFO_ERROR}, + #else + {"SHARED_INFO_ERROR", 46, 189}, + #endif + #ifdef CMS_R_SIGNER_CERTIFICATE_NOT_FOUND + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_CMS, CMS_R_SIGNER_CERTIFICATE_NOT_FOUND}, + #else + {"SIGNER_CERTIFICATE_NOT_FOUND", 46, 138}, + #endif + #ifdef CMS_R_SIGNFINAL_ERROR + {"SIGNFINAL_ERROR", ERR_LIB_CMS, CMS_R_SIGNFINAL_ERROR}, + #else + {"SIGNFINAL_ERROR", 46, 139}, + #endif + #ifdef CMS_R_SMIME_TEXT_ERROR + {"SMIME_TEXT_ERROR", ERR_LIB_CMS, CMS_R_SMIME_TEXT_ERROR}, + #else + {"SMIME_TEXT_ERROR", 46, 140}, + #endif + #ifdef CMS_R_STORE_INIT_ERROR + {"STORE_INIT_ERROR", ERR_LIB_CMS, CMS_R_STORE_INIT_ERROR}, + #else + {"STORE_INIT_ERROR", 46, 141}, + #endif + #ifdef CMS_R_TYPE_NOT_COMPRESSED_DATA + {"TYPE_NOT_COMPRESSED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_COMPRESSED_DATA}, + #else + {"TYPE_NOT_COMPRESSED_DATA", 46, 142}, + #endif + #ifdef CMS_R_TYPE_NOT_DATA + {"TYPE_NOT_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DATA}, + #else + {"TYPE_NOT_DATA", 46, 143}, + #endif + #ifdef CMS_R_TYPE_NOT_DIGESTED_DATA + {"TYPE_NOT_DIGESTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_DIGESTED_DATA}, + #else + {"TYPE_NOT_DIGESTED_DATA", 46, 144}, + #endif + #ifdef CMS_R_TYPE_NOT_ENCRYPTED_DATA + {"TYPE_NOT_ENCRYPTED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENCRYPTED_DATA}, + #else + {"TYPE_NOT_ENCRYPTED_DATA", 46, 145}, + #endif + #ifdef CMS_R_TYPE_NOT_ENVELOPED_DATA + {"TYPE_NOT_ENVELOPED_DATA", ERR_LIB_CMS, CMS_R_TYPE_NOT_ENVELOPED_DATA}, + #else + {"TYPE_NOT_ENVELOPED_DATA", 46, 146}, + #endif + #ifdef CMS_R_UNABLE_TO_FINALIZE_CONTEXT + {"UNABLE_TO_FINALIZE_CONTEXT", ERR_LIB_CMS, CMS_R_UNABLE_TO_FINALIZE_CONTEXT}, + #else + {"UNABLE_TO_FINALIZE_CONTEXT", 46, 147}, + #endif + #ifdef CMS_R_UNKNOWN_CIPHER + {"UNKNOWN_CIPHER", ERR_LIB_CMS, CMS_R_UNKNOWN_CIPHER}, + #else + {"UNKNOWN_CIPHER", 46, 148}, + #endif + #ifdef CMS_R_UNKNOWN_DIGEST_ALGORITHM + {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_CMS, CMS_R_UNKNOWN_DIGEST_ALGORITHM}, + #else + {"UNKNOWN_DIGEST_ALGORITHM", 46, 149}, + #endif + #ifdef CMS_R_UNKNOWN_ID + {"UNKNOWN_ID", ERR_LIB_CMS, CMS_R_UNKNOWN_ID}, + #else + {"UNKNOWN_ID", 46, 150}, + #endif + #ifdef CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM + {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM}, + #else + {"UNSUPPORTED_COMPRESSION_ALGORITHM", 46, 151}, + #endif + #ifdef CMS_R_UNSUPPORTED_CONTENT_TYPE + {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_CONTENT_TYPE}, + #else + {"UNSUPPORTED_CONTENT_TYPE", 46, 152}, + #endif + #ifdef CMS_R_UNSUPPORTED_ENCRYPTION_TYPE + {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_ENCRYPTION_TYPE}, + #else + {"UNSUPPORTED_ENCRYPTION_TYPE", 46, 192}, + #endif + #ifdef CMS_R_UNSUPPORTED_KEK_ALGORITHM + {"UNSUPPORTED_KEK_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEK_ALGORITHM}, + #else + {"UNSUPPORTED_KEK_ALGORITHM", 46, 153}, + #endif + #ifdef CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM + {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", ERR_LIB_CMS, CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM}, + #else + {"UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM", 46, 179}, + #endif + #ifdef CMS_R_UNSUPPORTED_LABEL_SOURCE + {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_LABEL_SOURCE}, + #else + {"UNSUPPORTED_LABEL_SOURCE", 46, 193}, + #endif + #ifdef CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE + {"UNSUPPORTED_RECIPIENTINFO_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE}, + #else + {"UNSUPPORTED_RECIPIENTINFO_TYPE", 46, 155}, + #endif + #ifdef CMS_R_UNSUPPORTED_RECIPIENT_TYPE + {"UNSUPPORTED_RECIPIENT_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_RECIPIENT_TYPE}, + #else + {"UNSUPPORTED_RECIPIENT_TYPE", 46, 154}, + #endif + #ifdef CMS_R_UNSUPPORTED_TYPE + {"UNSUPPORTED_TYPE", ERR_LIB_CMS, CMS_R_UNSUPPORTED_TYPE}, + #else + {"UNSUPPORTED_TYPE", 46, 156}, + #endif + #ifdef CMS_R_UNWRAP_ERROR + {"UNWRAP_ERROR", ERR_LIB_CMS, CMS_R_UNWRAP_ERROR}, + #else + {"UNWRAP_ERROR", 46, 157}, + #endif + #ifdef CMS_R_UNWRAP_FAILURE + {"UNWRAP_FAILURE", ERR_LIB_CMS, CMS_R_UNWRAP_FAILURE}, + #else + {"UNWRAP_FAILURE", 46, 180}, + #endif + #ifdef CMS_R_VERIFICATION_FAILURE + {"VERIFICATION_FAILURE", ERR_LIB_CMS, CMS_R_VERIFICATION_FAILURE}, + #else + {"VERIFICATION_FAILURE", 46, 158}, + #endif + #ifdef CMS_R_WRAP_ERROR + {"WRAP_ERROR", ERR_LIB_CMS, CMS_R_WRAP_ERROR}, + #else + {"WRAP_ERROR", 46, 159}, + #endif + #ifdef COMP_R_ZLIB_DEFLATE_ERROR + {"ZLIB_DEFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR}, + #else + {"ZLIB_DEFLATE_ERROR", 41, 99}, + #endif + #ifdef COMP_R_ZLIB_INFLATE_ERROR + {"ZLIB_INFLATE_ERROR", ERR_LIB_COMP, COMP_R_ZLIB_INFLATE_ERROR}, + #else + {"ZLIB_INFLATE_ERROR", 41, 100}, + #endif + #ifdef COMP_R_ZLIB_NOT_SUPPORTED + {"ZLIB_NOT_SUPPORTED", ERR_LIB_COMP, COMP_R_ZLIB_NOT_SUPPORTED}, + #else + {"ZLIB_NOT_SUPPORTED", 41, 101}, + #endif + #ifdef CONF_R_ERROR_LOADING_DSO + {"ERROR_LOADING_DSO", ERR_LIB_CONF, CONF_R_ERROR_LOADING_DSO}, + #else + {"ERROR_LOADING_DSO", 14, 110}, + #endif + #ifdef CONF_R_INVALID_PRAGMA + {"INVALID_PRAGMA", ERR_LIB_CONF, CONF_R_INVALID_PRAGMA}, + #else + {"INVALID_PRAGMA", 14, 122}, + #endif + #ifdef CONF_R_LIST_CANNOT_BE_NULL + {"LIST_CANNOT_BE_NULL", ERR_LIB_CONF, CONF_R_LIST_CANNOT_BE_NULL}, + #else + {"LIST_CANNOT_BE_NULL", 14, 115}, + #endif + #ifdef CONF_R_MANDATORY_BRACES_IN_VARIABLE_EXPANSION + {"MANDATORY_BRACES_IN_VARIABLE_EXPANSION", ERR_LIB_CONF, CONF_R_MANDATORY_BRACES_IN_VARIABLE_EXPANSION}, + #else + {"MANDATORY_BRACES_IN_VARIABLE_EXPANSION", 14, 123}, + #endif + #ifdef CONF_R_MISSING_CLOSE_SQUARE_BRACKET + {"MISSING_CLOSE_SQUARE_BRACKET", ERR_LIB_CONF, CONF_R_MISSING_CLOSE_SQUARE_BRACKET}, + #else + {"MISSING_CLOSE_SQUARE_BRACKET", 14, 100}, + #endif + #ifdef CONF_R_MISSING_EQUAL_SIGN + {"MISSING_EQUAL_SIGN", ERR_LIB_CONF, CONF_R_MISSING_EQUAL_SIGN}, + #else + {"MISSING_EQUAL_SIGN", 14, 101}, + #endif + #ifdef CONF_R_MISSING_INIT_FUNCTION + {"MISSING_INIT_FUNCTION", ERR_LIB_CONF, CONF_R_MISSING_INIT_FUNCTION}, + #else + {"MISSING_INIT_FUNCTION", 14, 112}, + #endif + #ifdef CONF_R_MODULE_INITIALIZATION_ERROR + {"MODULE_INITIALIZATION_ERROR", ERR_LIB_CONF, CONF_R_MODULE_INITIALIZATION_ERROR}, + #else + {"MODULE_INITIALIZATION_ERROR", 14, 109}, + #endif + #ifdef CONF_R_NO_CLOSE_BRACE + {"NO_CLOSE_BRACE", ERR_LIB_CONF, CONF_R_NO_CLOSE_BRACE}, + #else + {"NO_CLOSE_BRACE", 14, 102}, + #endif + #ifdef CONF_R_NO_CONF + {"NO_CONF", ERR_LIB_CONF, CONF_R_NO_CONF}, + #else + {"NO_CONF", 14, 105}, + #endif + #ifdef CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE + {"NO_CONF_OR_ENVIRONMENT_VARIABLE", ERR_LIB_CONF, CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE}, + #else + {"NO_CONF_OR_ENVIRONMENT_VARIABLE", 14, 106}, + #endif + #ifdef CONF_R_NO_SECTION + {"NO_SECTION", ERR_LIB_CONF, CONF_R_NO_SECTION}, + #else + {"NO_SECTION", 14, 107}, + #endif + #ifdef CONF_R_NO_SUCH_FILE + {"NO_SUCH_FILE", ERR_LIB_CONF, CONF_R_NO_SUCH_FILE}, + #else + {"NO_SUCH_FILE", 14, 114}, + #endif + #ifdef CONF_R_NO_VALUE + {"NO_VALUE", ERR_LIB_CONF, CONF_R_NO_VALUE}, + #else + {"NO_VALUE", 14, 108}, + #endif + #ifdef CONF_R_NUMBER_TOO_LARGE + {"NUMBER_TOO_LARGE", ERR_LIB_CONF, CONF_R_NUMBER_TOO_LARGE}, + #else + {"NUMBER_TOO_LARGE", 14, 121}, + #endif + #ifdef CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION + {"OPENSSL_CONF_REFERENCES_MISSING_SECTION", ERR_LIB_CONF, CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION}, + #else + {"OPENSSL_CONF_REFERENCES_MISSING_SECTION", 14, 124}, + #endif + #ifdef CONF_R_RECURSIVE_DIRECTORY_INCLUDE + {"RECURSIVE_DIRECTORY_INCLUDE", ERR_LIB_CONF, CONF_R_RECURSIVE_DIRECTORY_INCLUDE}, + #else + {"RECURSIVE_DIRECTORY_INCLUDE", 14, 111}, + #endif + #ifdef CONF_R_SSL_COMMAND_SECTION_EMPTY + {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_EMPTY}, + #else + {"SSL_COMMAND_SECTION_EMPTY", 14, 117}, + #endif + #ifdef CONF_R_SSL_COMMAND_SECTION_NOT_FOUND + {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_COMMAND_SECTION_NOT_FOUND}, + #else + {"SSL_COMMAND_SECTION_NOT_FOUND", 14, 118}, + #endif + #ifdef CONF_R_SSL_SECTION_EMPTY + {"SSL_SECTION_EMPTY", ERR_LIB_CONF, CONF_R_SSL_SECTION_EMPTY}, + #else + {"SSL_SECTION_EMPTY", 14, 119}, + #endif + #ifdef CONF_R_SSL_SECTION_NOT_FOUND + {"SSL_SECTION_NOT_FOUND", ERR_LIB_CONF, CONF_R_SSL_SECTION_NOT_FOUND}, + #else + {"SSL_SECTION_NOT_FOUND", 14, 120}, + #endif + #ifdef CONF_R_UNABLE_TO_CREATE_NEW_SECTION + {"UNABLE_TO_CREATE_NEW_SECTION", ERR_LIB_CONF, CONF_R_UNABLE_TO_CREATE_NEW_SECTION}, + #else + {"UNABLE_TO_CREATE_NEW_SECTION", 14, 103}, + #endif + #ifdef CONF_R_UNKNOWN_MODULE_NAME + {"UNKNOWN_MODULE_NAME", ERR_LIB_CONF, CONF_R_UNKNOWN_MODULE_NAME}, + #else + {"UNKNOWN_MODULE_NAME", 14, 113}, + #endif + #ifdef CONF_R_VARIABLE_EXPANSION_TOO_LONG + {"VARIABLE_EXPANSION_TOO_LONG", ERR_LIB_CONF, CONF_R_VARIABLE_EXPANSION_TOO_LONG}, + #else + {"VARIABLE_EXPANSION_TOO_LONG", 14, 116}, + #endif + #ifdef CONF_R_VARIABLE_HAS_NO_VALUE + {"VARIABLE_HAS_NO_VALUE", ERR_LIB_CONF, CONF_R_VARIABLE_HAS_NO_VALUE}, + #else + {"VARIABLE_HAS_NO_VALUE", 14, 104}, + #endif + #ifdef CRMF_R_BAD_PBM_ITERATIONCOUNT + {"BAD_PBM_ITERATIONCOUNT", ERR_LIB_CRMF, CRMF_R_BAD_PBM_ITERATIONCOUNT}, + #else + {"BAD_PBM_ITERATIONCOUNT", 56, 100}, + #endif + #ifdef CRMF_R_CRMFERROR + {"CRMFERROR", ERR_LIB_CRMF, CRMF_R_CRMFERROR}, + #else + {"CRMFERROR", 56, 102}, + #endif + #ifdef CRMF_R_ERROR + {"ERROR", ERR_LIB_CRMF, CRMF_R_ERROR}, + #else + {"ERROR", 56, 103}, + #endif + #ifdef CRMF_R_ERROR_DECODING_CERTIFICATE + {"ERROR_DECODING_CERTIFICATE", ERR_LIB_CRMF, CRMF_R_ERROR_DECODING_CERTIFICATE}, + #else + {"ERROR_DECODING_CERTIFICATE", 56, 104}, + #endif + #ifdef CRMF_R_ERROR_DECRYPTING_CERTIFICATE + {"ERROR_DECRYPTING_CERTIFICATE", ERR_LIB_CRMF, CRMF_R_ERROR_DECRYPTING_CERTIFICATE}, + #else + {"ERROR_DECRYPTING_CERTIFICATE", 56, 105}, + #endif + #ifdef CRMF_R_ERROR_DECRYPTING_SYMMETRIC_KEY + {"ERROR_DECRYPTING_SYMMETRIC_KEY", ERR_LIB_CRMF, CRMF_R_ERROR_DECRYPTING_SYMMETRIC_KEY}, + #else + {"ERROR_DECRYPTING_SYMMETRIC_KEY", 56, 106}, + #endif + #ifdef CRMF_R_FAILURE_OBTAINING_RANDOM + {"FAILURE_OBTAINING_RANDOM", ERR_LIB_CRMF, CRMF_R_FAILURE_OBTAINING_RANDOM}, + #else + {"FAILURE_OBTAINING_RANDOM", 56, 107}, + #endif + #ifdef CRMF_R_ITERATIONCOUNT_BELOW_100 + {"ITERATIONCOUNT_BELOW_100", ERR_LIB_CRMF, CRMF_R_ITERATIONCOUNT_BELOW_100}, + #else + {"ITERATIONCOUNT_BELOW_100", 56, 108}, + #endif + #ifdef CRMF_R_MALFORMED_IV + {"MALFORMED_IV", ERR_LIB_CRMF, CRMF_R_MALFORMED_IV}, + #else + {"MALFORMED_IV", 56, 101}, + #endif + #ifdef CRMF_R_NULL_ARGUMENT + {"NULL_ARGUMENT", ERR_LIB_CRMF, CRMF_R_NULL_ARGUMENT}, + #else + {"NULL_ARGUMENT", 56, 109}, + #endif + #ifdef CRMF_R_POPOSKINPUT_NOT_SUPPORTED + {"POPOSKINPUT_NOT_SUPPORTED", ERR_LIB_CRMF, CRMF_R_POPOSKINPUT_NOT_SUPPORTED}, + #else + {"POPOSKINPUT_NOT_SUPPORTED", 56, 113}, + #endif + #ifdef CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY + {"POPO_INCONSISTENT_PUBLIC_KEY", ERR_LIB_CRMF, CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY}, + #else + {"POPO_INCONSISTENT_PUBLIC_KEY", 56, 117}, + #endif + #ifdef CRMF_R_POPO_MISSING + {"POPO_MISSING", ERR_LIB_CRMF, CRMF_R_POPO_MISSING}, + #else + {"POPO_MISSING", 56, 121}, + #endif + #ifdef CRMF_R_POPO_MISSING_PUBLIC_KEY + {"POPO_MISSING_PUBLIC_KEY", ERR_LIB_CRMF, CRMF_R_POPO_MISSING_PUBLIC_KEY}, + #else + {"POPO_MISSING_PUBLIC_KEY", 56, 118}, + #endif + #ifdef CRMF_R_POPO_MISSING_SUBJECT + {"POPO_MISSING_SUBJECT", ERR_LIB_CRMF, CRMF_R_POPO_MISSING_SUBJECT}, + #else + {"POPO_MISSING_SUBJECT", 56, 119}, + #endif + #ifdef CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED + {"POPO_RAVERIFIED_NOT_ACCEPTED", ERR_LIB_CRMF, CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED}, + #else + {"POPO_RAVERIFIED_NOT_ACCEPTED", 56, 120}, + #endif + #ifdef CRMF_R_SETTING_MAC_ALGOR_FAILURE + {"SETTING_MAC_ALGOR_FAILURE", ERR_LIB_CRMF, CRMF_R_SETTING_MAC_ALGOR_FAILURE}, + #else + {"SETTING_MAC_ALGOR_FAILURE", 56, 110}, + #endif + #ifdef CRMF_R_SETTING_OWF_ALGOR_FAILURE + {"SETTING_OWF_ALGOR_FAILURE", ERR_LIB_CRMF, CRMF_R_SETTING_OWF_ALGOR_FAILURE}, + #else + {"SETTING_OWF_ALGOR_FAILURE", 56, 111}, + #endif + #ifdef CRMF_R_UNSUPPORTED_ALGORITHM + {"UNSUPPORTED_ALGORITHM", ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_ALGORITHM}, + #else + {"UNSUPPORTED_ALGORITHM", 56, 112}, + #endif + #ifdef CRMF_R_UNSUPPORTED_CIPHER + {"UNSUPPORTED_CIPHER", ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_CIPHER}, + #else + {"UNSUPPORTED_CIPHER", 56, 114}, + #endif + #ifdef CRMF_R_UNSUPPORTED_METHOD_FOR_CREATING_POPO + {"UNSUPPORTED_METHOD_FOR_CREATING_POPO", ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_METHOD_FOR_CREATING_POPO}, + #else + {"UNSUPPORTED_METHOD_FOR_CREATING_POPO", 56, 115}, + #endif + #ifdef CRMF_R_UNSUPPORTED_POPO_METHOD + {"UNSUPPORTED_POPO_METHOD", ERR_LIB_CRMF, CRMF_R_UNSUPPORTED_POPO_METHOD}, + #else + {"UNSUPPORTED_POPO_METHOD", 56, 116}, + #endif + #ifdef CRYPTO_R_BAD_ALGORITHM_NAME + {"BAD_ALGORITHM_NAME", ERR_LIB_CRYPTO, CRYPTO_R_BAD_ALGORITHM_NAME}, + #else + {"BAD_ALGORITHM_NAME", 15, 117}, + #endif + #ifdef CRYPTO_R_CONFLICTING_NAMES + {"CONFLICTING_NAMES", ERR_LIB_CRYPTO, CRYPTO_R_CONFLICTING_NAMES}, + #else + {"CONFLICTING_NAMES", 15, 118}, + #endif + #ifdef CRYPTO_R_FIPS_MODE_NOT_SUPPORTED + {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_CRYPTO, CRYPTO_R_FIPS_MODE_NOT_SUPPORTED}, + #else + {"FIPS_MODE_NOT_SUPPORTED", 15, 101}, + #endif + #ifdef CRYPTO_R_HEX_STRING_TOO_SHORT + {"HEX_STRING_TOO_SHORT", ERR_LIB_CRYPTO, CRYPTO_R_HEX_STRING_TOO_SHORT}, + #else + {"HEX_STRING_TOO_SHORT", 15, 121}, + #endif + #ifdef CRYPTO_R_ILLEGAL_HEX_DIGIT + {"ILLEGAL_HEX_DIGIT", ERR_LIB_CRYPTO, CRYPTO_R_ILLEGAL_HEX_DIGIT}, + #else + {"ILLEGAL_HEX_DIGIT", 15, 102}, + #endif + #ifdef CRYPTO_R_INSUFFICIENT_DATA_SPACE + {"INSUFFICIENT_DATA_SPACE", ERR_LIB_CRYPTO, CRYPTO_R_INSUFFICIENT_DATA_SPACE}, + #else + {"INSUFFICIENT_DATA_SPACE", 15, 106}, + #endif + #ifdef CRYPTO_R_INSUFFICIENT_PARAM_SIZE + {"INSUFFICIENT_PARAM_SIZE", ERR_LIB_CRYPTO, CRYPTO_R_INSUFFICIENT_PARAM_SIZE}, + #else + {"INSUFFICIENT_PARAM_SIZE", 15, 107}, + #endif + #ifdef CRYPTO_R_INSUFFICIENT_SECURE_DATA_SPACE + {"INSUFFICIENT_SECURE_DATA_SPACE", ERR_LIB_CRYPTO, CRYPTO_R_INSUFFICIENT_SECURE_DATA_SPACE}, + #else + {"INSUFFICIENT_SECURE_DATA_SPACE", 15, 108}, + #endif + #ifdef CRYPTO_R_INVALID_NULL_ARGUMENT + {"INVALID_NULL_ARGUMENT", ERR_LIB_CRYPTO, CRYPTO_R_INVALID_NULL_ARGUMENT}, + #else + {"INVALID_NULL_ARGUMENT", 15, 109}, + #endif + #ifdef CRYPTO_R_INVALID_OSSL_PARAM_TYPE + {"INVALID_OSSL_PARAM_TYPE", ERR_LIB_CRYPTO, CRYPTO_R_INVALID_OSSL_PARAM_TYPE}, + #else + {"INVALID_OSSL_PARAM_TYPE", 15, 110}, + #endif + #ifdef CRYPTO_R_ODD_NUMBER_OF_DIGITS + {"ODD_NUMBER_OF_DIGITS", ERR_LIB_CRYPTO, CRYPTO_R_ODD_NUMBER_OF_DIGITS}, + #else + {"ODD_NUMBER_OF_DIGITS", 15, 103}, + #endif + #ifdef CRYPTO_R_PROVIDER_ALREADY_EXISTS + {"PROVIDER_ALREADY_EXISTS", ERR_LIB_CRYPTO, CRYPTO_R_PROVIDER_ALREADY_EXISTS}, + #else + {"PROVIDER_ALREADY_EXISTS", 15, 104}, + #endif + #ifdef CRYPTO_R_PROVIDER_SECTION_ERROR + {"PROVIDER_SECTION_ERROR", ERR_LIB_CRYPTO, CRYPTO_R_PROVIDER_SECTION_ERROR}, + #else + {"PROVIDER_SECTION_ERROR", 15, 105}, + #endif + #ifdef CRYPTO_R_RANDOM_SECTION_ERROR + {"RANDOM_SECTION_ERROR", ERR_LIB_CRYPTO, CRYPTO_R_RANDOM_SECTION_ERROR}, + #else + {"RANDOM_SECTION_ERROR", 15, 119}, + #endif + #ifdef CRYPTO_R_SECURE_MALLOC_FAILURE + {"SECURE_MALLOC_FAILURE", ERR_LIB_CRYPTO, CRYPTO_R_SECURE_MALLOC_FAILURE}, + #else + {"SECURE_MALLOC_FAILURE", 15, 111}, + #endif + #ifdef CRYPTO_R_STRING_TOO_LONG + {"STRING_TOO_LONG", ERR_LIB_CRYPTO, CRYPTO_R_STRING_TOO_LONG}, + #else + {"STRING_TOO_LONG", 15, 112}, + #endif + #ifdef CRYPTO_R_TOO_MANY_BYTES + {"TOO_MANY_BYTES", ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_BYTES}, + #else + {"TOO_MANY_BYTES", 15, 113}, + #endif + #ifdef CRYPTO_R_TOO_MANY_RECORDS + {"TOO_MANY_RECORDS", ERR_LIB_CRYPTO, CRYPTO_R_TOO_MANY_RECORDS}, + #else + {"TOO_MANY_RECORDS", 15, 114}, + #endif + #ifdef CRYPTO_R_TOO_SMALL_BUFFER + {"TOO_SMALL_BUFFER", ERR_LIB_CRYPTO, CRYPTO_R_TOO_SMALL_BUFFER}, + #else + {"TOO_SMALL_BUFFER", 15, 116}, + #endif + #ifdef CRYPTO_R_UNKNOWN_NAME_IN_RANDOM_SECTION + {"UNKNOWN_NAME_IN_RANDOM_SECTION", ERR_LIB_CRYPTO, CRYPTO_R_UNKNOWN_NAME_IN_RANDOM_SECTION}, + #else + {"UNKNOWN_NAME_IN_RANDOM_SECTION", 15, 120}, + #endif + #ifdef CRYPTO_R_ZERO_LENGTH_NUMBER + {"ZERO_LENGTH_NUMBER", ERR_LIB_CRYPTO, CRYPTO_R_ZERO_LENGTH_NUMBER}, + #else + {"ZERO_LENGTH_NUMBER", 15, 115}, + #endif + #ifdef CT_R_BASE64_DECODE_ERROR + {"BASE64_DECODE_ERROR", ERR_LIB_CT, CT_R_BASE64_DECODE_ERROR}, + #else + {"BASE64_DECODE_ERROR", 50, 108}, + #endif + #ifdef CT_R_INVALID_LOG_ID_LENGTH + {"INVALID_LOG_ID_LENGTH", ERR_LIB_CT, CT_R_INVALID_LOG_ID_LENGTH}, + #else + {"INVALID_LOG_ID_LENGTH", 50, 100}, + #endif + #ifdef CT_R_LOG_CONF_INVALID + {"LOG_CONF_INVALID", ERR_LIB_CT, CT_R_LOG_CONF_INVALID}, + #else + {"LOG_CONF_INVALID", 50, 109}, + #endif + #ifdef CT_R_LOG_CONF_INVALID_KEY + {"LOG_CONF_INVALID_KEY", ERR_LIB_CT, CT_R_LOG_CONF_INVALID_KEY}, + #else + {"LOG_CONF_INVALID_KEY", 50, 110}, + #endif + #ifdef CT_R_LOG_CONF_MISSING_DESCRIPTION + {"LOG_CONF_MISSING_DESCRIPTION", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_DESCRIPTION}, + #else + {"LOG_CONF_MISSING_DESCRIPTION", 50, 111}, + #endif + #ifdef CT_R_LOG_CONF_MISSING_KEY + {"LOG_CONF_MISSING_KEY", ERR_LIB_CT, CT_R_LOG_CONF_MISSING_KEY}, + #else + {"LOG_CONF_MISSING_KEY", 50, 112}, + #endif + #ifdef CT_R_LOG_KEY_INVALID + {"LOG_KEY_INVALID", ERR_LIB_CT, CT_R_LOG_KEY_INVALID}, + #else + {"LOG_KEY_INVALID", 50, 113}, + #endif + #ifdef CT_R_SCT_FUTURE_TIMESTAMP + {"SCT_FUTURE_TIMESTAMP", ERR_LIB_CT, CT_R_SCT_FUTURE_TIMESTAMP}, + #else + {"SCT_FUTURE_TIMESTAMP", 50, 116}, + #endif + #ifdef CT_R_SCT_INVALID + {"SCT_INVALID", ERR_LIB_CT, CT_R_SCT_INVALID}, + #else + {"SCT_INVALID", 50, 104}, + #endif + #ifdef CT_R_SCT_INVALID_SIGNATURE + {"SCT_INVALID_SIGNATURE", ERR_LIB_CT, CT_R_SCT_INVALID_SIGNATURE}, + #else + {"SCT_INVALID_SIGNATURE", 50, 107}, + #endif + #ifdef CT_R_SCT_LIST_INVALID + {"SCT_LIST_INVALID", ERR_LIB_CT, CT_R_SCT_LIST_INVALID}, + #else + {"SCT_LIST_INVALID", 50, 105}, + #endif + #ifdef CT_R_SCT_LOG_ID_MISMATCH + {"SCT_LOG_ID_MISMATCH", ERR_LIB_CT, CT_R_SCT_LOG_ID_MISMATCH}, + #else + {"SCT_LOG_ID_MISMATCH", 50, 114}, + #endif + #ifdef CT_R_SCT_NOT_SET + {"SCT_NOT_SET", ERR_LIB_CT, CT_R_SCT_NOT_SET}, + #else + {"SCT_NOT_SET", 50, 106}, + #endif + #ifdef CT_R_SCT_UNSUPPORTED_VERSION + {"SCT_UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_SCT_UNSUPPORTED_VERSION}, + #else + {"SCT_UNSUPPORTED_VERSION", 50, 115}, + #endif + #ifdef CT_R_UNRECOGNIZED_SIGNATURE_NID + {"UNRECOGNIZED_SIGNATURE_NID", ERR_LIB_CT, CT_R_UNRECOGNIZED_SIGNATURE_NID}, + #else + {"UNRECOGNIZED_SIGNATURE_NID", 50, 101}, + #endif + #ifdef CT_R_UNSUPPORTED_ENTRY_TYPE + {"UNSUPPORTED_ENTRY_TYPE", ERR_LIB_CT, CT_R_UNSUPPORTED_ENTRY_TYPE}, + #else + {"UNSUPPORTED_ENTRY_TYPE", 50, 102}, + #endif + #ifdef CT_R_UNSUPPORTED_VERSION + {"UNSUPPORTED_VERSION", ERR_LIB_CT, CT_R_UNSUPPORTED_VERSION}, + #else + {"UNSUPPORTED_VERSION", 50, 103}, + #endif + #ifdef DH_R_BAD_FFC_PARAMETERS + {"BAD_FFC_PARAMETERS", ERR_LIB_DH, DH_R_BAD_FFC_PARAMETERS}, + #else + {"BAD_FFC_PARAMETERS", 5, 127}, + #endif + #ifdef DH_R_BAD_GENERATOR + {"BAD_GENERATOR", ERR_LIB_DH, DH_R_BAD_GENERATOR}, + #else + {"BAD_GENERATOR", 5, 101}, + #endif + #ifdef DH_R_BN_DECODE_ERROR + {"BN_DECODE_ERROR", ERR_LIB_DH, DH_R_BN_DECODE_ERROR}, + #else + {"BN_DECODE_ERROR", 5, 109}, + #endif + #ifdef DH_R_BN_ERROR + {"BN_ERROR", ERR_LIB_DH, DH_R_BN_ERROR}, + #else + {"BN_ERROR", 5, 106}, + #endif + #ifdef DH_R_CHECK_INVALID_J_VALUE + {"CHECK_INVALID_J_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_J_VALUE}, + #else + {"CHECK_INVALID_J_VALUE", 5, 115}, + #endif + #ifdef DH_R_CHECK_INVALID_Q_VALUE + {"CHECK_INVALID_Q_VALUE", ERR_LIB_DH, DH_R_CHECK_INVALID_Q_VALUE}, + #else + {"CHECK_INVALID_Q_VALUE", 5, 116}, + #endif + #ifdef DH_R_CHECK_PUBKEY_INVALID + {"CHECK_PUBKEY_INVALID", ERR_LIB_DH, DH_R_CHECK_PUBKEY_INVALID}, + #else + {"CHECK_PUBKEY_INVALID", 5, 122}, + #endif + #ifdef DH_R_CHECK_PUBKEY_TOO_LARGE + {"CHECK_PUBKEY_TOO_LARGE", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_LARGE}, + #else + {"CHECK_PUBKEY_TOO_LARGE", 5, 123}, + #endif + #ifdef DH_R_CHECK_PUBKEY_TOO_SMALL + {"CHECK_PUBKEY_TOO_SMALL", ERR_LIB_DH, DH_R_CHECK_PUBKEY_TOO_SMALL}, + #else + {"CHECK_PUBKEY_TOO_SMALL", 5, 124}, + #endif + #ifdef DH_R_CHECK_P_NOT_PRIME + {"CHECK_P_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_PRIME}, + #else + {"CHECK_P_NOT_PRIME", 5, 117}, + #endif + #ifdef DH_R_CHECK_P_NOT_SAFE_PRIME + {"CHECK_P_NOT_SAFE_PRIME", ERR_LIB_DH, DH_R_CHECK_P_NOT_SAFE_PRIME}, + #else + {"CHECK_P_NOT_SAFE_PRIME", 5, 118}, + #endif + #ifdef DH_R_CHECK_Q_NOT_PRIME + {"CHECK_Q_NOT_PRIME", ERR_LIB_DH, DH_R_CHECK_Q_NOT_PRIME}, + #else + {"CHECK_Q_NOT_PRIME", 5, 119}, + #endif + #ifdef DH_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_DH, DH_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", 5, 104}, + #endif + #ifdef DH_R_INVALID_PARAMETER_NAME + {"INVALID_PARAMETER_NAME", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NAME}, + #else + {"INVALID_PARAMETER_NAME", 5, 110}, + #endif + #ifdef DH_R_INVALID_PARAMETER_NID + {"INVALID_PARAMETER_NID", ERR_LIB_DH, DH_R_INVALID_PARAMETER_NID}, + #else + {"INVALID_PARAMETER_NID", 5, 114}, + #endif + #ifdef DH_R_INVALID_PUBKEY + {"INVALID_PUBKEY", ERR_LIB_DH, DH_R_INVALID_PUBKEY}, + #else + {"INVALID_PUBKEY", 5, 102}, + #endif + #ifdef DH_R_INVALID_SECRET + {"INVALID_SECRET", ERR_LIB_DH, DH_R_INVALID_SECRET}, + #else + {"INVALID_SECRET", 5, 128}, + #endif + #ifdef DH_R_KDF_PARAMETER_ERROR + {"KDF_PARAMETER_ERROR", ERR_LIB_DH, DH_R_KDF_PARAMETER_ERROR}, + #else + {"KDF_PARAMETER_ERROR", 5, 112}, + #endif + #ifdef DH_R_KEYS_NOT_SET + {"KEYS_NOT_SET", ERR_LIB_DH, DH_R_KEYS_NOT_SET}, + #else + {"KEYS_NOT_SET", 5, 108}, + #endif + #ifdef DH_R_MISSING_PUBKEY + {"MISSING_PUBKEY", ERR_LIB_DH, DH_R_MISSING_PUBKEY}, + #else + {"MISSING_PUBKEY", 5, 125}, + #endif + #ifdef DH_R_MODULUS_TOO_LARGE + {"MODULUS_TOO_LARGE", ERR_LIB_DH, DH_R_MODULUS_TOO_LARGE}, + #else + {"MODULUS_TOO_LARGE", 5, 103}, + #endif + #ifdef DH_R_MODULUS_TOO_SMALL + {"MODULUS_TOO_SMALL", ERR_LIB_DH, DH_R_MODULUS_TOO_SMALL}, + #else + {"MODULUS_TOO_SMALL", 5, 126}, + #endif + #ifdef DH_R_NOT_SUITABLE_GENERATOR + {"NOT_SUITABLE_GENERATOR", ERR_LIB_DH, DH_R_NOT_SUITABLE_GENERATOR}, + #else + {"NOT_SUITABLE_GENERATOR", 5, 120}, + #endif + #ifdef DH_R_NO_PARAMETERS_SET + {"NO_PARAMETERS_SET", ERR_LIB_DH, DH_R_NO_PARAMETERS_SET}, + #else + {"NO_PARAMETERS_SET", 5, 107}, + #endif + #ifdef DH_R_NO_PRIVATE_VALUE + {"NO_PRIVATE_VALUE", ERR_LIB_DH, DH_R_NO_PRIVATE_VALUE}, + #else + {"NO_PRIVATE_VALUE", 5, 100}, + #endif + #ifdef DH_R_PARAMETER_ENCODING_ERROR + {"PARAMETER_ENCODING_ERROR", ERR_LIB_DH, DH_R_PARAMETER_ENCODING_ERROR}, + #else + {"PARAMETER_ENCODING_ERROR", 5, 105}, + #endif + #ifdef DH_R_PEER_KEY_ERROR + {"PEER_KEY_ERROR", ERR_LIB_DH, DH_R_PEER_KEY_ERROR}, + #else + {"PEER_KEY_ERROR", 5, 111}, + #endif + #ifdef DH_R_SHARED_INFO_ERROR + {"SHARED_INFO_ERROR", ERR_LIB_DH, DH_R_SHARED_INFO_ERROR}, + #else + {"SHARED_INFO_ERROR", 5, 113}, + #endif + #ifdef DH_R_UNABLE_TO_CHECK_GENERATOR + {"UNABLE_TO_CHECK_GENERATOR", ERR_LIB_DH, DH_R_UNABLE_TO_CHECK_GENERATOR}, + #else + {"UNABLE_TO_CHECK_GENERATOR", 5, 121}, + #endif + #ifdef DSA_R_BAD_FFC_PARAMETERS + {"BAD_FFC_PARAMETERS", ERR_LIB_DSA, DSA_R_BAD_FFC_PARAMETERS}, + #else + {"BAD_FFC_PARAMETERS", 10, 114}, + #endif + #ifdef DSA_R_BAD_Q_VALUE + {"BAD_Q_VALUE", ERR_LIB_DSA, DSA_R_BAD_Q_VALUE}, + #else + {"BAD_Q_VALUE", 10, 102}, + #endif + #ifdef DSA_R_BN_DECODE_ERROR + {"BN_DECODE_ERROR", ERR_LIB_DSA, DSA_R_BN_DECODE_ERROR}, + #else + {"BN_DECODE_ERROR", 10, 108}, + #endif + #ifdef DSA_R_BN_ERROR + {"BN_ERROR", ERR_LIB_DSA, DSA_R_BN_ERROR}, + #else + {"BN_ERROR", 10, 109}, + #endif + #ifdef DSA_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_DSA, DSA_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", 10, 104}, + #endif + #ifdef DSA_R_INVALID_DIGEST_TYPE + {"INVALID_DIGEST_TYPE", ERR_LIB_DSA, DSA_R_INVALID_DIGEST_TYPE}, + #else + {"INVALID_DIGEST_TYPE", 10, 106}, + #endif + #ifdef DSA_R_INVALID_PARAMETERS + {"INVALID_PARAMETERS", ERR_LIB_DSA, DSA_R_INVALID_PARAMETERS}, + #else + {"INVALID_PARAMETERS", 10, 112}, + #endif + #ifdef DSA_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_DSA, DSA_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", 10, 101}, + #endif + #ifdef DSA_R_MISSING_PRIVATE_KEY + {"MISSING_PRIVATE_KEY", ERR_LIB_DSA, DSA_R_MISSING_PRIVATE_KEY}, + #else + {"MISSING_PRIVATE_KEY", 10, 111}, + #endif + #ifdef DSA_R_MODULUS_TOO_LARGE + {"MODULUS_TOO_LARGE", ERR_LIB_DSA, DSA_R_MODULUS_TOO_LARGE}, + #else + {"MODULUS_TOO_LARGE", 10, 103}, + #endif + #ifdef DSA_R_NO_PARAMETERS_SET + {"NO_PARAMETERS_SET", ERR_LIB_DSA, DSA_R_NO_PARAMETERS_SET}, + #else + {"NO_PARAMETERS_SET", 10, 107}, + #endif + #ifdef DSA_R_PARAMETER_ENCODING_ERROR + {"PARAMETER_ENCODING_ERROR", ERR_LIB_DSA, DSA_R_PARAMETER_ENCODING_ERROR}, + #else + {"PARAMETER_ENCODING_ERROR", 10, 105}, + #endif + #ifdef DSA_R_P_NOT_PRIME + {"P_NOT_PRIME", ERR_LIB_DSA, DSA_R_P_NOT_PRIME}, + #else + {"P_NOT_PRIME", 10, 115}, + #endif + #ifdef DSA_R_Q_NOT_PRIME + {"Q_NOT_PRIME", ERR_LIB_DSA, DSA_R_Q_NOT_PRIME}, + #else + {"Q_NOT_PRIME", 10, 113}, + #endif + #ifdef DSA_R_SEED_LEN_SMALL + {"SEED_LEN_SMALL", ERR_LIB_DSA, DSA_R_SEED_LEN_SMALL}, + #else + {"SEED_LEN_SMALL", 10, 110}, + #endif + #ifdef DSO_R_CTRL_FAILED + {"CTRL_FAILED", ERR_LIB_DSO, DSO_R_CTRL_FAILED}, + #else + {"CTRL_FAILED", 37, 100}, + #endif + #ifdef DSO_R_DSO_ALREADY_LOADED + {"DSO_ALREADY_LOADED", ERR_LIB_DSO, DSO_R_DSO_ALREADY_LOADED}, + #else + {"DSO_ALREADY_LOADED", 37, 110}, + #endif + #ifdef DSO_R_EMPTY_FILE_STRUCTURE + {"EMPTY_FILE_STRUCTURE", ERR_LIB_DSO, DSO_R_EMPTY_FILE_STRUCTURE}, + #else + {"EMPTY_FILE_STRUCTURE", 37, 113}, + #endif + #ifdef DSO_R_FAILURE + {"FAILURE", ERR_LIB_DSO, DSO_R_FAILURE}, + #else + {"FAILURE", 37, 114}, + #endif + #ifdef DSO_R_FILENAME_TOO_BIG + {"FILENAME_TOO_BIG", ERR_LIB_DSO, DSO_R_FILENAME_TOO_BIG}, + #else + {"FILENAME_TOO_BIG", 37, 101}, + #endif + #ifdef DSO_R_FINISH_FAILED + {"FINISH_FAILED", ERR_LIB_DSO, DSO_R_FINISH_FAILED}, + #else + {"FINISH_FAILED", 37, 102}, + #endif + #ifdef DSO_R_INCORRECT_FILE_SYNTAX + {"INCORRECT_FILE_SYNTAX", ERR_LIB_DSO, DSO_R_INCORRECT_FILE_SYNTAX}, + #else + {"INCORRECT_FILE_SYNTAX", 37, 115}, + #endif + #ifdef DSO_R_LOAD_FAILED + {"LOAD_FAILED", ERR_LIB_DSO, DSO_R_LOAD_FAILED}, + #else + {"LOAD_FAILED", 37, 103}, + #endif + #ifdef DSO_R_NAME_TRANSLATION_FAILED + {"NAME_TRANSLATION_FAILED", ERR_LIB_DSO, DSO_R_NAME_TRANSLATION_FAILED}, + #else + {"NAME_TRANSLATION_FAILED", 37, 109}, + #endif + #ifdef DSO_R_NO_FILENAME + {"NO_FILENAME", ERR_LIB_DSO, DSO_R_NO_FILENAME}, + #else + {"NO_FILENAME", 37, 111}, + #endif + #ifdef DSO_R_NULL_HANDLE + {"NULL_HANDLE", ERR_LIB_DSO, DSO_R_NULL_HANDLE}, + #else + {"NULL_HANDLE", 37, 104}, + #endif + #ifdef DSO_R_SET_FILENAME_FAILED + {"SET_FILENAME_FAILED", ERR_LIB_DSO, DSO_R_SET_FILENAME_FAILED}, + #else + {"SET_FILENAME_FAILED", 37, 112}, + #endif + #ifdef DSO_R_STACK_ERROR + {"STACK_ERROR", ERR_LIB_DSO, DSO_R_STACK_ERROR}, + #else + {"STACK_ERROR", 37, 105}, + #endif + #ifdef DSO_R_SYM_FAILURE + {"SYM_FAILURE", ERR_LIB_DSO, DSO_R_SYM_FAILURE}, + #else + {"SYM_FAILURE", 37, 106}, + #endif + #ifdef DSO_R_UNLOAD_FAILED + {"UNLOAD_FAILED", ERR_LIB_DSO, DSO_R_UNLOAD_FAILED}, + #else + {"UNLOAD_FAILED", 37, 107}, + #endif + #ifdef DSO_R_UNSUPPORTED + {"UNSUPPORTED", ERR_LIB_DSO, DSO_R_UNSUPPORTED}, + #else + {"UNSUPPORTED", 37, 108}, + #endif + #ifdef EC_R_ASN1_ERROR + {"ASN1_ERROR", ERR_LIB_EC, EC_R_ASN1_ERROR}, + #else + {"ASN1_ERROR", 16, 115}, + #endif + #ifdef EC_R_BAD_SIGNATURE + {"BAD_SIGNATURE", ERR_LIB_EC, EC_R_BAD_SIGNATURE}, + #else + {"BAD_SIGNATURE", 16, 156}, + #endif + #ifdef EC_R_BIGNUM_OUT_OF_RANGE + {"BIGNUM_OUT_OF_RANGE", ERR_LIB_EC, EC_R_BIGNUM_OUT_OF_RANGE}, + #else + {"BIGNUM_OUT_OF_RANGE", 16, 144}, + #endif + #ifdef EC_R_BUFFER_TOO_SMALL + {"BUFFER_TOO_SMALL", ERR_LIB_EC, EC_R_BUFFER_TOO_SMALL}, + #else + {"BUFFER_TOO_SMALL", 16, 100}, + #endif + #ifdef EC_R_CANNOT_INVERT + {"CANNOT_INVERT", ERR_LIB_EC, EC_R_CANNOT_INVERT}, + #else + {"CANNOT_INVERT", 16, 165}, + #endif + #ifdef EC_R_COORDINATES_OUT_OF_RANGE + {"COORDINATES_OUT_OF_RANGE", ERR_LIB_EC, EC_R_COORDINATES_OUT_OF_RANGE}, + #else + {"COORDINATES_OUT_OF_RANGE", 16, 146}, + #endif + #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_ECDH + {"CURVE_DOES_NOT_SUPPORT_ECDH", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_ECDH}, + #else + {"CURVE_DOES_NOT_SUPPORT_ECDH", 16, 160}, + #endif + #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_ECDSA + {"CURVE_DOES_NOT_SUPPORT_ECDSA", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_ECDSA}, + #else + {"CURVE_DOES_NOT_SUPPORT_ECDSA", 16, 170}, + #endif + #ifdef EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING + {"CURVE_DOES_NOT_SUPPORT_SIGNING", ERR_LIB_EC, EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING}, + #else + {"CURVE_DOES_NOT_SUPPORT_SIGNING", 16, 159}, + #endif + #ifdef EC_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_EC, EC_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", 16, 142}, + #endif + #ifdef EC_R_DISCRIMINANT_IS_ZERO + {"DISCRIMINANT_IS_ZERO", ERR_LIB_EC, EC_R_DISCRIMINANT_IS_ZERO}, + #else + {"DISCRIMINANT_IS_ZERO", 16, 118}, + #endif + #ifdef EC_R_EC_GROUP_NEW_BY_NAME_FAILURE + {"EC_GROUP_NEW_BY_NAME_FAILURE", ERR_LIB_EC, EC_R_EC_GROUP_NEW_BY_NAME_FAILURE}, + #else + {"EC_GROUP_NEW_BY_NAME_FAILURE", 16, 119}, + #endif + #ifdef EC_R_FAILED_MAKING_PUBLIC_KEY + {"FAILED_MAKING_PUBLIC_KEY", ERR_LIB_EC, EC_R_FAILED_MAKING_PUBLIC_KEY}, + #else + {"FAILED_MAKING_PUBLIC_KEY", 16, 166}, + #endif + #ifdef EC_R_FIELD_TOO_LARGE + {"FIELD_TOO_LARGE", ERR_LIB_EC, EC_R_FIELD_TOO_LARGE}, + #else + {"FIELD_TOO_LARGE", 16, 143}, + #endif + #ifdef EC_R_GF2M_NOT_SUPPORTED + {"GF2M_NOT_SUPPORTED", ERR_LIB_EC, EC_R_GF2M_NOT_SUPPORTED}, + #else + {"GF2M_NOT_SUPPORTED", 16, 147}, + #endif + #ifdef EC_R_GROUP2PKPARAMETERS_FAILURE + {"GROUP2PKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_GROUP2PKPARAMETERS_FAILURE}, + #else + {"GROUP2PKPARAMETERS_FAILURE", 16, 120}, + #endif + #ifdef EC_R_I2D_ECPKPARAMETERS_FAILURE + {"I2D_ECPKPARAMETERS_FAILURE", ERR_LIB_EC, EC_R_I2D_ECPKPARAMETERS_FAILURE}, + #else + {"I2D_ECPKPARAMETERS_FAILURE", 16, 121}, + #endif + #ifdef EC_R_INCOMPATIBLE_OBJECTS + {"INCOMPATIBLE_OBJECTS", ERR_LIB_EC, EC_R_INCOMPATIBLE_OBJECTS}, + #else + {"INCOMPATIBLE_OBJECTS", 16, 101}, + #endif + #ifdef EC_R_INVALID_A + {"INVALID_A", ERR_LIB_EC, EC_R_INVALID_A}, + #else + {"INVALID_A", 16, 168}, + #endif + #ifdef EC_R_INVALID_ARGUMENT + {"INVALID_ARGUMENT", ERR_LIB_EC, EC_R_INVALID_ARGUMENT}, + #else + {"INVALID_ARGUMENT", 16, 112}, + #endif + #ifdef EC_R_INVALID_B + {"INVALID_B", ERR_LIB_EC, EC_R_INVALID_B}, + #else + {"INVALID_B", 16, 169}, + #endif + #ifdef EC_R_INVALID_COFACTOR + {"INVALID_COFACTOR", ERR_LIB_EC, EC_R_INVALID_COFACTOR}, + #else + {"INVALID_COFACTOR", 16, 171}, + #endif + #ifdef EC_R_INVALID_COMPRESSED_POINT + {"INVALID_COMPRESSED_POINT", ERR_LIB_EC, EC_R_INVALID_COMPRESSED_POINT}, + #else + {"INVALID_COMPRESSED_POINT", 16, 110}, + #endif + #ifdef EC_R_INVALID_COMPRESSION_BIT + {"INVALID_COMPRESSION_BIT", ERR_LIB_EC, EC_R_INVALID_COMPRESSION_BIT}, + #else + {"INVALID_COMPRESSION_BIT", 16, 109}, + #endif + #ifdef EC_R_INVALID_CURVE + {"INVALID_CURVE", ERR_LIB_EC, EC_R_INVALID_CURVE}, + #else + {"INVALID_CURVE", 16, 141}, + #endif + #ifdef EC_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_EC, EC_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", 16, 151}, + #endif + #ifdef EC_R_INVALID_DIGEST_TYPE + {"INVALID_DIGEST_TYPE", ERR_LIB_EC, EC_R_INVALID_DIGEST_TYPE}, + #else + {"INVALID_DIGEST_TYPE", 16, 138}, + #endif + #ifdef EC_R_INVALID_ENCODING + {"INVALID_ENCODING", ERR_LIB_EC, EC_R_INVALID_ENCODING}, + #else + {"INVALID_ENCODING", 16, 102}, + #endif + #ifdef EC_R_INVALID_FIELD + {"INVALID_FIELD", ERR_LIB_EC, EC_R_INVALID_FIELD}, + #else + {"INVALID_FIELD", 16, 103}, + #endif + #ifdef EC_R_INVALID_FORM + {"INVALID_FORM", ERR_LIB_EC, EC_R_INVALID_FORM}, + #else + {"INVALID_FORM", 16, 104}, + #endif + #ifdef EC_R_INVALID_GENERATOR + {"INVALID_GENERATOR", ERR_LIB_EC, EC_R_INVALID_GENERATOR}, + #else + {"INVALID_GENERATOR", 16, 173}, + #endif + #ifdef EC_R_INVALID_GROUP_ORDER + {"INVALID_GROUP_ORDER", ERR_LIB_EC, EC_R_INVALID_GROUP_ORDER}, + #else + {"INVALID_GROUP_ORDER", 16, 122}, + #endif + #ifdef EC_R_INVALID_KEY + {"INVALID_KEY", ERR_LIB_EC, EC_R_INVALID_KEY}, + #else + {"INVALID_KEY", 16, 116}, + #endif + #ifdef EC_R_INVALID_NAMED_GROUP_CONVERSION + {"INVALID_NAMED_GROUP_CONVERSION", ERR_LIB_EC, EC_R_INVALID_NAMED_GROUP_CONVERSION}, + #else + {"INVALID_NAMED_GROUP_CONVERSION", 16, 174}, + #endif + #ifdef EC_R_INVALID_OUTPUT_LENGTH + {"INVALID_OUTPUT_LENGTH", ERR_LIB_EC, EC_R_INVALID_OUTPUT_LENGTH}, + #else + {"INVALID_OUTPUT_LENGTH", 16, 161}, + #endif + #ifdef EC_R_INVALID_P + {"INVALID_P", ERR_LIB_EC, EC_R_INVALID_P}, + #else + {"INVALID_P", 16, 172}, + #endif + #ifdef EC_R_INVALID_PEER_KEY + {"INVALID_PEER_KEY", ERR_LIB_EC, EC_R_INVALID_PEER_KEY}, + #else + {"INVALID_PEER_KEY", 16, 133}, + #endif + #ifdef EC_R_INVALID_PENTANOMIAL_BASIS + {"INVALID_PENTANOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_PENTANOMIAL_BASIS}, + #else + {"INVALID_PENTANOMIAL_BASIS", 16, 132}, + #endif + #ifdef EC_R_INVALID_PRIVATE_KEY + {"INVALID_PRIVATE_KEY", ERR_LIB_EC, EC_R_INVALID_PRIVATE_KEY}, + #else + {"INVALID_PRIVATE_KEY", 16, 123}, + #endif + #ifdef EC_R_INVALID_SEED + {"INVALID_SEED", ERR_LIB_EC, EC_R_INVALID_SEED}, + #else + {"INVALID_SEED", 16, 175}, + #endif + #ifdef EC_R_INVALID_TRINOMIAL_BASIS + {"INVALID_TRINOMIAL_BASIS", ERR_LIB_EC, EC_R_INVALID_TRINOMIAL_BASIS}, + #else + {"INVALID_TRINOMIAL_BASIS", 16, 137}, + #endif + #ifdef EC_R_KDF_PARAMETER_ERROR + {"KDF_PARAMETER_ERROR", ERR_LIB_EC, EC_R_KDF_PARAMETER_ERROR}, + #else + {"KDF_PARAMETER_ERROR", 16, 148}, + #endif + #ifdef EC_R_KEYS_NOT_SET + {"KEYS_NOT_SET", ERR_LIB_EC, EC_R_KEYS_NOT_SET}, + #else + {"KEYS_NOT_SET", 16, 140}, + #endif + #ifdef EC_R_LADDER_POST_FAILURE + {"LADDER_POST_FAILURE", ERR_LIB_EC, EC_R_LADDER_POST_FAILURE}, + #else + {"LADDER_POST_FAILURE", 16, 136}, + #endif + #ifdef EC_R_LADDER_PRE_FAILURE + {"LADDER_PRE_FAILURE", ERR_LIB_EC, EC_R_LADDER_PRE_FAILURE}, + #else + {"LADDER_PRE_FAILURE", 16, 153}, + #endif + #ifdef EC_R_LADDER_STEP_FAILURE + {"LADDER_STEP_FAILURE", ERR_LIB_EC, EC_R_LADDER_STEP_FAILURE}, + #else + {"LADDER_STEP_FAILURE", 16, 162}, + #endif + #ifdef EC_R_MISSING_OID + {"MISSING_OID", ERR_LIB_EC, EC_R_MISSING_OID}, + #else + {"MISSING_OID", 16, 167}, + #endif + #ifdef EC_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_EC, EC_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", 16, 124}, + #endif + #ifdef EC_R_MISSING_PRIVATE_KEY + {"MISSING_PRIVATE_KEY", ERR_LIB_EC, EC_R_MISSING_PRIVATE_KEY}, + #else + {"MISSING_PRIVATE_KEY", 16, 125}, + #endif + #ifdef EC_R_NEED_NEW_SETUP_VALUES + {"NEED_NEW_SETUP_VALUES", ERR_LIB_EC, EC_R_NEED_NEW_SETUP_VALUES}, + #else + {"NEED_NEW_SETUP_VALUES", 16, 157}, + #endif + #ifdef EC_R_NOT_A_NIST_PRIME + {"NOT_A_NIST_PRIME", ERR_LIB_EC, EC_R_NOT_A_NIST_PRIME}, + #else + {"NOT_A_NIST_PRIME", 16, 135}, + #endif + #ifdef EC_R_NOT_IMPLEMENTED + {"NOT_IMPLEMENTED", ERR_LIB_EC, EC_R_NOT_IMPLEMENTED}, + #else + {"NOT_IMPLEMENTED", 16, 126}, + #endif + #ifdef EC_R_NOT_INITIALIZED + {"NOT_INITIALIZED", ERR_LIB_EC, EC_R_NOT_INITIALIZED}, + #else + {"NOT_INITIALIZED", 16, 111}, + #endif + #ifdef EC_R_NO_PARAMETERS_SET + {"NO_PARAMETERS_SET", ERR_LIB_EC, EC_R_NO_PARAMETERS_SET}, + #else + {"NO_PARAMETERS_SET", 16, 139}, + #endif + #ifdef EC_R_NO_PRIVATE_VALUE + {"NO_PRIVATE_VALUE", ERR_LIB_EC, EC_R_NO_PRIVATE_VALUE}, + #else + {"NO_PRIVATE_VALUE", 16, 154}, + #endif + #ifdef EC_R_OPERATION_NOT_SUPPORTED + {"OPERATION_NOT_SUPPORTED", ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED}, + #else + {"OPERATION_NOT_SUPPORTED", 16, 152}, + #endif + #ifdef EC_R_PASSED_NULL_PARAMETER + {"PASSED_NULL_PARAMETER", ERR_LIB_EC, EC_R_PASSED_NULL_PARAMETER}, + #else + {"PASSED_NULL_PARAMETER", 16, 134}, + #endif + #ifdef EC_R_PEER_KEY_ERROR + {"PEER_KEY_ERROR", ERR_LIB_EC, EC_R_PEER_KEY_ERROR}, + #else + {"PEER_KEY_ERROR", 16, 149}, + #endif + #ifdef EC_R_POINT_ARITHMETIC_FAILURE + {"POINT_ARITHMETIC_FAILURE", ERR_LIB_EC, EC_R_POINT_ARITHMETIC_FAILURE}, + #else + {"POINT_ARITHMETIC_FAILURE", 16, 155}, + #endif + #ifdef EC_R_POINT_AT_INFINITY + {"POINT_AT_INFINITY", ERR_LIB_EC, EC_R_POINT_AT_INFINITY}, + #else + {"POINT_AT_INFINITY", 16, 106}, + #endif + #ifdef EC_R_POINT_COORDINATES_BLIND_FAILURE + {"POINT_COORDINATES_BLIND_FAILURE", ERR_LIB_EC, EC_R_POINT_COORDINATES_BLIND_FAILURE}, + #else + {"POINT_COORDINATES_BLIND_FAILURE", 16, 163}, + #endif + #ifdef EC_R_POINT_IS_NOT_ON_CURVE + {"POINT_IS_NOT_ON_CURVE", ERR_LIB_EC, EC_R_POINT_IS_NOT_ON_CURVE}, + #else + {"POINT_IS_NOT_ON_CURVE", 16, 107}, + #endif + #ifdef EC_R_RANDOM_NUMBER_GENERATION_FAILED + {"RANDOM_NUMBER_GENERATION_FAILED", ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED}, + #else + {"RANDOM_NUMBER_GENERATION_FAILED", 16, 158}, + #endif + #ifdef EC_R_SHARED_INFO_ERROR + {"SHARED_INFO_ERROR", ERR_LIB_EC, EC_R_SHARED_INFO_ERROR}, + #else + {"SHARED_INFO_ERROR", 16, 150}, + #endif + #ifdef EC_R_SLOT_FULL + {"SLOT_FULL", ERR_LIB_EC, EC_R_SLOT_FULL}, + #else + {"SLOT_FULL", 16, 108}, + #endif + #ifdef EC_R_UNDEFINED_GENERATOR + {"UNDEFINED_GENERATOR", ERR_LIB_EC, EC_R_UNDEFINED_GENERATOR}, + #else + {"UNDEFINED_GENERATOR", 16, 113}, + #endif + #ifdef EC_R_UNDEFINED_ORDER + {"UNDEFINED_ORDER", ERR_LIB_EC, EC_R_UNDEFINED_ORDER}, + #else + {"UNDEFINED_ORDER", 16, 128}, + #endif + #ifdef EC_R_UNKNOWN_COFACTOR + {"UNKNOWN_COFACTOR", ERR_LIB_EC, EC_R_UNKNOWN_COFACTOR}, + #else + {"UNKNOWN_COFACTOR", 16, 164}, + #endif + #ifdef EC_R_UNKNOWN_GROUP + {"UNKNOWN_GROUP", ERR_LIB_EC, EC_R_UNKNOWN_GROUP}, + #else + {"UNKNOWN_GROUP", 16, 129}, + #endif + #ifdef EC_R_UNKNOWN_ORDER + {"UNKNOWN_ORDER", ERR_LIB_EC, EC_R_UNKNOWN_ORDER}, + #else + {"UNKNOWN_ORDER", 16, 114}, + #endif + #ifdef EC_R_UNSUPPORTED_FIELD + {"UNSUPPORTED_FIELD", ERR_LIB_EC, EC_R_UNSUPPORTED_FIELD}, + #else + {"UNSUPPORTED_FIELD", 16, 131}, + #endif + #ifdef EC_R_WRONG_CURVE_PARAMETERS + {"WRONG_CURVE_PARAMETERS", ERR_LIB_EC, EC_R_WRONG_CURVE_PARAMETERS}, + #else + {"WRONG_CURVE_PARAMETERS", 16, 145}, + #endif + #ifdef EC_R_WRONG_ORDER + {"WRONG_ORDER", ERR_LIB_EC, EC_R_WRONG_ORDER}, + #else + {"WRONG_ORDER", 16, 130}, + #endif + #ifdef ENGINE_R_ALREADY_LOADED + {"ALREADY_LOADED", ERR_LIB_ENGINE, ENGINE_R_ALREADY_LOADED}, + #else + {"ALREADY_LOADED", 38, 100}, + #endif + #ifdef ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER + {"ARGUMENT_IS_NOT_A_NUMBER", ERR_LIB_ENGINE, ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER}, + #else + {"ARGUMENT_IS_NOT_A_NUMBER", 38, 133}, + #endif + #ifdef ENGINE_R_CMD_NOT_EXECUTABLE + {"CMD_NOT_EXECUTABLE", ERR_LIB_ENGINE, ENGINE_R_CMD_NOT_EXECUTABLE}, + #else + {"CMD_NOT_EXECUTABLE", 38, 134}, + #endif + #ifdef ENGINE_R_COMMAND_TAKES_INPUT + {"COMMAND_TAKES_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_INPUT}, + #else + {"COMMAND_TAKES_INPUT", 38, 135}, + #endif + #ifdef ENGINE_R_COMMAND_TAKES_NO_INPUT + {"COMMAND_TAKES_NO_INPUT", ERR_LIB_ENGINE, ENGINE_R_COMMAND_TAKES_NO_INPUT}, + #else + {"COMMAND_TAKES_NO_INPUT", 38, 136}, + #endif + #ifdef ENGINE_R_CONFLICTING_ENGINE_ID + {"CONFLICTING_ENGINE_ID", ERR_LIB_ENGINE, ENGINE_R_CONFLICTING_ENGINE_ID}, + #else + {"CONFLICTING_ENGINE_ID", 38, 103}, + #endif + #ifdef ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED + {"CTRL_COMMAND_NOT_IMPLEMENTED", ERR_LIB_ENGINE, ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED}, + #else + {"CTRL_COMMAND_NOT_IMPLEMENTED", 38, 119}, + #endif + #ifdef ENGINE_R_DSO_FAILURE + {"DSO_FAILURE", ERR_LIB_ENGINE, ENGINE_R_DSO_FAILURE}, + #else + {"DSO_FAILURE", 38, 104}, + #endif + #ifdef ENGINE_R_DSO_NOT_FOUND + {"DSO_NOT_FOUND", ERR_LIB_ENGINE, ENGINE_R_DSO_NOT_FOUND}, + #else + {"DSO_NOT_FOUND", 38, 132}, + #endif + #ifdef ENGINE_R_ENGINES_SECTION_ERROR + {"ENGINES_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINES_SECTION_ERROR}, + #else + {"ENGINES_SECTION_ERROR", 38, 148}, + #endif + #ifdef ENGINE_R_ENGINE_CONFIGURATION_ERROR + {"ENGINE_CONFIGURATION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_CONFIGURATION_ERROR}, + #else + {"ENGINE_CONFIGURATION_ERROR", 38, 102}, + #endif + #ifdef ENGINE_R_ENGINE_IS_NOT_IN_LIST + {"ENGINE_IS_NOT_IN_LIST", ERR_LIB_ENGINE, ENGINE_R_ENGINE_IS_NOT_IN_LIST}, + #else + {"ENGINE_IS_NOT_IN_LIST", 38, 105}, + #endif + #ifdef ENGINE_R_ENGINE_SECTION_ERROR + {"ENGINE_SECTION_ERROR", ERR_LIB_ENGINE, ENGINE_R_ENGINE_SECTION_ERROR}, + #else + {"ENGINE_SECTION_ERROR", 38, 149}, + #endif + #ifdef ENGINE_R_FAILED_LOADING_PRIVATE_KEY + {"FAILED_LOADING_PRIVATE_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PRIVATE_KEY}, + #else + {"FAILED_LOADING_PRIVATE_KEY", 38, 128}, + #endif + #ifdef ENGINE_R_FAILED_LOADING_PUBLIC_KEY + {"FAILED_LOADING_PUBLIC_KEY", ERR_LIB_ENGINE, ENGINE_R_FAILED_LOADING_PUBLIC_KEY}, + #else + {"FAILED_LOADING_PUBLIC_KEY", 38, 129}, + #endif + #ifdef ENGINE_R_FINISH_FAILED + {"FINISH_FAILED", ERR_LIB_ENGINE, ENGINE_R_FINISH_FAILED}, + #else + {"FINISH_FAILED", 38, 106}, + #endif + #ifdef ENGINE_R_ID_OR_NAME_MISSING + {"ID_OR_NAME_MISSING", ERR_LIB_ENGINE, ENGINE_R_ID_OR_NAME_MISSING}, + #else + {"ID_OR_NAME_MISSING", 38, 108}, + #endif + #ifdef ENGINE_R_INIT_FAILED + {"INIT_FAILED", ERR_LIB_ENGINE, ENGINE_R_INIT_FAILED}, + #else + {"INIT_FAILED", 38, 109}, + #endif + #ifdef ENGINE_R_INTERNAL_LIST_ERROR + {"INTERNAL_LIST_ERROR", ERR_LIB_ENGINE, ENGINE_R_INTERNAL_LIST_ERROR}, + #else + {"INTERNAL_LIST_ERROR", 38, 110}, + #endif + #ifdef ENGINE_R_INVALID_ARGUMENT + {"INVALID_ARGUMENT", ERR_LIB_ENGINE, ENGINE_R_INVALID_ARGUMENT}, + #else + {"INVALID_ARGUMENT", 38, 143}, + #endif + #ifdef ENGINE_R_INVALID_CMD_NAME + {"INVALID_CMD_NAME", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NAME}, + #else + {"INVALID_CMD_NAME", 38, 137}, + #endif + #ifdef ENGINE_R_INVALID_CMD_NUMBER + {"INVALID_CMD_NUMBER", ERR_LIB_ENGINE, ENGINE_R_INVALID_CMD_NUMBER}, + #else + {"INVALID_CMD_NUMBER", 38, 138}, + #endif + #ifdef ENGINE_R_INVALID_INIT_VALUE + {"INVALID_INIT_VALUE", ERR_LIB_ENGINE, ENGINE_R_INVALID_INIT_VALUE}, + #else + {"INVALID_INIT_VALUE", 38, 151}, + #endif + #ifdef ENGINE_R_INVALID_STRING + {"INVALID_STRING", ERR_LIB_ENGINE, ENGINE_R_INVALID_STRING}, + #else + {"INVALID_STRING", 38, 150}, + #endif + #ifdef ENGINE_R_NOT_INITIALISED + {"NOT_INITIALISED", ERR_LIB_ENGINE, ENGINE_R_NOT_INITIALISED}, + #else + {"NOT_INITIALISED", 38, 117}, + #endif + #ifdef ENGINE_R_NOT_LOADED + {"NOT_LOADED", ERR_LIB_ENGINE, ENGINE_R_NOT_LOADED}, + #else + {"NOT_LOADED", 38, 112}, + #endif + #ifdef ENGINE_R_NO_CONTROL_FUNCTION + {"NO_CONTROL_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_CONTROL_FUNCTION}, + #else + {"NO_CONTROL_FUNCTION", 38, 120}, + #endif + #ifdef ENGINE_R_NO_INDEX + {"NO_INDEX", ERR_LIB_ENGINE, ENGINE_R_NO_INDEX}, + #else + {"NO_INDEX", 38, 144}, + #endif + #ifdef ENGINE_R_NO_LOAD_FUNCTION + {"NO_LOAD_FUNCTION", ERR_LIB_ENGINE, ENGINE_R_NO_LOAD_FUNCTION}, + #else + {"NO_LOAD_FUNCTION", 38, 125}, + #endif + #ifdef ENGINE_R_NO_REFERENCE + {"NO_REFERENCE", ERR_LIB_ENGINE, ENGINE_R_NO_REFERENCE}, + #else + {"NO_REFERENCE", 38, 130}, + #endif + #ifdef ENGINE_R_NO_SUCH_ENGINE + {"NO_SUCH_ENGINE", ERR_LIB_ENGINE, ENGINE_R_NO_SUCH_ENGINE}, + #else + {"NO_SUCH_ENGINE", 38, 116}, + #endif + #ifdef ENGINE_R_UNIMPLEMENTED_CIPHER + {"UNIMPLEMENTED_CIPHER", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_CIPHER}, + #else + {"UNIMPLEMENTED_CIPHER", 38, 146}, + #endif + #ifdef ENGINE_R_UNIMPLEMENTED_DIGEST + {"UNIMPLEMENTED_DIGEST", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_DIGEST}, + #else + {"UNIMPLEMENTED_DIGEST", 38, 147}, + #endif + #ifdef ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD + {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", ERR_LIB_ENGINE, ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD}, + #else + {"UNIMPLEMENTED_PUBLIC_KEY_METHOD", 38, 101}, + #endif + #ifdef ENGINE_R_VERSION_INCOMPATIBILITY + {"VERSION_INCOMPATIBILITY", ERR_LIB_ENGINE, ENGINE_R_VERSION_INCOMPATIBILITY}, + #else + {"VERSION_INCOMPATIBILITY", 38, 145}, + #endif + #ifdef ESS_R_EMPTY_ESS_CERT_ID_LIST + {"EMPTY_ESS_CERT_ID_LIST", ERR_LIB_ESS, ESS_R_EMPTY_ESS_CERT_ID_LIST}, + #else + {"EMPTY_ESS_CERT_ID_LIST", 54, 107}, + #endif + #ifdef ESS_R_ESS_CERT_DIGEST_ERROR + {"ESS_CERT_DIGEST_ERROR", ERR_LIB_ESS, ESS_R_ESS_CERT_DIGEST_ERROR}, + #else + {"ESS_CERT_DIGEST_ERROR", 54, 103}, + #endif + #ifdef ESS_R_ESS_CERT_ID_NOT_FOUND + {"ESS_CERT_ID_NOT_FOUND", ERR_LIB_ESS, ESS_R_ESS_CERT_ID_NOT_FOUND}, + #else + {"ESS_CERT_ID_NOT_FOUND", 54, 104}, + #endif + #ifdef ESS_R_ESS_CERT_ID_WRONG_ORDER + {"ESS_CERT_ID_WRONG_ORDER", ERR_LIB_ESS, ESS_R_ESS_CERT_ID_WRONG_ORDER}, + #else + {"ESS_CERT_ID_WRONG_ORDER", 54, 105}, + #endif + #ifdef ESS_R_ESS_DIGEST_ALG_UNKNOWN + {"ESS_DIGEST_ALG_UNKNOWN", ERR_LIB_ESS, ESS_R_ESS_DIGEST_ALG_UNKNOWN}, + #else + {"ESS_DIGEST_ALG_UNKNOWN", 54, 106}, + #endif + #ifdef ESS_R_ESS_SIGNING_CERTIFICATE_ERROR + {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_ESS, ESS_R_ESS_SIGNING_CERTIFICATE_ERROR}, + #else + {"ESS_SIGNING_CERTIFICATE_ERROR", 54, 102}, + #endif + #ifdef ESS_R_ESS_SIGNING_CERT_ADD_ERROR + {"ESS_SIGNING_CERT_ADD_ERROR", ERR_LIB_ESS, ESS_R_ESS_SIGNING_CERT_ADD_ERROR}, + #else + {"ESS_SIGNING_CERT_ADD_ERROR", 54, 100}, + #endif + #ifdef ESS_R_ESS_SIGNING_CERT_V2_ADD_ERROR + {"ESS_SIGNING_CERT_V2_ADD_ERROR", ERR_LIB_ESS, ESS_R_ESS_SIGNING_CERT_V2_ADD_ERROR}, + #else + {"ESS_SIGNING_CERT_V2_ADD_ERROR", 54, 101}, + #endif + #ifdef ESS_R_MISSING_SIGNING_CERTIFICATE_ATTRIBUTE + {"MISSING_SIGNING_CERTIFICATE_ATTRIBUTE", ERR_LIB_ESS, ESS_R_MISSING_SIGNING_CERTIFICATE_ATTRIBUTE}, + #else + {"MISSING_SIGNING_CERTIFICATE_ATTRIBUTE", 54, 108}, + #endif + #ifdef EVP_R_AES_KEY_SETUP_FAILED + {"AES_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_AES_KEY_SETUP_FAILED}, + #else + {"AES_KEY_SETUP_FAILED", 6, 143}, + #endif + #ifdef EVP_R_ARIA_KEY_SETUP_FAILED + {"ARIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_ARIA_KEY_SETUP_FAILED}, + #else + {"ARIA_KEY_SETUP_FAILED", 6, 176}, + #endif + #ifdef EVP_R_BAD_ALGORITHM_NAME + {"BAD_ALGORITHM_NAME", ERR_LIB_EVP, EVP_R_BAD_ALGORITHM_NAME}, + #else + {"BAD_ALGORITHM_NAME", 6, 200}, + #endif + #ifdef EVP_R_BAD_DECRYPT + {"BAD_DECRYPT", ERR_LIB_EVP, EVP_R_BAD_DECRYPT}, + #else + {"BAD_DECRYPT", 6, 100}, + #endif + #ifdef EVP_R_BAD_KEY_LENGTH + {"BAD_KEY_LENGTH", ERR_LIB_EVP, EVP_R_BAD_KEY_LENGTH}, + #else + {"BAD_KEY_LENGTH", 6, 195}, + #endif + #ifdef EVP_R_BUFFER_TOO_SMALL + {"BUFFER_TOO_SMALL", ERR_LIB_EVP, EVP_R_BUFFER_TOO_SMALL}, + #else + {"BUFFER_TOO_SMALL", 6, 155}, + #endif + #ifdef EVP_R_CACHE_CONSTANTS_FAILED + {"CACHE_CONSTANTS_FAILED", ERR_LIB_EVP, EVP_R_CACHE_CONSTANTS_FAILED}, + #else + {"CACHE_CONSTANTS_FAILED", 6, 225}, + #endif + #ifdef EVP_R_CAMELLIA_KEY_SETUP_FAILED + {"CAMELLIA_KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_CAMELLIA_KEY_SETUP_FAILED}, + #else + {"CAMELLIA_KEY_SETUP_FAILED", 6, 157}, + #endif + #ifdef EVP_R_CANNOT_GET_PARAMETERS + {"CANNOT_GET_PARAMETERS", ERR_LIB_EVP, EVP_R_CANNOT_GET_PARAMETERS}, + #else + {"CANNOT_GET_PARAMETERS", 6, 197}, + #endif + #ifdef EVP_R_CANNOT_SET_PARAMETERS + {"CANNOT_SET_PARAMETERS", ERR_LIB_EVP, EVP_R_CANNOT_SET_PARAMETERS}, + #else + {"CANNOT_SET_PARAMETERS", 6, 198}, + #endif + #ifdef EVP_R_CIPHER_NOT_GCM_MODE + {"CIPHER_NOT_GCM_MODE", ERR_LIB_EVP, EVP_R_CIPHER_NOT_GCM_MODE}, + #else + {"CIPHER_NOT_GCM_MODE", 6, 184}, + #endif + #ifdef EVP_R_CIPHER_PARAMETER_ERROR + {"CIPHER_PARAMETER_ERROR", ERR_LIB_EVP, EVP_R_CIPHER_PARAMETER_ERROR}, + #else + {"CIPHER_PARAMETER_ERROR", 6, 122}, + #endif + #ifdef EVP_R_COMMAND_NOT_SUPPORTED + {"COMMAND_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_COMMAND_NOT_SUPPORTED}, + #else + {"COMMAND_NOT_SUPPORTED", 6, 147}, + #endif + #ifdef EVP_R_CONFLICTING_ALGORITHM_NAME + {"CONFLICTING_ALGORITHM_NAME", ERR_LIB_EVP, EVP_R_CONFLICTING_ALGORITHM_NAME}, + #else + {"CONFLICTING_ALGORITHM_NAME", 6, 201}, + #endif + #ifdef EVP_R_COPY_ERROR + {"COPY_ERROR", ERR_LIB_EVP, EVP_R_COPY_ERROR}, + #else + {"COPY_ERROR", 6, 173}, + #endif + #ifdef EVP_R_CTRL_NOT_IMPLEMENTED + {"CTRL_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_NOT_IMPLEMENTED}, + #else + {"CTRL_NOT_IMPLEMENTED", 6, 132}, + #endif + #ifdef EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED + {"CTRL_OPERATION_NOT_IMPLEMENTED", ERR_LIB_EVP, EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED}, + #else + {"CTRL_OPERATION_NOT_IMPLEMENTED", 6, 133}, + #endif + #ifdef EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH + {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH}, + #else + {"DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH", 6, 138}, + #endif + #ifdef EVP_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_EVP, EVP_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", 6, 114}, + #endif + #ifdef EVP_R_DEFAULT_QUERY_PARSE_ERROR + {"DEFAULT_QUERY_PARSE_ERROR", ERR_LIB_EVP, EVP_R_DEFAULT_QUERY_PARSE_ERROR}, + #else + {"DEFAULT_QUERY_PARSE_ERROR", 6, 210}, + #endif + #ifdef EVP_R_DIFFERENT_KEY_TYPES + {"DIFFERENT_KEY_TYPES", ERR_LIB_EVP, EVP_R_DIFFERENT_KEY_TYPES}, + #else + {"DIFFERENT_KEY_TYPES", 6, 101}, + #endif + #ifdef EVP_R_DIFFERENT_PARAMETERS + {"DIFFERENT_PARAMETERS", ERR_LIB_EVP, EVP_R_DIFFERENT_PARAMETERS}, + #else + {"DIFFERENT_PARAMETERS", 6, 153}, + #endif + #ifdef EVP_R_ERROR_LOADING_SECTION + {"ERROR_LOADING_SECTION", ERR_LIB_EVP, EVP_R_ERROR_LOADING_SECTION}, + #else + {"ERROR_LOADING_SECTION", 6, 165}, + #endif + #ifdef EVP_R_ERROR_SETTING_FIPS_MODE + {"ERROR_SETTING_FIPS_MODE", ERR_LIB_EVP, EVP_R_ERROR_SETTING_FIPS_MODE}, + #else + {"ERROR_SETTING_FIPS_MODE", 6, 166}, + #endif + #ifdef EVP_R_EXPECTING_AN_HMAC_KEY + {"EXPECTING_AN_HMAC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_HMAC_KEY}, + #else + {"EXPECTING_AN_HMAC_KEY", 6, 174}, + #endif + #ifdef EVP_R_EXPECTING_AN_RSA_KEY + {"EXPECTING_AN_RSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_AN_RSA_KEY}, + #else + {"EXPECTING_AN_RSA_KEY", 6, 127}, + #endif + #ifdef EVP_R_EXPECTING_A_DH_KEY + {"EXPECTING_A_DH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DH_KEY}, + #else + {"EXPECTING_A_DH_KEY", 6, 128}, + #endif + #ifdef EVP_R_EXPECTING_A_DSA_KEY + {"EXPECTING_A_DSA_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_DSA_KEY}, + #else + {"EXPECTING_A_DSA_KEY", 6, 129}, + #endif + #ifdef EVP_R_EXPECTING_A_ECX_KEY + {"EXPECTING_A_ECX_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_ECX_KEY}, + #else + {"EXPECTING_A_ECX_KEY", 6, 219}, + #endif + #ifdef EVP_R_EXPECTING_A_EC_KEY + {"EXPECTING_A_EC_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_EC_KEY}, + #else + {"EXPECTING_A_EC_KEY", 6, 142}, + #endif + #ifdef EVP_R_EXPECTING_A_POLY1305_KEY + {"EXPECTING_A_POLY1305_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_POLY1305_KEY}, + #else + {"EXPECTING_A_POLY1305_KEY", 6, 164}, + #endif + #ifdef EVP_R_EXPECTING_A_SIPHASH_KEY + {"EXPECTING_A_SIPHASH_KEY", ERR_LIB_EVP, EVP_R_EXPECTING_A_SIPHASH_KEY}, + #else + {"EXPECTING_A_SIPHASH_KEY", 6, 175}, + #endif + #ifdef EVP_R_FINAL_ERROR + {"FINAL_ERROR", ERR_LIB_EVP, EVP_R_FINAL_ERROR}, + #else + {"FINAL_ERROR", 6, 188}, + #endif + #ifdef EVP_R_FIPS_MODE_NOT_SUPPORTED + {"FIPS_MODE_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_FIPS_MODE_NOT_SUPPORTED}, + #else + {"FIPS_MODE_NOT_SUPPORTED", 6, 167}, + #endif + #ifdef EVP_R_GENERATE_ERROR + {"GENERATE_ERROR", ERR_LIB_EVP, EVP_R_GENERATE_ERROR}, + #else + {"GENERATE_ERROR", 6, 214}, + #endif + #ifdef EVP_R_GET_RAW_KEY_FAILED + {"GET_RAW_KEY_FAILED", ERR_LIB_EVP, EVP_R_GET_RAW_KEY_FAILED}, + #else + {"GET_RAW_KEY_FAILED", 6, 182}, + #endif + #ifdef EVP_R_ILLEGAL_SCRYPT_PARAMETERS + {"ILLEGAL_SCRYPT_PARAMETERS", ERR_LIB_EVP, EVP_R_ILLEGAL_SCRYPT_PARAMETERS}, + #else + {"ILLEGAL_SCRYPT_PARAMETERS", 6, 171}, + #endif + #ifdef EVP_R_INACCESSIBLE_DOMAIN_PARAMETERS + {"INACCESSIBLE_DOMAIN_PARAMETERS", ERR_LIB_EVP, EVP_R_INACCESSIBLE_DOMAIN_PARAMETERS}, + #else + {"INACCESSIBLE_DOMAIN_PARAMETERS", 6, 204}, + #endif + #ifdef EVP_R_INACCESSIBLE_KEY + {"INACCESSIBLE_KEY", ERR_LIB_EVP, EVP_R_INACCESSIBLE_KEY}, + #else + {"INACCESSIBLE_KEY", 6, 203}, + #endif + #ifdef EVP_R_INITIALIZATION_ERROR + {"INITIALIZATION_ERROR", ERR_LIB_EVP, EVP_R_INITIALIZATION_ERROR}, + #else + {"INITIALIZATION_ERROR", 6, 134}, + #endif + #ifdef EVP_R_INPUT_NOT_INITIALIZED + {"INPUT_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_INPUT_NOT_INITIALIZED}, + #else + {"INPUT_NOT_INITIALIZED", 6, 111}, + #endif + #ifdef EVP_R_INVALID_CUSTOM_LENGTH + {"INVALID_CUSTOM_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_CUSTOM_LENGTH}, + #else + {"INVALID_CUSTOM_LENGTH", 6, 185}, + #endif + #ifdef EVP_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_EVP, EVP_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", 6, 152}, + #endif + #ifdef EVP_R_INVALID_FIPS_MODE + {"INVALID_FIPS_MODE", ERR_LIB_EVP, EVP_R_INVALID_FIPS_MODE}, + #else + {"INVALID_FIPS_MODE", 6, 168}, + #endif + #ifdef EVP_R_INVALID_IV_LENGTH + {"INVALID_IV_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_IV_LENGTH}, + #else + {"INVALID_IV_LENGTH", 6, 194}, + #endif + #ifdef EVP_R_INVALID_KEY + {"INVALID_KEY", ERR_LIB_EVP, EVP_R_INVALID_KEY}, + #else + {"INVALID_KEY", 6, 163}, + #endif + #ifdef EVP_R_INVALID_KEY_LENGTH + {"INVALID_KEY_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_KEY_LENGTH}, + #else + {"INVALID_KEY_LENGTH", 6, 130}, + #endif + #ifdef EVP_R_INVALID_LENGTH + {"INVALID_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_LENGTH}, + #else + {"INVALID_LENGTH", 6, 221}, + #endif + #ifdef EVP_R_INVALID_NULL_ALGORITHM + {"INVALID_NULL_ALGORITHM", ERR_LIB_EVP, EVP_R_INVALID_NULL_ALGORITHM}, + #else + {"INVALID_NULL_ALGORITHM", 6, 218}, + #endif + #ifdef EVP_R_INVALID_OPERATION + {"INVALID_OPERATION", ERR_LIB_EVP, EVP_R_INVALID_OPERATION}, + #else + {"INVALID_OPERATION", 6, 148}, + #endif + #ifdef EVP_R_INVALID_PROVIDER_FUNCTIONS + {"INVALID_PROVIDER_FUNCTIONS", ERR_LIB_EVP, EVP_R_INVALID_PROVIDER_FUNCTIONS}, + #else + {"INVALID_PROVIDER_FUNCTIONS", 6, 193}, + #endif + #ifdef EVP_R_INVALID_SALT_LENGTH + {"INVALID_SALT_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_SALT_LENGTH}, + #else + {"INVALID_SALT_LENGTH", 6, 186}, + #endif + #ifdef EVP_R_INVALID_SECRET_LENGTH + {"INVALID_SECRET_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_SECRET_LENGTH}, + #else + {"INVALID_SECRET_LENGTH", 6, 223}, + #endif + #ifdef EVP_R_INVALID_SEED_LENGTH + {"INVALID_SEED_LENGTH", ERR_LIB_EVP, EVP_R_INVALID_SEED_LENGTH}, + #else + {"INVALID_SEED_LENGTH", 6, 220}, + #endif + #ifdef EVP_R_INVALID_VALUE + {"INVALID_VALUE", ERR_LIB_EVP, EVP_R_INVALID_VALUE}, + #else + {"INVALID_VALUE", 6, 222}, + #endif + #ifdef EVP_R_KEYMGMT_EXPORT_FAILURE + {"KEYMGMT_EXPORT_FAILURE", ERR_LIB_EVP, EVP_R_KEYMGMT_EXPORT_FAILURE}, + #else + {"KEYMGMT_EXPORT_FAILURE", 6, 205}, + #endif + #ifdef EVP_R_KEY_SETUP_FAILED + {"KEY_SETUP_FAILED", ERR_LIB_EVP, EVP_R_KEY_SETUP_FAILED}, + #else + {"KEY_SETUP_FAILED", 6, 180}, + #endif + #ifdef EVP_R_LOCKING_NOT_SUPPORTED + {"LOCKING_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_LOCKING_NOT_SUPPORTED}, + #else + {"LOCKING_NOT_SUPPORTED", 6, 213}, + #endif + #ifdef EVP_R_MEMORY_LIMIT_EXCEEDED + {"MEMORY_LIMIT_EXCEEDED", ERR_LIB_EVP, EVP_R_MEMORY_LIMIT_EXCEEDED}, + #else + {"MEMORY_LIMIT_EXCEEDED", 6, 172}, + #endif + #ifdef EVP_R_MESSAGE_DIGEST_IS_NULL + {"MESSAGE_DIGEST_IS_NULL", ERR_LIB_EVP, EVP_R_MESSAGE_DIGEST_IS_NULL}, + #else + {"MESSAGE_DIGEST_IS_NULL", 6, 159}, + #endif + #ifdef EVP_R_METHOD_NOT_SUPPORTED + {"METHOD_NOT_SUPPORTED", ERR_LIB_EVP, EVP_R_METHOD_NOT_SUPPORTED}, + #else + {"METHOD_NOT_SUPPORTED", 6, 144}, + #endif + #ifdef EVP_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_EVP, EVP_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", 6, 103}, + #endif + #ifdef EVP_R_NOT_ABLE_TO_COPY_CTX + {"NOT_ABLE_TO_COPY_CTX", ERR_LIB_EVP, EVP_R_NOT_ABLE_TO_COPY_CTX}, + #else + {"NOT_ABLE_TO_COPY_CTX", 6, 190}, + #endif + #ifdef EVP_R_NOT_XOF_OR_INVALID_LENGTH + {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_EVP, EVP_R_NOT_XOF_OR_INVALID_LENGTH}, + #else + {"NOT_XOF_OR_INVALID_LENGTH", 6, 178}, + #endif + #ifdef EVP_R_NO_CIPHER_SET + {"NO_CIPHER_SET", ERR_LIB_EVP, EVP_R_NO_CIPHER_SET}, + #else + {"NO_CIPHER_SET", 6, 131}, + #endif + #ifdef EVP_R_NO_DEFAULT_DIGEST + {"NO_DEFAULT_DIGEST", ERR_LIB_EVP, EVP_R_NO_DEFAULT_DIGEST}, + #else + {"NO_DEFAULT_DIGEST", 6, 158}, + #endif + #ifdef EVP_R_NO_DIGEST_SET + {"NO_DIGEST_SET", ERR_LIB_EVP, EVP_R_NO_DIGEST_SET}, + #else + {"NO_DIGEST_SET", 6, 139}, + #endif + #ifdef EVP_R_NO_IMPORT_FUNCTION + {"NO_IMPORT_FUNCTION", ERR_LIB_EVP, EVP_R_NO_IMPORT_FUNCTION}, + #else + {"NO_IMPORT_FUNCTION", 6, 206}, + #endif + #ifdef EVP_R_NO_KEYMGMT_AVAILABLE + {"NO_KEYMGMT_AVAILABLE", ERR_LIB_EVP, EVP_R_NO_KEYMGMT_AVAILABLE}, + #else + {"NO_KEYMGMT_AVAILABLE", 6, 199}, + #endif + #ifdef EVP_R_NO_KEYMGMT_PRESENT + {"NO_KEYMGMT_PRESENT", ERR_LIB_EVP, EVP_R_NO_KEYMGMT_PRESENT}, + #else + {"NO_KEYMGMT_PRESENT", 6, 196}, + #endif + #ifdef EVP_R_NO_KEY_SET + {"NO_KEY_SET", ERR_LIB_EVP, EVP_R_NO_KEY_SET}, + #else + {"NO_KEY_SET", 6, 154}, + #endif + #ifdef EVP_R_NO_OPERATION_SET + {"NO_OPERATION_SET", ERR_LIB_EVP, EVP_R_NO_OPERATION_SET}, + #else + {"NO_OPERATION_SET", 6, 149}, + #endif + #ifdef EVP_R_NULL_MAC_PKEY_CTX + {"NULL_MAC_PKEY_CTX", ERR_LIB_EVP, EVP_R_NULL_MAC_PKEY_CTX}, + #else + {"NULL_MAC_PKEY_CTX", 6, 208}, + #endif + #ifdef EVP_R_ONLY_ONESHOT_SUPPORTED + {"ONLY_ONESHOT_SUPPORTED", ERR_LIB_EVP, EVP_R_ONLY_ONESHOT_SUPPORTED}, + #else + {"ONLY_ONESHOT_SUPPORTED", 6, 177}, + #endif + #ifdef EVP_R_OPERATION_NOT_INITIALIZED + {"OPERATION_NOT_INITIALIZED", ERR_LIB_EVP, EVP_R_OPERATION_NOT_INITIALIZED}, + #else + {"OPERATION_NOT_INITIALIZED", 6, 151}, + #endif + #ifdef EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE}, + #else + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 6, 150}, + #endif + #ifdef EVP_R_OUTPUT_WOULD_OVERFLOW + {"OUTPUT_WOULD_OVERFLOW", ERR_LIB_EVP, EVP_R_OUTPUT_WOULD_OVERFLOW}, + #else + {"OUTPUT_WOULD_OVERFLOW", 6, 202}, + #endif + #ifdef EVP_R_PARAMETER_TOO_LARGE + {"PARAMETER_TOO_LARGE", ERR_LIB_EVP, EVP_R_PARAMETER_TOO_LARGE}, + #else + {"PARAMETER_TOO_LARGE", 6, 187}, + #endif + #ifdef EVP_R_PARTIALLY_OVERLAPPING + {"PARTIALLY_OVERLAPPING", ERR_LIB_EVP, EVP_R_PARTIALLY_OVERLAPPING}, + #else + {"PARTIALLY_OVERLAPPING", 6, 162}, + #endif + #ifdef EVP_R_PBKDF2_ERROR + {"PBKDF2_ERROR", ERR_LIB_EVP, EVP_R_PBKDF2_ERROR}, + #else + {"PBKDF2_ERROR", 6, 181}, + #endif + #ifdef EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED + {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", ERR_LIB_EVP, EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED}, + #else + {"PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED", 6, 179}, + #endif + #ifdef EVP_R_PRIVATE_KEY_DECODE_ERROR + {"PRIVATE_KEY_DECODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_DECODE_ERROR}, + #else + {"PRIVATE_KEY_DECODE_ERROR", 6, 145}, + #endif + #ifdef EVP_R_PRIVATE_KEY_ENCODE_ERROR + {"PRIVATE_KEY_ENCODE_ERROR", ERR_LIB_EVP, EVP_R_PRIVATE_KEY_ENCODE_ERROR}, + #else + {"PRIVATE_KEY_ENCODE_ERROR", 6, 146}, + #endif + #ifdef EVP_R_PUBLIC_KEY_NOT_RSA + {"PUBLIC_KEY_NOT_RSA", ERR_LIB_EVP, EVP_R_PUBLIC_KEY_NOT_RSA}, + #else + {"PUBLIC_KEY_NOT_RSA", 6, 106}, + #endif + #ifdef EVP_R_SET_DEFAULT_PROPERTY_FAILURE + {"SET_DEFAULT_PROPERTY_FAILURE", ERR_LIB_EVP, EVP_R_SET_DEFAULT_PROPERTY_FAILURE}, + #else + {"SET_DEFAULT_PROPERTY_FAILURE", 6, 209}, + #endif + #ifdef EVP_R_TOO_MANY_RECORDS + {"TOO_MANY_RECORDS", ERR_LIB_EVP, EVP_R_TOO_MANY_RECORDS}, + #else + {"TOO_MANY_RECORDS", 6, 183}, + #endif + #ifdef EVP_R_UNABLE_TO_ENABLE_LOCKING + {"UNABLE_TO_ENABLE_LOCKING", ERR_LIB_EVP, EVP_R_UNABLE_TO_ENABLE_LOCKING}, + #else + {"UNABLE_TO_ENABLE_LOCKING", 6, 212}, + #endif + #ifdef EVP_R_UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE + {"UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE", ERR_LIB_EVP, EVP_R_UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE}, + #else + {"UNABLE_TO_GET_MAXIMUM_REQUEST_SIZE", 6, 215}, + #endif + #ifdef EVP_R_UNABLE_TO_GET_RANDOM_STRENGTH + {"UNABLE_TO_GET_RANDOM_STRENGTH", ERR_LIB_EVP, EVP_R_UNABLE_TO_GET_RANDOM_STRENGTH}, + #else + {"UNABLE_TO_GET_RANDOM_STRENGTH", 6, 216}, + #endif + #ifdef EVP_R_UNABLE_TO_LOCK_CONTEXT + {"UNABLE_TO_LOCK_CONTEXT", ERR_LIB_EVP, EVP_R_UNABLE_TO_LOCK_CONTEXT}, + #else + {"UNABLE_TO_LOCK_CONTEXT", 6, 211}, + #endif + #ifdef EVP_R_UNABLE_TO_SET_CALLBACKS + {"UNABLE_TO_SET_CALLBACKS", ERR_LIB_EVP, EVP_R_UNABLE_TO_SET_CALLBACKS}, + #else + {"UNABLE_TO_SET_CALLBACKS", 6, 217}, + #endif + #ifdef EVP_R_UNKNOWN_CIPHER + {"UNKNOWN_CIPHER", ERR_LIB_EVP, EVP_R_UNKNOWN_CIPHER}, + #else + {"UNKNOWN_CIPHER", 6, 160}, + #endif + #ifdef EVP_R_UNKNOWN_DIGEST + {"UNKNOWN_DIGEST", ERR_LIB_EVP, EVP_R_UNKNOWN_DIGEST}, + #else + {"UNKNOWN_DIGEST", 6, 161}, + #endif + #ifdef EVP_R_UNKNOWN_KEY_TYPE + {"UNKNOWN_KEY_TYPE", ERR_LIB_EVP, EVP_R_UNKNOWN_KEY_TYPE}, + #else + {"UNKNOWN_KEY_TYPE", 6, 207}, + #endif + #ifdef EVP_R_UNKNOWN_OPTION + {"UNKNOWN_OPTION", ERR_LIB_EVP, EVP_R_UNKNOWN_OPTION}, + #else + {"UNKNOWN_OPTION", 6, 169}, + #endif + #ifdef EVP_R_UNKNOWN_PBE_ALGORITHM + {"UNKNOWN_PBE_ALGORITHM", ERR_LIB_EVP, EVP_R_UNKNOWN_PBE_ALGORITHM}, + #else + {"UNKNOWN_PBE_ALGORITHM", 6, 121}, + #endif + #ifdef EVP_R_UNSUPPORTED_ALGORITHM + {"UNSUPPORTED_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_ALGORITHM}, + #else + {"UNSUPPORTED_ALGORITHM", 6, 156}, + #endif + #ifdef EVP_R_UNSUPPORTED_CIPHER + {"UNSUPPORTED_CIPHER", ERR_LIB_EVP, EVP_R_UNSUPPORTED_CIPHER}, + #else + {"UNSUPPORTED_CIPHER", 6, 107}, + #endif + #ifdef EVP_R_UNSUPPORTED_KEYLENGTH + {"UNSUPPORTED_KEYLENGTH", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEYLENGTH}, + #else + {"UNSUPPORTED_KEYLENGTH", 6, 123}, + #endif + #ifdef EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION + {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION}, + #else + {"UNSUPPORTED_KEY_DERIVATION_FUNCTION", 6, 124}, + #endif + #ifdef EVP_R_UNSUPPORTED_KEY_SIZE + {"UNSUPPORTED_KEY_SIZE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_SIZE}, + #else + {"UNSUPPORTED_KEY_SIZE", 6, 108}, + #endif + #ifdef EVP_R_UNSUPPORTED_KEY_TYPE + {"UNSUPPORTED_KEY_TYPE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_KEY_TYPE}, + #else + {"UNSUPPORTED_KEY_TYPE", 6, 224}, + #endif + #ifdef EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS + {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_EVP, EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS}, + #else + {"UNSUPPORTED_NUMBER_OF_ROUNDS", 6, 135}, + #endif + #ifdef EVP_R_UNSUPPORTED_PRF + {"UNSUPPORTED_PRF", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRF}, + #else + {"UNSUPPORTED_PRF", 6, 125}, + #endif + #ifdef EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM + {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", ERR_LIB_EVP, EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM}, + #else + {"UNSUPPORTED_PRIVATE_KEY_ALGORITHM", 6, 118}, + #endif + #ifdef EVP_R_UNSUPPORTED_SALT_TYPE + {"UNSUPPORTED_SALT_TYPE", ERR_LIB_EVP, EVP_R_UNSUPPORTED_SALT_TYPE}, + #else + {"UNSUPPORTED_SALT_TYPE", 6, 126}, + #endif + #ifdef EVP_R_UPDATE_ERROR + {"UPDATE_ERROR", ERR_LIB_EVP, EVP_R_UPDATE_ERROR}, + #else + {"UPDATE_ERROR", 6, 189}, + #endif + #ifdef EVP_R_WRAP_MODE_NOT_ALLOWED + {"WRAP_MODE_NOT_ALLOWED", ERR_LIB_EVP, EVP_R_WRAP_MODE_NOT_ALLOWED}, + #else + {"WRAP_MODE_NOT_ALLOWED", 6, 170}, + #endif + #ifdef EVP_R_WRONG_FINAL_BLOCK_LENGTH + {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_EVP, EVP_R_WRONG_FINAL_BLOCK_LENGTH}, + #else + {"WRONG_FINAL_BLOCK_LENGTH", 6, 109}, + #endif + #ifdef EVP_R_XTS_DATA_UNIT_IS_TOO_LARGE + {"XTS_DATA_UNIT_IS_TOO_LARGE", ERR_LIB_EVP, EVP_R_XTS_DATA_UNIT_IS_TOO_LARGE}, + #else + {"XTS_DATA_UNIT_IS_TOO_LARGE", 6, 191}, + #endif + #ifdef EVP_R_XTS_DUPLICATED_KEYS + {"XTS_DUPLICATED_KEYS", ERR_LIB_EVP, EVP_R_XTS_DUPLICATED_KEYS}, + #else + {"XTS_DUPLICATED_KEYS", 6, 192}, + #endif + #ifdef HTTP_R_ASN1_LEN_EXCEEDS_MAX_RESP_LEN + {"ASN1_LEN_EXCEEDS_MAX_RESP_LEN", ERR_LIB_HTTP, HTTP_R_ASN1_LEN_EXCEEDS_MAX_RESP_LEN}, + #else + {"ASN1_LEN_EXCEEDS_MAX_RESP_LEN", 61, 108}, + #endif + #ifdef HTTP_R_CONNECT_FAILURE + {"CONNECT_FAILURE", ERR_LIB_HTTP, HTTP_R_CONNECT_FAILURE}, + #else + {"CONNECT_FAILURE", 61, 100}, + #endif + #ifdef HTTP_R_ERROR_PARSING_ASN1_LENGTH + {"ERROR_PARSING_ASN1_LENGTH", ERR_LIB_HTTP, HTTP_R_ERROR_PARSING_ASN1_LENGTH}, + #else + {"ERROR_PARSING_ASN1_LENGTH", 61, 109}, + #endif + #ifdef HTTP_R_ERROR_PARSING_CONTENT_LENGTH + {"ERROR_PARSING_CONTENT_LENGTH", ERR_LIB_HTTP, HTTP_R_ERROR_PARSING_CONTENT_LENGTH}, + #else + {"ERROR_PARSING_CONTENT_LENGTH", 61, 119}, + #endif + #ifdef HTTP_R_ERROR_PARSING_URL + {"ERROR_PARSING_URL", ERR_LIB_HTTP, HTTP_R_ERROR_PARSING_URL}, + #else + {"ERROR_PARSING_URL", 61, 101}, + #endif + #ifdef HTTP_R_ERROR_RECEIVING + {"ERROR_RECEIVING", ERR_LIB_HTTP, HTTP_R_ERROR_RECEIVING}, + #else + {"ERROR_RECEIVING", 61, 103}, + #endif + #ifdef HTTP_R_ERROR_SENDING + {"ERROR_SENDING", ERR_LIB_HTTP, HTTP_R_ERROR_SENDING}, + #else + {"ERROR_SENDING", 61, 102}, + #endif + #ifdef HTTP_R_FAILED_READING_DATA + {"FAILED_READING_DATA", ERR_LIB_HTTP, HTTP_R_FAILED_READING_DATA}, + #else + {"FAILED_READING_DATA", 61, 128}, + #endif + #ifdef HTTP_R_INCONSISTENT_CONTENT_LENGTH + {"INCONSISTENT_CONTENT_LENGTH", ERR_LIB_HTTP, HTTP_R_INCONSISTENT_CONTENT_LENGTH}, + #else + {"INCONSISTENT_CONTENT_LENGTH", 61, 120}, + #endif + #ifdef HTTP_R_INVALID_PORT_NUMBER + {"INVALID_PORT_NUMBER", ERR_LIB_HTTP, HTTP_R_INVALID_PORT_NUMBER}, + #else + {"INVALID_PORT_NUMBER", 61, 123}, + #endif + #ifdef HTTP_R_INVALID_URL_PATH + {"INVALID_URL_PATH", ERR_LIB_HTTP, HTTP_R_INVALID_URL_PATH}, + #else + {"INVALID_URL_PATH", 61, 125}, + #endif + #ifdef HTTP_R_INVALID_URL_SCHEME + {"INVALID_URL_SCHEME", ERR_LIB_HTTP, HTTP_R_INVALID_URL_SCHEME}, + #else + {"INVALID_URL_SCHEME", 61, 124}, + #endif + #ifdef HTTP_R_MAX_RESP_LEN_EXCEEDED + {"MAX_RESP_LEN_EXCEEDED", ERR_LIB_HTTP, HTTP_R_MAX_RESP_LEN_EXCEEDED}, + #else + {"MAX_RESP_LEN_EXCEEDED", 61, 117}, + #endif + #ifdef HTTP_R_MISSING_ASN1_ENCODING + {"MISSING_ASN1_ENCODING", ERR_LIB_HTTP, HTTP_R_MISSING_ASN1_ENCODING}, + #else + {"MISSING_ASN1_ENCODING", 61, 110}, + #endif + #ifdef HTTP_R_MISSING_CONTENT_TYPE + {"MISSING_CONTENT_TYPE", ERR_LIB_HTTP, HTTP_R_MISSING_CONTENT_TYPE}, + #else + {"MISSING_CONTENT_TYPE", 61, 121}, + #endif + #ifdef HTTP_R_MISSING_REDIRECT_LOCATION + {"MISSING_REDIRECT_LOCATION", ERR_LIB_HTTP, HTTP_R_MISSING_REDIRECT_LOCATION}, + #else + {"MISSING_REDIRECT_LOCATION", 61, 111}, + #endif + #ifdef HTTP_R_RECEIVED_ERROR + {"RECEIVED_ERROR", ERR_LIB_HTTP, HTTP_R_RECEIVED_ERROR}, + #else + {"RECEIVED_ERROR", 61, 105}, + #endif + #ifdef HTTP_R_RECEIVED_WRONG_HTTP_VERSION + {"RECEIVED_WRONG_HTTP_VERSION", ERR_LIB_HTTP, HTTP_R_RECEIVED_WRONG_HTTP_VERSION}, + #else + {"RECEIVED_WRONG_HTTP_VERSION", 61, 106}, + #endif + #ifdef HTTP_R_REDIRECTION_FROM_HTTPS_TO_HTTP + {"REDIRECTION_FROM_HTTPS_TO_HTTP", ERR_LIB_HTTP, HTTP_R_REDIRECTION_FROM_HTTPS_TO_HTTP}, + #else + {"REDIRECTION_FROM_HTTPS_TO_HTTP", 61, 112}, + #endif + #ifdef HTTP_R_REDIRECTION_NOT_ENABLED + {"REDIRECTION_NOT_ENABLED", ERR_LIB_HTTP, HTTP_R_REDIRECTION_NOT_ENABLED}, + #else + {"REDIRECTION_NOT_ENABLED", 61, 116}, + #endif + #ifdef HTTP_R_RESPONSE_LINE_TOO_LONG + {"RESPONSE_LINE_TOO_LONG", ERR_LIB_HTTP, HTTP_R_RESPONSE_LINE_TOO_LONG}, + #else + {"RESPONSE_LINE_TOO_LONG", 61, 113}, + #endif + #ifdef HTTP_R_RESPONSE_PARSE_ERROR + {"RESPONSE_PARSE_ERROR", ERR_LIB_HTTP, HTTP_R_RESPONSE_PARSE_ERROR}, + #else + {"RESPONSE_PARSE_ERROR", 61, 104}, + #endif + #ifdef HTTP_R_SOCK_NOT_SUPPORTED + {"SOCK_NOT_SUPPORTED", ERR_LIB_HTTP, HTTP_R_SOCK_NOT_SUPPORTED}, + #else + {"SOCK_NOT_SUPPORTED", 61, 122}, + #endif + #ifdef HTTP_R_STATUS_CODE_UNSUPPORTED + {"STATUS_CODE_UNSUPPORTED", ERR_LIB_HTTP, HTTP_R_STATUS_CODE_UNSUPPORTED}, + #else + {"STATUS_CODE_UNSUPPORTED", 61, 114}, + #endif + #ifdef HTTP_R_TLS_NOT_ENABLED + {"TLS_NOT_ENABLED", ERR_LIB_HTTP, HTTP_R_TLS_NOT_ENABLED}, + #else + {"TLS_NOT_ENABLED", 61, 107}, + #endif + #ifdef HTTP_R_TOO_MANY_REDIRECTIONS + {"TOO_MANY_REDIRECTIONS", ERR_LIB_HTTP, HTTP_R_TOO_MANY_REDIRECTIONS}, + #else + {"TOO_MANY_REDIRECTIONS", 61, 115}, + #endif + #ifdef HTTP_R_UNEXPECTED_CONTENT_TYPE + {"UNEXPECTED_CONTENT_TYPE", ERR_LIB_HTTP, HTTP_R_UNEXPECTED_CONTENT_TYPE}, + #else + {"UNEXPECTED_CONTENT_TYPE", 61, 118}, + #endif + #ifdef OBJ_R_OID_EXISTS + {"OID_EXISTS", ERR_LIB_OBJ, OBJ_R_OID_EXISTS}, + #else + {"OID_EXISTS", 8, 102}, + #endif + #ifdef OBJ_R_UNKNOWN_NID + {"UNKNOWN_NID", ERR_LIB_OBJ, OBJ_R_UNKNOWN_NID}, + #else + {"UNKNOWN_NID", 8, 101}, + #endif + #ifdef OBJ_R_UNKNOWN_OBJECT_NAME + {"UNKNOWN_OBJECT_NAME", ERR_LIB_OBJ, OBJ_R_UNKNOWN_OBJECT_NAME}, + #else + {"UNKNOWN_OBJECT_NAME", 8, 103}, + #endif + #ifdef OCSP_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_OCSP, OCSP_R_CERTIFICATE_VERIFY_ERROR}, + #else + {"CERTIFICATE_VERIFY_ERROR", 39, 101}, + #endif + #ifdef OCSP_R_DIGEST_ERR + {"DIGEST_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_ERR}, + #else + {"DIGEST_ERR", 39, 102}, + #endif + #ifdef OCSP_R_DIGEST_NAME_ERR + {"DIGEST_NAME_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_NAME_ERR}, + #else + {"DIGEST_NAME_ERR", 39, 106}, + #endif + #ifdef OCSP_R_DIGEST_SIZE_ERR + {"DIGEST_SIZE_ERR", ERR_LIB_OCSP, OCSP_R_DIGEST_SIZE_ERR}, + #else + {"DIGEST_SIZE_ERR", 39, 107}, + #endif + #ifdef OCSP_R_ERROR_IN_NEXTUPDATE_FIELD + {"ERROR_IN_NEXTUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_NEXTUPDATE_FIELD}, + #else + {"ERROR_IN_NEXTUPDATE_FIELD", 39, 122}, + #endif + #ifdef OCSP_R_ERROR_IN_THISUPDATE_FIELD + {"ERROR_IN_THISUPDATE_FIELD", ERR_LIB_OCSP, OCSP_R_ERROR_IN_THISUPDATE_FIELD}, + #else + {"ERROR_IN_THISUPDATE_FIELD", 39, 123}, + #endif + #ifdef OCSP_R_MISSING_OCSPSIGNING_USAGE + {"MISSING_OCSPSIGNING_USAGE", ERR_LIB_OCSP, OCSP_R_MISSING_OCSPSIGNING_USAGE}, + #else + {"MISSING_OCSPSIGNING_USAGE", 39, 103}, + #endif + #ifdef OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE + {"NEXTUPDATE_BEFORE_THISUPDATE", ERR_LIB_OCSP, OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE}, + #else + {"NEXTUPDATE_BEFORE_THISUPDATE", 39, 124}, + #endif + #ifdef OCSP_R_NOT_BASIC_RESPONSE + {"NOT_BASIC_RESPONSE", ERR_LIB_OCSP, OCSP_R_NOT_BASIC_RESPONSE}, + #else + {"NOT_BASIC_RESPONSE", 39, 104}, + #endif + #ifdef OCSP_R_NO_CERTIFICATES_IN_CHAIN + {"NO_CERTIFICATES_IN_CHAIN", ERR_LIB_OCSP, OCSP_R_NO_CERTIFICATES_IN_CHAIN}, + #else + {"NO_CERTIFICATES_IN_CHAIN", 39, 105}, + #endif + #ifdef OCSP_R_NO_RESPONSE_DATA + {"NO_RESPONSE_DATA", ERR_LIB_OCSP, OCSP_R_NO_RESPONSE_DATA}, + #else + {"NO_RESPONSE_DATA", 39, 108}, + #endif + #ifdef OCSP_R_NO_REVOKED_TIME + {"NO_REVOKED_TIME", ERR_LIB_OCSP, OCSP_R_NO_REVOKED_TIME}, + #else + {"NO_REVOKED_TIME", 39, 109}, + #endif + #ifdef OCSP_R_NO_SIGNER_KEY + {"NO_SIGNER_KEY", ERR_LIB_OCSP, OCSP_R_NO_SIGNER_KEY}, + #else + {"NO_SIGNER_KEY", 39, 130}, + #endif + #ifdef OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_OCSP, OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, + #else + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 39, 110}, + #endif + #ifdef OCSP_R_REQUEST_NOT_SIGNED + {"REQUEST_NOT_SIGNED", ERR_LIB_OCSP, OCSP_R_REQUEST_NOT_SIGNED}, + #else + {"REQUEST_NOT_SIGNED", 39, 128}, + #endif + #ifdef OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA + {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", ERR_LIB_OCSP, OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA}, + #else + {"RESPONSE_CONTAINS_NO_REVOCATION_DATA", 39, 111}, + #endif + #ifdef OCSP_R_ROOT_CA_NOT_TRUSTED + {"ROOT_CA_NOT_TRUSTED", ERR_LIB_OCSP, OCSP_R_ROOT_CA_NOT_TRUSTED}, + #else + {"ROOT_CA_NOT_TRUSTED", 39, 112}, + #endif + #ifdef OCSP_R_SIGNATURE_FAILURE + {"SIGNATURE_FAILURE", ERR_LIB_OCSP, OCSP_R_SIGNATURE_FAILURE}, + #else + {"SIGNATURE_FAILURE", 39, 117}, + #endif + #ifdef OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_OCSP, OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND}, + #else + {"SIGNER_CERTIFICATE_NOT_FOUND", 39, 118}, + #endif + #ifdef OCSP_R_STATUS_EXPIRED + {"STATUS_EXPIRED", ERR_LIB_OCSP, OCSP_R_STATUS_EXPIRED}, + #else + {"STATUS_EXPIRED", 39, 125}, + #endif + #ifdef OCSP_R_STATUS_NOT_YET_VALID + {"STATUS_NOT_YET_VALID", ERR_LIB_OCSP, OCSP_R_STATUS_NOT_YET_VALID}, + #else + {"STATUS_NOT_YET_VALID", 39, 126}, + #endif + #ifdef OCSP_R_STATUS_TOO_OLD + {"STATUS_TOO_OLD", ERR_LIB_OCSP, OCSP_R_STATUS_TOO_OLD}, + #else + {"STATUS_TOO_OLD", 39, 127}, + #endif + #ifdef OCSP_R_UNKNOWN_MESSAGE_DIGEST + {"UNKNOWN_MESSAGE_DIGEST", ERR_LIB_OCSP, OCSP_R_UNKNOWN_MESSAGE_DIGEST}, + #else + {"UNKNOWN_MESSAGE_DIGEST", 39, 119}, + #endif + #ifdef OCSP_R_UNKNOWN_NID + {"UNKNOWN_NID", ERR_LIB_OCSP, OCSP_R_UNKNOWN_NID}, + #else + {"UNKNOWN_NID", 39, 120}, + #endif + #ifdef OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE + {"UNSUPPORTED_REQUESTORNAME_TYPE", ERR_LIB_OCSP, OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE}, + #else + {"UNSUPPORTED_REQUESTORNAME_TYPE", 39, 129}, + #endif + #ifdef OSSL_DECODER_R_MISSING_GET_PARAMS + {"MISSING_GET_PARAMS", ERR_LIB_OSSL_DECODER, OSSL_DECODER_R_MISSING_GET_PARAMS}, + #else + {"MISSING_GET_PARAMS", 60, 100}, + #endif + #ifdef OSSL_ENCODER_R_ENCODER_NOT_FOUND + {"ENCODER_NOT_FOUND", ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_ENCODER_NOT_FOUND}, + #else + {"ENCODER_NOT_FOUND", 59, 101}, + #endif + #ifdef OSSL_ENCODER_R_INCORRECT_PROPERTY_QUERY + {"INCORRECT_PROPERTY_QUERY", ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_INCORRECT_PROPERTY_QUERY}, + #else + {"INCORRECT_PROPERTY_QUERY", 59, 100}, + #endif + #ifdef OSSL_ENCODER_R_MISSING_GET_PARAMS + {"MISSING_GET_PARAMS", ERR_LIB_OSSL_ENCODER, OSSL_ENCODER_R_MISSING_GET_PARAMS}, + #else + {"MISSING_GET_PARAMS", 59, 102}, + #endif + #ifdef OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE + {"AMBIGUOUS_CONTENT_TYPE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_AMBIGUOUS_CONTENT_TYPE}, + #else + {"AMBIGUOUS_CONTENT_TYPE", 44, 107}, + #endif + #ifdef OSSL_STORE_R_BAD_PASSWORD_READ + {"BAD_PASSWORD_READ", ERR_LIB_OSSL_STORE, OSSL_STORE_R_BAD_PASSWORD_READ}, + #else + {"BAD_PASSWORD_READ", 44, 115}, + #endif + #ifdef OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC + {"ERROR_VERIFYING_PKCS12_MAC", ERR_LIB_OSSL_STORE, OSSL_STORE_R_ERROR_VERIFYING_PKCS12_MAC}, + #else + {"ERROR_VERIFYING_PKCS12_MAC", 44, 113}, + #endif + #ifdef OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST + {"FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST", ERR_LIB_OSSL_STORE, OSSL_STORE_R_FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST}, + #else + {"FINGERPRINT_SIZE_DOES_NOT_MATCH_DIGEST", 44, 121}, + #endif + #ifdef OSSL_STORE_R_INVALID_SCHEME + {"INVALID_SCHEME", ERR_LIB_OSSL_STORE, OSSL_STORE_R_INVALID_SCHEME}, + #else + {"INVALID_SCHEME", 44, 106}, + #endif + #ifdef OSSL_STORE_R_IS_NOT_A + {"IS_NOT_A", ERR_LIB_OSSL_STORE, OSSL_STORE_R_IS_NOT_A}, + #else + {"IS_NOT_A", 44, 112}, + #endif + #ifdef OSSL_STORE_R_LOADER_INCOMPLETE + {"LOADER_INCOMPLETE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_LOADER_INCOMPLETE}, + #else + {"LOADER_INCOMPLETE", 44, 116}, + #endif + #ifdef OSSL_STORE_R_LOADING_STARTED + {"LOADING_STARTED", ERR_LIB_OSSL_STORE, OSSL_STORE_R_LOADING_STARTED}, + #else + {"LOADING_STARTED", 44, 117}, + #endif + #ifdef OSSL_STORE_R_NOT_A_CERTIFICATE + {"NOT_A_CERTIFICATE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_CERTIFICATE}, + #else + {"NOT_A_CERTIFICATE", 44, 100}, + #endif + #ifdef OSSL_STORE_R_NOT_A_CRL + {"NOT_A_CRL", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_CRL}, + #else + {"NOT_A_CRL", 44, 101}, + #endif + #ifdef OSSL_STORE_R_NOT_A_NAME + {"NOT_A_NAME", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_NAME}, + #else + {"NOT_A_NAME", 44, 103}, + #endif + #ifdef OSSL_STORE_R_NOT_A_PRIVATE_KEY + {"NOT_A_PRIVATE_KEY", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_PRIVATE_KEY}, + #else + {"NOT_A_PRIVATE_KEY", 44, 102}, + #endif + #ifdef OSSL_STORE_R_NOT_A_PUBLIC_KEY + {"NOT_A_PUBLIC_KEY", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_A_PUBLIC_KEY}, + #else + {"NOT_A_PUBLIC_KEY", 44, 122}, + #endif + #ifdef OSSL_STORE_R_NOT_PARAMETERS + {"NOT_PARAMETERS", ERR_LIB_OSSL_STORE, OSSL_STORE_R_NOT_PARAMETERS}, + #else + {"NOT_PARAMETERS", 44, 104}, + #endif + #ifdef OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR + {"PASSPHRASE_CALLBACK_ERROR", ERR_LIB_OSSL_STORE, OSSL_STORE_R_PASSPHRASE_CALLBACK_ERROR}, + #else + {"PASSPHRASE_CALLBACK_ERROR", 44, 114}, + #endif + #ifdef OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE + {"PATH_MUST_BE_ABSOLUTE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_PATH_MUST_BE_ABSOLUTE}, + #else + {"PATH_MUST_BE_ABSOLUTE", 44, 108}, + #endif + #ifdef OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES + {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", ERR_LIB_OSSL_STORE, OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES}, + #else + {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", 44, 119}, + #endif + #ifdef OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED + {"UI_PROCESS_INTERRUPTED_OR_CANCELLED", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UI_PROCESS_INTERRUPTED_OR_CANCELLED}, + #else + {"UI_PROCESS_INTERRUPTED_OR_CANCELLED", 44, 109}, + #endif + #ifdef OSSL_STORE_R_UNREGISTERED_SCHEME + {"UNREGISTERED_SCHEME", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNREGISTERED_SCHEME}, + #else + {"UNREGISTERED_SCHEME", 44, 105}, + #endif + #ifdef OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE + {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNSUPPORTED_CONTENT_TYPE}, + #else + {"UNSUPPORTED_CONTENT_TYPE", 44, 110}, + #endif + #ifdef OSSL_STORE_R_UNSUPPORTED_OPERATION + {"UNSUPPORTED_OPERATION", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNSUPPORTED_OPERATION}, + #else + {"UNSUPPORTED_OPERATION", 44, 118}, + #endif + #ifdef OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE + {"UNSUPPORTED_SEARCH_TYPE", ERR_LIB_OSSL_STORE, OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE}, + #else + {"UNSUPPORTED_SEARCH_TYPE", 44, 120}, + #endif + #ifdef OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED + {"URI_AUTHORITY_UNSUPPORTED", ERR_LIB_OSSL_STORE, OSSL_STORE_R_URI_AUTHORITY_UNSUPPORTED}, + #else + {"URI_AUTHORITY_UNSUPPORTED", 44, 111}, + #endif + #ifdef PEM_R_BAD_BASE64_DECODE + {"BAD_BASE64_DECODE", ERR_LIB_PEM, PEM_R_BAD_BASE64_DECODE}, + #else + {"BAD_BASE64_DECODE", 9, 100}, + #endif + #ifdef PEM_R_BAD_DECRYPT + {"BAD_DECRYPT", ERR_LIB_PEM, PEM_R_BAD_DECRYPT}, + #else + {"BAD_DECRYPT", 9, 101}, + #endif + #ifdef PEM_R_BAD_END_LINE + {"BAD_END_LINE", ERR_LIB_PEM, PEM_R_BAD_END_LINE}, + #else + {"BAD_END_LINE", 9, 102}, + #endif + #ifdef PEM_R_BAD_IV_CHARS + {"BAD_IV_CHARS", ERR_LIB_PEM, PEM_R_BAD_IV_CHARS}, + #else + {"BAD_IV_CHARS", 9, 103}, + #endif + #ifdef PEM_R_BAD_MAGIC_NUMBER + {"BAD_MAGIC_NUMBER", ERR_LIB_PEM, PEM_R_BAD_MAGIC_NUMBER}, + #else + {"BAD_MAGIC_NUMBER", 9, 116}, + #endif + #ifdef PEM_R_BAD_PASSWORD_READ + {"BAD_PASSWORD_READ", ERR_LIB_PEM, PEM_R_BAD_PASSWORD_READ}, + #else + {"BAD_PASSWORD_READ", 9, 104}, + #endif + #ifdef PEM_R_BAD_VERSION_NUMBER + {"BAD_VERSION_NUMBER", ERR_LIB_PEM, PEM_R_BAD_VERSION_NUMBER}, + #else + {"BAD_VERSION_NUMBER", 9, 117}, + #endif + #ifdef PEM_R_BIO_WRITE_FAILURE + {"BIO_WRITE_FAILURE", ERR_LIB_PEM, PEM_R_BIO_WRITE_FAILURE}, + #else + {"BIO_WRITE_FAILURE", 9, 118}, + #endif + #ifdef PEM_R_CIPHER_IS_NULL + {"CIPHER_IS_NULL", ERR_LIB_PEM, PEM_R_CIPHER_IS_NULL}, + #else + {"CIPHER_IS_NULL", 9, 127}, + #endif + #ifdef PEM_R_ERROR_CONVERTING_PRIVATE_KEY + {"ERROR_CONVERTING_PRIVATE_KEY", ERR_LIB_PEM, PEM_R_ERROR_CONVERTING_PRIVATE_KEY}, + #else + {"ERROR_CONVERTING_PRIVATE_KEY", 9, 115}, + #endif + #ifdef PEM_R_EXPECTING_DSS_KEY_BLOB + {"EXPECTING_DSS_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_DSS_KEY_BLOB}, + #else + {"EXPECTING_DSS_KEY_BLOB", 9, 131}, + #endif + #ifdef PEM_R_EXPECTING_PRIVATE_KEY_BLOB + {"EXPECTING_PRIVATE_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PRIVATE_KEY_BLOB}, + #else + {"EXPECTING_PRIVATE_KEY_BLOB", 9, 119}, + #endif + #ifdef PEM_R_EXPECTING_PUBLIC_KEY_BLOB + {"EXPECTING_PUBLIC_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_PUBLIC_KEY_BLOB}, + #else + {"EXPECTING_PUBLIC_KEY_BLOB", 9, 120}, + #endif + #ifdef PEM_R_EXPECTING_RSA_KEY_BLOB + {"EXPECTING_RSA_KEY_BLOB", ERR_LIB_PEM, PEM_R_EXPECTING_RSA_KEY_BLOB}, + #else + {"EXPECTING_RSA_KEY_BLOB", 9, 132}, + #endif + #ifdef PEM_R_HEADER_TOO_LONG + {"HEADER_TOO_LONG", ERR_LIB_PEM, PEM_R_HEADER_TOO_LONG}, + #else + {"HEADER_TOO_LONG", 9, 128}, + #endif + #ifdef PEM_R_INCONSISTENT_HEADER + {"INCONSISTENT_HEADER", ERR_LIB_PEM, PEM_R_INCONSISTENT_HEADER}, + #else + {"INCONSISTENT_HEADER", 9, 121}, + #endif + #ifdef PEM_R_KEYBLOB_HEADER_PARSE_ERROR + {"KEYBLOB_HEADER_PARSE_ERROR", ERR_LIB_PEM, PEM_R_KEYBLOB_HEADER_PARSE_ERROR}, + #else + {"KEYBLOB_HEADER_PARSE_ERROR", 9, 122}, + #endif + #ifdef PEM_R_KEYBLOB_TOO_SHORT + {"KEYBLOB_TOO_SHORT", ERR_LIB_PEM, PEM_R_KEYBLOB_TOO_SHORT}, + #else + {"KEYBLOB_TOO_SHORT", 9, 123}, + #endif + #ifdef PEM_R_MISSING_DEK_IV + {"MISSING_DEK_IV", ERR_LIB_PEM, PEM_R_MISSING_DEK_IV}, + #else + {"MISSING_DEK_IV", 9, 129}, + #endif + #ifdef PEM_R_NOT_DEK_INFO + {"NOT_DEK_INFO", ERR_LIB_PEM, PEM_R_NOT_DEK_INFO}, + #else + {"NOT_DEK_INFO", 9, 105}, + #endif + #ifdef PEM_R_NOT_ENCRYPTED + {"NOT_ENCRYPTED", ERR_LIB_PEM, PEM_R_NOT_ENCRYPTED}, + #else + {"NOT_ENCRYPTED", 9, 106}, + #endif + #ifdef PEM_R_NOT_PROC_TYPE + {"NOT_PROC_TYPE", ERR_LIB_PEM, PEM_R_NOT_PROC_TYPE}, + #else + {"NOT_PROC_TYPE", 9, 107}, + #endif + #ifdef PEM_R_NO_START_LINE + {"NO_START_LINE", ERR_LIB_PEM, PEM_R_NO_START_LINE}, + #else + {"NO_START_LINE", 9, 108}, + #endif + #ifdef PEM_R_PROBLEMS_GETTING_PASSWORD + {"PROBLEMS_GETTING_PASSWORD", ERR_LIB_PEM, PEM_R_PROBLEMS_GETTING_PASSWORD}, + #else + {"PROBLEMS_GETTING_PASSWORD", 9, 109}, + #endif + #ifdef PEM_R_PVK_DATA_TOO_SHORT + {"PVK_DATA_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_DATA_TOO_SHORT}, + #else + {"PVK_DATA_TOO_SHORT", 9, 124}, + #endif + #ifdef PEM_R_PVK_TOO_SHORT + {"PVK_TOO_SHORT", ERR_LIB_PEM, PEM_R_PVK_TOO_SHORT}, + #else + {"PVK_TOO_SHORT", 9, 125}, + #endif + #ifdef PEM_R_READ_KEY + {"READ_KEY", ERR_LIB_PEM, PEM_R_READ_KEY}, + #else + {"READ_KEY", 9, 111}, + #endif + #ifdef PEM_R_SHORT_HEADER + {"SHORT_HEADER", ERR_LIB_PEM, PEM_R_SHORT_HEADER}, + #else + {"SHORT_HEADER", 9, 112}, + #endif + #ifdef PEM_R_UNEXPECTED_DEK_IV + {"UNEXPECTED_DEK_IV", ERR_LIB_PEM, PEM_R_UNEXPECTED_DEK_IV}, + #else + {"UNEXPECTED_DEK_IV", 9, 130}, + #endif + #ifdef PEM_R_UNSUPPORTED_CIPHER + {"UNSUPPORTED_CIPHER", ERR_LIB_PEM, PEM_R_UNSUPPORTED_CIPHER}, + #else + {"UNSUPPORTED_CIPHER", 9, 113}, + #endif + #ifdef PEM_R_UNSUPPORTED_ENCRYPTION + {"UNSUPPORTED_ENCRYPTION", ERR_LIB_PEM, PEM_R_UNSUPPORTED_ENCRYPTION}, + #else + {"UNSUPPORTED_ENCRYPTION", 9, 114}, + #endif + #ifdef PEM_R_UNSUPPORTED_KEY_COMPONENTS + {"UNSUPPORTED_KEY_COMPONENTS", ERR_LIB_PEM, PEM_R_UNSUPPORTED_KEY_COMPONENTS}, + #else + {"UNSUPPORTED_KEY_COMPONENTS", 9, 126}, + #endif + #ifdef PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE + {"UNSUPPORTED_PUBLIC_KEY_TYPE", ERR_LIB_PEM, PEM_R_UNSUPPORTED_PUBLIC_KEY_TYPE}, + #else + {"UNSUPPORTED_PUBLIC_KEY_TYPE", 9, 110}, + #endif + #ifdef PKCS12_R_CANT_PACK_STRUCTURE + {"CANT_PACK_STRUCTURE", ERR_LIB_PKCS12, PKCS12_R_CANT_PACK_STRUCTURE}, + #else + {"CANT_PACK_STRUCTURE", 35, 100}, + #endif + #ifdef PKCS12_R_CONTENT_TYPE_NOT_DATA + {"CONTENT_TYPE_NOT_DATA", ERR_LIB_PKCS12, PKCS12_R_CONTENT_TYPE_NOT_DATA}, + #else + {"CONTENT_TYPE_NOT_DATA", 35, 121}, + #endif + #ifdef PKCS12_R_DECODE_ERROR + {"DECODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_DECODE_ERROR}, + #else + {"DECODE_ERROR", 35, 101}, + #endif + #ifdef PKCS12_R_ENCODE_ERROR + {"ENCODE_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCODE_ERROR}, + #else + {"ENCODE_ERROR", 35, 102}, + #endif + #ifdef PKCS12_R_ENCRYPT_ERROR + {"ENCRYPT_ERROR", ERR_LIB_PKCS12, PKCS12_R_ENCRYPT_ERROR}, + #else + {"ENCRYPT_ERROR", 35, 103}, + #endif + #ifdef PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE + {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", ERR_LIB_PKCS12, PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE}, + #else + {"ERROR_SETTING_ENCRYPTED_DATA_TYPE", 35, 120}, + #endif + #ifdef PKCS12_R_INVALID_NULL_ARGUMENT + {"INVALID_NULL_ARGUMENT", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_ARGUMENT}, + #else + {"INVALID_NULL_ARGUMENT", 35, 104}, + #endif + #ifdef PKCS12_R_INVALID_NULL_PKCS12_POINTER + {"INVALID_NULL_PKCS12_POINTER", ERR_LIB_PKCS12, PKCS12_R_INVALID_NULL_PKCS12_POINTER}, + #else + {"INVALID_NULL_PKCS12_POINTER", 35, 105}, + #endif + #ifdef PKCS12_R_INVALID_TYPE + {"INVALID_TYPE", ERR_LIB_PKCS12, PKCS12_R_INVALID_TYPE}, + #else + {"INVALID_TYPE", 35, 112}, + #endif + #ifdef PKCS12_R_IV_GEN_ERROR + {"IV_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_IV_GEN_ERROR}, + #else + {"IV_GEN_ERROR", 35, 106}, + #endif + #ifdef PKCS12_R_KEY_GEN_ERROR + {"KEY_GEN_ERROR", ERR_LIB_PKCS12, PKCS12_R_KEY_GEN_ERROR}, + #else + {"KEY_GEN_ERROR", 35, 107}, + #endif + #ifdef PKCS12_R_MAC_ABSENT + {"MAC_ABSENT", ERR_LIB_PKCS12, PKCS12_R_MAC_ABSENT}, + #else + {"MAC_ABSENT", 35, 108}, + #endif + #ifdef PKCS12_R_MAC_GENERATION_ERROR + {"MAC_GENERATION_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_GENERATION_ERROR}, + #else + {"MAC_GENERATION_ERROR", 35, 109}, + #endif + #ifdef PKCS12_R_MAC_SETUP_ERROR + {"MAC_SETUP_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_SETUP_ERROR}, + #else + {"MAC_SETUP_ERROR", 35, 110}, + #endif + #ifdef PKCS12_R_MAC_STRING_SET_ERROR + {"MAC_STRING_SET_ERROR", ERR_LIB_PKCS12, PKCS12_R_MAC_STRING_SET_ERROR}, + #else + {"MAC_STRING_SET_ERROR", 35, 111}, + #endif + #ifdef PKCS12_R_MAC_VERIFY_FAILURE + {"MAC_VERIFY_FAILURE", ERR_LIB_PKCS12, PKCS12_R_MAC_VERIFY_FAILURE}, + #else + {"MAC_VERIFY_FAILURE", 35, 113}, + #endif + #ifdef PKCS12_R_PARSE_ERROR + {"PARSE_ERROR", ERR_LIB_PKCS12, PKCS12_R_PARSE_ERROR}, + #else + {"PARSE_ERROR", 35, 114}, + #endif + #ifdef PKCS12_R_PKCS12_CIPHERFINAL_ERROR + {"PKCS12_CIPHERFINAL_ERROR", ERR_LIB_PKCS12, PKCS12_R_PKCS12_CIPHERFINAL_ERROR}, + #else + {"PKCS12_CIPHERFINAL_ERROR", 35, 116}, + #endif + #ifdef PKCS12_R_UNKNOWN_DIGEST_ALGORITHM + {"UNKNOWN_DIGEST_ALGORITHM", ERR_LIB_PKCS12, PKCS12_R_UNKNOWN_DIGEST_ALGORITHM}, + #else + {"UNKNOWN_DIGEST_ALGORITHM", 35, 118}, + #endif + #ifdef PKCS12_R_UNSUPPORTED_PKCS12_MODE + {"UNSUPPORTED_PKCS12_MODE", ERR_LIB_PKCS12, PKCS12_R_UNSUPPORTED_PKCS12_MODE}, + #else + {"UNSUPPORTED_PKCS12_MODE", 35, 119}, + #endif + #ifdef PKCS7_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_PKCS7, PKCS7_R_CERTIFICATE_VERIFY_ERROR}, + #else + {"CERTIFICATE_VERIFY_ERROR", 33, 117}, + #endif + #ifdef PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", ERR_LIB_PKCS7, PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER}, + #else + {"CIPHER_HAS_NO_OBJECT_IDENTIFIER", 33, 144}, + #endif + #ifdef PKCS7_R_CIPHER_NOT_INITIALIZED + {"CIPHER_NOT_INITIALIZED", ERR_LIB_PKCS7, PKCS7_R_CIPHER_NOT_INITIALIZED}, + #else + {"CIPHER_NOT_INITIALIZED", 33, 116}, + #endif + #ifdef PKCS7_R_CONTENT_AND_DATA_PRESENT + {"CONTENT_AND_DATA_PRESENT", ERR_LIB_PKCS7, PKCS7_R_CONTENT_AND_DATA_PRESENT}, + #else + {"CONTENT_AND_DATA_PRESENT", 33, 118}, + #endif + #ifdef PKCS7_R_CTRL_ERROR + {"CTRL_ERROR", ERR_LIB_PKCS7, PKCS7_R_CTRL_ERROR}, + #else + {"CTRL_ERROR", 33, 152}, + #endif + #ifdef PKCS7_R_DECRYPT_ERROR + {"DECRYPT_ERROR", ERR_LIB_PKCS7, PKCS7_R_DECRYPT_ERROR}, + #else + {"DECRYPT_ERROR", 33, 119}, + #endif + #ifdef PKCS7_R_DIGEST_FAILURE + {"DIGEST_FAILURE", ERR_LIB_PKCS7, PKCS7_R_DIGEST_FAILURE}, + #else + {"DIGEST_FAILURE", 33, 101}, + #endif + #ifdef PKCS7_R_ENCRYPTION_CTRL_FAILURE + {"ENCRYPTION_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_CTRL_FAILURE}, + #else + {"ENCRYPTION_CTRL_FAILURE", 33, 149}, + #endif + #ifdef PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE + {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, + #else + {"ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 150}, + #endif + #ifdef PKCS7_R_ERROR_ADDING_RECIPIENT + {"ERROR_ADDING_RECIPIENT", ERR_LIB_PKCS7, PKCS7_R_ERROR_ADDING_RECIPIENT}, + #else + {"ERROR_ADDING_RECIPIENT", 33, 120}, + #endif + #ifdef PKCS7_R_ERROR_SETTING_CIPHER + {"ERROR_SETTING_CIPHER", ERR_LIB_PKCS7, PKCS7_R_ERROR_SETTING_CIPHER}, + #else + {"ERROR_SETTING_CIPHER", 33, 121}, + #endif + #ifdef PKCS7_R_INVALID_NULL_POINTER + {"INVALID_NULL_POINTER", ERR_LIB_PKCS7, PKCS7_R_INVALID_NULL_POINTER}, + #else + {"INVALID_NULL_POINTER", 33, 143}, + #endif + #ifdef PKCS7_R_INVALID_SIGNED_DATA_TYPE + {"INVALID_SIGNED_DATA_TYPE", ERR_LIB_PKCS7, PKCS7_R_INVALID_SIGNED_DATA_TYPE}, + #else + {"INVALID_SIGNED_DATA_TYPE", 33, 155}, + #endif + #ifdef PKCS7_R_NO_CONTENT + {"NO_CONTENT", ERR_LIB_PKCS7, PKCS7_R_NO_CONTENT}, + #else + {"NO_CONTENT", 33, 122}, + #endif + #ifdef PKCS7_R_NO_DEFAULT_DIGEST + {"NO_DEFAULT_DIGEST", ERR_LIB_PKCS7, PKCS7_R_NO_DEFAULT_DIGEST}, + #else + {"NO_DEFAULT_DIGEST", 33, 151}, + #endif + #ifdef PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND + {"NO_MATCHING_DIGEST_TYPE_FOUND", ERR_LIB_PKCS7, PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND}, + #else + {"NO_MATCHING_DIGEST_TYPE_FOUND", 33, 154}, + #endif + #ifdef PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE + {"NO_RECIPIENT_MATCHES_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE}, + #else + {"NO_RECIPIENT_MATCHES_CERTIFICATE", 33, 115}, + #endif + #ifdef PKCS7_R_NO_SIGNATURES_ON_DATA + {"NO_SIGNATURES_ON_DATA", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNATURES_ON_DATA}, + #else + {"NO_SIGNATURES_ON_DATA", 33, 123}, + #endif + #ifdef PKCS7_R_NO_SIGNERS + {"NO_SIGNERS", ERR_LIB_PKCS7, PKCS7_R_NO_SIGNERS}, + #else + {"NO_SIGNERS", 33, 142}, + #endif + #ifdef PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE + {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", ERR_LIB_PKCS7, PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE}, + #else + {"OPERATION_NOT_SUPPORTED_ON_THIS_TYPE", 33, 104}, + #endif + #ifdef PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR + {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR}, + #else + {"PKCS7_ADD_SIGNATURE_ERROR", 33, 124}, + #endif + #ifdef PKCS7_R_PKCS7_ADD_SIGNER_ERROR + {"PKCS7_ADD_SIGNER_ERROR", ERR_LIB_PKCS7, PKCS7_R_PKCS7_ADD_SIGNER_ERROR}, + #else + {"PKCS7_ADD_SIGNER_ERROR", 33, 153}, + #endif + #ifdef PKCS7_R_PKCS7_DATASIGN + {"PKCS7_DATASIGN", ERR_LIB_PKCS7, PKCS7_R_PKCS7_DATASIGN}, + #else + {"PKCS7_DATASIGN", 33, 145}, + #endif + #ifdef PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, + #else + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 33, 127}, + #endif + #ifdef PKCS7_R_SIGNATURE_FAILURE + {"SIGNATURE_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNATURE_FAILURE}, + #else + {"SIGNATURE_FAILURE", 33, 105}, + #endif + #ifdef PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND + {"SIGNER_CERTIFICATE_NOT_FOUND", ERR_LIB_PKCS7, PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND}, + #else + {"SIGNER_CERTIFICATE_NOT_FOUND", 33, 128}, + #endif + #ifdef PKCS7_R_SIGNING_CTRL_FAILURE + {"SIGNING_CTRL_FAILURE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_CTRL_FAILURE}, + #else + {"SIGNING_CTRL_FAILURE", 33, 147}, + #endif + #ifdef PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE + {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", ERR_LIB_PKCS7, PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE}, + #else + {"SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE", 33, 148}, + #endif + #ifdef PKCS7_R_SMIME_TEXT_ERROR + {"SMIME_TEXT_ERROR", ERR_LIB_PKCS7, PKCS7_R_SMIME_TEXT_ERROR}, + #else + {"SMIME_TEXT_ERROR", 33, 129}, + #endif + #ifdef PKCS7_R_UNABLE_TO_FIND_CERTIFICATE + {"UNABLE_TO_FIND_CERTIFICATE", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_CERTIFICATE}, + #else + {"UNABLE_TO_FIND_CERTIFICATE", 33, 106}, + #endif + #ifdef PKCS7_R_UNABLE_TO_FIND_MEM_BIO + {"UNABLE_TO_FIND_MEM_BIO", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MEM_BIO}, + #else + {"UNABLE_TO_FIND_MEM_BIO", 33, 107}, + #endif + #ifdef PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST + {"UNABLE_TO_FIND_MESSAGE_DIGEST", ERR_LIB_PKCS7, PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST}, + #else + {"UNABLE_TO_FIND_MESSAGE_DIGEST", 33, 108}, + #endif + #ifdef PKCS7_R_UNKNOWN_DIGEST_TYPE + {"UNKNOWN_DIGEST_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_DIGEST_TYPE}, + #else + {"UNKNOWN_DIGEST_TYPE", 33, 109}, + #endif + #ifdef PKCS7_R_UNKNOWN_OPERATION + {"UNKNOWN_OPERATION", ERR_LIB_PKCS7, PKCS7_R_UNKNOWN_OPERATION}, + #else + {"UNKNOWN_OPERATION", 33, 110}, + #endif + #ifdef PKCS7_R_UNSUPPORTED_CIPHER_TYPE + {"UNSUPPORTED_CIPHER_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CIPHER_TYPE}, + #else + {"UNSUPPORTED_CIPHER_TYPE", 33, 111}, + #endif + #ifdef PKCS7_R_UNSUPPORTED_CONTENT_TYPE + {"UNSUPPORTED_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_UNSUPPORTED_CONTENT_TYPE}, + #else + {"UNSUPPORTED_CONTENT_TYPE", 33, 112}, + #endif + #ifdef PKCS7_R_WRONG_CONTENT_TYPE + {"WRONG_CONTENT_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_CONTENT_TYPE}, + #else + {"WRONG_CONTENT_TYPE", 33, 113}, + #endif + #ifdef PKCS7_R_WRONG_PKCS7_TYPE + {"WRONG_PKCS7_TYPE", ERR_LIB_PKCS7, PKCS7_R_WRONG_PKCS7_TYPE}, + #else + {"WRONG_PKCS7_TYPE", 33, 114}, + #endif + #ifdef PROP_R_NAME_TOO_LONG + {"NAME_TOO_LONG", ERR_LIB_PROP, PROP_R_NAME_TOO_LONG}, + #else + {"NAME_TOO_LONG", 55, 100}, + #endif + #ifdef PROP_R_NOT_AN_ASCII_CHARACTER + {"NOT_AN_ASCII_CHARACTER", ERR_LIB_PROP, PROP_R_NOT_AN_ASCII_CHARACTER}, + #else + {"NOT_AN_ASCII_CHARACTER", 55, 101}, + #endif + #ifdef PROP_R_NOT_AN_HEXADECIMAL_DIGIT + {"NOT_AN_HEXADECIMAL_DIGIT", ERR_LIB_PROP, PROP_R_NOT_AN_HEXADECIMAL_DIGIT}, + #else + {"NOT_AN_HEXADECIMAL_DIGIT", 55, 102}, + #endif + #ifdef PROP_R_NOT_AN_IDENTIFIER + {"NOT_AN_IDENTIFIER", ERR_LIB_PROP, PROP_R_NOT_AN_IDENTIFIER}, + #else + {"NOT_AN_IDENTIFIER", 55, 103}, + #endif + #ifdef PROP_R_NOT_AN_OCTAL_DIGIT + {"NOT_AN_OCTAL_DIGIT", ERR_LIB_PROP, PROP_R_NOT_AN_OCTAL_DIGIT}, + #else + {"NOT_AN_OCTAL_DIGIT", 55, 104}, + #endif + #ifdef PROP_R_NOT_A_DECIMAL_DIGIT + {"NOT_A_DECIMAL_DIGIT", ERR_LIB_PROP, PROP_R_NOT_A_DECIMAL_DIGIT}, + #else + {"NOT_A_DECIMAL_DIGIT", 55, 105}, + #endif + #ifdef PROP_R_NO_MATCHING_STRING_DELIMITER + {"NO_MATCHING_STRING_DELIMITER", ERR_LIB_PROP, PROP_R_NO_MATCHING_STRING_DELIMITER}, + #else + {"NO_MATCHING_STRING_DELIMITER", 55, 106}, + #endif + #ifdef PROP_R_NO_VALUE + {"NO_VALUE", ERR_LIB_PROP, PROP_R_NO_VALUE}, + #else + {"NO_VALUE", 55, 107}, + #endif + #ifdef PROP_R_PARSE_FAILED + {"PARSE_FAILED", ERR_LIB_PROP, PROP_R_PARSE_FAILED}, + #else + {"PARSE_FAILED", 55, 108}, + #endif + #ifdef PROP_R_STRING_TOO_LONG + {"STRING_TOO_LONG", ERR_LIB_PROP, PROP_R_STRING_TOO_LONG}, + #else + {"STRING_TOO_LONG", 55, 109}, + #endif + #ifdef PROP_R_TRAILING_CHARACTERS + {"TRAILING_CHARACTERS", ERR_LIB_PROP, PROP_R_TRAILING_CHARACTERS}, + #else + {"TRAILING_CHARACTERS", 55, 110}, + #endif + #ifdef PROV_R_ADDITIONAL_INPUT_TOO_LONG + {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_PROV, PROV_R_ADDITIONAL_INPUT_TOO_LONG}, + #else + {"ADDITIONAL_INPUT_TOO_LONG", 57, 184}, + #endif + #ifdef PROV_R_ALGORITHM_MISMATCH + {"ALGORITHM_MISMATCH", ERR_LIB_PROV, PROV_R_ALGORITHM_MISMATCH}, + #else + {"ALGORITHM_MISMATCH", 57, 173}, + #endif + #ifdef PROV_R_ALREADY_INSTANTIATED + {"ALREADY_INSTANTIATED", ERR_LIB_PROV, PROV_R_ALREADY_INSTANTIATED}, + #else + {"ALREADY_INSTANTIATED", 57, 185}, + #endif + #ifdef PROV_R_BAD_DECRYPT + {"BAD_DECRYPT", ERR_LIB_PROV, PROV_R_BAD_DECRYPT}, + #else + {"BAD_DECRYPT", 57, 100}, + #endif + #ifdef PROV_R_BAD_ENCODING + {"BAD_ENCODING", ERR_LIB_PROV, PROV_R_BAD_ENCODING}, + #else + {"BAD_ENCODING", 57, 141}, + #endif + #ifdef PROV_R_BAD_LENGTH + {"BAD_LENGTH", ERR_LIB_PROV, PROV_R_BAD_LENGTH}, + #else + {"BAD_LENGTH", 57, 142}, + #endif + #ifdef PROV_R_BAD_TLS_CLIENT_VERSION + {"BAD_TLS_CLIENT_VERSION", ERR_LIB_PROV, PROV_R_BAD_TLS_CLIENT_VERSION}, + #else + {"BAD_TLS_CLIENT_VERSION", 57, 161}, + #endif + #ifdef PROV_R_BN_ERROR + {"BN_ERROR", ERR_LIB_PROV, PROV_R_BN_ERROR}, + #else + {"BN_ERROR", 57, 160}, + #endif + #ifdef PROV_R_CIPHER_OPERATION_FAILED + {"CIPHER_OPERATION_FAILED", ERR_LIB_PROV, PROV_R_CIPHER_OPERATION_FAILED}, + #else + {"CIPHER_OPERATION_FAILED", 57, 102}, + #endif + #ifdef PROV_R_DERIVATION_FUNCTION_INIT_FAILED + {"DERIVATION_FUNCTION_INIT_FAILED", ERR_LIB_PROV, PROV_R_DERIVATION_FUNCTION_INIT_FAILED}, + #else + {"DERIVATION_FUNCTION_INIT_FAILED", 57, 205}, + #endif + #ifdef PROV_R_DIGEST_NOT_ALLOWED + {"DIGEST_NOT_ALLOWED", ERR_LIB_PROV, PROV_R_DIGEST_NOT_ALLOWED}, + #else + {"DIGEST_NOT_ALLOWED", 57, 174}, + #endif + #ifdef PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK + {"ENTROPY_SOURCE_STRENGTH_TOO_WEAK", ERR_LIB_PROV, PROV_R_ENTROPY_SOURCE_STRENGTH_TOO_WEAK}, + #else + {"ENTROPY_SOURCE_STRENGTH_TOO_WEAK", 57, 186}, + #endif + #ifdef PROV_R_ERROR_INSTANTIATING_DRBG + {"ERROR_INSTANTIATING_DRBG", ERR_LIB_PROV, PROV_R_ERROR_INSTANTIATING_DRBG}, + #else + {"ERROR_INSTANTIATING_DRBG", 57, 188}, + #endif + #ifdef PROV_R_ERROR_RETRIEVING_ENTROPY + {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_ENTROPY}, + #else + {"ERROR_RETRIEVING_ENTROPY", 57, 189}, + #endif + #ifdef PROV_R_ERROR_RETRIEVING_NONCE + {"ERROR_RETRIEVING_NONCE", ERR_LIB_PROV, PROV_R_ERROR_RETRIEVING_NONCE}, + #else + {"ERROR_RETRIEVING_NONCE", 57, 190}, + #endif + #ifdef PROV_R_FAILED_DURING_DERIVATION + {"FAILED_DURING_DERIVATION", ERR_LIB_PROV, PROV_R_FAILED_DURING_DERIVATION}, + #else + {"FAILED_DURING_DERIVATION", 57, 164}, + #endif + #ifdef PROV_R_FAILED_TO_CREATE_LOCK + {"FAILED_TO_CREATE_LOCK", ERR_LIB_PROV, PROV_R_FAILED_TO_CREATE_LOCK}, + #else + {"FAILED_TO_CREATE_LOCK", 57, 180}, + #endif + #ifdef PROV_R_FAILED_TO_DECRYPT + {"FAILED_TO_DECRYPT", ERR_LIB_PROV, PROV_R_FAILED_TO_DECRYPT}, + #else + {"FAILED_TO_DECRYPT", 57, 162}, + #endif + #ifdef PROV_R_FAILED_TO_GENERATE_KEY + {"FAILED_TO_GENERATE_KEY", ERR_LIB_PROV, PROV_R_FAILED_TO_GENERATE_KEY}, + #else + {"FAILED_TO_GENERATE_KEY", 57, 121}, + #endif + #ifdef PROV_R_FAILED_TO_GET_PARAMETER + {"FAILED_TO_GET_PARAMETER", ERR_LIB_PROV, PROV_R_FAILED_TO_GET_PARAMETER}, + #else + {"FAILED_TO_GET_PARAMETER", 57, 103}, + #endif + #ifdef PROV_R_FAILED_TO_SET_PARAMETER + {"FAILED_TO_SET_PARAMETER", ERR_LIB_PROV, PROV_R_FAILED_TO_SET_PARAMETER}, + #else + {"FAILED_TO_SET_PARAMETER", 57, 104}, + #endif + #ifdef PROV_R_FAILED_TO_SIGN + {"FAILED_TO_SIGN", ERR_LIB_PROV, PROV_R_FAILED_TO_SIGN}, + #else + {"FAILED_TO_SIGN", 57, 175}, + #endif + #ifdef PROV_R_FIPS_MODULE_CONDITIONAL_ERROR + {"FIPS_MODULE_CONDITIONAL_ERROR", ERR_LIB_PROV, PROV_R_FIPS_MODULE_CONDITIONAL_ERROR}, + #else + {"FIPS_MODULE_CONDITIONAL_ERROR", 57, 227}, + #endif + #ifdef PROV_R_FIPS_MODULE_ENTERING_ERROR_STATE + {"FIPS_MODULE_ENTERING_ERROR_STATE", ERR_LIB_PROV, PROV_R_FIPS_MODULE_ENTERING_ERROR_STATE}, + #else + {"FIPS_MODULE_ENTERING_ERROR_STATE", 57, 224}, + #endif + #ifdef PROV_R_FIPS_MODULE_IN_ERROR_STATE + {"FIPS_MODULE_IN_ERROR_STATE", ERR_LIB_PROV, PROV_R_FIPS_MODULE_IN_ERROR_STATE}, + #else + {"FIPS_MODULE_IN_ERROR_STATE", 57, 225}, + #endif + #ifdef PROV_R_GENERATE_ERROR + {"GENERATE_ERROR", ERR_LIB_PROV, PROV_R_GENERATE_ERROR}, + #else + {"GENERATE_ERROR", 57, 191}, + #endif + #ifdef PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE + {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_PROV, PROV_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE}, + #else + {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", 57, 165}, + #endif + #ifdef PROV_R_INDICATOR_INTEGRITY_FAILURE + {"INDICATOR_INTEGRITY_FAILURE", ERR_LIB_PROV, PROV_R_INDICATOR_INTEGRITY_FAILURE}, + #else + {"INDICATOR_INTEGRITY_FAILURE", 57, 210}, + #endif + #ifdef PROV_R_INSUFFICIENT_DRBG_STRENGTH + {"INSUFFICIENT_DRBG_STRENGTH", ERR_LIB_PROV, PROV_R_INSUFFICIENT_DRBG_STRENGTH}, + #else + {"INSUFFICIENT_DRBG_STRENGTH", 57, 181}, + #endif + #ifdef PROV_R_INVALID_AAD + {"INVALID_AAD", ERR_LIB_PROV, PROV_R_INVALID_AAD}, + #else + {"INVALID_AAD", 57, 108}, + #endif + #ifdef PROV_R_INVALID_CONFIG_DATA + {"INVALID_CONFIG_DATA", ERR_LIB_PROV, PROV_R_INVALID_CONFIG_DATA}, + #else + {"INVALID_CONFIG_DATA", 57, 211}, + #endif + #ifdef PROV_R_INVALID_CONSTANT_LENGTH + {"INVALID_CONSTANT_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_CONSTANT_LENGTH}, + #else + {"INVALID_CONSTANT_LENGTH", 57, 157}, + #endif + #ifdef PROV_R_INVALID_CURVE + {"INVALID_CURVE", ERR_LIB_PROV, PROV_R_INVALID_CURVE}, + #else + {"INVALID_CURVE", 57, 176}, + #endif + #ifdef PROV_R_INVALID_CUSTOM_LENGTH + {"INVALID_CUSTOM_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_CUSTOM_LENGTH}, + #else + {"INVALID_CUSTOM_LENGTH", 57, 111}, + #endif + #ifdef PROV_R_INVALID_DATA + {"INVALID_DATA", ERR_LIB_PROV, PROV_R_INVALID_DATA}, + #else + {"INVALID_DATA", 57, 115}, + #endif + #ifdef PROV_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_PROV, PROV_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", 57, 122}, + #endif + #ifdef PROV_R_INVALID_DIGEST_LENGTH + {"INVALID_DIGEST_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_DIGEST_LENGTH}, + #else + {"INVALID_DIGEST_LENGTH", 57, 166}, + #endif + #ifdef PROV_R_INVALID_DIGEST_SIZE + {"INVALID_DIGEST_SIZE", ERR_LIB_PROV, PROV_R_INVALID_DIGEST_SIZE}, + #else + {"INVALID_DIGEST_SIZE", 57, 218}, + #endif + #ifdef PROV_R_INVALID_ITERATION_COUNT + {"INVALID_ITERATION_COUNT", ERR_LIB_PROV, PROV_R_INVALID_ITERATION_COUNT}, + #else + {"INVALID_ITERATION_COUNT", 57, 123}, + #endif + #ifdef PROV_R_INVALID_IV_LENGTH + {"INVALID_IV_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH}, + #else + {"INVALID_IV_LENGTH", 57, 109}, + #endif + #ifdef PROV_R_INVALID_KEY + {"INVALID_KEY", ERR_LIB_PROV, PROV_R_INVALID_KEY}, + #else + {"INVALID_KEY", 57, 158}, + #endif + #ifdef PROV_R_INVALID_KEY_LENGTH + {"INVALID_KEY_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_KEY_LENGTH}, + #else + {"INVALID_KEY_LENGTH", 57, 105}, + #endif + #ifdef PROV_R_INVALID_MAC + {"INVALID_MAC", ERR_LIB_PROV, PROV_R_INVALID_MAC}, + #else + {"INVALID_MAC", 57, 151}, + #endif + #ifdef PROV_R_INVALID_MGF1_MD + {"INVALID_MGF1_MD", ERR_LIB_PROV, PROV_R_INVALID_MGF1_MD}, + #else + {"INVALID_MGF1_MD", 57, 167}, + #endif + #ifdef PROV_R_INVALID_MODE + {"INVALID_MODE", ERR_LIB_PROV, PROV_R_INVALID_MODE}, + #else + {"INVALID_MODE", 57, 125}, + #endif + #ifdef PROV_R_INVALID_PADDING_MODE + {"INVALID_PADDING_MODE", ERR_LIB_PROV, PROV_R_INVALID_PADDING_MODE}, + #else + {"INVALID_PADDING_MODE", 57, 168}, + #endif + #ifdef PROV_R_INVALID_PUBINFO + {"INVALID_PUBINFO", ERR_LIB_PROV, PROV_R_INVALID_PUBINFO}, + #else + {"INVALID_PUBINFO", 57, 198}, + #endif + #ifdef PROV_R_INVALID_SALT_LENGTH + {"INVALID_SALT_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_SALT_LENGTH}, + #else + {"INVALID_SALT_LENGTH", 57, 112}, + #endif + #ifdef PROV_R_INVALID_SEED_LENGTH + {"INVALID_SEED_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_SEED_LENGTH}, + #else + {"INVALID_SEED_LENGTH", 57, 154}, + #endif + #ifdef PROV_R_INVALID_SIGNATURE_SIZE + {"INVALID_SIGNATURE_SIZE", ERR_LIB_PROV, PROV_R_INVALID_SIGNATURE_SIZE}, + #else + {"INVALID_SIGNATURE_SIZE", 57, 179}, + #endif + #ifdef PROV_R_INVALID_STATE + {"INVALID_STATE", ERR_LIB_PROV, PROV_R_INVALID_STATE}, + #else + {"INVALID_STATE", 57, 212}, + #endif + #ifdef PROV_R_INVALID_TAG + {"INVALID_TAG", ERR_LIB_PROV, PROV_R_INVALID_TAG}, + #else + {"INVALID_TAG", 57, 110}, + #endif + #ifdef PROV_R_INVALID_TAG_LENGTH + {"INVALID_TAG_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_TAG_LENGTH}, + #else + {"INVALID_TAG_LENGTH", 57, 118}, + #endif + #ifdef PROV_R_INVALID_UKM_LENGTH + {"INVALID_UKM_LENGTH", ERR_LIB_PROV, PROV_R_INVALID_UKM_LENGTH}, + #else + {"INVALID_UKM_LENGTH", 57, 200}, + #endif + #ifdef PROV_R_INVALID_X931_DIGEST + {"INVALID_X931_DIGEST", ERR_LIB_PROV, PROV_R_INVALID_X931_DIGEST}, + #else + {"INVALID_X931_DIGEST", 57, 170}, + #endif + #ifdef PROV_R_IN_ERROR_STATE + {"IN_ERROR_STATE", ERR_LIB_PROV, PROV_R_IN_ERROR_STATE}, + #else + {"IN_ERROR_STATE", 57, 192}, + #endif + #ifdef PROV_R_KEY_SETUP_FAILED + {"KEY_SETUP_FAILED", ERR_LIB_PROV, PROV_R_KEY_SETUP_FAILED}, + #else + {"KEY_SETUP_FAILED", 57, 101}, + #endif + #ifdef PROV_R_KEY_SIZE_TOO_SMALL + {"KEY_SIZE_TOO_SMALL", ERR_LIB_PROV, PROV_R_KEY_SIZE_TOO_SMALL}, + #else + {"KEY_SIZE_TOO_SMALL", 57, 171}, + #endif + #ifdef PROV_R_MISSING_CEK_ALG + {"MISSING_CEK_ALG", ERR_LIB_PROV, PROV_R_MISSING_CEK_ALG}, + #else + {"MISSING_CEK_ALG", 57, 144}, + #endif + #ifdef PROV_R_MISSING_CIPHER + {"MISSING_CIPHER", ERR_LIB_PROV, PROV_R_MISSING_CIPHER}, + #else + {"MISSING_CIPHER", 57, 155}, + #endif + #ifdef PROV_R_MISSING_CONFIG_DATA + {"MISSING_CONFIG_DATA", ERR_LIB_PROV, PROV_R_MISSING_CONFIG_DATA}, + #else + {"MISSING_CONFIG_DATA", 57, 213}, + #endif + #ifdef PROV_R_MISSING_CONSTANT + {"MISSING_CONSTANT", ERR_LIB_PROV, PROV_R_MISSING_CONSTANT}, + #else + {"MISSING_CONSTANT", 57, 156}, + #endif + #ifdef PROV_R_MISSING_KEY + {"MISSING_KEY", ERR_LIB_PROV, PROV_R_MISSING_KEY}, + #else + {"MISSING_KEY", 57, 128}, + #endif + #ifdef PROV_R_MISSING_MAC + {"MISSING_MAC", ERR_LIB_PROV, PROV_R_MISSING_MAC}, + #else + {"MISSING_MAC", 57, 150}, + #endif + #ifdef PROV_R_MISSING_MESSAGE_DIGEST + {"MISSING_MESSAGE_DIGEST", ERR_LIB_PROV, PROV_R_MISSING_MESSAGE_DIGEST}, + #else + {"MISSING_MESSAGE_DIGEST", 57, 129}, + #endif + #ifdef PROV_R_MISSING_OID + {"MISSING_OID", ERR_LIB_PROV, PROV_R_MISSING_OID}, + #else + {"MISSING_OID", 57, 209}, + #endif + #ifdef PROV_R_MISSING_PASS + {"MISSING_PASS", ERR_LIB_PROV, PROV_R_MISSING_PASS}, + #else + {"MISSING_PASS", 57, 130}, + #endif + #ifdef PROV_R_MISSING_SALT + {"MISSING_SALT", ERR_LIB_PROV, PROV_R_MISSING_SALT}, + #else + {"MISSING_SALT", 57, 131}, + #endif + #ifdef PROV_R_MISSING_SECRET + {"MISSING_SECRET", ERR_LIB_PROV, PROV_R_MISSING_SECRET}, + #else + {"MISSING_SECRET", 57, 132}, + #endif + #ifdef PROV_R_MISSING_SEED + {"MISSING_SEED", ERR_LIB_PROV, PROV_R_MISSING_SEED}, + #else + {"MISSING_SEED", 57, 140}, + #endif + #ifdef PROV_R_MISSING_SESSION_ID + {"MISSING_SESSION_ID", ERR_LIB_PROV, PROV_R_MISSING_SESSION_ID}, + #else + {"MISSING_SESSION_ID", 57, 133}, + #endif + #ifdef PROV_R_MISSING_TYPE + {"MISSING_TYPE", ERR_LIB_PROV, PROV_R_MISSING_TYPE}, + #else + {"MISSING_TYPE", 57, 134}, + #endif + #ifdef PROV_R_MISSING_XCGHASH + {"MISSING_XCGHASH", ERR_LIB_PROV, PROV_R_MISSING_XCGHASH}, + #else + {"MISSING_XCGHASH", 57, 135}, + #endif + #ifdef PROV_R_MODULE_INTEGRITY_FAILURE + {"MODULE_INTEGRITY_FAILURE", ERR_LIB_PROV, PROV_R_MODULE_INTEGRITY_FAILURE}, + #else + {"MODULE_INTEGRITY_FAILURE", 57, 214}, + #endif + #ifdef PROV_R_NOT_A_PRIVATE_KEY + {"NOT_A_PRIVATE_KEY", ERR_LIB_PROV, PROV_R_NOT_A_PRIVATE_KEY}, + #else + {"NOT_A_PRIVATE_KEY", 57, 221}, + #endif + #ifdef PROV_R_NOT_A_PUBLIC_KEY + {"NOT_A_PUBLIC_KEY", ERR_LIB_PROV, PROV_R_NOT_A_PUBLIC_KEY}, + #else + {"NOT_A_PUBLIC_KEY", 57, 220}, + #endif + #ifdef PROV_R_NOT_INSTANTIATED + {"NOT_INSTANTIATED", ERR_LIB_PROV, PROV_R_NOT_INSTANTIATED}, + #else + {"NOT_INSTANTIATED", 57, 193}, + #endif + #ifdef PROV_R_NOT_PARAMETERS + {"NOT_PARAMETERS", ERR_LIB_PROV, PROV_R_NOT_PARAMETERS}, + #else + {"NOT_PARAMETERS", 57, 226}, + #endif + #ifdef PROV_R_NOT_SUPPORTED + {"NOT_SUPPORTED", ERR_LIB_PROV, PROV_R_NOT_SUPPORTED}, + #else + {"NOT_SUPPORTED", 57, 136}, + #endif + #ifdef PROV_R_NOT_XOF_OR_INVALID_LENGTH + {"NOT_XOF_OR_INVALID_LENGTH", ERR_LIB_PROV, PROV_R_NOT_XOF_OR_INVALID_LENGTH}, + #else + {"NOT_XOF_OR_INVALID_LENGTH", 57, 113}, + #endif + #ifdef PROV_R_NO_KEY_SET + {"NO_KEY_SET", ERR_LIB_PROV, PROV_R_NO_KEY_SET}, + #else + {"NO_KEY_SET", 57, 114}, + #endif + #ifdef PROV_R_NO_PARAMETERS_SET + {"NO_PARAMETERS_SET", ERR_LIB_PROV, PROV_R_NO_PARAMETERS_SET}, + #else + {"NO_PARAMETERS_SET", 57, 177}, + #endif + #ifdef PROV_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_PROV, PROV_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE}, + #else + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 57, 178}, + #endif + #ifdef PROV_R_OUTPUT_BUFFER_TOO_SMALL + {"OUTPUT_BUFFER_TOO_SMALL", ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL}, + #else + {"OUTPUT_BUFFER_TOO_SMALL", 57, 106}, + #endif + #ifdef PROV_R_PARENT_CANNOT_GENERATE_RANDOM_NUMBERS + {"PARENT_CANNOT_GENERATE_RANDOM_NUMBERS", ERR_LIB_PROV, PROV_R_PARENT_CANNOT_GENERATE_RANDOM_NUMBERS}, + #else + {"PARENT_CANNOT_GENERATE_RANDOM_NUMBERS", 57, 228}, + #endif + #ifdef PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED + {"PARENT_CANNOT_SUPPLY_ENTROPY_SEED", ERR_LIB_PROV, PROV_R_PARENT_CANNOT_SUPPLY_ENTROPY_SEED}, + #else + {"PARENT_CANNOT_SUPPLY_ENTROPY_SEED", 57, 187}, + #endif + #ifdef PROV_R_PARENT_LOCKING_NOT_ENABLED + {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_PROV, PROV_R_PARENT_LOCKING_NOT_ENABLED}, + #else + {"PARENT_LOCKING_NOT_ENABLED", 57, 182}, + #endif + #ifdef PROV_R_PARENT_STRENGTH_TOO_WEAK + {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_PROV, PROV_R_PARENT_STRENGTH_TOO_WEAK}, + #else + {"PARENT_STRENGTH_TOO_WEAK", 57, 194}, + #endif + #ifdef PROV_R_PATH_MUST_BE_ABSOLUTE + {"PATH_MUST_BE_ABSOLUTE", ERR_LIB_PROV, PROV_R_PATH_MUST_BE_ABSOLUTE}, + #else + {"PATH_MUST_BE_ABSOLUTE", 57, 219}, + #endif + #ifdef PROV_R_PERSONALISATION_STRING_TOO_LONG + {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_PROV, PROV_R_PERSONALISATION_STRING_TOO_LONG}, + #else + {"PERSONALISATION_STRING_TOO_LONG", 57, 195}, + #endif + #ifdef PROV_R_PSS_SALTLEN_TOO_SMALL + {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_PROV, PROV_R_PSS_SALTLEN_TOO_SMALL}, + #else + {"PSS_SALTLEN_TOO_SMALL", 57, 172}, + #endif + #ifdef PROV_R_REQUEST_TOO_LARGE_FOR_DRBG + {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_PROV, PROV_R_REQUEST_TOO_LARGE_FOR_DRBG}, + #else + {"REQUEST_TOO_LARGE_FOR_DRBG", 57, 196}, + #endif + #ifdef PROV_R_REQUIRE_CTR_MODE_CIPHER + {"REQUIRE_CTR_MODE_CIPHER", ERR_LIB_PROV, PROV_R_REQUIRE_CTR_MODE_CIPHER}, + #else + {"REQUIRE_CTR_MODE_CIPHER", 57, 206}, + #endif + #ifdef PROV_R_RESEED_ERROR + {"RESEED_ERROR", ERR_LIB_PROV, PROV_R_RESEED_ERROR}, + #else + {"RESEED_ERROR", 57, 197}, + #endif + #ifdef PROV_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES + {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", ERR_LIB_PROV, PROV_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES}, + #else + {"SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES", 57, 222}, + #endif + #ifdef PROV_R_SEED_SOURCES_MUST_NOT_HAVE_A_PARENT + {"SEED_SOURCES_MUST_NOT_HAVE_A_PARENT", ERR_LIB_PROV, PROV_R_SEED_SOURCES_MUST_NOT_HAVE_A_PARENT}, + #else + {"SEED_SOURCES_MUST_NOT_HAVE_A_PARENT", 57, 229}, + #endif + #ifdef PROV_R_SELF_TEST_KAT_FAILURE + {"SELF_TEST_KAT_FAILURE", ERR_LIB_PROV, PROV_R_SELF_TEST_KAT_FAILURE}, + #else + {"SELF_TEST_KAT_FAILURE", 57, 215}, + #endif + #ifdef PROV_R_SELF_TEST_POST_FAILURE + {"SELF_TEST_POST_FAILURE", ERR_LIB_PROV, PROV_R_SELF_TEST_POST_FAILURE}, + #else + {"SELF_TEST_POST_FAILURE", 57, 216}, + #endif + #ifdef PROV_R_TAG_NOT_NEEDED + {"TAG_NOT_NEEDED", ERR_LIB_PROV, PROV_R_TAG_NOT_NEEDED}, + #else + {"TAG_NOT_NEEDED", 57, 120}, + #endif + #ifdef PROV_R_TAG_NOT_SET + {"TAG_NOT_SET", ERR_LIB_PROV, PROV_R_TAG_NOT_SET}, + #else + {"TAG_NOT_SET", 57, 119}, + #endif + #ifdef PROV_R_TOO_MANY_RECORDS + {"TOO_MANY_RECORDS", ERR_LIB_PROV, PROV_R_TOO_MANY_RECORDS}, + #else + {"TOO_MANY_RECORDS", 57, 126}, + #endif + #ifdef PROV_R_UNABLE_TO_FIND_CIPHERS + {"UNABLE_TO_FIND_CIPHERS", ERR_LIB_PROV, PROV_R_UNABLE_TO_FIND_CIPHERS}, + #else + {"UNABLE_TO_FIND_CIPHERS", 57, 207}, + #endif + #ifdef PROV_R_UNABLE_TO_GET_PARENT_STRENGTH + {"UNABLE_TO_GET_PARENT_STRENGTH", ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PARENT_STRENGTH}, + #else + {"UNABLE_TO_GET_PARENT_STRENGTH", 57, 199}, + #endif + #ifdef PROV_R_UNABLE_TO_GET_PASSPHRASE + {"UNABLE_TO_GET_PASSPHRASE", ERR_LIB_PROV, PROV_R_UNABLE_TO_GET_PASSPHRASE}, + #else + {"UNABLE_TO_GET_PASSPHRASE", 57, 159}, + #endif + #ifdef PROV_R_UNABLE_TO_INITIALISE_CIPHERS + {"UNABLE_TO_INITIALISE_CIPHERS", ERR_LIB_PROV, PROV_R_UNABLE_TO_INITIALISE_CIPHERS}, + #else + {"UNABLE_TO_INITIALISE_CIPHERS", 57, 208}, + #endif + #ifdef PROV_R_UNABLE_TO_LOAD_SHA256 + {"UNABLE_TO_LOAD_SHA256", ERR_LIB_PROV, PROV_R_UNABLE_TO_LOAD_SHA256}, + #else + {"UNABLE_TO_LOAD_SHA256", 57, 147}, + #endif + #ifdef PROV_R_UNABLE_TO_LOCK_PARENT + {"UNABLE_TO_LOCK_PARENT", ERR_LIB_PROV, PROV_R_UNABLE_TO_LOCK_PARENT}, + #else + {"UNABLE_TO_LOCK_PARENT", 57, 201}, + #endif + #ifdef PROV_R_UNABLE_TO_RESEED + {"UNABLE_TO_RESEED", ERR_LIB_PROV, PROV_R_UNABLE_TO_RESEED}, + #else + {"UNABLE_TO_RESEED", 57, 204}, + #endif + #ifdef PROV_R_UNSUPPORTED_CEK_ALG + {"UNSUPPORTED_CEK_ALG", ERR_LIB_PROV, PROV_R_UNSUPPORTED_CEK_ALG}, + #else + {"UNSUPPORTED_CEK_ALG", 57, 145}, + #endif + #ifdef PROV_R_UNSUPPORTED_KEY_SIZE + {"UNSUPPORTED_KEY_SIZE", ERR_LIB_PROV, PROV_R_UNSUPPORTED_KEY_SIZE}, + #else + {"UNSUPPORTED_KEY_SIZE", 57, 153}, + #endif + #ifdef PROV_R_UNSUPPORTED_MAC_TYPE + {"UNSUPPORTED_MAC_TYPE", ERR_LIB_PROV, PROV_R_UNSUPPORTED_MAC_TYPE}, + #else + {"UNSUPPORTED_MAC_TYPE", 57, 137}, + #endif + #ifdef PROV_R_UNSUPPORTED_NUMBER_OF_ROUNDS + {"UNSUPPORTED_NUMBER_OF_ROUNDS", ERR_LIB_PROV, PROV_R_UNSUPPORTED_NUMBER_OF_ROUNDS}, + #else + {"UNSUPPORTED_NUMBER_OF_ROUNDS", 57, 152}, + #endif + #ifdef PROV_R_URI_AUTHORITY_UNSUPPORTED + {"URI_AUTHORITY_UNSUPPORTED", ERR_LIB_PROV, PROV_R_URI_AUTHORITY_UNSUPPORTED}, + #else + {"URI_AUTHORITY_UNSUPPORTED", 57, 223}, + #endif + #ifdef PROV_R_VALUE_ERROR + {"VALUE_ERROR", ERR_LIB_PROV, PROV_R_VALUE_ERROR}, + #else + {"VALUE_ERROR", 57, 138}, + #endif + #ifdef PROV_R_WRONG_FINAL_BLOCK_LENGTH + {"WRONG_FINAL_BLOCK_LENGTH", ERR_LIB_PROV, PROV_R_WRONG_FINAL_BLOCK_LENGTH}, + #else + {"WRONG_FINAL_BLOCK_LENGTH", 57, 107}, + #endif + #ifdef PROV_R_WRONG_OUTPUT_BUFFER_SIZE + {"WRONG_OUTPUT_BUFFER_SIZE", ERR_LIB_PROV, PROV_R_WRONG_OUTPUT_BUFFER_SIZE}, + #else + {"WRONG_OUTPUT_BUFFER_SIZE", 57, 139}, + #endif + #ifdef PROV_R_XOF_DIGESTS_NOT_ALLOWED + {"XOF_DIGESTS_NOT_ALLOWED", ERR_LIB_PROV, PROV_R_XOF_DIGESTS_NOT_ALLOWED}, + #else + {"XOF_DIGESTS_NOT_ALLOWED", 57, 183}, + #endif + #ifdef PROV_R_XTS_DATA_UNIT_IS_TOO_LARGE + {"XTS_DATA_UNIT_IS_TOO_LARGE", ERR_LIB_PROV, PROV_R_XTS_DATA_UNIT_IS_TOO_LARGE}, + #else + {"XTS_DATA_UNIT_IS_TOO_LARGE", 57, 148}, + #endif + #ifdef PROV_R_XTS_DUPLICATED_KEYS + {"XTS_DUPLICATED_KEYS", ERR_LIB_PROV, PROV_R_XTS_DUPLICATED_KEYS}, + #else + {"XTS_DUPLICATED_KEYS", 57, 149}, + #endif + #ifdef RAND_R_ADDITIONAL_INPUT_TOO_LONG + {"ADDITIONAL_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ADDITIONAL_INPUT_TOO_LONG}, + #else + {"ADDITIONAL_INPUT_TOO_LONG", 36, 102}, + #endif + #ifdef RAND_R_ALREADY_INSTANTIATED + {"ALREADY_INSTANTIATED", ERR_LIB_RAND, RAND_R_ALREADY_INSTANTIATED}, + #else + {"ALREADY_INSTANTIATED", 36, 103}, + #endif + #ifdef RAND_R_ARGUMENT_OUT_OF_RANGE + {"ARGUMENT_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ARGUMENT_OUT_OF_RANGE}, + #else + {"ARGUMENT_OUT_OF_RANGE", 36, 105}, + #endif + #ifdef RAND_R_CANNOT_OPEN_FILE + {"CANNOT_OPEN_FILE", ERR_LIB_RAND, RAND_R_CANNOT_OPEN_FILE}, + #else + {"CANNOT_OPEN_FILE", 36, 121}, + #endif + #ifdef RAND_R_DERIVATION_FUNCTION_MANDATORY_FOR_FIPS + {"DERIVATION_FUNCTION_MANDATORY_FOR_FIPS", ERR_LIB_RAND, RAND_R_DERIVATION_FUNCTION_MANDATORY_FOR_FIPS}, + #else + {"DERIVATION_FUNCTION_MANDATORY_FOR_FIPS", 36, 137}, + #endif + #ifdef RAND_R_DRBG_ALREADY_INITIALIZED + {"DRBG_ALREADY_INITIALIZED", ERR_LIB_RAND, RAND_R_DRBG_ALREADY_INITIALIZED}, + #else + {"DRBG_ALREADY_INITIALIZED", 36, 129}, + #endif + #ifdef RAND_R_DRBG_NOT_INITIALISED + {"DRBG_NOT_INITIALISED", ERR_LIB_RAND, RAND_R_DRBG_NOT_INITIALISED}, + #else + {"DRBG_NOT_INITIALISED", 36, 104}, + #endif + #ifdef RAND_R_ENTROPY_INPUT_TOO_LONG + {"ENTROPY_INPUT_TOO_LONG", ERR_LIB_RAND, RAND_R_ENTROPY_INPUT_TOO_LONG}, + #else + {"ENTROPY_INPUT_TOO_LONG", 36, 106}, + #endif + #ifdef RAND_R_ENTROPY_OUT_OF_RANGE + {"ENTROPY_OUT_OF_RANGE", ERR_LIB_RAND, RAND_R_ENTROPY_OUT_OF_RANGE}, + #else + {"ENTROPY_OUT_OF_RANGE", 36, 124}, + #endif + #ifdef RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED + {"ERROR_ENTROPY_POOL_WAS_IGNORED", ERR_LIB_RAND, RAND_R_ERROR_ENTROPY_POOL_WAS_IGNORED}, + #else + {"ERROR_ENTROPY_POOL_WAS_IGNORED", 36, 127}, + #endif + #ifdef RAND_R_ERROR_INITIALISING_DRBG + {"ERROR_INITIALISING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INITIALISING_DRBG}, + #else + {"ERROR_INITIALISING_DRBG", 36, 107}, + #endif + #ifdef RAND_R_ERROR_INSTANTIATING_DRBG + {"ERROR_INSTANTIATING_DRBG", ERR_LIB_RAND, RAND_R_ERROR_INSTANTIATING_DRBG}, + #else + {"ERROR_INSTANTIATING_DRBG", 36, 108}, + #endif + #ifdef RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT + {"ERROR_RETRIEVING_ADDITIONAL_INPUT", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ADDITIONAL_INPUT}, + #else + {"ERROR_RETRIEVING_ADDITIONAL_INPUT", 36, 109}, + #endif + #ifdef RAND_R_ERROR_RETRIEVING_ENTROPY + {"ERROR_RETRIEVING_ENTROPY", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_ENTROPY}, + #else + {"ERROR_RETRIEVING_ENTROPY", 36, 110}, + #endif + #ifdef RAND_R_ERROR_RETRIEVING_NONCE + {"ERROR_RETRIEVING_NONCE", ERR_LIB_RAND, RAND_R_ERROR_RETRIEVING_NONCE}, + #else + {"ERROR_RETRIEVING_NONCE", 36, 111}, + #endif + #ifdef RAND_R_FAILED_TO_CREATE_LOCK + {"FAILED_TO_CREATE_LOCK", ERR_LIB_RAND, RAND_R_FAILED_TO_CREATE_LOCK}, + #else + {"FAILED_TO_CREATE_LOCK", 36, 126}, + #endif + #ifdef RAND_R_FUNC_NOT_IMPLEMENTED + {"FUNC_NOT_IMPLEMENTED", ERR_LIB_RAND, RAND_R_FUNC_NOT_IMPLEMENTED}, + #else + {"FUNC_NOT_IMPLEMENTED", 36, 101}, + #endif + #ifdef RAND_R_FWRITE_ERROR + {"FWRITE_ERROR", ERR_LIB_RAND, RAND_R_FWRITE_ERROR}, + #else + {"FWRITE_ERROR", 36, 123}, + #endif + #ifdef RAND_R_GENERATE_ERROR + {"GENERATE_ERROR", ERR_LIB_RAND, RAND_R_GENERATE_ERROR}, + #else + {"GENERATE_ERROR", 36, 112}, + #endif + #ifdef RAND_R_INSUFFICIENT_DRBG_STRENGTH + {"INSUFFICIENT_DRBG_STRENGTH", ERR_LIB_RAND, RAND_R_INSUFFICIENT_DRBG_STRENGTH}, + #else + {"INSUFFICIENT_DRBG_STRENGTH", 36, 139}, + #endif + #ifdef RAND_R_INTERNAL_ERROR + {"INTERNAL_ERROR", ERR_LIB_RAND, RAND_R_INTERNAL_ERROR}, + #else + {"INTERNAL_ERROR", 36, 113}, + #endif + #ifdef RAND_R_IN_ERROR_STATE + {"IN_ERROR_STATE", ERR_LIB_RAND, RAND_R_IN_ERROR_STATE}, + #else + {"IN_ERROR_STATE", 36, 114}, + #endif + #ifdef RAND_R_NOT_A_REGULAR_FILE + {"NOT_A_REGULAR_FILE", ERR_LIB_RAND, RAND_R_NOT_A_REGULAR_FILE}, + #else + {"NOT_A_REGULAR_FILE", 36, 122}, + #endif + #ifdef RAND_R_NOT_INSTANTIATED + {"NOT_INSTANTIATED", ERR_LIB_RAND, RAND_R_NOT_INSTANTIATED}, + #else + {"NOT_INSTANTIATED", 36, 115}, + #endif + #ifdef RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED + {"NO_DRBG_IMPLEMENTATION_SELECTED", ERR_LIB_RAND, RAND_R_NO_DRBG_IMPLEMENTATION_SELECTED}, + #else + {"NO_DRBG_IMPLEMENTATION_SELECTED", 36, 128}, + #endif + #ifdef RAND_R_PARENT_LOCKING_NOT_ENABLED + {"PARENT_LOCKING_NOT_ENABLED", ERR_LIB_RAND, RAND_R_PARENT_LOCKING_NOT_ENABLED}, + #else + {"PARENT_LOCKING_NOT_ENABLED", 36, 130}, + #endif + #ifdef RAND_R_PARENT_STRENGTH_TOO_WEAK + {"PARENT_STRENGTH_TOO_WEAK", ERR_LIB_RAND, RAND_R_PARENT_STRENGTH_TOO_WEAK}, + #else + {"PARENT_STRENGTH_TOO_WEAK", 36, 131}, + #endif + #ifdef RAND_R_PERSONALISATION_STRING_TOO_LONG + {"PERSONALISATION_STRING_TOO_LONG", ERR_LIB_RAND, RAND_R_PERSONALISATION_STRING_TOO_LONG}, + #else + {"PERSONALISATION_STRING_TOO_LONG", 36, 116}, + #endif + #ifdef RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED + {"PREDICTION_RESISTANCE_NOT_SUPPORTED", ERR_LIB_RAND, RAND_R_PREDICTION_RESISTANCE_NOT_SUPPORTED}, + #else + {"PREDICTION_RESISTANCE_NOT_SUPPORTED", 36, 133}, + #endif + #ifdef RAND_R_PRNG_NOT_SEEDED + {"PRNG_NOT_SEEDED", ERR_LIB_RAND, RAND_R_PRNG_NOT_SEEDED}, + #else + {"PRNG_NOT_SEEDED", 36, 100}, + #endif + #ifdef RAND_R_RANDOM_POOL_OVERFLOW + {"RANDOM_POOL_OVERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_OVERFLOW}, + #else + {"RANDOM_POOL_OVERFLOW", 36, 125}, + #endif + #ifdef RAND_R_RANDOM_POOL_UNDERFLOW + {"RANDOM_POOL_UNDERFLOW", ERR_LIB_RAND, RAND_R_RANDOM_POOL_UNDERFLOW}, + #else + {"RANDOM_POOL_UNDERFLOW", 36, 134}, + #endif + #ifdef RAND_R_REQUEST_TOO_LARGE_FOR_DRBG + {"REQUEST_TOO_LARGE_FOR_DRBG", ERR_LIB_RAND, RAND_R_REQUEST_TOO_LARGE_FOR_DRBG}, + #else + {"REQUEST_TOO_LARGE_FOR_DRBG", 36, 117}, + #endif + #ifdef RAND_R_RESEED_ERROR + {"RESEED_ERROR", ERR_LIB_RAND, RAND_R_RESEED_ERROR}, + #else + {"RESEED_ERROR", 36, 118}, + #endif + #ifdef RAND_R_SELFTEST_FAILURE + {"SELFTEST_FAILURE", ERR_LIB_RAND, RAND_R_SELFTEST_FAILURE}, + #else + {"SELFTEST_FAILURE", 36, 119}, + #endif + #ifdef RAND_R_TOO_LITTLE_NONCE_REQUESTED + {"TOO_LITTLE_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_LITTLE_NONCE_REQUESTED}, + #else + {"TOO_LITTLE_NONCE_REQUESTED", 36, 135}, + #endif + #ifdef RAND_R_TOO_MUCH_NONCE_REQUESTED + {"TOO_MUCH_NONCE_REQUESTED", ERR_LIB_RAND, RAND_R_TOO_MUCH_NONCE_REQUESTED}, + #else + {"TOO_MUCH_NONCE_REQUESTED", 36, 136}, + #endif + #ifdef RAND_R_UNABLE_TO_CREATE_DRBG + {"UNABLE_TO_CREATE_DRBG", ERR_LIB_RAND, RAND_R_UNABLE_TO_CREATE_DRBG}, + #else + {"UNABLE_TO_CREATE_DRBG", 36, 143}, + #endif + #ifdef RAND_R_UNABLE_TO_FETCH_DRBG + {"UNABLE_TO_FETCH_DRBG", ERR_LIB_RAND, RAND_R_UNABLE_TO_FETCH_DRBG}, + #else + {"UNABLE_TO_FETCH_DRBG", 36, 144}, + #endif + #ifdef RAND_R_UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER + {"UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER", ERR_LIB_RAND, RAND_R_UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER}, + #else + {"UNABLE_TO_GET_PARENT_RESEED_PROP_COUNTER", 36, 141}, + #endif + #ifdef RAND_R_UNABLE_TO_GET_PARENT_STRENGTH + {"UNABLE_TO_GET_PARENT_STRENGTH", ERR_LIB_RAND, RAND_R_UNABLE_TO_GET_PARENT_STRENGTH}, + #else + {"UNABLE_TO_GET_PARENT_STRENGTH", 36, 138}, + #endif + #ifdef RAND_R_UNABLE_TO_LOCK_PARENT + {"UNABLE_TO_LOCK_PARENT", ERR_LIB_RAND, RAND_R_UNABLE_TO_LOCK_PARENT}, + #else + {"UNABLE_TO_LOCK_PARENT", 36, 140}, + #endif + #ifdef RAND_R_UNSUPPORTED_DRBG_FLAGS + {"UNSUPPORTED_DRBG_FLAGS", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_FLAGS}, + #else + {"UNSUPPORTED_DRBG_FLAGS", 36, 132}, + #endif + #ifdef RAND_R_UNSUPPORTED_DRBG_TYPE + {"UNSUPPORTED_DRBG_TYPE", ERR_LIB_RAND, RAND_R_UNSUPPORTED_DRBG_TYPE}, + #else + {"UNSUPPORTED_DRBG_TYPE", 36, 120}, + #endif + #ifdef RSA_R_ALGORITHM_MISMATCH + {"ALGORITHM_MISMATCH", ERR_LIB_RSA, RSA_R_ALGORITHM_MISMATCH}, + #else + {"ALGORITHM_MISMATCH", 4, 100}, + #endif + #ifdef RSA_R_BAD_E_VALUE + {"BAD_E_VALUE", ERR_LIB_RSA, RSA_R_BAD_E_VALUE}, + #else + {"BAD_E_VALUE", 4, 101}, + #endif + #ifdef RSA_R_BAD_FIXED_HEADER_DECRYPT + {"BAD_FIXED_HEADER_DECRYPT", ERR_LIB_RSA, RSA_R_BAD_FIXED_HEADER_DECRYPT}, + #else + {"BAD_FIXED_HEADER_DECRYPT", 4, 102}, + #endif + #ifdef RSA_R_BAD_PAD_BYTE_COUNT + {"BAD_PAD_BYTE_COUNT", ERR_LIB_RSA, RSA_R_BAD_PAD_BYTE_COUNT}, + #else + {"BAD_PAD_BYTE_COUNT", 4, 103}, + #endif + #ifdef RSA_R_BAD_SIGNATURE + {"BAD_SIGNATURE", ERR_LIB_RSA, RSA_R_BAD_SIGNATURE}, + #else + {"BAD_SIGNATURE", 4, 104}, + #endif + #ifdef RSA_R_BLOCK_TYPE_IS_NOT_01 + {"BLOCK_TYPE_IS_NOT_01", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_01}, + #else + {"BLOCK_TYPE_IS_NOT_01", 4, 106}, + #endif + #ifdef RSA_R_BLOCK_TYPE_IS_NOT_02 + {"BLOCK_TYPE_IS_NOT_02", ERR_LIB_RSA, RSA_R_BLOCK_TYPE_IS_NOT_02}, + #else + {"BLOCK_TYPE_IS_NOT_02", 4, 107}, + #endif + #ifdef RSA_R_DATA_GREATER_THAN_MOD_LEN + {"DATA_GREATER_THAN_MOD_LEN", ERR_LIB_RSA, RSA_R_DATA_GREATER_THAN_MOD_LEN}, + #else + {"DATA_GREATER_THAN_MOD_LEN", 4, 108}, + #endif + #ifdef RSA_R_DATA_TOO_LARGE + {"DATA_TOO_LARGE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE}, + #else + {"DATA_TOO_LARGE", 4, 109}, + #endif + #ifdef RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE + {"DATA_TOO_LARGE_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE}, + #else + {"DATA_TOO_LARGE_FOR_KEY_SIZE", 4, 110}, + #endif + #ifdef RSA_R_DATA_TOO_LARGE_FOR_MODULUS + {"DATA_TOO_LARGE_FOR_MODULUS", ERR_LIB_RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS}, + #else + {"DATA_TOO_LARGE_FOR_MODULUS", 4, 132}, + #endif + #ifdef RSA_R_DATA_TOO_SMALL + {"DATA_TOO_SMALL", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL}, + #else + {"DATA_TOO_SMALL", 4, 111}, + #endif + #ifdef RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE + {"DATA_TOO_SMALL_FOR_KEY_SIZE", ERR_LIB_RSA, RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE}, + #else + {"DATA_TOO_SMALL_FOR_KEY_SIZE", 4, 122}, + #endif + #ifdef RSA_R_DIGEST_DOES_NOT_MATCH + {"DIGEST_DOES_NOT_MATCH", ERR_LIB_RSA, RSA_R_DIGEST_DOES_NOT_MATCH}, + #else + {"DIGEST_DOES_NOT_MATCH", 4, 158}, + #endif + #ifdef RSA_R_DIGEST_NOT_ALLOWED + {"DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_DIGEST_NOT_ALLOWED}, + #else + {"DIGEST_NOT_ALLOWED", 4, 145}, + #endif + #ifdef RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY + {"DIGEST_TOO_BIG_FOR_RSA_KEY", ERR_LIB_RSA, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY}, + #else + {"DIGEST_TOO_BIG_FOR_RSA_KEY", 4, 112}, + #endif + #ifdef RSA_R_DMP1_NOT_CONGRUENT_TO_D + {"DMP1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMP1_NOT_CONGRUENT_TO_D}, + #else + {"DMP1_NOT_CONGRUENT_TO_D", 4, 124}, + #endif + #ifdef RSA_R_DMQ1_NOT_CONGRUENT_TO_D + {"DMQ1_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_DMQ1_NOT_CONGRUENT_TO_D}, + #else + {"DMQ1_NOT_CONGRUENT_TO_D", 4, 125}, + #endif + #ifdef RSA_R_D_E_NOT_CONGRUENT_TO_1 + {"D_E_NOT_CONGRUENT_TO_1", ERR_LIB_RSA, RSA_R_D_E_NOT_CONGRUENT_TO_1}, + #else + {"D_E_NOT_CONGRUENT_TO_1", 4, 123}, + #endif + #ifdef RSA_R_FIRST_OCTET_INVALID + {"FIRST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_FIRST_OCTET_INVALID}, + #else + {"FIRST_OCTET_INVALID", 4, 133}, + #endif + #ifdef RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE + {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", ERR_LIB_RSA, RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE}, + #else + {"ILLEGAL_OR_UNSUPPORTED_PADDING_MODE", 4, 144}, + #endif + #ifdef RSA_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", 4, 157}, + #endif + #ifdef RSA_R_INVALID_DIGEST_LENGTH + {"INVALID_DIGEST_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_DIGEST_LENGTH}, + #else + {"INVALID_DIGEST_LENGTH", 4, 143}, + #endif + #ifdef RSA_R_INVALID_HEADER + {"INVALID_HEADER", ERR_LIB_RSA, RSA_R_INVALID_HEADER}, + #else + {"INVALID_HEADER", 4, 137}, + #endif + #ifdef RSA_R_INVALID_KEYPAIR + {"INVALID_KEYPAIR", ERR_LIB_RSA, RSA_R_INVALID_KEYPAIR}, + #else + {"INVALID_KEYPAIR", 4, 171}, + #endif + #ifdef RSA_R_INVALID_KEY_LENGTH + {"INVALID_KEY_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_KEY_LENGTH}, + #else + {"INVALID_KEY_LENGTH", 4, 173}, + #endif + #ifdef RSA_R_INVALID_LABEL + {"INVALID_LABEL", ERR_LIB_RSA, RSA_R_INVALID_LABEL}, + #else + {"INVALID_LABEL", 4, 160}, + #endif + #ifdef RSA_R_INVALID_MESSAGE_LENGTH + {"INVALID_MESSAGE_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_MESSAGE_LENGTH}, + #else + {"INVALID_MESSAGE_LENGTH", 4, 131}, + #endif + #ifdef RSA_R_INVALID_MGF1_MD + {"INVALID_MGF1_MD", ERR_LIB_RSA, RSA_R_INVALID_MGF1_MD}, + #else + {"INVALID_MGF1_MD", 4, 156}, + #endif + #ifdef RSA_R_INVALID_MODULUS + {"INVALID_MODULUS", ERR_LIB_RSA, RSA_R_INVALID_MODULUS}, + #else + {"INVALID_MODULUS", 4, 174}, + #endif + #ifdef RSA_R_INVALID_MULTI_PRIME_KEY + {"INVALID_MULTI_PRIME_KEY", ERR_LIB_RSA, RSA_R_INVALID_MULTI_PRIME_KEY}, + #else + {"INVALID_MULTI_PRIME_KEY", 4, 167}, + #endif + #ifdef RSA_R_INVALID_OAEP_PARAMETERS + {"INVALID_OAEP_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_OAEP_PARAMETERS}, + #else + {"INVALID_OAEP_PARAMETERS", 4, 161}, + #endif + #ifdef RSA_R_INVALID_PADDING + {"INVALID_PADDING", ERR_LIB_RSA, RSA_R_INVALID_PADDING}, + #else + {"INVALID_PADDING", 4, 138}, + #endif + #ifdef RSA_R_INVALID_PADDING_MODE + {"INVALID_PADDING_MODE", ERR_LIB_RSA, RSA_R_INVALID_PADDING_MODE}, + #else + {"INVALID_PADDING_MODE", 4, 141}, + #endif + #ifdef RSA_R_INVALID_PSS_PARAMETERS + {"INVALID_PSS_PARAMETERS", ERR_LIB_RSA, RSA_R_INVALID_PSS_PARAMETERS}, + #else + {"INVALID_PSS_PARAMETERS", 4, 149}, + #endif + #ifdef RSA_R_INVALID_PSS_SALTLEN + {"INVALID_PSS_SALTLEN", ERR_LIB_RSA, RSA_R_INVALID_PSS_SALTLEN}, + #else + {"INVALID_PSS_SALTLEN", 4, 146}, + #endif + #ifdef RSA_R_INVALID_REQUEST + {"INVALID_REQUEST", ERR_LIB_RSA, RSA_R_INVALID_REQUEST}, + #else + {"INVALID_REQUEST", 4, 175}, + #endif + #ifdef RSA_R_INVALID_SALT_LENGTH + {"INVALID_SALT_LENGTH", ERR_LIB_RSA, RSA_R_INVALID_SALT_LENGTH}, + #else + {"INVALID_SALT_LENGTH", 4, 150}, + #endif + #ifdef RSA_R_INVALID_STRENGTH + {"INVALID_STRENGTH", ERR_LIB_RSA, RSA_R_INVALID_STRENGTH}, + #else + {"INVALID_STRENGTH", 4, 176}, + #endif + #ifdef RSA_R_INVALID_TRAILER + {"INVALID_TRAILER", ERR_LIB_RSA, RSA_R_INVALID_TRAILER}, + #else + {"INVALID_TRAILER", 4, 139}, + #endif + #ifdef RSA_R_INVALID_X931_DIGEST + {"INVALID_X931_DIGEST", ERR_LIB_RSA, RSA_R_INVALID_X931_DIGEST}, + #else + {"INVALID_X931_DIGEST", 4, 142}, + #endif + #ifdef RSA_R_IQMP_NOT_INVERSE_OF_Q + {"IQMP_NOT_INVERSE_OF_Q", ERR_LIB_RSA, RSA_R_IQMP_NOT_INVERSE_OF_Q}, + #else + {"IQMP_NOT_INVERSE_OF_Q", 4, 126}, + #endif + #ifdef RSA_R_KEY_PRIME_NUM_INVALID + {"KEY_PRIME_NUM_INVALID", ERR_LIB_RSA, RSA_R_KEY_PRIME_NUM_INVALID}, + #else + {"KEY_PRIME_NUM_INVALID", 4, 165}, + #endif + #ifdef RSA_R_KEY_SIZE_TOO_SMALL + {"KEY_SIZE_TOO_SMALL", ERR_LIB_RSA, RSA_R_KEY_SIZE_TOO_SMALL}, + #else + {"KEY_SIZE_TOO_SMALL", 4, 120}, + #endif + #ifdef RSA_R_LAST_OCTET_INVALID + {"LAST_OCTET_INVALID", ERR_LIB_RSA, RSA_R_LAST_OCTET_INVALID}, + #else + {"LAST_OCTET_INVALID", 4, 134}, + #endif + #ifdef RSA_R_MGF1_DIGEST_NOT_ALLOWED + {"MGF1_DIGEST_NOT_ALLOWED", ERR_LIB_RSA, RSA_R_MGF1_DIGEST_NOT_ALLOWED}, + #else + {"MGF1_DIGEST_NOT_ALLOWED", 4, 152}, + #endif + #ifdef RSA_R_MISSING_PRIVATE_KEY + {"MISSING_PRIVATE_KEY", ERR_LIB_RSA, RSA_R_MISSING_PRIVATE_KEY}, + #else + {"MISSING_PRIVATE_KEY", 4, 179}, + #endif + #ifdef RSA_R_MODULUS_TOO_LARGE + {"MODULUS_TOO_LARGE", ERR_LIB_RSA, RSA_R_MODULUS_TOO_LARGE}, + #else + {"MODULUS_TOO_LARGE", 4, 105}, + #endif + #ifdef RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R + {"MP_COEFFICIENT_NOT_INVERSE_OF_R", ERR_LIB_RSA, RSA_R_MP_COEFFICIENT_NOT_INVERSE_OF_R}, + #else + {"MP_COEFFICIENT_NOT_INVERSE_OF_R", 4, 168}, + #endif + #ifdef RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D + {"MP_EXPONENT_NOT_CONGRUENT_TO_D", ERR_LIB_RSA, RSA_R_MP_EXPONENT_NOT_CONGRUENT_TO_D}, + #else + {"MP_EXPONENT_NOT_CONGRUENT_TO_D", 4, 169}, + #endif + #ifdef RSA_R_MP_R_NOT_PRIME + {"MP_R_NOT_PRIME", ERR_LIB_RSA, RSA_R_MP_R_NOT_PRIME}, + #else + {"MP_R_NOT_PRIME", 4, 170}, + #endif + #ifdef RSA_R_NO_PUBLIC_EXPONENT + {"NO_PUBLIC_EXPONENT", ERR_LIB_RSA, RSA_R_NO_PUBLIC_EXPONENT}, + #else + {"NO_PUBLIC_EXPONENT", 4, 140}, + #endif + #ifdef RSA_R_NULL_BEFORE_BLOCK_MISSING + {"NULL_BEFORE_BLOCK_MISSING", ERR_LIB_RSA, RSA_R_NULL_BEFORE_BLOCK_MISSING}, + #else + {"NULL_BEFORE_BLOCK_MISSING", 4, 113}, + #endif + #ifdef RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES + {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES}, + #else + {"N_DOES_NOT_EQUAL_PRODUCT_OF_PRIMES", 4, 172}, + #endif + #ifdef RSA_R_N_DOES_NOT_EQUAL_P_Q + {"N_DOES_NOT_EQUAL_P_Q", ERR_LIB_RSA, RSA_R_N_DOES_NOT_EQUAL_P_Q}, + #else + {"N_DOES_NOT_EQUAL_P_Q", 4, 127}, + #endif + #ifdef RSA_R_OAEP_DECODING_ERROR + {"OAEP_DECODING_ERROR", ERR_LIB_RSA, RSA_R_OAEP_DECODING_ERROR}, + #else + {"OAEP_DECODING_ERROR", 4, 121}, + #endif + #ifdef RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", ERR_LIB_RSA, RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE}, + #else + {"OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE", 4, 148}, + #endif + #ifdef RSA_R_PADDING_CHECK_FAILED + {"PADDING_CHECK_FAILED", ERR_LIB_RSA, RSA_R_PADDING_CHECK_FAILED}, + #else + {"PADDING_CHECK_FAILED", 4, 114}, + #endif + #ifdef RSA_R_PAIRWISE_TEST_FAILURE + {"PAIRWISE_TEST_FAILURE", ERR_LIB_RSA, RSA_R_PAIRWISE_TEST_FAILURE}, + #else + {"PAIRWISE_TEST_FAILURE", 4, 177}, + #endif + #ifdef RSA_R_PKCS_DECODING_ERROR + {"PKCS_DECODING_ERROR", ERR_LIB_RSA, RSA_R_PKCS_DECODING_ERROR}, + #else + {"PKCS_DECODING_ERROR", 4, 159}, + #endif + #ifdef RSA_R_PSS_SALTLEN_TOO_SMALL + {"PSS_SALTLEN_TOO_SMALL", ERR_LIB_RSA, RSA_R_PSS_SALTLEN_TOO_SMALL}, + #else + {"PSS_SALTLEN_TOO_SMALL", 4, 164}, + #endif + #ifdef RSA_R_PUB_EXPONENT_OUT_OF_RANGE + {"PUB_EXPONENT_OUT_OF_RANGE", ERR_LIB_RSA, RSA_R_PUB_EXPONENT_OUT_OF_RANGE}, + #else + {"PUB_EXPONENT_OUT_OF_RANGE", 4, 178}, + #endif + #ifdef RSA_R_P_NOT_PRIME + {"P_NOT_PRIME", ERR_LIB_RSA, RSA_R_P_NOT_PRIME}, + #else + {"P_NOT_PRIME", 4, 128}, + #endif + #ifdef RSA_R_Q_NOT_PRIME + {"Q_NOT_PRIME", ERR_LIB_RSA, RSA_R_Q_NOT_PRIME}, + #else + {"Q_NOT_PRIME", 4, 129}, + #endif + #ifdef RSA_R_RSA_OPERATIONS_NOT_SUPPORTED + {"RSA_OPERATIONS_NOT_SUPPORTED", ERR_LIB_RSA, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED}, + #else + {"RSA_OPERATIONS_NOT_SUPPORTED", 4, 130}, + #endif + #ifdef RSA_R_SLEN_CHECK_FAILED + {"SLEN_CHECK_FAILED", ERR_LIB_RSA, RSA_R_SLEN_CHECK_FAILED}, + #else + {"SLEN_CHECK_FAILED", 4, 136}, + #endif + #ifdef RSA_R_SLEN_RECOVERY_FAILED + {"SLEN_RECOVERY_FAILED", ERR_LIB_RSA, RSA_R_SLEN_RECOVERY_FAILED}, + #else + {"SLEN_RECOVERY_FAILED", 4, 135}, + #endif + #ifdef RSA_R_SSLV3_ROLLBACK_ATTACK + {"SSLV3_ROLLBACK_ATTACK", ERR_LIB_RSA, RSA_R_SSLV3_ROLLBACK_ATTACK}, + #else + {"SSLV3_ROLLBACK_ATTACK", 4, 115}, + #endif + #ifdef RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", ERR_LIB_RSA, RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD}, + #else + {"THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD", 4, 116}, + #endif + #ifdef RSA_R_UNKNOWN_ALGORITHM_TYPE + {"UNKNOWN_ALGORITHM_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_ALGORITHM_TYPE}, + #else + {"UNKNOWN_ALGORITHM_TYPE", 4, 117}, + #endif + #ifdef RSA_R_UNKNOWN_DIGEST + {"UNKNOWN_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_DIGEST}, + #else + {"UNKNOWN_DIGEST", 4, 166}, + #endif + #ifdef RSA_R_UNKNOWN_MASK_DIGEST + {"UNKNOWN_MASK_DIGEST", ERR_LIB_RSA, RSA_R_UNKNOWN_MASK_DIGEST}, + #else + {"UNKNOWN_MASK_DIGEST", 4, 151}, + #endif + #ifdef RSA_R_UNKNOWN_PADDING_TYPE + {"UNKNOWN_PADDING_TYPE", ERR_LIB_RSA, RSA_R_UNKNOWN_PADDING_TYPE}, + #else + {"UNKNOWN_PADDING_TYPE", 4, 118}, + #endif + #ifdef RSA_R_UNSUPPORTED_ENCRYPTION_TYPE + {"UNSUPPORTED_ENCRYPTION_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_ENCRYPTION_TYPE}, + #else + {"UNSUPPORTED_ENCRYPTION_TYPE", 4, 162}, + #endif + #ifdef RSA_R_UNSUPPORTED_LABEL_SOURCE + {"UNSUPPORTED_LABEL_SOURCE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_LABEL_SOURCE}, + #else + {"UNSUPPORTED_LABEL_SOURCE", 4, 163}, + #endif + #ifdef RSA_R_UNSUPPORTED_MASK_ALGORITHM + {"UNSUPPORTED_MASK_ALGORITHM", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_ALGORITHM}, + #else + {"UNSUPPORTED_MASK_ALGORITHM", 4, 153}, + #endif + #ifdef RSA_R_UNSUPPORTED_MASK_PARAMETER + {"UNSUPPORTED_MASK_PARAMETER", ERR_LIB_RSA, RSA_R_UNSUPPORTED_MASK_PARAMETER}, + #else + {"UNSUPPORTED_MASK_PARAMETER", 4, 154}, + #endif + #ifdef RSA_R_UNSUPPORTED_SIGNATURE_TYPE + {"UNSUPPORTED_SIGNATURE_TYPE", ERR_LIB_RSA, RSA_R_UNSUPPORTED_SIGNATURE_TYPE}, + #else + {"UNSUPPORTED_SIGNATURE_TYPE", 4, 155}, + #endif + #ifdef RSA_R_VALUE_MISSING + {"VALUE_MISSING", ERR_LIB_RSA, RSA_R_VALUE_MISSING}, + #else + {"VALUE_MISSING", 4, 147}, + #endif + #ifdef RSA_R_WRONG_SIGNATURE_LENGTH + {"WRONG_SIGNATURE_LENGTH", ERR_LIB_RSA, RSA_R_WRONG_SIGNATURE_LENGTH}, + #else + {"WRONG_SIGNATURE_LENGTH", 4, 119}, + #endif + #ifdef SM2_R_ASN1_ERROR + {"ASN1_ERROR", ERR_LIB_SM2, SM2_R_ASN1_ERROR}, + #else + {"ASN1_ERROR", 53, 100}, + #endif + #ifdef SM2_R_BAD_SIGNATURE + {"BAD_SIGNATURE", ERR_LIB_SM2, SM2_R_BAD_SIGNATURE}, + #else + {"BAD_SIGNATURE", 53, 101}, + #endif + #ifdef SM2_R_BUFFER_TOO_SMALL + {"BUFFER_TOO_SMALL", ERR_LIB_SM2, SM2_R_BUFFER_TOO_SMALL}, + #else + {"BUFFER_TOO_SMALL", 53, 107}, + #endif + #ifdef SM2_R_DIST_ID_TOO_LARGE + {"DIST_ID_TOO_LARGE", ERR_LIB_SM2, SM2_R_DIST_ID_TOO_LARGE}, + #else + {"DIST_ID_TOO_LARGE", 53, 110}, + #endif + #ifdef SM2_R_ID_NOT_SET + {"ID_NOT_SET", ERR_LIB_SM2, SM2_R_ID_NOT_SET}, + #else + {"ID_NOT_SET", 53, 112}, + #endif + #ifdef SM2_R_ID_TOO_LARGE + {"ID_TOO_LARGE", ERR_LIB_SM2, SM2_R_ID_TOO_LARGE}, + #else + {"ID_TOO_LARGE", 53, 111}, + #endif + #ifdef SM2_R_INVALID_CURVE + {"INVALID_CURVE", ERR_LIB_SM2, SM2_R_INVALID_CURVE}, + #else + {"INVALID_CURVE", 53, 108}, + #endif + #ifdef SM2_R_INVALID_DIGEST + {"INVALID_DIGEST", ERR_LIB_SM2, SM2_R_INVALID_DIGEST}, + #else + {"INVALID_DIGEST", 53, 102}, + #endif + #ifdef SM2_R_INVALID_DIGEST_TYPE + {"INVALID_DIGEST_TYPE", ERR_LIB_SM2, SM2_R_INVALID_DIGEST_TYPE}, + #else + {"INVALID_DIGEST_TYPE", 53, 103}, + #endif + #ifdef SM2_R_INVALID_ENCODING + {"INVALID_ENCODING", ERR_LIB_SM2, SM2_R_INVALID_ENCODING}, + #else + {"INVALID_ENCODING", 53, 104}, + #endif + #ifdef SM2_R_INVALID_FIELD + {"INVALID_FIELD", ERR_LIB_SM2, SM2_R_INVALID_FIELD}, + #else + {"INVALID_FIELD", 53, 105}, + #endif + #ifdef SM2_R_INVALID_PRIVATE_KEY + {"INVALID_PRIVATE_KEY", ERR_LIB_SM2, SM2_R_INVALID_PRIVATE_KEY}, + #else + {"INVALID_PRIVATE_KEY", 53, 113}, + #endif + #ifdef SM2_R_NO_PARAMETERS_SET + {"NO_PARAMETERS_SET", ERR_LIB_SM2, SM2_R_NO_PARAMETERS_SET}, + #else + {"NO_PARAMETERS_SET", 53, 109}, + #endif + #ifdef SM2_R_USER_ID_TOO_LARGE + {"USER_ID_TOO_LARGE", ERR_LIB_SM2, SM2_R_USER_ID_TOO_LARGE}, + #else + {"USER_ID_TOO_LARGE", 53, 106}, + #endif + #ifdef SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY + {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", ERR_LIB_SSL, SSL_R_APPLICATION_DATA_AFTER_CLOSE_NOTIFY}, + #else + {"APPLICATION_DATA_AFTER_CLOSE_NOTIFY", 20, 291}, + #endif + #ifdef SSL_R_APP_DATA_IN_HANDSHAKE + {"APP_DATA_IN_HANDSHAKE", ERR_LIB_SSL, SSL_R_APP_DATA_IN_HANDSHAKE}, + #else + {"APP_DATA_IN_HANDSHAKE", 20, 100}, + #endif + #ifdef SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT + {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", ERR_LIB_SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT}, + #else + {"ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT", 20, 272}, + #endif + #ifdef SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE + {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE}, + #else + {"AT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODE", 20, 143}, + #endif + #ifdef SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE + {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", ERR_LIB_SSL, SSL_R_AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE}, + #else + {"AT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODE", 20, 158}, + #endif + #ifdef SSL_R_BAD_CHANGE_CIPHER_SPEC + {"BAD_CHANGE_CIPHER_SPEC", ERR_LIB_SSL, SSL_R_BAD_CHANGE_CIPHER_SPEC}, + #else + {"BAD_CHANGE_CIPHER_SPEC", 20, 103}, + #endif + #ifdef SSL_R_BAD_CIPHER + {"BAD_CIPHER", ERR_LIB_SSL, SSL_R_BAD_CIPHER}, + #else + {"BAD_CIPHER", 20, 186}, + #endif + #ifdef SSL_R_BAD_DATA + {"BAD_DATA", ERR_LIB_SSL, SSL_R_BAD_DATA}, + #else + {"BAD_DATA", 20, 390}, + #endif + #ifdef SSL_R_BAD_DATA_RETURNED_BY_CALLBACK + {"BAD_DATA_RETURNED_BY_CALLBACK", ERR_LIB_SSL, SSL_R_BAD_DATA_RETURNED_BY_CALLBACK}, + #else + {"BAD_DATA_RETURNED_BY_CALLBACK", 20, 106}, + #endif + #ifdef SSL_R_BAD_DECOMPRESSION + {"BAD_DECOMPRESSION", ERR_LIB_SSL, SSL_R_BAD_DECOMPRESSION}, + #else + {"BAD_DECOMPRESSION", 20, 107}, + #endif + #ifdef SSL_R_BAD_DH_VALUE + {"BAD_DH_VALUE", ERR_LIB_SSL, SSL_R_BAD_DH_VALUE}, + #else + {"BAD_DH_VALUE", 20, 102}, + #endif + #ifdef SSL_R_BAD_DIGEST_LENGTH + {"BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_BAD_DIGEST_LENGTH}, + #else + {"BAD_DIGEST_LENGTH", 20, 111}, + #endif + #ifdef SSL_R_BAD_EARLY_DATA + {"BAD_EARLY_DATA", ERR_LIB_SSL, SSL_R_BAD_EARLY_DATA}, + #else + {"BAD_EARLY_DATA", 20, 233}, + #endif + #ifdef SSL_R_BAD_ECC_CERT + {"BAD_ECC_CERT", ERR_LIB_SSL, SSL_R_BAD_ECC_CERT}, + #else + {"BAD_ECC_CERT", 20, 304}, + #endif + #ifdef SSL_R_BAD_ECPOINT + {"BAD_ECPOINT", ERR_LIB_SSL, SSL_R_BAD_ECPOINT}, + #else + {"BAD_ECPOINT", 20, 306}, + #endif + #ifdef SSL_R_BAD_EXTENSION + {"BAD_EXTENSION", ERR_LIB_SSL, SSL_R_BAD_EXTENSION}, + #else + {"BAD_EXTENSION", 20, 110}, + #endif + #ifdef SSL_R_BAD_HANDSHAKE_LENGTH + {"BAD_HANDSHAKE_LENGTH", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_LENGTH}, + #else + {"BAD_HANDSHAKE_LENGTH", 20, 332}, + #endif + #ifdef SSL_R_BAD_HANDSHAKE_STATE + {"BAD_HANDSHAKE_STATE", ERR_LIB_SSL, SSL_R_BAD_HANDSHAKE_STATE}, + #else + {"BAD_HANDSHAKE_STATE", 20, 236}, + #endif + #ifdef SSL_R_BAD_HELLO_REQUEST + {"BAD_HELLO_REQUEST", ERR_LIB_SSL, SSL_R_BAD_HELLO_REQUEST}, + #else + {"BAD_HELLO_REQUEST", 20, 105}, + #endif + #ifdef SSL_R_BAD_HRR_VERSION + {"BAD_HRR_VERSION", ERR_LIB_SSL, SSL_R_BAD_HRR_VERSION}, + #else + {"BAD_HRR_VERSION", 20, 263}, + #endif + #ifdef SSL_R_BAD_KEY_SHARE + {"BAD_KEY_SHARE", ERR_LIB_SSL, SSL_R_BAD_KEY_SHARE}, + #else + {"BAD_KEY_SHARE", 20, 108}, + #endif + #ifdef SSL_R_BAD_KEY_UPDATE + {"BAD_KEY_UPDATE", ERR_LIB_SSL, SSL_R_BAD_KEY_UPDATE}, + #else + {"BAD_KEY_UPDATE", 20, 122}, + #endif + #ifdef SSL_R_BAD_LEGACY_VERSION + {"BAD_LEGACY_VERSION", ERR_LIB_SSL, SSL_R_BAD_LEGACY_VERSION}, + #else + {"BAD_LEGACY_VERSION", 20, 292}, + #endif + #ifdef SSL_R_BAD_LENGTH + {"BAD_LENGTH", ERR_LIB_SSL, SSL_R_BAD_LENGTH}, + #else + {"BAD_LENGTH", 20, 271}, + #endif + #ifdef SSL_R_BAD_PACKET + {"BAD_PACKET", ERR_LIB_SSL, SSL_R_BAD_PACKET}, + #else + {"BAD_PACKET", 20, 240}, + #endif + #ifdef SSL_R_BAD_PACKET_LENGTH + {"BAD_PACKET_LENGTH", ERR_LIB_SSL, SSL_R_BAD_PACKET_LENGTH}, + #else + {"BAD_PACKET_LENGTH", 20, 115}, + #endif + #ifdef SSL_R_BAD_PROTOCOL_VERSION_NUMBER + {"BAD_PROTOCOL_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_BAD_PROTOCOL_VERSION_NUMBER}, + #else + {"BAD_PROTOCOL_VERSION_NUMBER", 20, 116}, + #endif + #ifdef SSL_R_BAD_PSK + {"BAD_PSK", ERR_LIB_SSL, SSL_R_BAD_PSK}, + #else + {"BAD_PSK", 20, 219}, + #endif + #ifdef SSL_R_BAD_PSK_IDENTITY + {"BAD_PSK_IDENTITY", ERR_LIB_SSL, SSL_R_BAD_PSK_IDENTITY}, + #else + {"BAD_PSK_IDENTITY", 20, 114}, + #endif + #ifdef SSL_R_BAD_RECORD_TYPE + {"BAD_RECORD_TYPE", ERR_LIB_SSL, SSL_R_BAD_RECORD_TYPE}, + #else + {"BAD_RECORD_TYPE", 20, 443}, + #endif + #ifdef SSL_R_BAD_RSA_ENCRYPT + {"BAD_RSA_ENCRYPT", ERR_LIB_SSL, SSL_R_BAD_RSA_ENCRYPT}, + #else + {"BAD_RSA_ENCRYPT", 20, 119}, + #endif + #ifdef SSL_R_BAD_SIGNATURE + {"BAD_SIGNATURE", ERR_LIB_SSL, SSL_R_BAD_SIGNATURE}, + #else + {"BAD_SIGNATURE", 20, 123}, + #endif + #ifdef SSL_R_BAD_SRP_A_LENGTH + {"BAD_SRP_A_LENGTH", ERR_LIB_SSL, SSL_R_BAD_SRP_A_LENGTH}, + #else + {"BAD_SRP_A_LENGTH", 20, 347}, + #endif + #ifdef SSL_R_BAD_SRP_PARAMETERS + {"BAD_SRP_PARAMETERS", ERR_LIB_SSL, SSL_R_BAD_SRP_PARAMETERS}, + #else + {"BAD_SRP_PARAMETERS", 20, 371}, + #endif + #ifdef SSL_R_BAD_SRTP_MKI_VALUE + {"BAD_SRTP_MKI_VALUE", ERR_LIB_SSL, SSL_R_BAD_SRTP_MKI_VALUE}, + #else + {"BAD_SRTP_MKI_VALUE", 20, 352}, + #endif + #ifdef SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST + {"BAD_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST}, + #else + {"BAD_SRTP_PROTECTION_PROFILE_LIST", 20, 353}, + #endif + #ifdef SSL_R_BAD_SSL_FILETYPE + {"BAD_SSL_FILETYPE", ERR_LIB_SSL, SSL_R_BAD_SSL_FILETYPE}, + #else + {"BAD_SSL_FILETYPE", 20, 124}, + #endif + #ifdef SSL_R_BAD_VALUE + {"BAD_VALUE", ERR_LIB_SSL, SSL_R_BAD_VALUE}, + #else + {"BAD_VALUE", 20, 384}, + #endif + #ifdef SSL_R_BAD_WRITE_RETRY + {"BAD_WRITE_RETRY", ERR_LIB_SSL, SSL_R_BAD_WRITE_RETRY}, + #else + {"BAD_WRITE_RETRY", 20, 127}, + #endif + #ifdef SSL_R_BINDER_DOES_NOT_VERIFY + {"BINDER_DOES_NOT_VERIFY", ERR_LIB_SSL, SSL_R_BINDER_DOES_NOT_VERIFY}, + #else + {"BINDER_DOES_NOT_VERIFY", 20, 253}, + #endif + #ifdef SSL_R_BIO_NOT_SET + {"BIO_NOT_SET", ERR_LIB_SSL, SSL_R_BIO_NOT_SET}, + #else + {"BIO_NOT_SET", 20, 128}, + #endif + #ifdef SSL_R_BLOCK_CIPHER_PAD_IS_WRONG + {"BLOCK_CIPHER_PAD_IS_WRONG", ERR_LIB_SSL, SSL_R_BLOCK_CIPHER_PAD_IS_WRONG}, + #else + {"BLOCK_CIPHER_PAD_IS_WRONG", 20, 129}, + #endif + #ifdef SSL_R_BN_LIB + {"BN_LIB", ERR_LIB_SSL, SSL_R_BN_LIB}, + #else + {"BN_LIB", 20, 130}, + #endif + #ifdef SSL_R_CALLBACK_FAILED + {"CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_CALLBACK_FAILED}, + #else + {"CALLBACK_FAILED", 20, 234}, + #endif + #ifdef SSL_R_CANNOT_CHANGE_CIPHER + {"CANNOT_CHANGE_CIPHER", ERR_LIB_SSL, SSL_R_CANNOT_CHANGE_CIPHER}, + #else + {"CANNOT_CHANGE_CIPHER", 20, 109}, + #endif + #ifdef SSL_R_CANNOT_GET_GROUP_NAME + {"CANNOT_GET_GROUP_NAME", ERR_LIB_SSL, SSL_R_CANNOT_GET_GROUP_NAME}, + #else + {"CANNOT_GET_GROUP_NAME", 20, 299}, + #endif + #ifdef SSL_R_CA_DN_LENGTH_MISMATCH + {"CA_DN_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CA_DN_LENGTH_MISMATCH}, + #else + {"CA_DN_LENGTH_MISMATCH", 20, 131}, + #endif + #ifdef SSL_R_CA_KEY_TOO_SMALL + {"CA_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_CA_KEY_TOO_SMALL}, + #else + {"CA_KEY_TOO_SMALL", 20, 397}, + #endif + #ifdef SSL_R_CA_MD_TOO_WEAK + {"CA_MD_TOO_WEAK", ERR_LIB_SSL, SSL_R_CA_MD_TOO_WEAK}, + #else + {"CA_MD_TOO_WEAK", 20, 398}, + #endif + #ifdef SSL_R_CCS_RECEIVED_EARLY + {"CCS_RECEIVED_EARLY", ERR_LIB_SSL, SSL_R_CCS_RECEIVED_EARLY}, + #else + {"CCS_RECEIVED_EARLY", 20, 133}, + #endif + #ifdef SSL_R_CERTIFICATE_VERIFY_FAILED + {"CERTIFICATE_VERIFY_FAILED", ERR_LIB_SSL, SSL_R_CERTIFICATE_VERIFY_FAILED}, + #else + {"CERTIFICATE_VERIFY_FAILED", 20, 134}, + #endif + #ifdef SSL_R_CERT_CB_ERROR + {"CERT_CB_ERROR", ERR_LIB_SSL, SSL_R_CERT_CB_ERROR}, + #else + {"CERT_CB_ERROR", 20, 377}, + #endif + #ifdef SSL_R_CERT_LENGTH_MISMATCH + {"CERT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_CERT_LENGTH_MISMATCH}, + #else + {"CERT_LENGTH_MISMATCH", 20, 135}, + #endif + #ifdef SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED + {"CIPHERSUITE_DIGEST_HAS_CHANGED", ERR_LIB_SSL, SSL_R_CIPHERSUITE_DIGEST_HAS_CHANGED}, + #else + {"CIPHERSUITE_DIGEST_HAS_CHANGED", 20, 218}, + #endif + #ifdef SSL_R_CIPHER_CODE_WRONG_LENGTH + {"CIPHER_CODE_WRONG_LENGTH", ERR_LIB_SSL, SSL_R_CIPHER_CODE_WRONG_LENGTH}, + #else + {"CIPHER_CODE_WRONG_LENGTH", 20, 137}, + #endif + #ifdef SSL_R_CLIENTHELLO_TLSEXT + {"CLIENTHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_CLIENTHELLO_TLSEXT}, + #else + {"CLIENTHELLO_TLSEXT", 20, 226}, + #endif + #ifdef SSL_R_COMPRESSED_LENGTH_TOO_LONG + {"COMPRESSED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_COMPRESSED_LENGTH_TOO_LONG}, + #else + {"COMPRESSED_LENGTH_TOO_LONG", 20, 140}, + #endif + #ifdef SSL_R_COMPRESSION_DISABLED + {"COMPRESSION_DISABLED", ERR_LIB_SSL, SSL_R_COMPRESSION_DISABLED}, + #else + {"COMPRESSION_DISABLED", 20, 343}, + #endif + #ifdef SSL_R_COMPRESSION_FAILURE + {"COMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_COMPRESSION_FAILURE}, + #else + {"COMPRESSION_FAILURE", 20, 141}, + #endif + #ifdef SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE + {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", ERR_LIB_SSL, SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE}, + #else + {"COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE", 20, 307}, + #endif + #ifdef SSL_R_COMPRESSION_LIBRARY_ERROR + {"COMPRESSION_LIBRARY_ERROR", ERR_LIB_SSL, SSL_R_COMPRESSION_LIBRARY_ERROR}, + #else + {"COMPRESSION_LIBRARY_ERROR", 20, 142}, + #endif + #ifdef SSL_R_CONNECTION_TYPE_NOT_SET + {"CONNECTION_TYPE_NOT_SET", ERR_LIB_SSL, SSL_R_CONNECTION_TYPE_NOT_SET}, + #else + {"CONNECTION_TYPE_NOT_SET", 20, 144}, + #endif + #ifdef SSL_R_CONTEXT_NOT_DANE_ENABLED + {"CONTEXT_NOT_DANE_ENABLED", ERR_LIB_SSL, SSL_R_CONTEXT_NOT_DANE_ENABLED}, + #else + {"CONTEXT_NOT_DANE_ENABLED", 20, 167}, + #endif + #ifdef SSL_R_COOKIE_GEN_CALLBACK_FAILURE + {"COOKIE_GEN_CALLBACK_FAILURE", ERR_LIB_SSL, SSL_R_COOKIE_GEN_CALLBACK_FAILURE}, + #else + {"COOKIE_GEN_CALLBACK_FAILURE", 20, 400}, + #endif + #ifdef SSL_R_COOKIE_MISMATCH + {"COOKIE_MISMATCH", ERR_LIB_SSL, SSL_R_COOKIE_MISMATCH}, + #else + {"COOKIE_MISMATCH", 20, 308}, + #endif + #ifdef SSL_R_COPY_PARAMETERS_FAILED + {"COPY_PARAMETERS_FAILED", ERR_LIB_SSL, SSL_R_COPY_PARAMETERS_FAILED}, + #else + {"COPY_PARAMETERS_FAILED", 20, 296}, + #endif + #ifdef SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED + {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", ERR_LIB_SSL, SSL_R_CUSTOM_EXT_HANDLER_ALREADY_INSTALLED}, + #else + {"CUSTOM_EXT_HANDLER_ALREADY_INSTALLED", 20, 206}, + #endif + #ifdef SSL_R_DANE_ALREADY_ENABLED + {"DANE_ALREADY_ENABLED", ERR_LIB_SSL, SSL_R_DANE_ALREADY_ENABLED}, + #else + {"DANE_ALREADY_ENABLED", 20, 172}, + #endif + #ifdef SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL + {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", ERR_LIB_SSL, SSL_R_DANE_CANNOT_OVERRIDE_MTYPE_FULL}, + #else + {"DANE_CANNOT_OVERRIDE_MTYPE_FULL", 20, 173}, + #endif + #ifdef SSL_R_DANE_NOT_ENABLED + {"DANE_NOT_ENABLED", ERR_LIB_SSL, SSL_R_DANE_NOT_ENABLED}, + #else + {"DANE_NOT_ENABLED", 20, 175}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE + {"DANE_TLSA_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE}, + #else + {"DANE_TLSA_BAD_CERTIFICATE", 20, 180}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE + {"DANE_TLSA_BAD_CERTIFICATE_USAGE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_CERTIFICATE_USAGE}, + #else + {"DANE_TLSA_BAD_CERTIFICATE_USAGE", 20, 184}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_DATA_LENGTH + {"DANE_TLSA_BAD_DATA_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DATA_LENGTH}, + #else + {"DANE_TLSA_BAD_DATA_LENGTH", 20, 189}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH + {"DANE_TLSA_BAD_DIGEST_LENGTH", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_DIGEST_LENGTH}, + #else + {"DANE_TLSA_BAD_DIGEST_LENGTH", 20, 192}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_MATCHING_TYPE + {"DANE_TLSA_BAD_MATCHING_TYPE", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_MATCHING_TYPE}, + #else + {"DANE_TLSA_BAD_MATCHING_TYPE", 20, 200}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_PUBLIC_KEY + {"DANE_TLSA_BAD_PUBLIC_KEY", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_PUBLIC_KEY}, + #else + {"DANE_TLSA_BAD_PUBLIC_KEY", 20, 201}, + #endif + #ifdef SSL_R_DANE_TLSA_BAD_SELECTOR + {"DANE_TLSA_BAD_SELECTOR", ERR_LIB_SSL, SSL_R_DANE_TLSA_BAD_SELECTOR}, + #else + {"DANE_TLSA_BAD_SELECTOR", 20, 202}, + #endif + #ifdef SSL_R_DANE_TLSA_NULL_DATA + {"DANE_TLSA_NULL_DATA", ERR_LIB_SSL, SSL_R_DANE_TLSA_NULL_DATA}, + #else + {"DANE_TLSA_NULL_DATA", 20, 203}, + #endif + #ifdef SSL_R_DATA_BETWEEN_CCS_AND_FINISHED + {"DATA_BETWEEN_CCS_AND_FINISHED", ERR_LIB_SSL, SSL_R_DATA_BETWEEN_CCS_AND_FINISHED}, + #else + {"DATA_BETWEEN_CCS_AND_FINISHED", 20, 145}, + #endif + #ifdef SSL_R_DATA_LENGTH_TOO_LONG + {"DATA_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_DATA_LENGTH_TOO_LONG}, + #else + {"DATA_LENGTH_TOO_LONG", 20, 146}, + #endif + #ifdef SSL_R_DECRYPTION_FAILED + {"DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED}, + #else + {"DECRYPTION_FAILED", 20, 147}, + #endif + #ifdef SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC + {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC}, + #else + {"DECRYPTION_FAILED_OR_BAD_RECORD_MAC", 20, 281}, + #endif + #ifdef SSL_R_DH_KEY_TOO_SMALL + {"DH_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_DH_KEY_TOO_SMALL}, + #else + {"DH_KEY_TOO_SMALL", 20, 394}, + #endif + #ifdef SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG + {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", ERR_LIB_SSL, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG}, + #else + {"DH_PUBLIC_VALUE_LENGTH_IS_WRONG", 20, 148}, + #endif + #ifdef SSL_R_DIGEST_CHECK_FAILED + {"DIGEST_CHECK_FAILED", ERR_LIB_SSL, SSL_R_DIGEST_CHECK_FAILED}, + #else + {"DIGEST_CHECK_FAILED", 20, 149}, + #endif + #ifdef SSL_R_DTLS_MESSAGE_TOO_BIG + {"DTLS_MESSAGE_TOO_BIG", ERR_LIB_SSL, SSL_R_DTLS_MESSAGE_TOO_BIG}, + #else + {"DTLS_MESSAGE_TOO_BIG", 20, 334}, + #endif + #ifdef SSL_R_DUPLICATE_COMPRESSION_ID + {"DUPLICATE_COMPRESSION_ID", ERR_LIB_SSL, SSL_R_DUPLICATE_COMPRESSION_ID}, + #else + {"DUPLICATE_COMPRESSION_ID", 20, 309}, + #endif + #ifdef SSL_R_ECC_CERT_NOT_FOR_SIGNING + {"ECC_CERT_NOT_FOR_SIGNING", ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING}, + #else + {"ECC_CERT_NOT_FOR_SIGNING", 20, 318}, + #endif + #ifdef SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE + {"ECDH_REQUIRED_FOR_SUITEB_MODE", ERR_LIB_SSL, SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE}, + #else + {"ECDH_REQUIRED_FOR_SUITEB_MODE", 20, 374}, + #endif + #ifdef SSL_R_EE_KEY_TOO_SMALL + {"EE_KEY_TOO_SMALL", ERR_LIB_SSL, SSL_R_EE_KEY_TOO_SMALL}, + #else + {"EE_KEY_TOO_SMALL", 20, 399}, + #endif + #ifdef SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST + {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", ERR_LIB_SSL, SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST}, + #else + {"EMPTY_SRTP_PROTECTION_PROFILE_LIST", 20, 354}, + #endif + #ifdef SSL_R_ENCRYPTED_LENGTH_TOO_LONG + {"ENCRYPTED_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_ENCRYPTED_LENGTH_TOO_LONG}, + #else + {"ENCRYPTED_LENGTH_TOO_LONG", 20, 150}, + #endif + #ifdef SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST + {"ERROR_IN_RECEIVED_CIPHER_LIST", ERR_LIB_SSL, SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST}, + #else + {"ERROR_IN_RECEIVED_CIPHER_LIST", 20, 151}, + #endif + #ifdef SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN + {"ERROR_SETTING_TLSA_BASE_DOMAIN", ERR_LIB_SSL, SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN}, + #else + {"ERROR_SETTING_TLSA_BASE_DOMAIN", 20, 204}, + #endif + #ifdef SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE + {"EXCEEDS_MAX_FRAGMENT_SIZE", ERR_LIB_SSL, SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE}, + #else + {"EXCEEDS_MAX_FRAGMENT_SIZE", 20, 194}, + #endif + #ifdef SSL_R_EXCESSIVE_MESSAGE_SIZE + {"EXCESSIVE_MESSAGE_SIZE", ERR_LIB_SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE}, + #else + {"EXCESSIVE_MESSAGE_SIZE", 20, 152}, + #endif + #ifdef SSL_R_EXTENSION_NOT_RECEIVED + {"EXTENSION_NOT_RECEIVED", ERR_LIB_SSL, SSL_R_EXTENSION_NOT_RECEIVED}, + #else + {"EXTENSION_NOT_RECEIVED", 20, 279}, + #endif + #ifdef SSL_R_EXTRA_DATA_IN_MESSAGE + {"EXTRA_DATA_IN_MESSAGE", ERR_LIB_SSL, SSL_R_EXTRA_DATA_IN_MESSAGE}, + #else + {"EXTRA_DATA_IN_MESSAGE", 20, 153}, + #endif + #ifdef SSL_R_EXT_LENGTH_MISMATCH + {"EXT_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_EXT_LENGTH_MISMATCH}, + #else + {"EXT_LENGTH_MISMATCH", 20, 163}, + #endif + #ifdef SSL_R_FAILED_TO_INIT_ASYNC + {"FAILED_TO_INIT_ASYNC", ERR_LIB_SSL, SSL_R_FAILED_TO_INIT_ASYNC}, + #else + {"FAILED_TO_INIT_ASYNC", 20, 405}, + #endif + #ifdef SSL_R_FRAGMENTED_CLIENT_HELLO + {"FRAGMENTED_CLIENT_HELLO", ERR_LIB_SSL, SSL_R_FRAGMENTED_CLIENT_HELLO}, + #else + {"FRAGMENTED_CLIENT_HELLO", 20, 401}, + #endif + #ifdef SSL_R_GOT_A_FIN_BEFORE_A_CCS + {"GOT_A_FIN_BEFORE_A_CCS", ERR_LIB_SSL, SSL_R_GOT_A_FIN_BEFORE_A_CCS}, + #else + {"GOT_A_FIN_BEFORE_A_CCS", 20, 154}, + #endif + #ifdef SSL_R_HTTPS_PROXY_REQUEST + {"HTTPS_PROXY_REQUEST", ERR_LIB_SSL, SSL_R_HTTPS_PROXY_REQUEST}, + #else + {"HTTPS_PROXY_REQUEST", 20, 155}, + #endif + #ifdef SSL_R_HTTP_REQUEST + {"HTTP_REQUEST", ERR_LIB_SSL, SSL_R_HTTP_REQUEST}, + #else + {"HTTP_REQUEST", 20, 156}, + #endif + #ifdef SSL_R_ILLEGAL_POINT_COMPRESSION + {"ILLEGAL_POINT_COMPRESSION", ERR_LIB_SSL, SSL_R_ILLEGAL_POINT_COMPRESSION}, + #else + {"ILLEGAL_POINT_COMPRESSION", 20, 162}, + #endif + #ifdef SSL_R_ILLEGAL_SUITEB_DIGEST + {"ILLEGAL_SUITEB_DIGEST", ERR_LIB_SSL, SSL_R_ILLEGAL_SUITEB_DIGEST}, + #else + {"ILLEGAL_SUITEB_DIGEST", 20, 380}, + #endif + #ifdef SSL_R_INAPPROPRIATE_FALLBACK + {"INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_INAPPROPRIATE_FALLBACK}, + #else + {"INAPPROPRIATE_FALLBACK", 20, 373}, + #endif + #ifdef SSL_R_INCONSISTENT_COMPRESSION + {"INCONSISTENT_COMPRESSION", ERR_LIB_SSL, SSL_R_INCONSISTENT_COMPRESSION}, + #else + {"INCONSISTENT_COMPRESSION", 20, 340}, + #endif + #ifdef SSL_R_INCONSISTENT_EARLY_DATA_ALPN + {"INCONSISTENT_EARLY_DATA_ALPN", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_ALPN}, + #else + {"INCONSISTENT_EARLY_DATA_ALPN", 20, 222}, + #endif + #ifdef SSL_R_INCONSISTENT_EARLY_DATA_SNI + {"INCONSISTENT_EARLY_DATA_SNI", ERR_LIB_SSL, SSL_R_INCONSISTENT_EARLY_DATA_SNI}, + #else + {"INCONSISTENT_EARLY_DATA_SNI", 20, 231}, + #endif + #ifdef SSL_R_INCONSISTENT_EXTMS + {"INCONSISTENT_EXTMS", ERR_LIB_SSL, SSL_R_INCONSISTENT_EXTMS}, + #else + {"INCONSISTENT_EXTMS", 20, 104}, + #endif + #ifdef SSL_R_INSUFFICIENT_SECURITY + {"INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_INSUFFICIENT_SECURITY}, + #else + {"INSUFFICIENT_SECURITY", 20, 241}, + #endif + #ifdef SSL_R_INVALID_ALERT + {"INVALID_ALERT", ERR_LIB_SSL, SSL_R_INVALID_ALERT}, + #else + {"INVALID_ALERT", 20, 205}, + #endif + #ifdef SSL_R_INVALID_CCS_MESSAGE + {"INVALID_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_INVALID_CCS_MESSAGE}, + #else + {"INVALID_CCS_MESSAGE", 20, 260}, + #endif + #ifdef SSL_R_INVALID_CERTIFICATE_OR_ALG + {"INVALID_CERTIFICATE_OR_ALG", ERR_LIB_SSL, SSL_R_INVALID_CERTIFICATE_OR_ALG}, + #else + {"INVALID_CERTIFICATE_OR_ALG", 20, 238}, + #endif + #ifdef SSL_R_INVALID_COMMAND + {"INVALID_COMMAND", ERR_LIB_SSL, SSL_R_INVALID_COMMAND}, + #else + {"INVALID_COMMAND", 20, 280}, + #endif + #ifdef SSL_R_INVALID_COMPRESSION_ALGORITHM + {"INVALID_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_INVALID_COMPRESSION_ALGORITHM}, + #else + {"INVALID_COMPRESSION_ALGORITHM", 20, 341}, + #endif + #ifdef SSL_R_INVALID_CONFIG + {"INVALID_CONFIG", ERR_LIB_SSL, SSL_R_INVALID_CONFIG}, + #else + {"INVALID_CONFIG", 20, 283}, + #endif + #ifdef SSL_R_INVALID_CONFIGURATION_NAME + {"INVALID_CONFIGURATION_NAME", ERR_LIB_SSL, SSL_R_INVALID_CONFIGURATION_NAME}, + #else + {"INVALID_CONFIGURATION_NAME", 20, 113}, + #endif + #ifdef SSL_R_INVALID_CONTEXT + {"INVALID_CONTEXT", ERR_LIB_SSL, SSL_R_INVALID_CONTEXT}, + #else + {"INVALID_CONTEXT", 20, 282}, + #endif + #ifdef SSL_R_INVALID_CT_VALIDATION_TYPE + {"INVALID_CT_VALIDATION_TYPE", ERR_LIB_SSL, SSL_R_INVALID_CT_VALIDATION_TYPE}, + #else + {"INVALID_CT_VALIDATION_TYPE", 20, 212}, + #endif + #ifdef SSL_R_INVALID_KEY_UPDATE_TYPE + {"INVALID_KEY_UPDATE_TYPE", ERR_LIB_SSL, SSL_R_INVALID_KEY_UPDATE_TYPE}, + #else + {"INVALID_KEY_UPDATE_TYPE", 20, 120}, + #endif + #ifdef SSL_R_INVALID_MAX_EARLY_DATA + {"INVALID_MAX_EARLY_DATA", ERR_LIB_SSL, SSL_R_INVALID_MAX_EARLY_DATA}, + #else + {"INVALID_MAX_EARLY_DATA", 20, 174}, + #endif + #ifdef SSL_R_INVALID_NULL_CMD_NAME + {"INVALID_NULL_CMD_NAME", ERR_LIB_SSL, SSL_R_INVALID_NULL_CMD_NAME}, + #else + {"INVALID_NULL_CMD_NAME", 20, 385}, + #endif + #ifdef SSL_R_INVALID_SEQUENCE_NUMBER + {"INVALID_SEQUENCE_NUMBER", ERR_LIB_SSL, SSL_R_INVALID_SEQUENCE_NUMBER}, + #else + {"INVALID_SEQUENCE_NUMBER", 20, 402}, + #endif + #ifdef SSL_R_INVALID_SERVERINFO_DATA + {"INVALID_SERVERINFO_DATA", ERR_LIB_SSL, SSL_R_INVALID_SERVERINFO_DATA}, + #else + {"INVALID_SERVERINFO_DATA", 20, 388}, + #endif + #ifdef SSL_R_INVALID_SESSION_ID + {"INVALID_SESSION_ID", ERR_LIB_SSL, SSL_R_INVALID_SESSION_ID}, + #else + {"INVALID_SESSION_ID", 20, 999}, + #endif + #ifdef SSL_R_INVALID_SRP_USERNAME + {"INVALID_SRP_USERNAME", ERR_LIB_SSL, SSL_R_INVALID_SRP_USERNAME}, + #else + {"INVALID_SRP_USERNAME", 20, 357}, + #endif + #ifdef SSL_R_INVALID_STATUS_RESPONSE + {"INVALID_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_INVALID_STATUS_RESPONSE}, + #else + {"INVALID_STATUS_RESPONSE", 20, 328}, + #endif + #ifdef SSL_R_INVALID_TICKET_KEYS_LENGTH + {"INVALID_TICKET_KEYS_LENGTH", ERR_LIB_SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH}, + #else + {"INVALID_TICKET_KEYS_LENGTH", 20, 325}, + #endif + #ifdef SSL_R_LENGTH_MISMATCH + {"LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_LENGTH_MISMATCH}, + #else + {"LENGTH_MISMATCH", 20, 159}, + #endif + #ifdef SSL_R_LENGTH_TOO_LONG + {"LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_LENGTH_TOO_LONG}, + #else + {"LENGTH_TOO_LONG", 20, 404}, + #endif + #ifdef SSL_R_LENGTH_TOO_SHORT + {"LENGTH_TOO_SHORT", ERR_LIB_SSL, SSL_R_LENGTH_TOO_SHORT}, + #else + {"LENGTH_TOO_SHORT", 20, 160}, + #endif + #ifdef SSL_R_LIBRARY_BUG + {"LIBRARY_BUG", ERR_LIB_SSL, SSL_R_LIBRARY_BUG}, + #else + {"LIBRARY_BUG", 20, 274}, + #endif + #ifdef SSL_R_LIBRARY_HAS_NO_CIPHERS + {"LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_LIBRARY_HAS_NO_CIPHERS}, + #else + {"LIBRARY_HAS_NO_CIPHERS", 20, 161}, + #endif + #ifdef SSL_R_MISSING_DSA_SIGNING_CERT + {"MISSING_DSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_DSA_SIGNING_CERT}, + #else + {"MISSING_DSA_SIGNING_CERT", 20, 165}, + #endif + #ifdef SSL_R_MISSING_ECDSA_SIGNING_CERT + {"MISSING_ECDSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_ECDSA_SIGNING_CERT}, + #else + {"MISSING_ECDSA_SIGNING_CERT", 20, 381}, + #endif + #ifdef SSL_R_MISSING_FATAL + {"MISSING_FATAL", ERR_LIB_SSL, SSL_R_MISSING_FATAL}, + #else + {"MISSING_FATAL", 20, 256}, + #endif + #ifdef SSL_R_MISSING_PARAMETERS + {"MISSING_PARAMETERS", ERR_LIB_SSL, SSL_R_MISSING_PARAMETERS}, + #else + {"MISSING_PARAMETERS", 20, 290}, + #endif + #ifdef SSL_R_MISSING_RSA_CERTIFICATE + {"MISSING_RSA_CERTIFICATE", ERR_LIB_SSL, SSL_R_MISSING_RSA_CERTIFICATE}, + #else + {"MISSING_RSA_CERTIFICATE", 20, 168}, + #endif + #ifdef SSL_R_MISSING_RSA_ENCRYPTING_CERT + {"MISSING_RSA_ENCRYPTING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_ENCRYPTING_CERT}, + #else + {"MISSING_RSA_ENCRYPTING_CERT", 20, 169}, + #endif + #ifdef SSL_R_MISSING_RSA_SIGNING_CERT + {"MISSING_RSA_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_RSA_SIGNING_CERT}, + #else + {"MISSING_RSA_SIGNING_CERT", 20, 170}, + #endif + #ifdef SSL_R_MISSING_SIGALGS_EXTENSION + {"MISSING_SIGALGS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SIGALGS_EXTENSION}, + #else + {"MISSING_SIGALGS_EXTENSION", 20, 112}, + #endif + #ifdef SSL_R_MISSING_SIGNING_CERT + {"MISSING_SIGNING_CERT", ERR_LIB_SSL, SSL_R_MISSING_SIGNING_CERT}, + #else + {"MISSING_SIGNING_CERT", 20, 221}, + #endif + #ifdef SSL_R_MISSING_SRP_PARAM + {"MISSING_SRP_PARAM", ERR_LIB_SSL, SSL_R_MISSING_SRP_PARAM}, + #else + {"MISSING_SRP_PARAM", 20, 358}, + #endif + #ifdef SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION + {"MISSING_SUPPORTED_GROUPS_EXTENSION", ERR_LIB_SSL, SSL_R_MISSING_SUPPORTED_GROUPS_EXTENSION}, + #else + {"MISSING_SUPPORTED_GROUPS_EXTENSION", 20, 209}, + #endif + #ifdef SSL_R_MISSING_TMP_DH_KEY + {"MISSING_TMP_DH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_DH_KEY}, + #else + {"MISSING_TMP_DH_KEY", 20, 171}, + #endif + #ifdef SSL_R_MISSING_TMP_ECDH_KEY + {"MISSING_TMP_ECDH_KEY", ERR_LIB_SSL, SSL_R_MISSING_TMP_ECDH_KEY}, + #else + {"MISSING_TMP_ECDH_KEY", 20, 311}, + #endif + #ifdef SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA + {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", ERR_LIB_SSL, SSL_R_MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA}, + #else + {"MIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATA", 20, 293}, + #endif + #ifdef SSL_R_NOT_ON_RECORD_BOUNDARY + {"NOT_ON_RECORD_BOUNDARY", ERR_LIB_SSL, SSL_R_NOT_ON_RECORD_BOUNDARY}, + #else + {"NOT_ON_RECORD_BOUNDARY", 20, 182}, + #endif + #ifdef SSL_R_NOT_REPLACING_CERTIFICATE + {"NOT_REPLACING_CERTIFICATE", ERR_LIB_SSL, SSL_R_NOT_REPLACING_CERTIFICATE}, + #else + {"NOT_REPLACING_CERTIFICATE", 20, 289}, + #endif + #ifdef SSL_R_NOT_SERVER + {"NOT_SERVER", ERR_LIB_SSL, SSL_R_NOT_SERVER}, + #else + {"NOT_SERVER", 20, 284}, + #endif + #ifdef SSL_R_NO_APPLICATION_PROTOCOL + {"NO_APPLICATION_PROTOCOL", ERR_LIB_SSL, SSL_R_NO_APPLICATION_PROTOCOL}, + #else + {"NO_APPLICATION_PROTOCOL", 20, 235}, + #endif + #ifdef SSL_R_NO_CERTIFICATES_RETURNED + {"NO_CERTIFICATES_RETURNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATES_RETURNED}, + #else + {"NO_CERTIFICATES_RETURNED", 20, 176}, + #endif + #ifdef SSL_R_NO_CERTIFICATE_ASSIGNED + {"NO_CERTIFICATE_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_ASSIGNED}, + #else + {"NO_CERTIFICATE_ASSIGNED", 20, 177}, + #endif + #ifdef SSL_R_NO_CERTIFICATE_SET + {"NO_CERTIFICATE_SET", ERR_LIB_SSL, SSL_R_NO_CERTIFICATE_SET}, + #else + {"NO_CERTIFICATE_SET", 20, 179}, + #endif + #ifdef SSL_R_NO_CHANGE_FOLLOWING_HRR + {"NO_CHANGE_FOLLOWING_HRR", ERR_LIB_SSL, SSL_R_NO_CHANGE_FOLLOWING_HRR}, + #else + {"NO_CHANGE_FOLLOWING_HRR", 20, 214}, + #endif + #ifdef SSL_R_NO_CIPHERS_AVAILABLE + {"NO_CIPHERS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_CIPHERS_AVAILABLE}, + #else + {"NO_CIPHERS_AVAILABLE", 20, 181}, + #endif + #ifdef SSL_R_NO_CIPHERS_SPECIFIED + {"NO_CIPHERS_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_CIPHERS_SPECIFIED}, + #else + {"NO_CIPHERS_SPECIFIED", 20, 183}, + #endif + #ifdef SSL_R_NO_CIPHER_MATCH + {"NO_CIPHER_MATCH", ERR_LIB_SSL, SSL_R_NO_CIPHER_MATCH}, + #else + {"NO_CIPHER_MATCH", 20, 185}, + #endif + #ifdef SSL_R_NO_CLIENT_CERT_METHOD + {"NO_CLIENT_CERT_METHOD", ERR_LIB_SSL, SSL_R_NO_CLIENT_CERT_METHOD}, + #else + {"NO_CLIENT_CERT_METHOD", 20, 331}, + #endif + #ifdef SSL_R_NO_COMPRESSION_SPECIFIED + {"NO_COMPRESSION_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_COMPRESSION_SPECIFIED}, + #else + {"NO_COMPRESSION_SPECIFIED", 20, 187}, + #endif + #ifdef SSL_R_NO_COOKIE_CALLBACK_SET + {"NO_COOKIE_CALLBACK_SET", ERR_LIB_SSL, SSL_R_NO_COOKIE_CALLBACK_SET}, + #else + {"NO_COOKIE_CALLBACK_SET", 20, 287}, + #endif + #ifdef SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER + {"NO_GOST_CERTIFICATE_SENT_BY_PEER", ERR_LIB_SSL, SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER}, + #else + {"NO_GOST_CERTIFICATE_SENT_BY_PEER", 20, 330}, + #endif + #ifdef SSL_R_NO_METHOD_SPECIFIED + {"NO_METHOD_SPECIFIED", ERR_LIB_SSL, SSL_R_NO_METHOD_SPECIFIED}, + #else + {"NO_METHOD_SPECIFIED", 20, 188}, + #endif + #ifdef SSL_R_NO_PEM_EXTENSIONS + {"NO_PEM_EXTENSIONS", ERR_LIB_SSL, SSL_R_NO_PEM_EXTENSIONS}, + #else + {"NO_PEM_EXTENSIONS", 20, 389}, + #endif + #ifdef SSL_R_NO_PRIVATE_KEY_ASSIGNED + {"NO_PRIVATE_KEY_ASSIGNED", ERR_LIB_SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED}, + #else + {"NO_PRIVATE_KEY_ASSIGNED", 20, 190}, + #endif + #ifdef SSL_R_NO_PROTOCOLS_AVAILABLE + {"NO_PROTOCOLS_AVAILABLE", ERR_LIB_SSL, SSL_R_NO_PROTOCOLS_AVAILABLE}, + #else + {"NO_PROTOCOLS_AVAILABLE", 20, 191}, + #endif + #ifdef SSL_R_NO_RENEGOTIATION + {"NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_NO_RENEGOTIATION}, + #else + {"NO_RENEGOTIATION", 20, 339}, + #endif + #ifdef SSL_R_NO_REQUIRED_DIGEST + {"NO_REQUIRED_DIGEST", ERR_LIB_SSL, SSL_R_NO_REQUIRED_DIGEST}, + #else + {"NO_REQUIRED_DIGEST", 20, 324}, + #endif + #ifdef SSL_R_NO_SHARED_CIPHER + {"NO_SHARED_CIPHER", ERR_LIB_SSL, SSL_R_NO_SHARED_CIPHER}, + #else + {"NO_SHARED_CIPHER", 20, 193}, + #endif + #ifdef SSL_R_NO_SHARED_GROUPS + {"NO_SHARED_GROUPS", ERR_LIB_SSL, SSL_R_NO_SHARED_GROUPS}, + #else + {"NO_SHARED_GROUPS", 20, 410}, + #endif + #ifdef SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS + {"NO_SHARED_SIGNATURE_ALGORITHMS", ERR_LIB_SSL, SSL_R_NO_SHARED_SIGNATURE_ALGORITHMS}, + #else + {"NO_SHARED_SIGNATURE_ALGORITHMS", 20, 376}, + #endif + #ifdef SSL_R_NO_SRTP_PROFILES + {"NO_SRTP_PROFILES", ERR_LIB_SSL, SSL_R_NO_SRTP_PROFILES}, + #else + {"NO_SRTP_PROFILES", 20, 359}, + #endif + #ifdef SSL_R_NO_SUITABLE_DIGEST_ALGORITHM + {"NO_SUITABLE_DIGEST_ALGORITHM", ERR_LIB_SSL, SSL_R_NO_SUITABLE_DIGEST_ALGORITHM}, + #else + {"NO_SUITABLE_DIGEST_ALGORITHM", 20, 297}, + #endif + #ifdef SSL_R_NO_SUITABLE_GROUPS + {"NO_SUITABLE_GROUPS", ERR_LIB_SSL, SSL_R_NO_SUITABLE_GROUPS}, + #else + {"NO_SUITABLE_GROUPS", 20, 295}, + #endif + #ifdef SSL_R_NO_SUITABLE_KEY_SHARE + {"NO_SUITABLE_KEY_SHARE", ERR_LIB_SSL, SSL_R_NO_SUITABLE_KEY_SHARE}, + #else + {"NO_SUITABLE_KEY_SHARE", 20, 101}, + #endif + #ifdef SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM + {"NO_SUITABLE_SIGNATURE_ALGORITHM", ERR_LIB_SSL, SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM}, + #else + {"NO_SUITABLE_SIGNATURE_ALGORITHM", 20, 118}, + #endif + #ifdef SSL_R_NO_VALID_SCTS + {"NO_VALID_SCTS", ERR_LIB_SSL, SSL_R_NO_VALID_SCTS}, + #else + {"NO_VALID_SCTS", 20, 216}, + #endif + #ifdef SSL_R_NO_VERIFY_COOKIE_CALLBACK + {"NO_VERIFY_COOKIE_CALLBACK", ERR_LIB_SSL, SSL_R_NO_VERIFY_COOKIE_CALLBACK}, + #else + {"NO_VERIFY_COOKIE_CALLBACK", 20, 403}, + #endif + #ifdef SSL_R_NULL_SSL_CTX + {"NULL_SSL_CTX", ERR_LIB_SSL, SSL_R_NULL_SSL_CTX}, + #else + {"NULL_SSL_CTX", 20, 195}, + #endif + #ifdef SSL_R_NULL_SSL_METHOD_PASSED + {"NULL_SSL_METHOD_PASSED", ERR_LIB_SSL, SSL_R_NULL_SSL_METHOD_PASSED}, + #else + {"NULL_SSL_METHOD_PASSED", 20, 196}, + #endif + #ifdef SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED + {"OLD_SESSION_CIPHER_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED}, + #else + {"OLD_SESSION_CIPHER_NOT_RETURNED", 20, 197}, + #endif + #ifdef SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED + {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", ERR_LIB_SSL, SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED}, + #else + {"OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED", 20, 344}, + #endif + #ifdef SSL_R_OVERFLOW_ERROR + {"OVERFLOW_ERROR", ERR_LIB_SSL, SSL_R_OVERFLOW_ERROR}, + #else + {"OVERFLOW_ERROR", 20, 237}, + #endif + #ifdef SSL_R_PACKET_LENGTH_TOO_LONG + {"PACKET_LENGTH_TOO_LONG", ERR_LIB_SSL, SSL_R_PACKET_LENGTH_TOO_LONG}, + #else + {"PACKET_LENGTH_TOO_LONG", 20, 198}, + #endif + #ifdef SSL_R_PARSE_TLSEXT + {"PARSE_TLSEXT", ERR_LIB_SSL, SSL_R_PARSE_TLSEXT}, + #else + {"PARSE_TLSEXT", 20, 227}, + #endif + #ifdef SSL_R_PATH_TOO_LONG + {"PATH_TOO_LONG", ERR_LIB_SSL, SSL_R_PATH_TOO_LONG}, + #else + {"PATH_TOO_LONG", 20, 270}, + #endif + #ifdef SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE + {"PEER_DID_NOT_RETURN_A_CERTIFICATE", ERR_LIB_SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE}, + #else + {"PEER_DID_NOT_RETURN_A_CERTIFICATE", 20, 199}, + #endif + #ifdef SSL_R_PEM_NAME_BAD_PREFIX + {"PEM_NAME_BAD_PREFIX", ERR_LIB_SSL, SSL_R_PEM_NAME_BAD_PREFIX}, + #else + {"PEM_NAME_BAD_PREFIX", 20, 391}, + #endif + #ifdef SSL_R_PEM_NAME_TOO_SHORT + {"PEM_NAME_TOO_SHORT", ERR_LIB_SSL, SSL_R_PEM_NAME_TOO_SHORT}, + #else + {"PEM_NAME_TOO_SHORT", 20, 392}, + #endif + #ifdef SSL_R_PIPELINE_FAILURE + {"PIPELINE_FAILURE", ERR_LIB_SSL, SSL_R_PIPELINE_FAILURE}, + #else + {"PIPELINE_FAILURE", 20, 406}, + #endif + #ifdef SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR + {"POST_HANDSHAKE_AUTH_ENCODING_ERR", ERR_LIB_SSL, SSL_R_POST_HANDSHAKE_AUTH_ENCODING_ERR}, + #else + {"POST_HANDSHAKE_AUTH_ENCODING_ERR", 20, 278}, + #endif + #ifdef SSL_R_PRIVATE_KEY_MISMATCH + {"PRIVATE_KEY_MISMATCH", ERR_LIB_SSL, SSL_R_PRIVATE_KEY_MISMATCH}, + #else + {"PRIVATE_KEY_MISMATCH", 20, 288}, + #endif + #ifdef SSL_R_PROTOCOL_IS_SHUTDOWN + {"PROTOCOL_IS_SHUTDOWN", ERR_LIB_SSL, SSL_R_PROTOCOL_IS_SHUTDOWN}, + #else + {"PROTOCOL_IS_SHUTDOWN", 20, 207}, + #endif + #ifdef SSL_R_PSK_IDENTITY_NOT_FOUND + {"PSK_IDENTITY_NOT_FOUND", ERR_LIB_SSL, SSL_R_PSK_IDENTITY_NOT_FOUND}, + #else + {"PSK_IDENTITY_NOT_FOUND", 20, 223}, + #endif + #ifdef SSL_R_PSK_NO_CLIENT_CB + {"PSK_NO_CLIENT_CB", ERR_LIB_SSL, SSL_R_PSK_NO_CLIENT_CB}, + #else + {"PSK_NO_CLIENT_CB", 20, 224}, + #endif + #ifdef SSL_R_PSK_NO_SERVER_CB + {"PSK_NO_SERVER_CB", ERR_LIB_SSL, SSL_R_PSK_NO_SERVER_CB}, + #else + {"PSK_NO_SERVER_CB", 20, 225}, + #endif + #ifdef SSL_R_READ_BIO_NOT_SET + {"READ_BIO_NOT_SET", ERR_LIB_SSL, SSL_R_READ_BIO_NOT_SET}, + #else + {"READ_BIO_NOT_SET", 20, 211}, + #endif + #ifdef SSL_R_READ_TIMEOUT_EXPIRED + {"READ_TIMEOUT_EXPIRED", ERR_LIB_SSL, SSL_R_READ_TIMEOUT_EXPIRED}, + #else + {"READ_TIMEOUT_EXPIRED", 20, 312}, + #endif + #ifdef SSL_R_RECORD_LENGTH_MISMATCH + {"RECORD_LENGTH_MISMATCH", ERR_LIB_SSL, SSL_R_RECORD_LENGTH_MISMATCH}, + #else + {"RECORD_LENGTH_MISMATCH", 20, 213}, + #endif + #ifdef SSL_R_RECORD_TOO_SMALL + {"RECORD_TOO_SMALL", ERR_LIB_SSL, SSL_R_RECORD_TOO_SMALL}, + #else + {"RECORD_TOO_SMALL", 20, 298}, + #endif + #ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG + {"RENEGOTIATE_EXT_TOO_LONG", ERR_LIB_SSL, SSL_R_RENEGOTIATE_EXT_TOO_LONG}, + #else + {"RENEGOTIATE_EXT_TOO_LONG", 20, 335}, + #endif + #ifdef SSL_R_RENEGOTIATION_ENCODING_ERR + {"RENEGOTIATION_ENCODING_ERR", ERR_LIB_SSL, SSL_R_RENEGOTIATION_ENCODING_ERR}, + #else + {"RENEGOTIATION_ENCODING_ERR", 20, 336}, + #endif + #ifdef SSL_R_RENEGOTIATION_MISMATCH + {"RENEGOTIATION_MISMATCH", ERR_LIB_SSL, SSL_R_RENEGOTIATION_MISMATCH}, + #else + {"RENEGOTIATION_MISMATCH", 20, 337}, + #endif + #ifdef SSL_R_REQUEST_PENDING + {"REQUEST_PENDING", ERR_LIB_SSL, SSL_R_REQUEST_PENDING}, + #else + {"REQUEST_PENDING", 20, 285}, + #endif + #ifdef SSL_R_REQUEST_SENT + {"REQUEST_SENT", ERR_LIB_SSL, SSL_R_REQUEST_SENT}, + #else + {"REQUEST_SENT", 20, 286}, + #endif + #ifdef SSL_R_REQUIRED_CIPHER_MISSING + {"REQUIRED_CIPHER_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_CIPHER_MISSING}, + #else + {"REQUIRED_CIPHER_MISSING", 20, 215}, + #endif + #ifdef SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING + {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", ERR_LIB_SSL, SSL_R_REQUIRED_COMPRESSION_ALGORITHM_MISSING}, + #else + {"REQUIRED_COMPRESSION_ALGORITHM_MISSING", 20, 342}, + #endif + #ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING + {"SCSV_RECEIVED_WHEN_RENEGOTIATING", ERR_LIB_SSL, SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING}, + #else + {"SCSV_RECEIVED_WHEN_RENEGOTIATING", 20, 345}, + #endif + #ifdef SSL_R_SCT_VERIFICATION_FAILED + {"SCT_VERIFICATION_FAILED", ERR_LIB_SSL, SSL_R_SCT_VERIFICATION_FAILED}, + #else + {"SCT_VERIFICATION_FAILED", 20, 208}, + #endif + #ifdef SSL_R_SERVERHELLO_TLSEXT + {"SERVERHELLO_TLSEXT", ERR_LIB_SSL, SSL_R_SERVERHELLO_TLSEXT}, + #else + {"SERVERHELLO_TLSEXT", 20, 275}, + #endif + #ifdef SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED + {"SESSION_ID_CONTEXT_UNINITIALIZED", ERR_LIB_SSL, SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED}, + #else + {"SESSION_ID_CONTEXT_UNINITIALIZED", 20, 277}, + #endif + #ifdef SSL_R_SHUTDOWN_WHILE_IN_INIT + {"SHUTDOWN_WHILE_IN_INIT", ERR_LIB_SSL, SSL_R_SHUTDOWN_WHILE_IN_INIT}, + #else + {"SHUTDOWN_WHILE_IN_INIT", 20, 407}, + #endif + #ifdef SSL_R_SIGNATURE_ALGORITHMS_ERROR + {"SIGNATURE_ALGORITHMS_ERROR", ERR_LIB_SSL, SSL_R_SIGNATURE_ALGORITHMS_ERROR}, + #else + {"SIGNATURE_ALGORITHMS_ERROR", 20, 360}, + #endif + #ifdef SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE + {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", ERR_LIB_SSL, SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE}, + #else + {"SIGNATURE_FOR_NON_SIGNING_CERTIFICATE", 20, 220}, + #endif + #ifdef SSL_R_SRP_A_CALC + {"SRP_A_CALC", ERR_LIB_SSL, SSL_R_SRP_A_CALC}, + #else + {"SRP_A_CALC", 20, 361}, + #endif + #ifdef SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES + {"SRTP_COULD_NOT_ALLOCATE_PROFILES", ERR_LIB_SSL, SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES}, + #else + {"SRTP_COULD_NOT_ALLOCATE_PROFILES", 20, 362}, + #endif + #ifdef SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG + {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", ERR_LIB_SSL, SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG}, + #else + {"SRTP_PROTECTION_PROFILE_LIST_TOO_LONG", 20, 363}, + #endif + #ifdef SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE + {"SRTP_UNKNOWN_PROTECTION_PROFILE", ERR_LIB_SSL, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE}, + #else + {"SRTP_UNKNOWN_PROTECTION_PROFILE", 20, 364}, + #endif + #ifdef SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH + {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH}, + #else + {"SSL3_EXT_INVALID_MAX_FRAGMENT_LENGTH", 20, 232}, + #endif + #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME + {"SSL3_EXT_INVALID_SERVERNAME", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME}, + #else + {"SSL3_EXT_INVALID_SERVERNAME", 20, 319}, + #endif + #ifdef SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE + {"SSL3_EXT_INVALID_SERVERNAME_TYPE", ERR_LIB_SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE}, + #else + {"SSL3_EXT_INVALID_SERVERNAME_TYPE", 20, 320}, + #endif + #ifdef SSL_R_SSL3_SESSION_ID_TOO_LONG + {"SSL3_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL3_SESSION_ID_TOO_LONG}, + #else + {"SSL3_SESSION_ID_TOO_LONG", 20, 300}, + #endif + #ifdef SSL_R_SSLV3_ALERT_BAD_CERTIFICATE + {"SSLV3_ALERT_BAD_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_CERTIFICATE}, + #else + {"SSLV3_ALERT_BAD_CERTIFICATE", 20, 1042}, + #endif + #ifdef SSL_R_SSLV3_ALERT_BAD_RECORD_MAC + {"SSLV3_ALERT_BAD_RECORD_MAC", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_BAD_RECORD_MAC}, + #else + {"SSLV3_ALERT_BAD_RECORD_MAC", 20, 1020}, + #endif + #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED + {"SSLV3_ALERT_CERTIFICATE_EXPIRED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED}, + #else + {"SSLV3_ALERT_CERTIFICATE_EXPIRED", 20, 1045}, + #endif + #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED + {"SSLV3_ALERT_CERTIFICATE_REVOKED", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED}, + #else + {"SSLV3_ALERT_CERTIFICATE_REVOKED", 20, 1044}, + #endif + #ifdef SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN + {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN}, + #else + {"SSLV3_ALERT_CERTIFICATE_UNKNOWN", 20, 1046}, + #endif + #ifdef SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE + {"SSLV3_ALERT_DECOMPRESSION_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE}, + #else + {"SSLV3_ALERT_DECOMPRESSION_FAILURE", 20, 1030}, + #endif + #ifdef SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE + {"SSLV3_ALERT_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE}, + #else + {"SSLV3_ALERT_HANDSHAKE_FAILURE", 20, 1040}, + #endif + #ifdef SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER + {"SSLV3_ALERT_ILLEGAL_PARAMETER", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER}, + #else + {"SSLV3_ALERT_ILLEGAL_PARAMETER", 20, 1047}, + #endif + #ifdef SSL_R_SSLV3_ALERT_NO_CERTIFICATE + {"SSLV3_ALERT_NO_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_NO_CERTIFICATE}, + #else + {"SSLV3_ALERT_NO_CERTIFICATE", 20, 1041}, + #endif + #ifdef SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE + {"SSLV3_ALERT_UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE}, + #else + {"SSLV3_ALERT_UNEXPECTED_MESSAGE", 20, 1010}, + #endif + #ifdef SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE + {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", ERR_LIB_SSL, SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE}, + #else + {"SSLV3_ALERT_UNSUPPORTED_CERTIFICATE", 20, 1043}, + #endif + #ifdef SSL_R_SSL_COMMAND_SECTION_EMPTY + {"SSL_COMMAND_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_EMPTY}, + #else + {"SSL_COMMAND_SECTION_EMPTY", 20, 117}, + #endif + #ifdef SSL_R_SSL_COMMAND_SECTION_NOT_FOUND + {"SSL_COMMAND_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_COMMAND_SECTION_NOT_FOUND}, + #else + {"SSL_COMMAND_SECTION_NOT_FOUND", 20, 125}, + #endif + #ifdef SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION + {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", ERR_LIB_SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION}, + #else + {"SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION", 20, 228}, + #endif + #ifdef SSL_R_SSL_HANDSHAKE_FAILURE + {"SSL_HANDSHAKE_FAILURE", ERR_LIB_SSL, SSL_R_SSL_HANDSHAKE_FAILURE}, + #else + {"SSL_HANDSHAKE_FAILURE", 20, 229}, + #endif + #ifdef SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS + {"SSL_LIBRARY_HAS_NO_CIPHERS", ERR_LIB_SSL, SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS}, + #else + {"SSL_LIBRARY_HAS_NO_CIPHERS", 20, 230}, + #endif + #ifdef SSL_R_SSL_NEGATIVE_LENGTH + {"SSL_NEGATIVE_LENGTH", ERR_LIB_SSL, SSL_R_SSL_NEGATIVE_LENGTH}, + #else + {"SSL_NEGATIVE_LENGTH", 20, 372}, + #endif + #ifdef SSL_R_SSL_SECTION_EMPTY + {"SSL_SECTION_EMPTY", ERR_LIB_SSL, SSL_R_SSL_SECTION_EMPTY}, + #else + {"SSL_SECTION_EMPTY", 20, 126}, + #endif + #ifdef SSL_R_SSL_SECTION_NOT_FOUND + {"SSL_SECTION_NOT_FOUND", ERR_LIB_SSL, SSL_R_SSL_SECTION_NOT_FOUND}, + #else + {"SSL_SECTION_NOT_FOUND", 20, 136}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_CALLBACK_FAILED + {"SSL_SESSION_ID_CALLBACK_FAILED", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CALLBACK_FAILED}, + #else + {"SSL_SESSION_ID_CALLBACK_FAILED", 20, 301}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_CONFLICT + {"SSL_SESSION_ID_CONFLICT", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONFLICT}, + #else + {"SSL_SESSION_ID_CONFLICT", 20, 302}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG + {"SSL_SESSION_ID_CONTEXT_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG}, + #else + {"SSL_SESSION_ID_CONTEXT_TOO_LONG", 20, 273}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH + {"SSL_SESSION_ID_HAS_BAD_LENGTH", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH}, + #else + {"SSL_SESSION_ID_HAS_BAD_LENGTH", 20, 303}, + #endif + #ifdef SSL_R_SSL_SESSION_ID_TOO_LONG + {"SSL_SESSION_ID_TOO_LONG", ERR_LIB_SSL, SSL_R_SSL_SESSION_ID_TOO_LONG}, + #else + {"SSL_SESSION_ID_TOO_LONG", 20, 408}, + #endif + #ifdef SSL_R_SSL_SESSION_VERSION_MISMATCH + {"SSL_SESSION_VERSION_MISMATCH", ERR_LIB_SSL, SSL_R_SSL_SESSION_VERSION_MISMATCH}, + #else + {"SSL_SESSION_VERSION_MISMATCH", 20, 210}, + #endif + #ifdef SSL_R_STILL_IN_INIT + {"STILL_IN_INIT", ERR_LIB_SSL, SSL_R_STILL_IN_INIT}, + #else + {"STILL_IN_INIT", 20, 121}, + #endif + #ifdef SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED + {"TLSV13_ALERT_CERTIFICATE_REQUIRED", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED}, + #else + {"TLSV13_ALERT_CERTIFICATE_REQUIRED", 20, 1116}, + #endif + #ifdef SSL_R_TLSV13_ALERT_MISSING_EXTENSION + {"TLSV13_ALERT_MISSING_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV13_ALERT_MISSING_EXTENSION}, + #else + {"TLSV13_ALERT_MISSING_EXTENSION", 20, 1109}, + #endif + #ifdef SSL_R_TLSV1_ALERT_ACCESS_DENIED + {"TLSV1_ALERT_ACCESS_DENIED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_ACCESS_DENIED}, + #else + {"TLSV1_ALERT_ACCESS_DENIED", 20, 1049}, + #endif + #ifdef SSL_R_TLSV1_ALERT_DECODE_ERROR + {"TLSV1_ALERT_DECODE_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECODE_ERROR}, + #else + {"TLSV1_ALERT_DECODE_ERROR", 20, 1050}, + #endif + #ifdef SSL_R_TLSV1_ALERT_DECRYPTION_FAILED + {"TLSV1_ALERT_DECRYPTION_FAILED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPTION_FAILED}, + #else + {"TLSV1_ALERT_DECRYPTION_FAILED", 20, 1021}, + #endif + #ifdef SSL_R_TLSV1_ALERT_DECRYPT_ERROR + {"TLSV1_ALERT_DECRYPT_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_DECRYPT_ERROR}, + #else + {"TLSV1_ALERT_DECRYPT_ERROR", 20, 1051}, + #endif + #ifdef SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION + {"TLSV1_ALERT_EXPORT_RESTRICTION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION}, + #else + {"TLSV1_ALERT_EXPORT_RESTRICTION", 20, 1060}, + #endif + #ifdef SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK + {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK}, + #else + {"TLSV1_ALERT_INAPPROPRIATE_FALLBACK", 20, 1086}, + #endif + #ifdef SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY + {"TLSV1_ALERT_INSUFFICIENT_SECURITY", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY}, + #else + {"TLSV1_ALERT_INSUFFICIENT_SECURITY", 20, 1071}, + #endif + #ifdef SSL_R_TLSV1_ALERT_INTERNAL_ERROR + {"TLSV1_ALERT_INTERNAL_ERROR", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_INTERNAL_ERROR}, + #else + {"TLSV1_ALERT_INTERNAL_ERROR", 20, 1080}, + #endif + #ifdef SSL_R_TLSV1_ALERT_NO_RENEGOTIATION + {"TLSV1_ALERT_NO_RENEGOTIATION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_NO_RENEGOTIATION}, + #else + {"TLSV1_ALERT_NO_RENEGOTIATION", 20, 1100}, + #endif + #ifdef SSL_R_TLSV1_ALERT_PROTOCOL_VERSION + {"TLSV1_ALERT_PROTOCOL_VERSION", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_PROTOCOL_VERSION}, + #else + {"TLSV1_ALERT_PROTOCOL_VERSION", 20, 1070}, + #endif + #ifdef SSL_R_TLSV1_ALERT_RECORD_OVERFLOW + {"TLSV1_ALERT_RECORD_OVERFLOW", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_RECORD_OVERFLOW}, + #else + {"TLSV1_ALERT_RECORD_OVERFLOW", 20, 1022}, + #endif + #ifdef SSL_R_TLSV1_ALERT_UNKNOWN_CA + {"TLSV1_ALERT_UNKNOWN_CA", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_UNKNOWN_CA}, + #else + {"TLSV1_ALERT_UNKNOWN_CA", 20, 1048}, + #endif + #ifdef SSL_R_TLSV1_ALERT_USER_CANCELLED + {"TLSV1_ALERT_USER_CANCELLED", ERR_LIB_SSL, SSL_R_TLSV1_ALERT_USER_CANCELLED}, + #else + {"TLSV1_ALERT_USER_CANCELLED", 20, 1090}, + #endif + #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE + {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE}, + #else + {"TLSV1_BAD_CERTIFICATE_HASH_VALUE", 20, 1114}, + #endif + #ifdef SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE + {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", ERR_LIB_SSL, SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE}, + #else + {"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE", 20, 1113}, + #endif + #ifdef SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE + {"TLSV1_CERTIFICATE_UNOBTAINABLE", ERR_LIB_SSL, SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE}, + #else + {"TLSV1_CERTIFICATE_UNOBTAINABLE", 20, 1111}, + #endif + #ifdef SSL_R_TLSV1_UNRECOGNIZED_NAME + {"TLSV1_UNRECOGNIZED_NAME", ERR_LIB_SSL, SSL_R_TLSV1_UNRECOGNIZED_NAME}, + #else + {"TLSV1_UNRECOGNIZED_NAME", 20, 1112}, + #endif + #ifdef SSL_R_TLSV1_UNSUPPORTED_EXTENSION + {"TLSV1_UNSUPPORTED_EXTENSION", ERR_LIB_SSL, SSL_R_TLSV1_UNSUPPORTED_EXTENSION}, + #else + {"TLSV1_UNSUPPORTED_EXTENSION", 20, 1110}, + #endif + #ifdef SSL_R_TLS_ILLEGAL_EXPORTER_LABEL + {"TLS_ILLEGAL_EXPORTER_LABEL", ERR_LIB_SSL, SSL_R_TLS_ILLEGAL_EXPORTER_LABEL}, + #else + {"TLS_ILLEGAL_EXPORTER_LABEL", 20, 367}, + #endif + #ifdef SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST + {"TLS_INVALID_ECPOINTFORMAT_LIST", ERR_LIB_SSL, SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST}, + #else + {"TLS_INVALID_ECPOINTFORMAT_LIST", 20, 157}, + #endif + #ifdef SSL_R_TOO_MANY_KEY_UPDATES + {"TOO_MANY_KEY_UPDATES", ERR_LIB_SSL, SSL_R_TOO_MANY_KEY_UPDATES}, + #else + {"TOO_MANY_KEY_UPDATES", 20, 132}, + #endif + #ifdef SSL_R_TOO_MANY_WARN_ALERTS + {"TOO_MANY_WARN_ALERTS", ERR_LIB_SSL, SSL_R_TOO_MANY_WARN_ALERTS}, + #else + {"TOO_MANY_WARN_ALERTS", 20, 409}, + #endif + #ifdef SSL_R_TOO_MUCH_EARLY_DATA + {"TOO_MUCH_EARLY_DATA", ERR_LIB_SSL, SSL_R_TOO_MUCH_EARLY_DATA}, + #else + {"TOO_MUCH_EARLY_DATA", 20, 164}, + #endif + #ifdef SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS + {"UNABLE_TO_FIND_ECDH_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS}, + #else + {"UNABLE_TO_FIND_ECDH_PARAMETERS", 20, 314}, + #endif + #ifdef SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS + {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", ERR_LIB_SSL, SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS}, + #else + {"UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS", 20, 239}, + #endif + #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES + {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES}, + #else + {"UNABLE_TO_LOAD_SSL3_MD5_ROUTINES", 20, 242}, + #endif + #ifdef SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES + {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", ERR_LIB_SSL, SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES}, + #else + {"UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES", 20, 243}, + #endif + #ifdef SSL_R_UNEXPECTED_CCS_MESSAGE + {"UNEXPECTED_CCS_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_CCS_MESSAGE}, + #else + {"UNEXPECTED_CCS_MESSAGE", 20, 262}, + #endif + #ifdef SSL_R_UNEXPECTED_END_OF_EARLY_DATA + {"UNEXPECTED_END_OF_EARLY_DATA", ERR_LIB_SSL, SSL_R_UNEXPECTED_END_OF_EARLY_DATA}, + #else + {"UNEXPECTED_END_OF_EARLY_DATA", 20, 178}, + #endif + #ifdef SSL_R_UNEXPECTED_EOF_WHILE_READING + {"UNEXPECTED_EOF_WHILE_READING", ERR_LIB_SSL, SSL_R_UNEXPECTED_EOF_WHILE_READING}, + #else + {"UNEXPECTED_EOF_WHILE_READING", 20, 294}, + #endif + #ifdef SSL_R_UNEXPECTED_MESSAGE + {"UNEXPECTED_MESSAGE", ERR_LIB_SSL, SSL_R_UNEXPECTED_MESSAGE}, + #else + {"UNEXPECTED_MESSAGE", 20, 244}, + #endif + #ifdef SSL_R_UNEXPECTED_RECORD + {"UNEXPECTED_RECORD", ERR_LIB_SSL, SSL_R_UNEXPECTED_RECORD}, + #else + {"UNEXPECTED_RECORD", 20, 245}, + #endif + #ifdef SSL_R_UNINITIALIZED + {"UNINITIALIZED", ERR_LIB_SSL, SSL_R_UNINITIALIZED}, + #else + {"UNINITIALIZED", 20, 276}, + #endif + #ifdef SSL_R_UNKNOWN_ALERT_TYPE + {"UNKNOWN_ALERT_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_ALERT_TYPE}, + #else + {"UNKNOWN_ALERT_TYPE", 20, 246}, + #endif + #ifdef SSL_R_UNKNOWN_CERTIFICATE_TYPE + {"UNKNOWN_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE}, + #else + {"UNKNOWN_CERTIFICATE_TYPE", 20, 247}, + #endif + #ifdef SSL_R_UNKNOWN_CIPHER_RETURNED + {"UNKNOWN_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_RETURNED}, + #else + {"UNKNOWN_CIPHER_RETURNED", 20, 248}, + #endif + #ifdef SSL_R_UNKNOWN_CIPHER_TYPE + {"UNKNOWN_CIPHER_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_CIPHER_TYPE}, + #else + {"UNKNOWN_CIPHER_TYPE", 20, 249}, + #endif + #ifdef SSL_R_UNKNOWN_CMD_NAME + {"UNKNOWN_CMD_NAME", ERR_LIB_SSL, SSL_R_UNKNOWN_CMD_NAME}, + #else + {"UNKNOWN_CMD_NAME", 20, 386}, + #endif + #ifdef SSL_R_UNKNOWN_COMMAND + {"UNKNOWN_COMMAND", ERR_LIB_SSL, SSL_R_UNKNOWN_COMMAND}, + #else + {"UNKNOWN_COMMAND", 20, 139}, + #endif + #ifdef SSL_R_UNKNOWN_DIGEST + {"UNKNOWN_DIGEST", ERR_LIB_SSL, SSL_R_UNKNOWN_DIGEST}, + #else + {"UNKNOWN_DIGEST", 20, 368}, + #endif + #ifdef SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE + {"UNKNOWN_KEY_EXCHANGE_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE}, + #else + {"UNKNOWN_KEY_EXCHANGE_TYPE", 20, 250}, + #endif + #ifdef SSL_R_UNKNOWN_PKEY_TYPE + {"UNKNOWN_PKEY_TYPE", ERR_LIB_SSL, SSL_R_UNKNOWN_PKEY_TYPE}, + #else + {"UNKNOWN_PKEY_TYPE", 20, 251}, + #endif + #ifdef SSL_R_UNKNOWN_PROTOCOL + {"UNKNOWN_PROTOCOL", ERR_LIB_SSL, SSL_R_UNKNOWN_PROTOCOL}, + #else + {"UNKNOWN_PROTOCOL", 20, 252}, + #endif + #ifdef SSL_R_UNKNOWN_SSL_VERSION + {"UNKNOWN_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNKNOWN_SSL_VERSION}, + #else + {"UNKNOWN_SSL_VERSION", 20, 254}, + #endif + #ifdef SSL_R_UNKNOWN_STATE + {"UNKNOWN_STATE", ERR_LIB_SSL, SSL_R_UNKNOWN_STATE}, + #else + {"UNKNOWN_STATE", 20, 255}, + #endif + #ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED + {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", ERR_LIB_SSL, SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED}, + #else + {"UNSAFE_LEGACY_RENEGOTIATION_DISABLED", 20, 338}, + #endif + #ifdef SSL_R_UNSOLICITED_EXTENSION + {"UNSOLICITED_EXTENSION", ERR_LIB_SSL, SSL_R_UNSOLICITED_EXTENSION}, + #else + {"UNSOLICITED_EXTENSION", 20, 217}, + #endif + #ifdef SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM + {"UNSUPPORTED_COMPRESSION_ALGORITHM", ERR_LIB_SSL, SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM}, + #else + {"UNSUPPORTED_COMPRESSION_ALGORITHM", 20, 257}, + #endif + #ifdef SSL_R_UNSUPPORTED_ELLIPTIC_CURVE + {"UNSUPPORTED_ELLIPTIC_CURVE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_ELLIPTIC_CURVE}, + #else + {"UNSUPPORTED_ELLIPTIC_CURVE", 20, 315}, + #endif + #ifdef SSL_R_UNSUPPORTED_PROTOCOL + {"UNSUPPORTED_PROTOCOL", ERR_LIB_SSL, SSL_R_UNSUPPORTED_PROTOCOL}, + #else + {"UNSUPPORTED_PROTOCOL", 20, 258}, + #endif + #ifdef SSL_R_UNSUPPORTED_SSL_VERSION + {"UNSUPPORTED_SSL_VERSION", ERR_LIB_SSL, SSL_R_UNSUPPORTED_SSL_VERSION}, + #else + {"UNSUPPORTED_SSL_VERSION", 20, 259}, + #endif + #ifdef SSL_R_UNSUPPORTED_STATUS_TYPE + {"UNSUPPORTED_STATUS_TYPE", ERR_LIB_SSL, SSL_R_UNSUPPORTED_STATUS_TYPE}, + #else + {"UNSUPPORTED_STATUS_TYPE", 20, 329}, + #endif + #ifdef SSL_R_USE_SRTP_NOT_NEGOTIATED + {"USE_SRTP_NOT_NEGOTIATED", ERR_LIB_SSL, SSL_R_USE_SRTP_NOT_NEGOTIATED}, + #else + {"USE_SRTP_NOT_NEGOTIATED", 20, 369}, + #endif + #ifdef SSL_R_VERSION_TOO_HIGH + {"VERSION_TOO_HIGH", ERR_LIB_SSL, SSL_R_VERSION_TOO_HIGH}, + #else + {"VERSION_TOO_HIGH", 20, 166}, + #endif + #ifdef SSL_R_VERSION_TOO_LOW + {"VERSION_TOO_LOW", ERR_LIB_SSL, SSL_R_VERSION_TOO_LOW}, + #else + {"VERSION_TOO_LOW", 20, 396}, + #endif + #ifdef SSL_R_WRONG_CERTIFICATE_TYPE + {"WRONG_CERTIFICATE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_CERTIFICATE_TYPE}, + #else + {"WRONG_CERTIFICATE_TYPE", 20, 383}, + #endif + #ifdef SSL_R_WRONG_CIPHER_RETURNED + {"WRONG_CIPHER_RETURNED", ERR_LIB_SSL, SSL_R_WRONG_CIPHER_RETURNED}, + #else + {"WRONG_CIPHER_RETURNED", 20, 261}, + #endif + #ifdef SSL_R_WRONG_CURVE + {"WRONG_CURVE", ERR_LIB_SSL, SSL_R_WRONG_CURVE}, + #else + {"WRONG_CURVE", 20, 378}, + #endif + #ifdef SSL_R_WRONG_SIGNATURE_LENGTH + {"WRONG_SIGNATURE_LENGTH", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_LENGTH}, + #else + {"WRONG_SIGNATURE_LENGTH", 20, 264}, + #endif + #ifdef SSL_R_WRONG_SIGNATURE_SIZE + {"WRONG_SIGNATURE_SIZE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_SIZE}, + #else + {"WRONG_SIGNATURE_SIZE", 20, 265}, + #endif + #ifdef SSL_R_WRONG_SIGNATURE_TYPE + {"WRONG_SIGNATURE_TYPE", ERR_LIB_SSL, SSL_R_WRONG_SIGNATURE_TYPE}, + #else + {"WRONG_SIGNATURE_TYPE", 20, 370}, + #endif + #ifdef SSL_R_WRONG_SSL_VERSION + {"WRONG_SSL_VERSION", ERR_LIB_SSL, SSL_R_WRONG_SSL_VERSION}, + #else + {"WRONG_SSL_VERSION", 20, 266}, + #endif + #ifdef SSL_R_WRONG_VERSION_NUMBER + {"WRONG_VERSION_NUMBER", ERR_LIB_SSL, SSL_R_WRONG_VERSION_NUMBER}, + #else + {"WRONG_VERSION_NUMBER", 20, 267}, + #endif + #ifdef SSL_R_X509_LIB + {"X509_LIB", ERR_LIB_SSL, SSL_R_X509_LIB}, + #else + {"X509_LIB", 20, 268}, + #endif + #ifdef SSL_R_X509_VERIFICATION_SETUP_PROBLEMS + {"X509_VERIFICATION_SETUP_PROBLEMS", ERR_LIB_SSL, SSL_R_X509_VERIFICATION_SETUP_PROBLEMS}, + #else + {"X509_VERIFICATION_SETUP_PROBLEMS", 20, 269}, + #endif + #ifdef TS_R_BAD_PKCS7_TYPE + {"BAD_PKCS7_TYPE", ERR_LIB_TS, TS_R_BAD_PKCS7_TYPE}, + #else + {"BAD_PKCS7_TYPE", 47, 132}, + #endif + #ifdef TS_R_BAD_TYPE + {"BAD_TYPE", ERR_LIB_TS, TS_R_BAD_TYPE}, + #else + {"BAD_TYPE", 47, 133}, + #endif + #ifdef TS_R_CANNOT_LOAD_CERT + {"CANNOT_LOAD_CERT", ERR_LIB_TS, TS_R_CANNOT_LOAD_CERT}, + #else + {"CANNOT_LOAD_CERT", 47, 137}, + #endif + #ifdef TS_R_CANNOT_LOAD_KEY + {"CANNOT_LOAD_KEY", ERR_LIB_TS, TS_R_CANNOT_LOAD_KEY}, + #else + {"CANNOT_LOAD_KEY", 47, 138}, + #endif + #ifdef TS_R_CERTIFICATE_VERIFY_ERROR + {"CERTIFICATE_VERIFY_ERROR", ERR_LIB_TS, TS_R_CERTIFICATE_VERIFY_ERROR}, + #else + {"CERTIFICATE_VERIFY_ERROR", 47, 100}, + #endif + #ifdef TS_R_COULD_NOT_SET_ENGINE + {"COULD_NOT_SET_ENGINE", ERR_LIB_TS, TS_R_COULD_NOT_SET_ENGINE}, + #else + {"COULD_NOT_SET_ENGINE", 47, 127}, + #endif + #ifdef TS_R_COULD_NOT_SET_TIME + {"COULD_NOT_SET_TIME", ERR_LIB_TS, TS_R_COULD_NOT_SET_TIME}, + #else + {"COULD_NOT_SET_TIME", 47, 115}, + #endif + #ifdef TS_R_DETACHED_CONTENT + {"DETACHED_CONTENT", ERR_LIB_TS, TS_R_DETACHED_CONTENT}, + #else + {"DETACHED_CONTENT", 47, 134}, + #endif + #ifdef TS_R_ESS_ADD_SIGNING_CERT_ERROR + {"ESS_ADD_SIGNING_CERT_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_ERROR}, + #else + {"ESS_ADD_SIGNING_CERT_ERROR", 47, 116}, + #endif + #ifdef TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR + {"ESS_ADD_SIGNING_CERT_V2_ERROR", ERR_LIB_TS, TS_R_ESS_ADD_SIGNING_CERT_V2_ERROR}, + #else + {"ESS_ADD_SIGNING_CERT_V2_ERROR", 47, 139}, + #endif + #ifdef TS_R_ESS_SIGNING_CERTIFICATE_ERROR + {"ESS_SIGNING_CERTIFICATE_ERROR", ERR_LIB_TS, TS_R_ESS_SIGNING_CERTIFICATE_ERROR}, + #else + {"ESS_SIGNING_CERTIFICATE_ERROR", 47, 101}, + #endif + #ifdef TS_R_INVALID_NULL_POINTER + {"INVALID_NULL_POINTER", ERR_LIB_TS, TS_R_INVALID_NULL_POINTER}, + #else + {"INVALID_NULL_POINTER", 47, 102}, + #endif + #ifdef TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE + {"INVALID_SIGNER_CERTIFICATE_PURPOSE", ERR_LIB_TS, TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE}, + #else + {"INVALID_SIGNER_CERTIFICATE_PURPOSE", 47, 117}, + #endif + #ifdef TS_R_MESSAGE_IMPRINT_MISMATCH + {"MESSAGE_IMPRINT_MISMATCH", ERR_LIB_TS, TS_R_MESSAGE_IMPRINT_MISMATCH}, + #else + {"MESSAGE_IMPRINT_MISMATCH", 47, 103}, + #endif + #ifdef TS_R_NONCE_MISMATCH + {"NONCE_MISMATCH", ERR_LIB_TS, TS_R_NONCE_MISMATCH}, + #else + {"NONCE_MISMATCH", 47, 104}, + #endif + #ifdef TS_R_NONCE_NOT_RETURNED + {"NONCE_NOT_RETURNED", ERR_LIB_TS, TS_R_NONCE_NOT_RETURNED}, + #else + {"NONCE_NOT_RETURNED", 47, 105}, + #endif + #ifdef TS_R_NO_CONTENT + {"NO_CONTENT", ERR_LIB_TS, TS_R_NO_CONTENT}, + #else + {"NO_CONTENT", 47, 106}, + #endif + #ifdef TS_R_NO_TIME_STAMP_TOKEN + {"NO_TIME_STAMP_TOKEN", ERR_LIB_TS, TS_R_NO_TIME_STAMP_TOKEN}, + #else + {"NO_TIME_STAMP_TOKEN", 47, 107}, + #endif + #ifdef TS_R_PKCS7_ADD_SIGNATURE_ERROR + {"PKCS7_ADD_SIGNATURE_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNATURE_ERROR}, + #else + {"PKCS7_ADD_SIGNATURE_ERROR", 47, 118}, + #endif + #ifdef TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR + {"PKCS7_ADD_SIGNED_ATTR_ERROR", ERR_LIB_TS, TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR}, + #else + {"PKCS7_ADD_SIGNED_ATTR_ERROR", 47, 119}, + #endif + #ifdef TS_R_PKCS7_TO_TS_TST_INFO_FAILED + {"PKCS7_TO_TS_TST_INFO_FAILED", ERR_LIB_TS, TS_R_PKCS7_TO_TS_TST_INFO_FAILED}, + #else + {"PKCS7_TO_TS_TST_INFO_FAILED", 47, 129}, + #endif + #ifdef TS_R_POLICY_MISMATCH + {"POLICY_MISMATCH", ERR_LIB_TS, TS_R_POLICY_MISMATCH}, + #else + {"POLICY_MISMATCH", 47, 108}, + #endif + #ifdef TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", ERR_LIB_TS, TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE}, + #else + {"PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE", 47, 120}, + #endif + #ifdef TS_R_RESPONSE_SETUP_ERROR + {"RESPONSE_SETUP_ERROR", ERR_LIB_TS, TS_R_RESPONSE_SETUP_ERROR}, + #else + {"RESPONSE_SETUP_ERROR", 47, 121}, + #endif + #ifdef TS_R_SIGNATURE_FAILURE + {"SIGNATURE_FAILURE", ERR_LIB_TS, TS_R_SIGNATURE_FAILURE}, + #else + {"SIGNATURE_FAILURE", 47, 109}, + #endif + #ifdef TS_R_THERE_MUST_BE_ONE_SIGNER + {"THERE_MUST_BE_ONE_SIGNER", ERR_LIB_TS, TS_R_THERE_MUST_BE_ONE_SIGNER}, + #else + {"THERE_MUST_BE_ONE_SIGNER", 47, 110}, + #endif + #ifdef TS_R_TIME_SYSCALL_ERROR + {"TIME_SYSCALL_ERROR", ERR_LIB_TS, TS_R_TIME_SYSCALL_ERROR}, + #else + {"TIME_SYSCALL_ERROR", 47, 122}, + #endif + #ifdef TS_R_TOKEN_NOT_PRESENT + {"TOKEN_NOT_PRESENT", ERR_LIB_TS, TS_R_TOKEN_NOT_PRESENT}, + #else + {"TOKEN_NOT_PRESENT", 47, 130}, + #endif + #ifdef TS_R_TOKEN_PRESENT + {"TOKEN_PRESENT", ERR_LIB_TS, TS_R_TOKEN_PRESENT}, + #else + {"TOKEN_PRESENT", 47, 131}, + #endif + #ifdef TS_R_TSA_NAME_MISMATCH + {"TSA_NAME_MISMATCH", ERR_LIB_TS, TS_R_TSA_NAME_MISMATCH}, + #else + {"TSA_NAME_MISMATCH", 47, 111}, + #endif + #ifdef TS_R_TSA_UNTRUSTED + {"TSA_UNTRUSTED", ERR_LIB_TS, TS_R_TSA_UNTRUSTED}, + #else + {"TSA_UNTRUSTED", 47, 112}, + #endif + #ifdef TS_R_TST_INFO_SETUP_ERROR + {"TST_INFO_SETUP_ERROR", ERR_LIB_TS, TS_R_TST_INFO_SETUP_ERROR}, + #else + {"TST_INFO_SETUP_ERROR", 47, 123}, + #endif + #ifdef TS_R_TS_DATASIGN + {"TS_DATASIGN", ERR_LIB_TS, TS_R_TS_DATASIGN}, + #else + {"TS_DATASIGN", 47, 124}, + #endif + #ifdef TS_R_UNACCEPTABLE_POLICY + {"UNACCEPTABLE_POLICY", ERR_LIB_TS, TS_R_UNACCEPTABLE_POLICY}, + #else + {"UNACCEPTABLE_POLICY", 47, 125}, + #endif + #ifdef TS_R_UNSUPPORTED_MD_ALGORITHM + {"UNSUPPORTED_MD_ALGORITHM", ERR_LIB_TS, TS_R_UNSUPPORTED_MD_ALGORITHM}, + #else + {"UNSUPPORTED_MD_ALGORITHM", 47, 126}, + #endif + #ifdef TS_R_UNSUPPORTED_VERSION + {"UNSUPPORTED_VERSION", ERR_LIB_TS, TS_R_UNSUPPORTED_VERSION}, + #else + {"UNSUPPORTED_VERSION", 47, 113}, + #endif + #ifdef TS_R_VAR_BAD_VALUE + {"VAR_BAD_VALUE", ERR_LIB_TS, TS_R_VAR_BAD_VALUE}, + #else + {"VAR_BAD_VALUE", 47, 135}, + #endif + #ifdef TS_R_VAR_LOOKUP_FAILURE + {"VAR_LOOKUP_FAILURE", ERR_LIB_TS, TS_R_VAR_LOOKUP_FAILURE}, + #else + {"VAR_LOOKUP_FAILURE", 47, 136}, + #endif + #ifdef TS_R_WRONG_CONTENT_TYPE + {"WRONG_CONTENT_TYPE", ERR_LIB_TS, TS_R_WRONG_CONTENT_TYPE}, + #else + {"WRONG_CONTENT_TYPE", 47, 114}, + #endif + #ifdef UI_R_COMMON_OK_AND_CANCEL_CHARACTERS + {"COMMON_OK_AND_CANCEL_CHARACTERS", ERR_LIB_UI, UI_R_COMMON_OK_AND_CANCEL_CHARACTERS}, + #else + {"COMMON_OK_AND_CANCEL_CHARACTERS", 40, 104}, + #endif + #ifdef UI_R_INDEX_TOO_LARGE + {"INDEX_TOO_LARGE", ERR_LIB_UI, UI_R_INDEX_TOO_LARGE}, + #else + {"INDEX_TOO_LARGE", 40, 102}, + #endif + #ifdef UI_R_INDEX_TOO_SMALL + {"INDEX_TOO_SMALL", ERR_LIB_UI, UI_R_INDEX_TOO_SMALL}, + #else + {"INDEX_TOO_SMALL", 40, 103}, + #endif + #ifdef UI_R_NO_RESULT_BUFFER + {"NO_RESULT_BUFFER", ERR_LIB_UI, UI_R_NO_RESULT_BUFFER}, + #else + {"NO_RESULT_BUFFER", 40, 105}, + #endif + #ifdef UI_R_PROCESSING_ERROR + {"PROCESSING_ERROR", ERR_LIB_UI, UI_R_PROCESSING_ERROR}, + #else + {"PROCESSING_ERROR", 40, 107}, + #endif + #ifdef UI_R_RESULT_TOO_LARGE + {"RESULT_TOO_LARGE", ERR_LIB_UI, UI_R_RESULT_TOO_LARGE}, + #else + {"RESULT_TOO_LARGE", 40, 100}, + #endif + #ifdef UI_R_RESULT_TOO_SMALL + {"RESULT_TOO_SMALL", ERR_LIB_UI, UI_R_RESULT_TOO_SMALL}, + #else + {"RESULT_TOO_SMALL", 40, 101}, + #endif + #ifdef UI_R_SYSASSIGN_ERROR + {"SYSASSIGN_ERROR", ERR_LIB_UI, UI_R_SYSASSIGN_ERROR}, + #else + {"SYSASSIGN_ERROR", 40, 109}, + #endif + #ifdef UI_R_SYSDASSGN_ERROR + {"SYSDASSGN_ERROR", ERR_LIB_UI, UI_R_SYSDASSGN_ERROR}, + #else + {"SYSDASSGN_ERROR", 40, 110}, + #endif + #ifdef UI_R_SYSQIOW_ERROR + {"SYSQIOW_ERROR", ERR_LIB_UI, UI_R_SYSQIOW_ERROR}, + #else + {"SYSQIOW_ERROR", 40, 111}, + #endif + #ifdef UI_R_UNKNOWN_CONTROL_COMMAND + {"UNKNOWN_CONTROL_COMMAND", ERR_LIB_UI, UI_R_UNKNOWN_CONTROL_COMMAND}, + #else + {"UNKNOWN_CONTROL_COMMAND", 40, 106}, + #endif + #ifdef UI_R_UNKNOWN_TTYGET_ERRNO_VALUE + {"UNKNOWN_TTYGET_ERRNO_VALUE", ERR_LIB_UI, UI_R_UNKNOWN_TTYGET_ERRNO_VALUE}, + #else + {"UNKNOWN_TTYGET_ERRNO_VALUE", 40, 108}, + #endif + #ifdef UI_R_USER_DATA_DUPLICATION_UNSUPPORTED + {"USER_DATA_DUPLICATION_UNSUPPORTED", ERR_LIB_UI, UI_R_USER_DATA_DUPLICATION_UNSUPPORTED}, + #else + {"USER_DATA_DUPLICATION_UNSUPPORTED", 40, 112}, + #endif + #ifdef X509V3_R_BAD_IP_ADDRESS + {"BAD_IP_ADDRESS", ERR_LIB_X509V3, X509V3_R_BAD_IP_ADDRESS}, + #else + {"BAD_IP_ADDRESS", 34, 118}, + #endif + #ifdef X509V3_R_BAD_OBJECT + {"BAD_OBJECT", ERR_LIB_X509V3, X509V3_R_BAD_OBJECT}, + #else + {"BAD_OBJECT", 34, 119}, + #endif + #ifdef X509V3_R_BN_DEC2BN_ERROR + {"BN_DEC2BN_ERROR", ERR_LIB_X509V3, X509V3_R_BN_DEC2BN_ERROR}, + #else + {"BN_DEC2BN_ERROR", 34, 100}, + #endif + #ifdef X509V3_R_BN_TO_ASN1_INTEGER_ERROR + {"BN_TO_ASN1_INTEGER_ERROR", ERR_LIB_X509V3, X509V3_R_BN_TO_ASN1_INTEGER_ERROR}, + #else + {"BN_TO_ASN1_INTEGER_ERROR", 34, 101}, + #endif + #ifdef X509V3_R_DIRNAME_ERROR + {"DIRNAME_ERROR", ERR_LIB_X509V3, X509V3_R_DIRNAME_ERROR}, + #else + {"DIRNAME_ERROR", 34, 149}, + #endif + #ifdef X509V3_R_DISTPOINT_ALREADY_SET + {"DISTPOINT_ALREADY_SET", ERR_LIB_X509V3, X509V3_R_DISTPOINT_ALREADY_SET}, + #else + {"DISTPOINT_ALREADY_SET", 34, 160}, + #endif + #ifdef X509V3_R_DUPLICATE_ZONE_ID + {"DUPLICATE_ZONE_ID", ERR_LIB_X509V3, X509V3_R_DUPLICATE_ZONE_ID}, + #else + {"DUPLICATE_ZONE_ID", 34, 133}, + #endif + #ifdef X509V3_R_EMPTY_KEY_USAGE + {"EMPTY_KEY_USAGE", ERR_LIB_X509V3, X509V3_R_EMPTY_KEY_USAGE}, + #else + {"EMPTY_KEY_USAGE", 34, 169}, + #endif + #ifdef X509V3_R_ERROR_CONVERTING_ZONE + {"ERROR_CONVERTING_ZONE", ERR_LIB_X509V3, X509V3_R_ERROR_CONVERTING_ZONE}, + #else + {"ERROR_CONVERTING_ZONE", 34, 131}, + #endif + #ifdef X509V3_R_ERROR_CREATING_EXTENSION + {"ERROR_CREATING_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_CREATING_EXTENSION}, + #else + {"ERROR_CREATING_EXTENSION", 34, 144}, + #endif + #ifdef X509V3_R_ERROR_IN_EXTENSION + {"ERROR_IN_EXTENSION", ERR_LIB_X509V3, X509V3_R_ERROR_IN_EXTENSION}, + #else + {"ERROR_IN_EXTENSION", 34, 128}, + #endif + #ifdef X509V3_R_EXPECTED_A_SECTION_NAME + {"EXPECTED_A_SECTION_NAME", ERR_LIB_X509V3, X509V3_R_EXPECTED_A_SECTION_NAME}, + #else + {"EXPECTED_A_SECTION_NAME", 34, 137}, + #endif + #ifdef X509V3_R_EXTENSION_EXISTS + {"EXTENSION_EXISTS", ERR_LIB_X509V3, X509V3_R_EXTENSION_EXISTS}, + #else + {"EXTENSION_EXISTS", 34, 145}, + #endif + #ifdef X509V3_R_EXTENSION_NAME_ERROR + {"EXTENSION_NAME_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_NAME_ERROR}, + #else + {"EXTENSION_NAME_ERROR", 34, 115}, + #endif + #ifdef X509V3_R_EXTENSION_NOT_FOUND + {"EXTENSION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_EXTENSION_NOT_FOUND}, + #else + {"EXTENSION_NOT_FOUND", 34, 102}, + #endif + #ifdef X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED + {"EXTENSION_SETTING_NOT_SUPPORTED", ERR_LIB_X509V3, X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED}, + #else + {"EXTENSION_SETTING_NOT_SUPPORTED", 34, 103}, + #endif + #ifdef X509V3_R_EXTENSION_VALUE_ERROR + {"EXTENSION_VALUE_ERROR", ERR_LIB_X509V3, X509V3_R_EXTENSION_VALUE_ERROR}, + #else + {"EXTENSION_VALUE_ERROR", 34, 116}, + #endif + #ifdef X509V3_R_ILLEGAL_EMPTY_EXTENSION + {"ILLEGAL_EMPTY_EXTENSION", ERR_LIB_X509V3, X509V3_R_ILLEGAL_EMPTY_EXTENSION}, + #else + {"ILLEGAL_EMPTY_EXTENSION", 34, 151}, + #endif + #ifdef X509V3_R_INCORRECT_POLICY_SYNTAX_TAG + {"INCORRECT_POLICY_SYNTAX_TAG", ERR_LIB_X509V3, X509V3_R_INCORRECT_POLICY_SYNTAX_TAG}, + #else + {"INCORRECT_POLICY_SYNTAX_TAG", 34, 152}, + #endif + #ifdef X509V3_R_INVALID_ASNUMBER + {"INVALID_ASNUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_ASNUMBER}, + #else + {"INVALID_ASNUMBER", 34, 162}, + #endif + #ifdef X509V3_R_INVALID_ASRANGE + {"INVALID_ASRANGE", ERR_LIB_X509V3, X509V3_R_INVALID_ASRANGE}, + #else + {"INVALID_ASRANGE", 34, 163}, + #endif + #ifdef X509V3_R_INVALID_BOOLEAN_STRING + {"INVALID_BOOLEAN_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_BOOLEAN_STRING}, + #else + {"INVALID_BOOLEAN_STRING", 34, 104}, + #endif + #ifdef X509V3_R_INVALID_CERTIFICATE + {"INVALID_CERTIFICATE", ERR_LIB_X509V3, X509V3_R_INVALID_CERTIFICATE}, + #else + {"INVALID_CERTIFICATE", 34, 158}, + #endif + #ifdef X509V3_R_INVALID_EMPTY_NAME + {"INVALID_EMPTY_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_EMPTY_NAME}, + #else + {"INVALID_EMPTY_NAME", 34, 108}, + #endif + #ifdef X509V3_R_INVALID_EXTENSION_STRING + {"INVALID_EXTENSION_STRING", ERR_LIB_X509V3, X509V3_R_INVALID_EXTENSION_STRING}, + #else + {"INVALID_EXTENSION_STRING", 34, 105}, + #endif + #ifdef X509V3_R_INVALID_INHERITANCE + {"INVALID_INHERITANCE", ERR_LIB_X509V3, X509V3_R_INVALID_INHERITANCE}, + #else + {"INVALID_INHERITANCE", 34, 165}, + #endif + #ifdef X509V3_R_INVALID_IPADDRESS + {"INVALID_IPADDRESS", ERR_LIB_X509V3, X509V3_R_INVALID_IPADDRESS}, + #else + {"INVALID_IPADDRESS", 34, 166}, + #endif + #ifdef X509V3_R_INVALID_MULTIPLE_RDNS + {"INVALID_MULTIPLE_RDNS", ERR_LIB_X509V3, X509V3_R_INVALID_MULTIPLE_RDNS}, + #else + {"INVALID_MULTIPLE_RDNS", 34, 161}, + #endif + #ifdef X509V3_R_INVALID_NAME + {"INVALID_NAME", ERR_LIB_X509V3, X509V3_R_INVALID_NAME}, + #else + {"INVALID_NAME", 34, 106}, + #endif + #ifdef X509V3_R_INVALID_NULL_ARGUMENT + {"INVALID_NULL_ARGUMENT", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_ARGUMENT}, + #else + {"INVALID_NULL_ARGUMENT", 34, 107}, + #endif + #ifdef X509V3_R_INVALID_NULL_VALUE + {"INVALID_NULL_VALUE", ERR_LIB_X509V3, X509V3_R_INVALID_NULL_VALUE}, + #else + {"INVALID_NULL_VALUE", 34, 109}, + #endif + #ifdef X509V3_R_INVALID_NUMBER + {"INVALID_NUMBER", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBER}, + #else + {"INVALID_NUMBER", 34, 140}, + #endif + #ifdef X509V3_R_INVALID_NUMBERS + {"INVALID_NUMBERS", ERR_LIB_X509V3, X509V3_R_INVALID_NUMBERS}, + #else + {"INVALID_NUMBERS", 34, 141}, + #endif + #ifdef X509V3_R_INVALID_OBJECT_IDENTIFIER + {"INVALID_OBJECT_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_OBJECT_IDENTIFIER}, + #else + {"INVALID_OBJECT_IDENTIFIER", 34, 110}, + #endif + #ifdef X509V3_R_INVALID_OPTION + {"INVALID_OPTION", ERR_LIB_X509V3, X509V3_R_INVALID_OPTION}, + #else + {"INVALID_OPTION", 34, 138}, + #endif + #ifdef X509V3_R_INVALID_POLICY_IDENTIFIER + {"INVALID_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_INVALID_POLICY_IDENTIFIER}, + #else + {"INVALID_POLICY_IDENTIFIER", 34, 134}, + #endif + #ifdef X509V3_R_INVALID_PROXY_POLICY_SETTING + {"INVALID_PROXY_POLICY_SETTING", ERR_LIB_X509V3, X509V3_R_INVALID_PROXY_POLICY_SETTING}, + #else + {"INVALID_PROXY_POLICY_SETTING", 34, 153}, + #endif + #ifdef X509V3_R_INVALID_PURPOSE + {"INVALID_PURPOSE", ERR_LIB_X509V3, X509V3_R_INVALID_PURPOSE}, + #else + {"INVALID_PURPOSE", 34, 146}, + #endif + #ifdef X509V3_R_INVALID_SAFI + {"INVALID_SAFI", ERR_LIB_X509V3, X509V3_R_INVALID_SAFI}, + #else + {"INVALID_SAFI", 34, 164}, + #endif + #ifdef X509V3_R_INVALID_SECTION + {"INVALID_SECTION", ERR_LIB_X509V3, X509V3_R_INVALID_SECTION}, + #else + {"INVALID_SECTION", 34, 135}, + #endif + #ifdef X509V3_R_INVALID_SYNTAX + {"INVALID_SYNTAX", ERR_LIB_X509V3, X509V3_R_INVALID_SYNTAX}, + #else + {"INVALID_SYNTAX", 34, 143}, + #endif + #ifdef X509V3_R_ISSUER_DECODE_ERROR + {"ISSUER_DECODE_ERROR", ERR_LIB_X509V3, X509V3_R_ISSUER_DECODE_ERROR}, + #else + {"ISSUER_DECODE_ERROR", 34, 126}, + #endif + #ifdef X509V3_R_MISSING_VALUE + {"MISSING_VALUE", ERR_LIB_X509V3, X509V3_R_MISSING_VALUE}, + #else + {"MISSING_VALUE", 34, 124}, + #endif + #ifdef X509V3_R_NEED_ORGANIZATION_AND_NUMBERS + {"NEED_ORGANIZATION_AND_NUMBERS", ERR_LIB_X509V3, X509V3_R_NEED_ORGANIZATION_AND_NUMBERS}, + #else + {"NEED_ORGANIZATION_AND_NUMBERS", 34, 142}, + #endif + #ifdef X509V3_R_NEGATIVE_PATHLEN + {"NEGATIVE_PATHLEN", ERR_LIB_X509V3, X509V3_R_NEGATIVE_PATHLEN}, + #else + {"NEGATIVE_PATHLEN", 34, 168}, + #endif + #ifdef X509V3_R_NO_CONFIG_DATABASE + {"NO_CONFIG_DATABASE", ERR_LIB_X509V3, X509V3_R_NO_CONFIG_DATABASE}, + #else + {"NO_CONFIG_DATABASE", 34, 136}, + #endif + #ifdef X509V3_R_NO_ISSUER_CERTIFICATE + {"NO_ISSUER_CERTIFICATE", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_CERTIFICATE}, + #else + {"NO_ISSUER_CERTIFICATE", 34, 121}, + #endif + #ifdef X509V3_R_NO_ISSUER_DETAILS + {"NO_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_ISSUER_DETAILS}, + #else + {"NO_ISSUER_DETAILS", 34, 127}, + #endif + #ifdef X509V3_R_NO_POLICY_IDENTIFIER + {"NO_POLICY_IDENTIFIER", ERR_LIB_X509V3, X509V3_R_NO_POLICY_IDENTIFIER}, + #else + {"NO_POLICY_IDENTIFIER", 34, 139}, + #endif + #ifdef X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED + {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", ERR_LIB_X509V3, X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED}, + #else + {"NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED", 34, 154}, + #endif + #ifdef X509V3_R_NO_PUBLIC_KEY + {"NO_PUBLIC_KEY", ERR_LIB_X509V3, X509V3_R_NO_PUBLIC_KEY}, + #else + {"NO_PUBLIC_KEY", 34, 114}, + #endif + #ifdef X509V3_R_NO_SUBJECT_DETAILS + {"NO_SUBJECT_DETAILS", ERR_LIB_X509V3, X509V3_R_NO_SUBJECT_DETAILS}, + #else + {"NO_SUBJECT_DETAILS", 34, 125}, + #endif + #ifdef X509V3_R_OPERATION_NOT_DEFINED + {"OPERATION_NOT_DEFINED", ERR_LIB_X509V3, X509V3_R_OPERATION_NOT_DEFINED}, + #else + {"OPERATION_NOT_DEFINED", 34, 148}, + #endif + #ifdef X509V3_R_OTHERNAME_ERROR + {"OTHERNAME_ERROR", ERR_LIB_X509V3, X509V3_R_OTHERNAME_ERROR}, + #else + {"OTHERNAME_ERROR", 34, 147}, + #endif + #ifdef X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED + {"POLICY_LANGUAGE_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED}, + #else + {"POLICY_LANGUAGE_ALREADY_DEFINED", 34, 155}, + #endif + #ifdef X509V3_R_POLICY_PATH_LENGTH + {"POLICY_PATH_LENGTH", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH}, + #else + {"POLICY_PATH_LENGTH", 34, 156}, + #endif + #ifdef X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED + {"POLICY_PATH_LENGTH_ALREADY_DEFINED", ERR_LIB_X509V3, X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED}, + #else + {"POLICY_PATH_LENGTH_ALREADY_DEFINED", 34, 157}, + #endif + #ifdef X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY + {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", ERR_LIB_X509V3, X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY}, + #else + {"POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY", 34, 159}, + #endif + #ifdef X509V3_R_SECTION_NOT_FOUND + {"SECTION_NOT_FOUND", ERR_LIB_X509V3, X509V3_R_SECTION_NOT_FOUND}, + #else + {"SECTION_NOT_FOUND", 34, 150}, + #endif + #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS + {"UNABLE_TO_GET_ISSUER_DETAILS", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS}, + #else + {"UNABLE_TO_GET_ISSUER_DETAILS", 34, 122}, + #endif + #ifdef X509V3_R_UNABLE_TO_GET_ISSUER_KEYID + {"UNABLE_TO_GET_ISSUER_KEYID", ERR_LIB_X509V3, X509V3_R_UNABLE_TO_GET_ISSUER_KEYID}, + #else + {"UNABLE_TO_GET_ISSUER_KEYID", 34, 123}, + #endif + #ifdef X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT + {"UNKNOWN_BIT_STRING_ARGUMENT", ERR_LIB_X509V3, X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT}, + #else + {"UNKNOWN_BIT_STRING_ARGUMENT", 34, 111}, + #endif + #ifdef X509V3_R_UNKNOWN_EXTENSION + {"UNKNOWN_EXTENSION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION}, + #else + {"UNKNOWN_EXTENSION", 34, 129}, + #endif + #ifdef X509V3_R_UNKNOWN_EXTENSION_NAME + {"UNKNOWN_EXTENSION_NAME", ERR_LIB_X509V3, X509V3_R_UNKNOWN_EXTENSION_NAME}, + #else + {"UNKNOWN_EXTENSION_NAME", 34, 130}, + #endif + #ifdef X509V3_R_UNKNOWN_OPTION + {"UNKNOWN_OPTION", ERR_LIB_X509V3, X509V3_R_UNKNOWN_OPTION}, + #else + {"UNKNOWN_OPTION", 34, 120}, + #endif + #ifdef X509V3_R_UNSUPPORTED_OPTION + {"UNSUPPORTED_OPTION", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_OPTION}, + #else + {"UNSUPPORTED_OPTION", 34, 117}, + #endif + #ifdef X509V3_R_UNSUPPORTED_TYPE + {"UNSUPPORTED_TYPE", ERR_LIB_X509V3, X509V3_R_UNSUPPORTED_TYPE}, + #else + {"UNSUPPORTED_TYPE", 34, 167}, + #endif + #ifdef X509V3_R_USER_TOO_LONG + {"USER_TOO_LONG", ERR_LIB_X509V3, X509V3_R_USER_TOO_LONG}, + #else + {"USER_TOO_LONG", 34, 132}, + #endif + #ifdef X509_R_AKID_MISMATCH + {"AKID_MISMATCH", ERR_LIB_X509, X509_R_AKID_MISMATCH}, + #else + {"AKID_MISMATCH", 11, 110}, + #endif + #ifdef X509_R_BAD_SELECTOR + {"BAD_SELECTOR", ERR_LIB_X509, X509_R_BAD_SELECTOR}, + #else + {"BAD_SELECTOR", 11, 133}, + #endif + #ifdef X509_R_BAD_X509_FILETYPE + {"BAD_X509_FILETYPE", ERR_LIB_X509, X509_R_BAD_X509_FILETYPE}, + #else + {"BAD_X509_FILETYPE", 11, 100}, + #endif + #ifdef X509_R_BASE64_DECODE_ERROR + {"BASE64_DECODE_ERROR", ERR_LIB_X509, X509_R_BASE64_DECODE_ERROR}, + #else + {"BASE64_DECODE_ERROR", 11, 118}, + #endif + #ifdef X509_R_CANT_CHECK_DH_KEY + {"CANT_CHECK_DH_KEY", ERR_LIB_X509, X509_R_CANT_CHECK_DH_KEY}, + #else + {"CANT_CHECK_DH_KEY", 11, 114}, + #endif + #ifdef X509_R_CERTIFICATE_VERIFICATION_FAILED + {"CERTIFICATE_VERIFICATION_FAILED", ERR_LIB_X509, X509_R_CERTIFICATE_VERIFICATION_FAILED}, + #else + {"CERTIFICATE_VERIFICATION_FAILED", 11, 139}, + #endif + #ifdef X509_R_CERT_ALREADY_IN_HASH_TABLE + {"CERT_ALREADY_IN_HASH_TABLE", ERR_LIB_X509, X509_R_CERT_ALREADY_IN_HASH_TABLE}, + #else + {"CERT_ALREADY_IN_HASH_TABLE", 11, 101}, + #endif + #ifdef X509_R_CRL_ALREADY_DELTA + {"CRL_ALREADY_DELTA", ERR_LIB_X509, X509_R_CRL_ALREADY_DELTA}, + #else + {"CRL_ALREADY_DELTA", 11, 127}, + #endif + #ifdef X509_R_CRL_VERIFY_FAILURE + {"CRL_VERIFY_FAILURE", ERR_LIB_X509, X509_R_CRL_VERIFY_FAILURE}, + #else + {"CRL_VERIFY_FAILURE", 11, 131}, + #endif + #ifdef X509_R_ERROR_GETTING_MD_BY_NID + {"ERROR_GETTING_MD_BY_NID", ERR_LIB_X509, X509_R_ERROR_GETTING_MD_BY_NID}, + #else + {"ERROR_GETTING_MD_BY_NID", 11, 141}, + #endif + #ifdef X509_R_ERROR_USING_SIGINF_SET + {"ERROR_USING_SIGINF_SET", ERR_LIB_X509, X509_R_ERROR_USING_SIGINF_SET}, + #else + {"ERROR_USING_SIGINF_SET", 11, 142}, + #endif + #ifdef X509_R_IDP_MISMATCH + {"IDP_MISMATCH", ERR_LIB_X509, X509_R_IDP_MISMATCH}, + #else + {"IDP_MISMATCH", 11, 128}, + #endif + #ifdef X509_R_INVALID_ATTRIBUTES + {"INVALID_ATTRIBUTES", ERR_LIB_X509, X509_R_INVALID_ATTRIBUTES}, + #else + {"INVALID_ATTRIBUTES", 11, 138}, + #endif + #ifdef X509_R_INVALID_DIRECTORY + {"INVALID_DIRECTORY", ERR_LIB_X509, X509_R_INVALID_DIRECTORY}, + #else + {"INVALID_DIRECTORY", 11, 113}, + #endif + #ifdef X509_R_INVALID_DISTPOINT + {"INVALID_DISTPOINT", ERR_LIB_X509, X509_R_INVALID_DISTPOINT}, + #else + {"INVALID_DISTPOINT", 11, 143}, + #endif + #ifdef X509_R_INVALID_FIELD_NAME + {"INVALID_FIELD_NAME", ERR_LIB_X509, X509_R_INVALID_FIELD_NAME}, + #else + {"INVALID_FIELD_NAME", 11, 119}, + #endif + #ifdef X509_R_INVALID_TRUST + {"INVALID_TRUST", ERR_LIB_X509, X509_R_INVALID_TRUST}, + #else + {"INVALID_TRUST", 11, 123}, + #endif + #ifdef X509_R_ISSUER_MISMATCH + {"ISSUER_MISMATCH", ERR_LIB_X509, X509_R_ISSUER_MISMATCH}, + #else + {"ISSUER_MISMATCH", 11, 129}, + #endif + #ifdef X509_R_KEY_TYPE_MISMATCH + {"KEY_TYPE_MISMATCH", ERR_LIB_X509, X509_R_KEY_TYPE_MISMATCH}, + #else + {"KEY_TYPE_MISMATCH", 11, 115}, + #endif + #ifdef X509_R_KEY_VALUES_MISMATCH + {"KEY_VALUES_MISMATCH", ERR_LIB_X509, X509_R_KEY_VALUES_MISMATCH}, + #else + {"KEY_VALUES_MISMATCH", 11, 116}, + #endif + #ifdef X509_R_LOADING_CERT_DIR + {"LOADING_CERT_DIR", ERR_LIB_X509, X509_R_LOADING_CERT_DIR}, + #else + {"LOADING_CERT_DIR", 11, 103}, + #endif + #ifdef X509_R_LOADING_DEFAULTS + {"LOADING_DEFAULTS", ERR_LIB_X509, X509_R_LOADING_DEFAULTS}, + #else + {"LOADING_DEFAULTS", 11, 104}, + #endif + #ifdef X509_R_METHOD_NOT_SUPPORTED + {"METHOD_NOT_SUPPORTED", ERR_LIB_X509, X509_R_METHOD_NOT_SUPPORTED}, + #else + {"METHOD_NOT_SUPPORTED", 11, 124}, + #endif + #ifdef X509_R_NAME_TOO_LONG + {"NAME_TOO_LONG", ERR_LIB_X509, X509_R_NAME_TOO_LONG}, + #else + {"NAME_TOO_LONG", 11, 134}, + #endif + #ifdef X509_R_NEWER_CRL_NOT_NEWER + {"NEWER_CRL_NOT_NEWER", ERR_LIB_X509, X509_R_NEWER_CRL_NOT_NEWER}, + #else + {"NEWER_CRL_NOT_NEWER", 11, 132}, + #endif + #ifdef X509_R_NO_CERTIFICATE_FOUND + {"NO_CERTIFICATE_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_FOUND}, + #else + {"NO_CERTIFICATE_FOUND", 11, 135}, + #endif + #ifdef X509_R_NO_CERTIFICATE_OR_CRL_FOUND + {"NO_CERTIFICATE_OR_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CERTIFICATE_OR_CRL_FOUND}, + #else + {"NO_CERTIFICATE_OR_CRL_FOUND", 11, 136}, + #endif + #ifdef X509_R_NO_CERT_SET_FOR_US_TO_VERIFY + {"NO_CERT_SET_FOR_US_TO_VERIFY", ERR_LIB_X509, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY}, + #else + {"NO_CERT_SET_FOR_US_TO_VERIFY", 11, 105}, + #endif + #ifdef X509_R_NO_CRL_FOUND + {"NO_CRL_FOUND", ERR_LIB_X509, X509_R_NO_CRL_FOUND}, + #else + {"NO_CRL_FOUND", 11, 137}, + #endif + #ifdef X509_R_NO_CRL_NUMBER + {"NO_CRL_NUMBER", ERR_LIB_X509, X509_R_NO_CRL_NUMBER}, + #else + {"NO_CRL_NUMBER", 11, 130}, + #endif + #ifdef X509_R_PUBLIC_KEY_DECODE_ERROR + {"PUBLIC_KEY_DECODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_DECODE_ERROR}, + #else + {"PUBLIC_KEY_DECODE_ERROR", 11, 125}, + #endif + #ifdef X509_R_PUBLIC_KEY_ENCODE_ERROR + {"PUBLIC_KEY_ENCODE_ERROR", ERR_LIB_X509, X509_R_PUBLIC_KEY_ENCODE_ERROR}, + #else + {"PUBLIC_KEY_ENCODE_ERROR", 11, 126}, + #endif + #ifdef X509_R_SHOULD_RETRY + {"SHOULD_RETRY", ERR_LIB_X509, X509_R_SHOULD_RETRY}, + #else + {"SHOULD_RETRY", 11, 106}, + #endif + #ifdef X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN + {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", ERR_LIB_X509, X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN}, + #else + {"UNABLE_TO_FIND_PARAMETERS_IN_CHAIN", 11, 107}, + #endif + #ifdef X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY + {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", ERR_LIB_X509, X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY}, + #else + {"UNABLE_TO_GET_CERTS_PUBLIC_KEY", 11, 108}, + #endif + #ifdef X509_R_UNKNOWN_KEY_TYPE + {"UNKNOWN_KEY_TYPE", ERR_LIB_X509, X509_R_UNKNOWN_KEY_TYPE}, + #else + {"UNKNOWN_KEY_TYPE", 11, 117}, + #endif + #ifdef X509_R_UNKNOWN_NID + {"UNKNOWN_NID", ERR_LIB_X509, X509_R_UNKNOWN_NID}, + #else + {"UNKNOWN_NID", 11, 109}, + #endif + #ifdef X509_R_UNKNOWN_PURPOSE_ID + {"UNKNOWN_PURPOSE_ID", ERR_LIB_X509, X509_R_UNKNOWN_PURPOSE_ID}, + #else + {"UNKNOWN_PURPOSE_ID", 11, 121}, + #endif + #ifdef X509_R_UNKNOWN_SIGID_ALGS + {"UNKNOWN_SIGID_ALGS", ERR_LIB_X509, X509_R_UNKNOWN_SIGID_ALGS}, + #else + {"UNKNOWN_SIGID_ALGS", 11, 144}, + #endif + #ifdef X509_R_UNKNOWN_TRUST_ID + {"UNKNOWN_TRUST_ID", ERR_LIB_X509, X509_R_UNKNOWN_TRUST_ID}, + #else + {"UNKNOWN_TRUST_ID", 11, 120}, + #endif + #ifdef X509_R_UNSUPPORTED_ALGORITHM + {"UNSUPPORTED_ALGORITHM", ERR_LIB_X509, X509_R_UNSUPPORTED_ALGORITHM}, + #else + {"UNSUPPORTED_ALGORITHM", 11, 111}, + #endif + #ifdef X509_R_WRONG_LOOKUP_TYPE + {"WRONG_LOOKUP_TYPE", ERR_LIB_X509, X509_R_WRONG_LOOKUP_TYPE}, + #else + {"WRONG_LOOKUP_TYPE", 11, 112}, + #endif + #ifdef X509_R_WRONG_TYPE + {"WRONG_TYPE", ERR_LIB_X509, X509_R_WRONG_TYPE}, + #else + {"WRONG_TYPE", 11, 122}, + #endif + { NULL } +}; + diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9fdGVzdGNhcGltb2R1bGUuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9fdGVzdGNhcGltb2R1bGUuYw== 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -19,7 +19,6 @@ #include "Python.h" #include "datetime.h" -#include "pydecimal.h" #include "marshal.h" #include "structmember.h" // PyMemberDef #include <float.h> @@ -2774,252 +2773,6 @@ return Py_BuildValue("(lll)", days, seconds, microseconds); } -/* Test decimal API */ -static int decimal_initialized = 0; -static PyObject * -decimal_is_special(PyObject *module, PyObject *dec) -{ - int is_special; - - (void)module; - if (!decimal_initialized) { - if (import_decimal() < 0) { - return NULL; - } - - decimal_initialized = 1; - } - - is_special = PyDec_IsSpecial(dec); - if (is_special < 0) { - return NULL; - } - - return PyBool_FromLong(is_special); -} - -static PyObject * -decimal_is_nan(PyObject *module, PyObject *dec) -{ - int is_nan; - - (void)module; - if (!decimal_initialized) { - if (import_decimal() < 0) { - return NULL; - } - - decimal_initialized = 1; - } - - is_nan = PyDec_IsNaN(dec); - if (is_nan < 0) { - return NULL; - } - - return PyBool_FromLong(is_nan); -} - -static PyObject * -decimal_is_infinite(PyObject *module, PyObject *dec) -{ - int is_infinite; - - (void)module; - if (!decimal_initialized) { - if (import_decimal() < 0) { - return NULL; - } - - decimal_initialized = 1; - } - - is_infinite = PyDec_IsInfinite(dec); - if (is_infinite < 0) { - return NULL; - } - - return PyBool_FromLong(is_infinite); -} - -static PyObject * -decimal_get_digits(PyObject *module, PyObject *dec) -{ - int64_t digits; - - (void)module; - if (!decimal_initialized) { - if (import_decimal() < 0) { - return NULL; - } - - decimal_initialized = 1; - } - - digits = PyDec_GetDigits(dec); - if (digits < 0) { - return NULL; - } - - return PyLong_FromLongLong(digits); -} - -static PyObject * -decimal_as_triple(PyObject *module, PyObject *dec) -{ - PyObject *tuple = NULL; - PyObject *sign, *hi, *lo; - mpd_uint128_triple_t triple; - - (void)module; - if (!decimal_initialized) { - if (import_decimal() < 0) { - return NULL; - } - - decimal_initialized = 1; - } - - triple = PyDec_AsUint128Triple(dec); - if (triple.tag == MPD_TRIPLE_ERROR && PyErr_Occurred()) { - return NULL; - } - - sign = PyLong_FromUnsignedLong(triple.sign); - if (sign == NULL) { - return NULL; - } - - hi = PyLong_FromUnsignedLongLong(triple.hi); - if (hi == NULL) { - Py_DECREF(sign); - return NULL; - } - - lo = PyLong_FromUnsignedLongLong(triple.lo); - if (lo == NULL) { - Py_DECREF(hi); - Py_DECREF(sign); - return NULL; - } - - switch (triple.tag) { - case MPD_TRIPLE_QNAN: - assert(triple.exp == 0); - tuple = Py_BuildValue("(OOOs)", sign, hi, lo, "n"); - break; - - case MPD_TRIPLE_SNAN: - assert(triple.exp == 0); - tuple = Py_BuildValue("(OOOs)", sign, hi, lo, "N"); - break; - - case MPD_TRIPLE_INF: - assert(triple.hi == 0); - assert(triple.lo == 0); - assert(triple.exp == 0); - tuple = Py_BuildValue("(OOOs)", sign, hi, lo, "F"); - break; - - case MPD_TRIPLE_NORMAL: - tuple = Py_BuildValue("(OOOL)", sign, hi, lo, triple.exp); - break; - - case MPD_TRIPLE_ERROR: - PyErr_SetString(PyExc_ValueError, - "value out of bounds for a uint128 triple"); - break; - - default: - PyErr_SetString(PyExc_RuntimeError, - "decimal_as_triple: internal error: unexpected tag"); - break; - } - - Py_DECREF(lo); - Py_DECREF(hi); - Py_DECREF(sign); - - return tuple; -} - -static PyObject * -decimal_from_triple(PyObject *module, PyObject *tuple) -{ - mpd_uint128_triple_t triple = { MPD_TRIPLE_ERROR, 0, 0, 0, 0 }; - PyObject *exp; - unsigned long sign; - - (void)module; - if (!decimal_initialized) { - if (import_decimal() < 0) { - return NULL; - } - - decimal_initialized = 1; - } - - if (!PyTuple_Check(tuple)) { - PyErr_SetString(PyExc_TypeError, "argument must be a tuple"); - return NULL; - } - - if (PyTuple_GET_SIZE(tuple) != 4) { - PyErr_SetString(PyExc_ValueError, "tuple size must be 4"); - return NULL; - } - - sign = PyLong_AsUnsignedLong(PyTuple_GET_ITEM(tuple, 0)); - if (sign == (unsigned long)-1 && PyErr_Occurred()) { - return NULL; - } - if (sign > UINT8_MAX) { - PyErr_SetString(PyExc_ValueError, "sign must be 0 or 1"); - return NULL; - } - triple.sign = (uint8_t)sign; - - triple.hi = PyLong_AsUnsignedLongLong(PyTuple_GET_ITEM(tuple, 1)); - if (triple.hi == (unsigned long long)-1 && PyErr_Occurred()) { - return NULL; - } - - triple.lo = PyLong_AsUnsignedLongLong(PyTuple_GET_ITEM(tuple, 2)); - if (triple.lo == (unsigned long long)-1 && PyErr_Occurred()) { - return NULL; - } - - exp = PyTuple_GET_ITEM(tuple, 3); - if (PyLong_Check(exp)) { - triple.tag = MPD_TRIPLE_NORMAL; - triple.exp = PyLong_AsLongLong(exp); - if (triple.exp == -1 && PyErr_Occurred()) { - return NULL; - } - } - else if (PyUnicode_Check(exp)) { - if (PyUnicode_CompareWithASCIIString(exp, "F") == 0) { - triple.tag = MPD_TRIPLE_INF; - } - else if (PyUnicode_CompareWithASCIIString(exp, "n") == 0) { - triple.tag = MPD_TRIPLE_QNAN; - } - else if (PyUnicode_CompareWithASCIIString(exp, "N") == 0) { - triple.tag = MPD_TRIPLE_SNAN; - } - else { - PyErr_SetString(PyExc_ValueError, "not a valid exponent"); - return NULL; - } - } - else { - PyErr_SetString(PyExc_TypeError, "exponent must be int or string"); - return NULL; - } - - return PyDec_FromUint128Triple(&triple); -} - /* test_thread_state spawns a thread of its own, and that thread releases * `thread_done` when it's finished. The driver code has to know when the * thread finishes, because the thread uses a PyObject (the callable) that @@ -5658,5 +5411,42 @@ } -// Test Py_NewRef() and Py_XNewRef() functions +#define TEST_REFCOUNT() \ + do { \ + PyObject *obj = PyList_New(0); \ + if (obj == NULL) { \ + return NULL; \ + } \ + assert(Py_REFCNT(obj) == 1); \ + \ + /* test Py_NewRef() */ \ + PyObject *ref = Py_NewRef(obj); \ + assert(ref == obj); \ + assert(Py_REFCNT(obj) == 2); \ + Py_DECREF(ref); \ + \ + /* test Py_XNewRef() */ \ + PyObject *xref = Py_XNewRef(obj); \ + assert(xref == obj); \ + assert(Py_REFCNT(obj) == 2); \ + Py_DECREF(xref); \ + \ + assert(Py_XNewRef(NULL) == NULL); \ + \ + Py_DECREF(obj); \ + Py_RETURN_NONE; \ + } while (0) \ + + +// Test Py_NewRef() and Py_XNewRef() macros +static PyObject* +test_refcount_macros(PyObject *self, PyObject *Py_UNUSED(ignored)) +{ + TEST_REFCOUNT(); +} + +#undef Py_NewRef +#undef Py_XNewRef + +// Test Py_NewRef() and Py_XNewRef() functions, after undefining macros. static PyObject* @@ -5662,28 +5452,57 @@ static PyObject* -test_refcount(PyObject *self, PyObject *Py_UNUSED(ignored)) -{ - PyObject *obj = PyList_New(0); - if (obj == NULL) { - return NULL; - } - assert(Py_REFCNT(obj) == 1); - - // Test Py_NewRef() - PyObject *ref = Py_NewRef(obj); - assert(ref == obj); - assert(Py_REFCNT(obj) == 2); - Py_DECREF(ref); - - // Test Py_XNewRef() - PyObject *xref = Py_XNewRef(obj); - assert(xref == obj); - assert(Py_REFCNT(obj) == 2); - Py_DECREF(xref); - - assert(Py_XNewRef(NULL) == NULL); - - Py_DECREF(obj); - Py_RETURN_NONE; +test_refcount_funcs(PyObject *self, PyObject *Py_UNUSED(ignored)) +{ + TEST_REFCOUNT(); +} + + +// Test Py_Is() function +#define TEST_PY_IS() \ + do { \ + PyObject *o_none = Py_None; \ + PyObject *o_true = Py_True; \ + PyObject *o_false = Py_False; \ + PyObject *obj = PyList_New(0); \ + if (obj == NULL) { \ + return NULL; \ + } \ + \ + /* test Py_Is() */ \ + assert(Py_Is(obj, obj)); \ + assert(!Py_Is(obj, o_none)); \ + \ + /* test Py_None */ \ + assert(Py_Is(o_none, o_none)); \ + assert(!Py_Is(obj, o_none)); \ + \ + /* test Py_True */ \ + assert(Py_Is(o_true, o_true)); \ + assert(!Py_Is(o_false, o_true)); \ + assert(!Py_Is(obj, o_true)); \ + \ + /* test Py_False */ \ + assert(Py_Is(o_false, o_false)); \ + assert(!Py_Is(o_true, o_false)); \ + assert(!Py_Is(obj, o_false)); \ + \ + Py_DECREF(obj); \ + Py_RETURN_NONE; \ + } while (0) + +// Test Py_Is() macro +static PyObject* +test_py_is_macros(PyObject *self, PyObject *Py_UNUSED(ignored)) +{ + TEST_PY_IS(); +} + +#undef Py_Is + +// Test Py_Is() function, after undefining its macro. +static PyObject* +test_py_is_funcs(PyObject *self, PyObject *Py_UNUSED(ignored)) +{ + TEST_PY_IS(); } @@ -5735,12 +5554,6 @@ {"PyDateTime_DATE_GET", test_PyDateTime_DATE_GET, METH_O}, {"PyDateTime_TIME_GET", test_PyDateTime_TIME_GET, METH_O}, {"PyDateTime_DELTA_GET", test_PyDateTime_DELTA_GET, METH_O}, - {"decimal_is_special", decimal_is_special, METH_O}, - {"decimal_is_nan", decimal_is_nan, METH_O}, - {"decimal_is_infinite", decimal_is_infinite, METH_O}, - {"decimal_get_digits", decimal_get_digits, METH_O}, - {"decimal_as_triple", decimal_as_triple, METH_O}, - {"decimal_from_triple", decimal_from_triple, METH_O}, {"test_list_api", test_list_api, METH_NOARGS}, {"test_dict_iteration", test_dict_iteration, METH_NOARGS}, {"dict_getitem_knownhash", dict_getitem_knownhash, METH_VARARGS}, @@ -5979,7 +5792,10 @@ {"pynumber_tobase", pynumber_tobase, METH_VARARGS}, {"without_gc", without_gc, METH_O}, {"test_set_type_size", test_set_type_size, METH_NOARGS}, - {"test_refcount", test_refcount, METH_NOARGS}, + {"test_refcount_macros", test_refcount_macros, METH_NOARGS}, + {"test_refcount_funcs", test_refcount_funcs, METH_NOARGS}, + {"test_py_is_macros", test_py_is_macros, METH_NOARGS}, + {"test_py_is_funcs", test_py_is_funcs, METH_NOARGS}, {"fatal_error", test_fatal_error, METH_VARARGS, PyDoc_STR("fatal_error(message, release_gil=False): call Py_FatalError(message)")}, {NULL, NULL} /* sentinel */ diff --git a/Modules/_xxtestfuzz/fuzzer.c b/Modules/_xxtestfuzz/fuzzer.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9feHh0ZXN0ZnV6ei9mdXp6ZXIuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9feHh0ZXN0ZnV6ei9mdXp6ZXIuYw== 100644 --- a/Modules/_xxtestfuzz/fuzzer.c +++ b/Modules/_xxtestfuzz/fuzzer.c @@ -354,7 +354,7 @@ return 0; } /* Ignore non null-terminated strings since _csv can't handle - embeded nulls */ + embedded nulls */ if (memchr(data, '\0', size) == NULL) { return 0; } @@ -383,7 +383,7 @@ } /* Ignore csv.Error because we're probably going to generate - some bad files (embeded new-lines, unterminated quotes etc) */ + some bad files (embedded new-lines, unterminated quotes etc) */ if (PyErr_ExceptionMatches(csv_error)) { PyErr_Clear(); } diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9hcnJheW1vZHVsZS5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9hcnJheW1vZHVsZS5j 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -1136,6 +1136,8 @@ array.array.index v: object + start: slice_index(accept={int}) = 0 + stop: slice_index(accept={int}, c_default="PY_SSIZE_T_MAX") = sys.maxsize / Return index of first occurrence of v in the array. @@ -1139,6 +1141,8 @@ / Return index of first occurrence of v in the array. + +Raise ValueError if the value is not present. [clinic start generated code]*/ static PyObject * @@ -1142,6 +1146,7 @@ [clinic start generated code]*/ static PyObject * -array_array_index(arrayobject *self, PyObject *v) -/*[clinic end generated code: output=d48498d325602167 input=cf619898c6649d08]*/ +array_array_index_impl(arrayobject *self, PyObject *v, Py_ssize_t start, + Py_ssize_t stop) +/*[clinic end generated code: output=c45e777880c99f52 input=089dff7baa7e5a7e]*/ { @@ -1147,7 +1152,16 @@ { - Py_ssize_t i; - - for (i = 0; i < Py_SIZE(self); i++) { + if (start < 0) { + start += Py_SIZE(self); + if (start < 0) { + start = 0; + } + } + if (stop < 0) { + stop += Py_SIZE(self); + } + // Use Py_SIZE() for every iteration in case the array is mutated + // during PyObject_RichCompareBool() + for (Py_ssize_t i = start; i < stop && i < Py_SIZE(self); i++) { PyObject *selfi; int cmp; diff --git a/Modules/clinic/_cursesmodule.c.h b/Modules/clinic/_cursesmodule.c.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9jbGluaWMvX2N1cnNlc21vZHVsZS5jLmg=..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9jbGluaWMvX2N1cnNlc21vZHVsZS5jLmg= 100644 --- a/Modules/clinic/_cursesmodule.c.h +++ b/Modules/clinic/_cursesmodule.c.h @@ -689,7 +689,7 @@ #define _CURSES_WINDOW_ENCLOSE_METHODDEF \ {"enclose", (PyCFunction)(void(*)(void))_curses_window_enclose, METH_FASTCALL, _curses_window_enclose__doc__}, -static long +static PyObject * _curses_window_enclose_impl(PyCursesWindowObject *self, int y, int x); static PyObject * @@ -698,7 +698,6 @@ PyObject *return_value = NULL; int y; int x; - long _return_value; if (!_PyArg_CheckPositional("enclose", nargs, 2, 2)) { goto exit; @@ -711,11 +710,7 @@ if (x == -1 && PyErr_Occurred()) { goto exit; } - _return_value = _curses_window_enclose_impl(self, y, x); - if ((_return_value == -1) && PyErr_Occurred()) { - goto exit; - } - return_value = PyLong_FromLong(_return_value); + return_value = _curses_window_enclose_impl(self, y, x); exit: return return_value; @@ -4289,4 +4284,4 @@ #ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF #define _CURSES_USE_DEFAULT_COLORS_METHODDEF #endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */ -/*[clinic end generated code: output=ae6559aa61200289 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9efc9943a3ac3741 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9jbGluaWMvX2hhc2hvcGVuc3NsLmMuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9jbGluaWMvX2hhc2hvcGVuc3NsLmMuaA== 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -1081,7 +1081,7 @@ static PyObject * _hashlib_hmac_singleshot_impl(PyObject *module, Py_buffer *key, - Py_buffer *msg, const char *digest); + Py_buffer *msg, PyObject *digest); static PyObject * _hashlib_hmac_singleshot(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) @@ -1092,7 +1092,7 @@ PyObject *argsbuf[3]; Py_buffer key = {NULL, NULL}; Py_buffer msg = {NULL, NULL}; - const char *digest; + PyObject *digest; args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 3, 3, 0, argsbuf); if (!args) { @@ -1112,19 +1112,7 @@ _PyArg_BadArgument("hmac_digest", "argument 'msg'", "contiguous buffer", args[1]); goto exit; } - if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("hmac_digest", "argument 'digest'", "str", args[2]); - goto exit; - } - Py_ssize_t digest_length; - digest = PyUnicode_AsUTF8AndSize(args[2], &digest_length); - if (digest == NULL) { - goto exit; - } - if (strlen(digest) != (size_t)digest_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); - goto exit; - } + digest = args[2]; return_value = _hashlib_hmac_singleshot_impl(module, &key, &msg, digest); exit: @@ -1151,7 +1139,7 @@ static PyObject * _hashlib_hmac_new_impl(PyObject *module, Py_buffer *key, PyObject *msg_obj, - const char *digestmod); + PyObject *digestmod); static PyObject * _hashlib_hmac_new(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) @@ -1163,7 +1151,7 @@ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 1; Py_buffer key = {NULL, NULL}; PyObject *msg_obj = NULL; - const char *digestmod = NULL; + PyObject *digestmod = NULL; args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 3, 0, argsbuf); if (!args) { @@ -1185,19 +1173,7 @@ goto skip_optional_pos; } } - if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("hmac_new", "argument 'digestmod'", "str", args[2]); - goto exit; - } - Py_ssize_t digestmod_length; - digestmod = PyUnicode_AsUTF8AndSize(args[2], &digestmod_length); - if (digestmod == NULL) { - goto exit; - } - if (strlen(digestmod) != (size_t)digestmod_length) { - PyErr_SetString(PyExc_ValueError, "embedded null character"); - goto exit; - } + digestmod = args[2]; skip_optional_pos: return_value = _hashlib_hmac_new_impl(module, &key, msg_obj, digestmod); @@ -1417,4 +1393,4 @@ #ifndef _HASHLIB_GET_FIPS_MODE_METHODDEF #define _HASHLIB_GET_FIPS_MODE_METHODDEF #endif /* !defined(_HASHLIB_GET_FIPS_MODE_METHODDEF) */ -/*[clinic end generated code: output=2bbd6159493f44ea input=a9049054013a1b77]*/ +/*[clinic end generated code: output=980087de1b03ad42 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/arraymodule.c.h b/Modules/clinic/arraymodule.c.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9jbGluaWMvYXJyYXltb2R1bGUuYy5o..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9jbGluaWMvYXJyYXltb2R1bGUuYy5o 100644 --- a/Modules/clinic/arraymodule.c.h +++ b/Modules/clinic/arraymodule.c.h @@ -39,6 +39,6 @@ {"count", (PyCFunction)array_array_count, METH_O, array_array_count__doc__}, PyDoc_STRVAR(array_array_index__doc__, -"index($self, v, /)\n" +"index($self, v, start=0, stop=sys.maxsize, /)\n" "--\n" "\n" @@ -43,5 +43,7 @@ "--\n" "\n" -"Return index of first occurrence of v in the array."); +"Return index of first occurrence of v in the array.\n" +"\n" +"Raise ValueError if the value is not present."); #define ARRAY_ARRAY_INDEX_METHODDEF \ @@ -46,6 +48,41 @@ #define ARRAY_ARRAY_INDEX_METHODDEF \ - {"index", (PyCFunction)array_array_index, METH_O, array_array_index__doc__}, + {"index", (PyCFunction)(void(*)(void))array_array_index, METH_FASTCALL, array_array_index__doc__}, + +static PyObject * +array_array_index_impl(arrayobject *self, PyObject *v, Py_ssize_t start, + Py_ssize_t stop); + +static PyObject * +array_array_index(arrayobject *self, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *v; + Py_ssize_t start = 0; + Py_ssize_t stop = PY_SSIZE_T_MAX; + + if (!_PyArg_CheckPositional("index", nargs, 1, 3)) { + goto exit; + } + v = args[0]; + if (nargs < 2) { + goto skip_optional; + } + if (!_PyEval_SliceIndexNotNone(args[1], &start)) { + goto exit; + } + if (nargs < 3) { + goto skip_optional; + } + if (!_PyEval_SliceIndexNotNone(args[2], &stop)) { + goto exit; + } +skip_optional: + return_value = array_array_index_impl(self, v, start, stop); + +exit: + return return_value; +} PyDoc_STRVAR(array_array_remove__doc__, "remove($self, v, /)\n" @@ -535,4 +572,4 @@ #define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \ {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, -/*[clinic end generated code: output=a7f71a18b994c88f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=376001addedc67ee input=a9049054013a1b77]*/ diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9jbGluaWMvcG9zaXhtb2R1bGUuYy5o..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9jbGluaWMvcG9zaXhtb2R1bGUuYy5o 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -1276,6 +1276,47 @@ #endif /* defined(MS_WINDOWS) */ +#if defined(MS_WINDOWS) + +PyDoc_STRVAR(os__path_splitroot__doc__, +"_path_splitroot($module, /, path)\n" +"--\n" +"\n" +"Removes everything after the root on Win32."); + +#define OS__PATH_SPLITROOT_METHODDEF \ + {"_path_splitroot", (PyCFunction)(void(*)(void))os__path_splitroot, METH_FASTCALL|METH_KEYWORDS, os__path_splitroot__doc__}, + +static PyObject * +os__path_splitroot_impl(PyObject *module, path_t *path); + +static PyObject * +os__path_splitroot(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + static const char * const _keywords[] = {"path", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "_path_splitroot", 0}; + PyObject *argsbuf[1]; + path_t path = PATH_T_INITIALIZE("_path_splitroot", "path", 0, 0); + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); + if (!args) { + goto exit; + } + if (!path_converter(args[0], &path)) { + goto exit; + } + return_value = os__path_splitroot_impl(module, &path); + +exit: + /* Cleanup for path */ + path_cleanup(&path); + + return return_value; +} + +#endif /* defined(MS_WINDOWS) */ + PyDoc_STRVAR(os_mkdir__doc__, "mkdir($module, /, path, mode=511, *, dir_fd=None)\n" "--\n" @@ -8664,6 +8705,10 @@ #define OS__GETVOLUMEPATHNAME_METHODDEF #endif /* !defined(OS__GETVOLUMEPATHNAME_METHODDEF) */ +#ifndef OS__PATH_SPLITROOT_METHODDEF + #define OS__PATH_SPLITROOT_METHODDEF +#endif /* !defined(OS__PATH_SPLITROOT_METHODDEF) */ + #ifndef OS_NICE_METHODDEF #define OS_NICE_METHODDEF #endif /* !defined(OS_NICE_METHODDEF) */ @@ -9163,4 +9208,4 @@ #ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF #define OS_WAITSTATUS_TO_EXITCODE_METHODDEF #endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */ -/*[clinic end generated code: output=f3ec08afcd6cd8f8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ede310b1d316d2b2 input=a9049054013a1b77]*/ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9wb3NpeG1vZHVsZS5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9wb3NpeG1vZHVsZS5j 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -19,6 +19,7 @@ FSCTL_GET_REPARSE_POINT is not exported with WIN32_LEAN_AND_MEAN. */ # include <windows.h> +# include <pathcch.h> #endif #ifdef __VMS @@ -4529,6 +4530,53 @@ return result; } + +/*[clinic input] +os._path_splitroot + + path: path_t + +Removes everything after the root on Win32. +[clinic start generated code]*/ + +static PyObject * +os__path_splitroot_impl(PyObject *module, path_t *path) +/*[clinic end generated code: output=ab7f1a88b654581c input=dc93b1d3984cffb6]*/ +{ + wchar_t *buffer; + wchar_t *end; + PyObject *result = NULL; + HRESULT ret; + + buffer = (wchar_t*)PyMem_Malloc(sizeof(wchar_t) * (wcslen(path->wide) + 1)); + if (!buffer) { + return NULL; + } + wcscpy(buffer, path->wide); + for (wchar_t *p = wcschr(buffer, L'/'); p; p = wcschr(p, L'/')) { + *p = L'\\'; + } + + Py_BEGIN_ALLOW_THREADS + ret = PathCchSkipRoot(buffer, &end); + Py_END_ALLOW_THREADS + if (FAILED(ret)) { + result = Py_BuildValue("sO", "", path->object); + } else if (end != buffer) { + size_t rootLen = (size_t)(end - buffer); + result = Py_BuildValue("NN", + PyUnicode_FromWideChar(path->wide, rootLen), + PyUnicode_FromWideChar(path->wide + rootLen, -1) + ); + } else { + result = Py_BuildValue("Os", path->object, ""); + } + PyMem_Free(buffer); + + return result; +} + + #endif /* MS_WINDOWS */ @@ -15244,6 +15292,7 @@ OS__GETDISKUSAGE_METHODDEF OS__GETFINALPATHNAME_METHODDEF OS__GETVOLUMEPATHNAME_METHODDEF + OS__PATH_SPLITROOT_METHODDEF OS_GETLOADAVG_METHODDEF OS_URANDOM_METHODDEF OS_SETRESUID_METHODDEF diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9zb2NrZXRtb2R1bGUuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9zb2NrZXRtb2R1bGUuYw== 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -7946,6 +7946,9 @@ #ifdef IPPROTO_BIP PyModule_AddIntMacro(m, IPPROTO_BIP); #endif +#ifdef IPPROTO_MPTCP + PyModule_AddIntMacro(m, IPPROTO_MPTCP); +#endif /**/ #ifdef IPPROTO_RAW PyModule_AddIntMacro(m, IPPROTO_RAW); diff --git a/Modules/symtablemodule.c b/Modules/symtablemodule.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy9zeW10YWJsZW1vZHVsZS5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy9zeW10YWJsZW1vZHVsZS5j 100644 --- a/Modules/symtablemodule.c +++ b/Modules/symtablemodule.c @@ -1,6 +1,4 @@ #include "Python.h" - -#include "Python-ast.h" #include "pycore_symtable.h" // struct symtable #include "clinic/symtablemodule.c.h" diff --git a/Modules/xxlimited.c b/Modules/xxlimited.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy94eGxpbWl0ZWQuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy94eGxpbWl0ZWQuYw== 100644 --- a/Modules/xxlimited.c +++ b/Modules/xxlimited.c @@ -55,6 +55,8 @@ pass */ +#define Py_LIMITED_API 0x030a0000 + #include "Python.h" // Module state diff --git a/Modules/xxlimited_35.c b/Modules/xxlimited_35.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_TW9kdWxlcy94eGxpbWl0ZWRfMzUuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_TW9kdWxlcy94eGxpbWl0ZWRfMzUuYw== 100644 --- a/Modules/xxlimited_35.c +++ b/Modules/xxlimited_35.c @@ -5,7 +5,7 @@ * See the xxlimited module for an extension module template. */ -/* Xxo objects */ +#define Py_LIMITED_API 0x03050000 #include "Python.h" @@ -9,6 +9,8 @@ #include "Python.h" +/* Xxo objects */ + static PyObject *ErrorObject; typedef struct { diff --git a/Objects/abstract.c b/Objects/abstract.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9hYnN0cmFjdC5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9hYnN0cmFjdC5j 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -2738,6 +2738,26 @@ } } +PyObject * +PyObject_GetAiter(PyObject *o) { + PyTypeObject *t = Py_TYPE(o); + unaryfunc f; + + if (t->tp_as_async == NULL || t->tp_as_async->am_aiter == NULL) { + return type_error("'%.200s' object is not an AsyncIterable", o); + } + f = t->tp_as_async->am_aiter; + PyObject *it = (*f)(o); + if (it != NULL && !PyAiter_Check(it)) { + PyErr_Format(PyExc_TypeError, + "aiter() returned non-AsyncIterator of type '%.100s'", + Py_TYPE(it)->tp_name); + Py_DECREF(it); + it = NULL; + } + return it; +} + int PyIter_Check(PyObject *obj) { @@ -2746,6 +2766,17 @@ tp->tp_iternext != &_PyObject_NextNotImplemented); } +int +PyAiter_Check(PyObject *obj) +{ + PyTypeObject *tp = Py_TYPE(obj); + return (tp->tp_as_async != NULL && + tp->tp_as_async->am_aiter != NULL && + tp->tp_as_async->am_aiter != &_PyObject_NextNotImplemented && + tp->tp_as_async->am_anext != NULL && + tp->tp_as_async->am_anext != &_PyObject_NextNotImplemented); +} + /* Return next item. * If an error occurs, return NULL. PyErr_Occurred() will be true. * If the iteration terminates normally, return NULL and clear the diff --git a/Objects/bytes_methods.c b/Objects/bytes_methods.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9ieXRlc19tZXRob2RzLmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9ieXRlc19tZXRob2RzLmM= 100644 --- a/Objects/bytes_methods.c +++ b/Objects/bytes_methods.c @@ -115,8 +115,7 @@ { const char *p = cptr; const char *end = p + len; - const char *aligned_end = (const char *) _Py_ALIGN_DOWN(end, SIZEOF_SIZE_T); while (p < end) { /* Fast path, see in STRINGLIB(utf8_decode) in stringlib/codecs.h for an explanation. */ @@ -119,7 +118,7 @@ while (p < end) { /* Fast path, see in STRINGLIB(utf8_decode) in stringlib/codecs.h for an explanation. */ - if (_Py_IS_ALIGNED(p, SIZEOF_SIZE_T)) { + if (_Py_IS_ALIGNED(p, ALIGNOF_SIZE_T)) { /* Help allocation */ const char *_p = p; @@ -124,6 +123,6 @@ /* Help allocation */ const char *_p = p; - while (_p < aligned_end) { + while (_p + SIZEOF_SIZE_T <= end) { size_t value = *(const size_t *) _p; if (value & ASCII_CHAR_MASK) { Py_RETURN_FALSE; diff --git a/Objects/codeobject.c b/Objects/codeobject.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9jb2Rlb2JqZWN0LmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9jb2Rlb2JqZWN0LmM= 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -1246,7 +1246,7 @@ int PyCode_Addr2Line(PyCodeObject *co, int addrq) { - if (addrq == -1) { + if (addrq < 0) { return co->co_firstlineno; } assert(addrq >= 0 && addrq < PyBytes_GET_SIZE(co->co_code)); diff --git a/Objects/dictobject.c b/Objects/dictobject.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9kaWN0b2JqZWN0LmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9kaWN0b2JqZWN0LmM= 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -4988,5 +4988,5 @@ _PyDict_NewKeysForClass(void) { PyDictKeysObject *keys = new_keys_object(PyDict_MINSIZE); - if (keys == NULL) + if (keys == NULL) { PyErr_Clear(); @@ -4992,3 +4992,4 @@ PyErr_Clear(); - else + } + else { keys->dk_lookup = lookdict_split; @@ -4994,4 +4995,5 @@ keys->dk_lookup = lookdict_split; + } return keys; } diff --git a/Objects/exceptions.c b/Objects/exceptions.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9leGNlcHRpb25zLmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9leGNlcHRpb25zLmM= 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -1341,9 +1341,76 @@ /* * AttributeError extends Exception */ -SimpleExtendsException(PyExc_Exception, AttributeError, - "Attribute not found."); - + +static int +AttributeError_init(PyAttributeErrorObject *self, PyObject *args, PyObject *kwds) +{ + static char *kwlist[] = {"name", "obj", NULL}; + PyObject *name = NULL; + PyObject *obj = NULL; + + if (BaseException_init((PyBaseExceptionObject *)self, args, NULL) == -1) { + return -1; + } + + PyObject *empty_tuple = PyTuple_New(0); + if (!empty_tuple) { + return -1; + } + if (!PyArg_ParseTupleAndKeywords(empty_tuple, kwds, "|$OO:AttributeError", kwlist, + &name, &obj)) { + Py_DECREF(empty_tuple); + return -1; + } + Py_DECREF(empty_tuple); + + Py_XINCREF(name); + Py_XSETREF(self->name, name); + + Py_XINCREF(obj); + Py_XSETREF(self->obj, obj); + + return 0; +} + +static int +AttributeError_clear(PyAttributeErrorObject *self) +{ + Py_CLEAR(self->obj); + Py_CLEAR(self->name); + return BaseException_clear((PyBaseExceptionObject *)self); +} + +static void +AttributeError_dealloc(PyAttributeErrorObject *self) +{ + _PyObject_GC_UNTRACK(self); + AttributeError_clear(self); + Py_TYPE(self)->tp_free((PyObject *)self); +} + +static int +AttributeError_traverse(PyAttributeErrorObject *self, visitproc visit, void *arg) +{ + Py_VISIT(self->obj); + Py_VISIT(self->name); + return BaseException_traverse((PyBaseExceptionObject *)self, visit, arg); +} + +static PyMemberDef AttributeError_members[] = { + {"name", T_OBJECT, offsetof(PyAttributeErrorObject, name), 0, PyDoc_STR("attribute name")}, + {"obj", T_OBJECT, offsetof(PyAttributeErrorObject, obj), 0, PyDoc_STR("object")}, + {NULL} /* Sentinel */ +}; + +static PyMethodDef AttributeError_methods[] = { + {NULL} /* Sentinel */ +}; + +ComplexExtendsException(PyExc_Exception, AttributeError, + AttributeError, 0, + AttributeError_methods, AttributeError_members, + 0, BaseException_str, "Attribute not found."); /* * SyntaxError extends Exception @@ -2468,6 +2535,13 @@ /* + * EncodingWarning extends Warning + */ +SimpleExtendsException(PyExc_Warning, EncodingWarning, + "Base class for warnings about encodings."); + + +/* * ResourceWarning extends Warning */ SimpleExtendsException(PyExc_Warning, ResourceWarning, @@ -2595,6 +2669,7 @@ PRE_INIT(BufferError); PRE_INIT(Warning); PRE_INIT(UserWarning); + PRE_INIT(EncodingWarning); PRE_INIT(DeprecationWarning); PRE_INIT(PendingDeprecationWarning); PRE_INIT(SyntaxWarning); @@ -2737,6 +2812,7 @@ POST_INIT(BufferError); POST_INIT(Warning); POST_INIT(UserWarning); + POST_INIT(EncodingWarning); POST_INIT(DeprecationWarning); POST_INIT(PendingDeprecationWarning); POST_INIT(SyntaxWarning); diff --git a/Objects/floatobject.c b/Objects/floatobject.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9mbG9hdG9iamVjdC5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9mbG9hdG9iamVjdC5j 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -1968,7 +1968,7 @@ .tp_vectorcall = (vectorcallfunc)float_vectorcall, }; -int +void _PyFloat_Init(void) { /* We attempt to determine if this machine is using IEEE @@ -2016,4 +2016,5 @@ double_format = detected_double_format; float_format = detected_float_format; +} @@ -2019,4 +2020,7 @@ +int +_PyFloat_InitTypes(void) +{ /* Init float info */ if (FloatInfoType.tp_name == NULL) { if (PyStructSequence_InitType2(&FloatInfoType, &floatinfo_desc) < 0) { @@ -2020,6 +2024,6 @@ /* Init float info */ if (FloatInfoType.tp_name == NULL) { if (PyStructSequence_InitType2(&FloatInfoType, &floatinfo_desc) < 0) { - return 0; + return -1; } } @@ -2024,6 +2028,6 @@ } } - return 1; + return 0; } void diff --git a/Objects/frameobject.c b/Objects/frameobject.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9mcmFtZW9iamVjdC5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9mcmFtZW9iamVjdC5j 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -15,7 +15,6 @@ {"f_code", T_OBJECT, OFF(f_code), READONLY}, {"f_builtins", T_OBJECT, OFF(f_builtins), READONLY}, {"f_globals", T_OBJECT, OFF(f_globals), READONLY}, - {"f_lasti", T_INT, OFF(f_lasti), READONLY}, {"f_trace_lines", T_BOOL, OFF(f_trace_lines), 0}, {"f_trace_opcodes", T_BOOL, OFF(f_trace_opcodes), 0}, {NULL} /* Sentinel */ @@ -46,7 +45,7 @@ return f->f_lineno; } else { - return PyCode_Addr2Line(f->f_code, f->f_lasti); + return PyCode_Addr2Line(f->f_code, f->f_lasti*2); } } @@ -56,6 +55,15 @@ return PyLong_FromLong(PyFrame_GetLineNumber(f)); } +static PyObject * +frame_getlasti(PyFrameObject *f, void *closure) +{ + if (f->f_lasti < 0) { + return PyLong_FromLong(-1); + } + return PyLong_FromLong(f->f_lasti*2); +} + /* Given the index of the effective opcode, scan back to construct the oparg with EXTENDED_ARG */ @@ -135,7 +143,7 @@ case POP_JUMP_IF_FALSE: case POP_JUMP_IF_TRUE: case JUMP_IF_NOT_EXC_MATCH: - j = get_arg(code, i) / sizeof(_Py_CODEUNIT); + j = get_arg(code, i); assert(j < len); if (blocks[j] == -1 && j < i) { todo = 1; @@ -145,7 +153,7 @@ blocks[i+1] = block_stack; break; case JUMP_ABSOLUTE: - j = get_arg(code, i) / sizeof(_Py_CODEUNIT); + j = get_arg(code, i); assert(j < len); if (blocks[j] == -1 && j < i) { todo = 1; @@ -154,7 +162,7 @@ blocks[j] = block_stack; break; case SETUP_FINALLY: - j = get_arg(code, i) / sizeof(_Py_CODEUNIT) + i + 1; + j = get_arg(code, i) + i + 1; assert(j < len); except_stack = push_block(block_stack, Except); assert(blocks[j] == -1 || blocks[j] == except_stack); @@ -164,7 +172,7 @@ break; case SETUP_WITH: case SETUP_ASYNC_WITH: - j = get_arg(code, i) / sizeof(_Py_CODEUNIT) + i + 1; + j = get_arg(code, i) + i + 1; assert(j < len); except_stack = push_block(block_stack, Except); assert(blocks[j] == -1 || blocks[j] == except_stack); @@ -173,7 +181,7 @@ blocks[i+1] = block_stack; break; case JUMP_FORWARD: - j = get_arg(code, i) / sizeof(_Py_CODEUNIT) + i + 1; + j = get_arg(code, i) + i + 1; assert(j < len); assert(blocks[j] == -1 || blocks[j] == block_stack); blocks[j] = block_stack; @@ -186,7 +194,7 @@ case FOR_ITER: blocks[i+1] = block_stack; block_stack = pop_block(block_stack); - j = get_arg(code, i) / sizeof(_Py_CODEUNIT) + i + 1; + j = get_arg(code, i) + i + 1; assert(j < len); assert(blocks[j] == -1 || blocks[j] == block_stack); blocks[j] = block_stack; @@ -422,7 +430,7 @@ int64_t target_block_stack = -1; int64_t best_block_stack = -1; int best_addr = -1; - int64_t start_block_stack = blocks[f->f_lasti/sizeof(_Py_CODEUNIT)]; + int64_t start_block_stack = blocks[f->f_lasti]; const char *msg = "cannot find bytecode for specified line"; for (int i = 0; i < len; i++) { if (lines[i] == new_lineno) { @@ -431,7 +439,7 @@ msg = NULL; if (target_block_stack > best_block_stack) { best_block_stack = target_block_stack; - best_addr = i*sizeof(_Py_CODEUNIT); + best_addr = i; } } else if (msg) { @@ -511,6 +519,7 @@ {"f_lineno", (getter)frame_getlineno, (setter)frame_setlineno, NULL}, {"f_trace", (getter)frame_gettrace, (setter)frame_settrace, NULL}, + {"f_lasti", (getter)frame_getlasti, NULL, NULL}, {0} }; diff --git a/Objects/funcobject.c b/Objects/funcobject.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9mdW5jb2JqZWN0LmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9mdW5jb2JqZWN0LmM= 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -639,7 +639,7 @@ func_repr(PyFunctionObject *op) { return PyUnicode_FromFormat("<function %U at %p>", - op->func_qualname, op); + op->func_qualname, op); } static int @@ -715,6 +715,50 @@ }; +static int +functools_copy_attr(PyObject *wrapper, PyObject *wrapped, PyObject *name) +{ + PyObject *value = PyObject_GetAttr(wrapped, name); + if (value == NULL) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); + return 0; + } + return -1; + } + + int res = PyObject_SetAttr(wrapper, name, value); + Py_DECREF(value); + return res; +} + +// Similar to functools.wraps(wrapper, wrapped) +static int +functools_wraps(PyObject *wrapper, PyObject *wrapped) +{ +#define COPY_ATTR(ATTR) \ + do { \ + _Py_IDENTIFIER(ATTR); \ + PyObject *attr = _PyUnicode_FromId(&PyId_ ## ATTR); \ + if (attr == NULL) { \ + return -1; \ + } \ + if (functools_copy_attr(wrapper, wrapped, attr) < 0) { \ + return -1; \ + } \ + } while (0) \ + + COPY_ATTR(__module__); + COPY_ATTR(__name__); + COPY_ATTR(__qualname__); + COPY_ATTR(__doc__); + COPY_ATTR(__annotations__); + return 0; + +#undef COPY_ATTR +} + + /* Class method object */ /* A class method receives the class as implicit first argument, @@ -798,8 +842,12 @@ return -1; Py_INCREF(callable); Py_XSETREF(cm->cm_callable, callable); + + if (functools_wraps((PyObject *)cm, cm->cm_callable) < 0) { + return -1; + } return 0; } static PyMemberDef cm_memberlist[] = { {"__func__", T_OBJECT, offsetof(classmethod, cm_callable), READONLY}, @@ -801,8 +849,9 @@ return 0; } static PyMemberDef cm_memberlist[] = { {"__func__", T_OBJECT, offsetof(classmethod, cm_callable), READONLY}, + {"__wrapped__", T_OBJECT, offsetof(classmethod, cm_callable), READONLY}, {NULL} /* Sentinel */ }; @@ -821,10 +870,8 @@ static PyGetSetDef cm_getsetlist[] = { {"__isabstractmethod__", - (getter)cm_get___isabstractmethod__, NULL, - NULL, - NULL}, + (getter)cm_get___isabstractmethod__, NULL, NULL, NULL}, {"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict, NULL, NULL}, {NULL} /* Sentinel */ }; @@ -827,7 +874,13 @@ {"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict, NULL, NULL}, {NULL} /* Sentinel */ }; +static PyObject* +cm_repr(classmethod *cm) +{ + return PyUnicode_FromFormat("<classmethod(%R)>", cm->cm_callable); +} + PyDoc_STRVAR(classmethod_doc, "classmethod(function) -> method\n\ \n\ @@ -860,7 +913,7 @@ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_as_async */ - 0, /* tp_repr */ + (reprfunc)cm_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ @@ -980,6 +1033,10 @@ return -1; Py_INCREF(callable); Py_XSETREF(sm->sm_callable, callable); + + if (functools_wraps((PyObject *)sm, sm->sm_callable) < 0) { + return -1; + } return 0; } @@ -983,5 +1040,12 @@ return 0; } +static PyObject* +sm_call(PyObject *callable, PyObject *args, PyObject *kwargs) +{ + staticmethod *sm = (staticmethod *)callable; + return PyObject_Call(sm->sm_callable, args, kwargs); +} + static PyMemberDef sm_memberlist[] = { {"__func__", T_OBJECT, offsetof(staticmethod, sm_callable), READONLY}, @@ -986,5 +1050,6 @@ static PyMemberDef sm_memberlist[] = { {"__func__", T_OBJECT, offsetof(staticmethod, sm_callable), READONLY}, + {"__wrapped__", T_OBJECT, offsetof(staticmethod, sm_callable), READONLY}, {NULL} /* Sentinel */ }; @@ -1003,10 +1068,8 @@ static PyGetSetDef sm_getsetlist[] = { {"__isabstractmethod__", - (getter)sm_get___isabstractmethod__, NULL, - NULL, - NULL}, + (getter)sm_get___isabstractmethod__, NULL, NULL, NULL}, {"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict, NULL, NULL}, {NULL} /* Sentinel */ }; @@ -1009,7 +1072,13 @@ {"__dict__", PyObject_GenericGetDict, PyObject_GenericSetDict, NULL, NULL}, {NULL} /* Sentinel */ }; +static PyObject* +sm_repr(staticmethod *sm) +{ + return PyUnicode_FromFormat("<staticmethod(%R)>", sm->sm_callable); +} + PyDoc_STRVAR(staticmethod_doc, "staticmethod(function) -> method\n\ \n\ @@ -1040,8 +1109,8 @@ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_as_async */ - 0, /* tp_repr */ + (reprfunc)sm_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ @@ -1044,8 +1113,8 @@ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ - 0, /* tp_call */ + sm_call, /* tp_call */ 0, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ diff --git a/Objects/genobject.c b/Objects/genobject.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9nZW5vYmplY3QuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9nZW5vYmplY3QuYw== 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -176,27 +176,12 @@ } assert(_PyFrame_IsRunnable(f)); - if (f->f_lasti == -1) { - if (arg && arg != Py_None) { - const char *msg = "can't send non-None value to a " - "just-started generator"; - if (PyCoro_CheckExact(gen)) { - msg = NON_INIT_CORO_MSG; - } - else if (PyAsyncGen_CheckExact(gen)) { - msg = "can't send non-None value to a " - "just-started async generator"; - } - PyErr_SetString(PyExc_TypeError, msg); - return PYGEN_ERROR; - } - } else { - /* Push arg onto the frame's value stack */ - result = arg ? arg : Py_None; - Py_INCREF(result); - gen->gi_frame->f_valuestack[gen->gi_frame->f_stackdepth] = result; - gen->gi_frame->f_stackdepth++; - } + assert(f->f_lasti >= 0 || ((unsigned char *)PyBytes_AS_STRING(f->f_code->co_code))[0] == GEN_START); + /* Push arg onto the frame's value stack */ + result = arg ? arg : Py_None; + Py_INCREF(result); + gen->gi_frame->f_valuestack[gen->gi_frame->f_stackdepth] = result; + gen->gi_frame->f_stackdepth++; /* Generators always return to their most recent caller, not * necessarily their creator. */ @@ -357,7 +342,7 @@ return NULL; } - if (code[f->f_lasti + sizeof(_Py_CODEUNIT)] != YIELD_FROM) + if (code[(f->f_lasti+1)*sizeof(_Py_CODEUNIT)] != YIELD_FROM) return NULL; assert(f->f_stackdepth > 0); yf = f->f_valuestack[f->f_stackdepth-1]; @@ -481,7 +466,7 @@ Py_DECREF(ret); /* Termination repetition of YIELD_FROM */ assert(gen->gi_frame->f_lasti >= 0); - gen->gi_frame->f_lasti += sizeof(_Py_CODEUNIT); + gen->gi_frame->f_lasti += 1; if (_PyGen_FetchStopIterationValue(&val) == 0) { ret = gen_send(gen, val); Py_DECREF(val); diff --git a/Objects/iterobject.c b/Objects/iterobject.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9pdGVyb2JqZWN0LmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9pdGVyb2JqZWN0LmM= 100644 --- a/Objects/iterobject.c +++ b/Objects/iterobject.c @@ -157,7 +157,7 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ 0, /* tp_doc */ (traverseproc)iter_traverse, /* tp_traverse */ 0, /* tp_clear */ @@ -276,7 +276,7 @@ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ 0, /* tp_doc */ (traverseproc)calliter_traverse, /* tp_traverse */ 0, /* tp_clear */ @@ -288,3 +288,140 @@ }; +/* -------------------------------------- */ + +typedef struct { + PyObject_HEAD + PyObject *wrapped; + PyObject *default_value; +} anextawaitableobject; + +static void +anextawaitable_dealloc(anextawaitableobject *obj) +{ + _PyObject_GC_UNTRACK(obj); + Py_XDECREF(obj->wrapped); + Py_XDECREF(obj->default_value); + PyObject_GC_Del(obj); +} + +static int +anextawaitable_traverse(anextawaitableobject *obj, visitproc visit, void *arg) +{ + Py_VISIT(obj->wrapped); + Py_VISIT(obj->default_value); + return 0; +} + +static PyObject * +anextawaitable_iternext(anextawaitableobject *obj) +{ + /* Consider the following class: + * + * class A: + * async def __anext__(self): + * ... + * a = A() + * + * Then `await anext(a)` should call + * a.__anext__().__await__().__next__() + * + * On the other hand, given + * + * async def agen(): + * yield 1 + * yield 2 + * gen = agen() + * + * Then `await anext(gen)` can just call + * gen.__anext__().__next__() + */ + assert(obj->wrapped != NULL); + PyObject *awaitable = _PyCoro_GetAwaitableIter(obj->wrapped); + if (awaitable == NULL) { + return NULL; + } + if (Py_TYPE(awaitable)->tp_iternext == NULL) { + /* _PyCoro_GetAwaitableIter returns a Coroutine, a Generator, + * or an iterator. Of these, only coroutines lack tp_iternext. + */ + assert(PyCoro_CheckExact(awaitable)); + unaryfunc getter = Py_TYPE(awaitable)->tp_as_async->am_await; + PyObject *new_awaitable = getter(awaitable); + if (new_awaitable == NULL) { + Py_DECREF(awaitable); + return NULL; + } + Py_SETREF(awaitable, new_awaitable); + if (Py_TYPE(awaitable)->tp_iternext == NULL) { + PyErr_SetString(PyExc_TypeError, + "__await__ returned a non-iterable"); + Py_DECREF(awaitable); + return NULL; + } + } + PyObject *result = (*Py_TYPE(awaitable)->tp_iternext)(awaitable); + Py_DECREF(awaitable); + if (result != NULL) { + return result; + } + if (PyErr_ExceptionMatches(PyExc_StopAsyncIteration)) { + _PyGen_SetStopIterationValue(obj->default_value); + } + return NULL; +} + +static PyAsyncMethods anextawaitable_as_async = { + PyObject_SelfIter, /* am_await */ + 0, /* am_aiter */ + 0, /* am_anext */ + 0, /* am_send */ +}; + +PyTypeObject _PyAnextAwaitable_Type = { + PyVarObject_HEAD_INIT(&PyType_Type, 0) + "anext_awaitable", /* tp_name */ + sizeof(anextawaitableobject), /* tp_basicsize */ + 0, /* tp_itemsize */ + /* methods */ + (destructor)anextawaitable_dealloc, /* tp_dealloc */ + 0, /* tp_vectorcall_offset */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + &anextawaitable_as_async, /* tp_as_async */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ + 0, /* tp_doc */ + (traverseproc)anextawaitable_traverse, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + PyObject_SelfIter, /* tp_iter */ + (unaryfunc)anextawaitable_iternext, /* tp_iternext */ + 0, /* tp_methods */ +}; + +PyObject * +PyAnextAwaitable_New(PyObject *awaitable, PyObject *default_value) +{ + anextawaitableobject *anext = PyObject_GC_New( + anextawaitableobject, &_PyAnextAwaitable_Type); + if (anext == NULL) { + return NULL; + } + Py_INCREF(awaitable); + anext->wrapped = awaitable; + Py_INCREF(default_value); + anext->default_value = default_value; + _PyObject_GC_TRACK(anext); + return (PyObject *)anext; +} diff --git a/Objects/longobject.c b/Objects/longobject.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9sb25nb2JqZWN0LmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9sb25nb2JqZWN0LmM= 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -5719,12 +5719,16 @@ interp->small_ints[i] = v; } - - if (_Py_IsMainInterpreter(interp)) { - /* initialize int_info */ - if (Int_InfoType.tp_name == NULL) { - if (PyStructSequence_InitType2(&Int_InfoType, &int_info_desc) < 0) { - return 0; - } + return 0; +} + + +int +_PyLong_InitTypes(void) +{ + /* initialize int_info */ + if (Int_InfoType.tp_name == NULL) { + if (PyStructSequence_InitType2(&Int_InfoType, &int_info_desc) < 0) { + return -1; } } @@ -5729,7 +5733,6 @@ } } - - return 1; + return 0; } void diff --git a/Objects/object.c b/Objects/object.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9vYmplY3QuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9vYmplY3QuYw== 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -10,6 +10,8 @@ #include "pycore_pylifecycle.h" #include "pycore_pymem.h" // _PyMem_IsPtrFreed() #include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_symtable.h" // PySTEntry_Type +#include "pycore_unionobject.h" // _Py_UnionType #include "frameobject.h" #include "interpreteridobject.h" @@ -13,6 +15,11 @@ #include "frameobject.h" #include "interpreteridobject.h" +#ifdef Py_LIMITED_API + // Prevent recursive call _Py_IncRef() <=> Py_INCREF() +# error "Py_LIMITED_API macro must not be defined" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -136,6 +143,18 @@ Py_XDECREF(o); } +void +_Py_IncRef(PyObject *o) +{ + Py_INCREF(o); +} + +void +_Py_DecRef(PyObject *o) +{ + Py_DECREF(o); +} + PyObject * PyObject_Init(PyObject *op, PyTypeObject *tp) { @@ -865,7 +884,29 @@ return result; } +static inline int +set_attribute_error_context(PyObject* v, PyObject* name) +{ + assert(PyErr_Occurred()); + _Py_IDENTIFIER(name); + _Py_IDENTIFIER(obj); + // Intercept AttributeError exceptions and augment them to offer + // suggestions later. + if (PyErr_ExceptionMatches(PyExc_AttributeError)){ + PyObject *type, *value, *traceback; + PyErr_Fetch(&type, &value, &traceback); + PyErr_NormalizeException(&type, &value, &traceback); + if (PyErr_GivenExceptionMatches(value, PyExc_AttributeError) && + (_PyObject_SetAttrId(value, &PyId_name, name) || + _PyObject_SetAttrId(value, &PyId_obj, v))) { + return 1; + } + PyErr_Restore(type, value, traceback); + } + return 0; +} + PyObject * PyObject_GetAttr(PyObject *v, PyObject *name) { PyTypeObject *tp = Py_TYPE(v); @@ -868,11 +909,10 @@ PyObject * PyObject_GetAttr(PyObject *v, PyObject *name) { PyTypeObject *tp = Py_TYPE(v); - if (!PyUnicode_Check(name)) { PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", Py_TYPE(name)->tp_name); return NULL; } @@ -873,10 +913,13 @@ if (!PyUnicode_Check(name)) { PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", Py_TYPE(name)->tp_name); return NULL; } - if (tp->tp_getattro != NULL) - return (*tp->tp_getattro)(v, name); - if (tp->tp_getattr != NULL) { + + PyObject* result = NULL; + if (tp->tp_getattro != NULL) { + result = (*tp->tp_getattro)(v, name); + } + else if (tp->tp_getattr != NULL) { const char *name_str = PyUnicode_AsUTF8(name); @@ -882,3 +925,3 @@ const char *name_str = PyUnicode_AsUTF8(name); - if (name_str == NULL) + if (name_str == NULL) { return NULL; @@ -884,3 +927,4 @@ return NULL; - return (*tp->tp_getattr)(v, (char *)name_str); + } + result = (*tp->tp_getattr)(v, (char *)name_str); } @@ -886,8 +930,14 @@ } - PyErr_Format(PyExc_AttributeError, - "'%.50s' object has no attribute '%U'", - tp->tp_name, name); - return NULL; + else { + PyErr_Format(PyExc_AttributeError, + "'%.50s' object has no attribute '%U'", + tp->tp_name, name); + } + + if (result == NULL) { + set_attribute_error_context(v, name); + } + return result; } int @@ -1146,6 +1196,8 @@ PyErr_Format(PyExc_AttributeError, "'%.50s' object has no attribute '%U'", tp->tp_name, name); + + set_attribute_error_context(obj, name); return 0; } @@ -1728,5 +1780,5 @@ return status; } -#define INIT_TYPE(TYPE, NAME) \ +#define INIT_TYPE(TYPE) \ do { \ @@ -1732,6 +1784,6 @@ do { \ - if (PyType_Ready(TYPE) < 0) { \ - return _PyStatus_ERR("Can't initialize " NAME " type"); \ + if (PyType_Ready(&(TYPE)) < 0) { \ + return _PyStatus_ERR("Can't initialize " #TYPE " type"); \ } \ } while (0) @@ -1735,71 +1787,99 @@ } \ } while (0) - INIT_TYPE(&PyBaseObject_Type, "object"); - INIT_TYPE(&PyType_Type, "type"); - INIT_TYPE(&_PyWeakref_RefType, "weakref"); - INIT_TYPE(&_PyWeakref_CallableProxyType, "callable weakref proxy"); - INIT_TYPE(&_PyWeakref_ProxyType, "weakref proxy"); - INIT_TYPE(&PyLong_Type, "int"); - INIT_TYPE(&PyBool_Type, "bool"); - INIT_TYPE(&PyByteArray_Type, "bytearray"); - INIT_TYPE(&PyBytes_Type, "str"); - INIT_TYPE(&PyList_Type, "list"); - INIT_TYPE(&_PyNone_Type, "None"); - INIT_TYPE(&_PyNotImplemented_Type, "NotImplemented"); - INIT_TYPE(&PyTraceBack_Type, "traceback"); - INIT_TYPE(&PySuper_Type, "super"); - INIT_TYPE(&PyRange_Type, "range"); - INIT_TYPE(&PyDict_Type, "dict"); - INIT_TYPE(&PyDictKeys_Type, "dict keys"); - INIT_TYPE(&PyDictValues_Type, "dict values"); - INIT_TYPE(&PyDictItems_Type, "dict items"); - INIT_TYPE(&PyDictRevIterKey_Type, "reversed dict keys"); - INIT_TYPE(&PyDictRevIterValue_Type, "reversed dict values"); - INIT_TYPE(&PyDictRevIterItem_Type, "reversed dict items"); - INIT_TYPE(&PyODict_Type, "OrderedDict"); - INIT_TYPE(&PyODictKeys_Type, "odict_keys"); - INIT_TYPE(&PyODictItems_Type, "odict_items"); - INIT_TYPE(&PyODictValues_Type, "odict_values"); - INIT_TYPE(&PyODictIter_Type, "odict_keyiterator"); - INIT_TYPE(&PySet_Type, "set"); - INIT_TYPE(&PyUnicode_Type, "str"); - INIT_TYPE(&PySlice_Type, "slice"); - INIT_TYPE(&PyStaticMethod_Type, "static method"); - INIT_TYPE(&PyComplex_Type, "complex"); - INIT_TYPE(&PyFloat_Type, "float"); - INIT_TYPE(&PyFrozenSet_Type, "frozenset"); - INIT_TYPE(&PyProperty_Type, "property"); - INIT_TYPE(&_PyManagedBuffer_Type, "managed buffer"); - INIT_TYPE(&PyMemoryView_Type, "memoryview"); - INIT_TYPE(&PyTuple_Type, "tuple"); - INIT_TYPE(&PyEnum_Type, "enumerate"); - INIT_TYPE(&PyReversed_Type, "reversed"); - INIT_TYPE(&PyStdPrinter_Type, "StdPrinter"); - INIT_TYPE(&PyCode_Type, "code"); - INIT_TYPE(&PyFrame_Type, "frame"); - INIT_TYPE(&PyCFunction_Type, "builtin function"); - INIT_TYPE(&PyCMethod_Type, "builtin method"); - INIT_TYPE(&PyMethod_Type, "method"); - INIT_TYPE(&PyFunction_Type, "function"); - INIT_TYPE(&PyDictProxy_Type, "dict proxy"); - INIT_TYPE(&PyGen_Type, "generator"); - INIT_TYPE(&PyGetSetDescr_Type, "get-set descriptor"); - INIT_TYPE(&PyWrapperDescr_Type, "wrapper"); - INIT_TYPE(&_PyMethodWrapper_Type, "method wrapper"); - INIT_TYPE(&PyEllipsis_Type, "ellipsis"); - INIT_TYPE(&PyMemberDescr_Type, "member descriptor"); - INIT_TYPE(&_PyNamespace_Type, "namespace"); - INIT_TYPE(&PyCapsule_Type, "capsule"); - INIT_TYPE(&PyLongRangeIter_Type, "long range iterator"); - INIT_TYPE(&PyCell_Type, "cell"); - INIT_TYPE(&PyInstanceMethod_Type, "instance method"); - INIT_TYPE(&PyClassMethodDescr_Type, "class method descr"); - INIT_TYPE(&PyMethodDescr_Type, "method descr"); - INIT_TYPE(&PyCallIter_Type, "call iter"); - INIT_TYPE(&PySeqIter_Type, "sequence iterator"); - INIT_TYPE(&PyPickleBuffer_Type, "pickle.PickleBuffer"); - INIT_TYPE(&PyCoro_Type, "coroutine"); - INIT_TYPE(&_PyCoroWrapper_Type, "coroutine wrapper"); - INIT_TYPE(&_PyInterpreterID_Type, "interpreter ID"); + // Base types + INIT_TYPE(PyBaseObject_Type); + INIT_TYPE(PyType_Type); + assert(PyBaseObject_Type.tp_base == NULL); + assert(PyType_Type.tp_base == &PyBaseObject_Type); + + // All other static types + INIT_TYPE(PyAsyncGen_Type); + INIT_TYPE(PyBool_Type); + INIT_TYPE(PyByteArrayIter_Type); + INIT_TYPE(PyByteArray_Type); + INIT_TYPE(PyBytesIter_Type); + INIT_TYPE(PyBytes_Type); + INIT_TYPE(PyCFunction_Type); + INIT_TYPE(PyCMethod_Type); + INIT_TYPE(PyCallIter_Type); + INIT_TYPE(PyCapsule_Type); + INIT_TYPE(PyCell_Type); + INIT_TYPE(PyClassMethodDescr_Type); + INIT_TYPE(PyClassMethod_Type); + INIT_TYPE(PyCode_Type); + INIT_TYPE(PyComplex_Type); + INIT_TYPE(PyCoro_Type); + INIT_TYPE(PyDictItems_Type); + INIT_TYPE(PyDictIterItem_Type); + INIT_TYPE(PyDictIterKey_Type); + INIT_TYPE(PyDictIterValue_Type); + INIT_TYPE(PyDictKeys_Type); + INIT_TYPE(PyDictProxy_Type); + INIT_TYPE(PyDictRevIterItem_Type); + INIT_TYPE(PyDictRevIterKey_Type); + INIT_TYPE(PyDictRevIterValue_Type); + INIT_TYPE(PyDictValues_Type); + INIT_TYPE(PyDict_Type); + INIT_TYPE(PyEllipsis_Type); + INIT_TYPE(PyEnum_Type); + INIT_TYPE(PyFloat_Type); + INIT_TYPE(PyFrame_Type); + INIT_TYPE(PyFrozenSet_Type); + INIT_TYPE(PyFunction_Type); + INIT_TYPE(PyGen_Type); + INIT_TYPE(PyGetSetDescr_Type); + INIT_TYPE(PyInstanceMethod_Type); + INIT_TYPE(PyListIter_Type); + INIT_TYPE(PyListRevIter_Type); + INIT_TYPE(PyList_Type); + INIT_TYPE(PyLongRangeIter_Type); + INIT_TYPE(PyLong_Type); + INIT_TYPE(PyMemberDescr_Type); + INIT_TYPE(PyMemoryView_Type); + INIT_TYPE(PyMethodDescr_Type); + INIT_TYPE(PyMethod_Type); + INIT_TYPE(PyModuleDef_Type); + INIT_TYPE(PyModule_Type); + INIT_TYPE(PyODictItems_Type); + INIT_TYPE(PyODictIter_Type); + INIT_TYPE(PyODictKeys_Type); + INIT_TYPE(PyODictValues_Type); + INIT_TYPE(PyODict_Type); + INIT_TYPE(PyPickleBuffer_Type); + INIT_TYPE(PyProperty_Type); + INIT_TYPE(PyRangeIter_Type); + INIT_TYPE(PyRange_Type); + INIT_TYPE(PyReversed_Type); + INIT_TYPE(PySTEntry_Type); + INIT_TYPE(PySeqIter_Type); + INIT_TYPE(PySetIter_Type); + INIT_TYPE(PySet_Type); + INIT_TYPE(PySlice_Type); + INIT_TYPE(PyStaticMethod_Type); + INIT_TYPE(PyStdPrinter_Type); + INIT_TYPE(PySuper_Type); + INIT_TYPE(PyTraceBack_Type); + INIT_TYPE(PyTupleIter_Type); + INIT_TYPE(PyTuple_Type); + INIT_TYPE(PyUnicodeIter_Type); + INIT_TYPE(PyUnicode_Type); + INIT_TYPE(PyWrapperDescr_Type); + INIT_TYPE(Py_GenericAliasType); + INIT_TYPE(_PyAnextAwaitable_Type); + INIT_TYPE(_PyAsyncGenASend_Type); + INIT_TYPE(_PyAsyncGenAThrow_Type); + INIT_TYPE(_PyAsyncGenWrappedValue_Type); + INIT_TYPE(_PyCoroWrapper_Type); + INIT_TYPE(_PyInterpreterID_Type); + INIT_TYPE(_PyManagedBuffer_Type); + INIT_TYPE(_PyMethodWrapper_Type); + INIT_TYPE(_PyNamespace_Type); + INIT_TYPE(_PyNone_Type); + INIT_TYPE(_PyNotImplemented_Type); + INIT_TYPE(_PyWeakref_CallableProxyType); + INIT_TYPE(_PyWeakref_ProxyType); + INIT_TYPE(_PyWeakref_RefType); + INIT_TYPE(_Py_UnionType); + return _PyStatus_OK(); @@ -1805,5 +1885,4 @@ return _PyStatus_OK(); - #undef INIT_TYPE } @@ -2233,6 +2312,33 @@ return _Py_XNewRef(obj); } +#undef Py_Is +#undef Py_IsNone +#undef Py_IsTrue +#undef Py_IsFalse + +// Export Py_Is(), Py_IsNone(), Py_IsTrue(), Py_IsFalse() as regular functions +// for the stable ABI. +int Py_Is(PyObject *x, PyObject *y) +{ + return (x == y); +} + +int Py_IsNone(PyObject *x) +{ + return Py_Is(x, Py_None); +} + +int Py_IsTrue(PyObject *x) +{ + return Py_Is(x, Py_True); +} + +int Py_IsFalse(PyObject *x) +{ + return Py_Is(x, Py_False); +} + #ifdef __cplusplus } #endif diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9vYm1hbGxvYy5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9vYm1hbGxvYy5j 100644 --- a/Objects/obmalloc.c +++ b/Objects/obmalloc.c @@ -894,6 +894,22 @@ #endif #endif +#if !defined(WITH_PYMALLOC_RADIX_TREE) +/* Use radix-tree to track arena memory regions, for address_in_range(). + * Enable by default since it allows larger pool sizes. Can be disabled + * using -DWITH_PYMALLOC_RADIX_TREE=0 */ +#define WITH_PYMALLOC_RADIX_TREE 1 +#endif + +#if SIZEOF_VOID_P > 4 +/* on 64-bit platforms use larger pools and arenas if we can */ +#define USE_LARGE_ARENAS +#if WITH_PYMALLOC_RADIX_TREE +/* large pools only supported if radix-tree is enabled */ +#define USE_LARGE_POOLS +#endif +#endif + /* * The allocator sub-allocates <Big> blocks of memory (called arenas) aligned * on a page boundary. This is a reserved virtual address space for the @@ -907,10 +923,16 @@ * Arenas are allocated with mmap() on systems supporting anonymous memory * mappings to reduce heap fragmentation. */ -#define ARENA_SIZE (256 << 10) /* 256KB */ +#ifdef USE_LARGE_ARENAS +#define ARENA_BITS 20 /* 1 MiB */ +#else +#define ARENA_BITS 18 /* 256 KiB */ +#endif +#define ARENA_SIZE (1 << ARENA_BITS) +#define ARENA_SIZE_MASK (ARENA_SIZE - 1) #ifdef WITH_MEMORY_LIMITS #define MAX_ARENAS (SMALL_MEMORY_LIMIT / ARENA_SIZE) #endif /* @@ -911,9 +933,8 @@ #ifdef WITH_MEMORY_LIMITS #define MAX_ARENAS (SMALL_MEMORY_LIMIT / ARENA_SIZE) #endif /* - * Size of the pools used for small blocks. Should be a power of 2, - * between 1K and SYSTEM_PAGE_SIZE, that is: 1k, 2k, 4k. + * Size of the pools used for small blocks. Must be a power of 2. */ @@ -919,6 +940,17 @@ */ -#define POOL_SIZE SYSTEM_PAGE_SIZE /* must be 2^N */ -#define POOL_SIZE_MASK SYSTEM_PAGE_SIZE_MASK +#ifdef USE_LARGE_POOLS +#define POOL_BITS 14 /* 16 KiB */ +#else +#define POOL_BITS 12 /* 4 KiB */ +#endif +#define POOL_SIZE (1 << POOL_BITS) +#define POOL_SIZE_MASK (POOL_SIZE - 1) + +#if !WITH_PYMALLOC_RADIX_TREE +#if POOL_SIZE != SYSTEM_PAGE_SIZE +# error "pool size must be equal to system page size" +#endif +#endif #define MAX_POOLS_IN_ARENA (ARENA_SIZE / POOL_SIZE) #if MAX_POOLS_IN_ARENA * POOL_SIZE != ARENA_SIZE @@ -1233,6 +1265,264 @@ return n; } +#if WITH_PYMALLOC_RADIX_TREE +/*==========================================================================*/ +/* radix tree for tracking arena usage + + bit allocation for keys + + 64-bit pointers and 2^20 arena size: + 16 -> ignored (POINTER_BITS - ADDRESS_BITS) + 10 -> MAP_TOP + 10 -> MAP_MID + 8 -> MAP_BOT + 20 -> ideal aligned arena + ---- + 64 + + 32-bit pointers and 2^18 arena size: + 14 -> MAP_BOT + 18 -> ideal aligned arena + ---- + 32 + +*/ + +#if SIZEOF_VOID_P == 8 + +/* number of bits in a pointer */ +#define POINTER_BITS 64 + +/* Current 64-bit processors are limited to 48-bit physical addresses. For + * now, the top 17 bits of addresses will all be equal to bit 2**47. If that + * changes in the future, this must be adjusted upwards. + */ +#define ADDRESS_BITS 48 + +/* use the top and mid layers of the radix tree */ +#define USE_INTERIOR_NODES + +#elif SIZEOF_VOID_P == 4 + +#define POINTER_BITS 32 +#define ADDRESS_BITS 32 + +#else + + /* Currently this code works for 64-bit or 32-bit pointers only. */ +#error "obmalloc radix tree requires 64-bit or 32-bit pointers." + +#endif /* SIZEOF_VOID_P */ + +/* arena_coverage_t members require this to be true */ +#if ARENA_BITS >= 32 +# error "arena size must be < 2^32" +#endif + +#ifdef USE_INTERIOR_NODES +/* number of bits used for MAP_TOP and MAP_MID nodes */ +#define INTERIOR_BITS ((ADDRESS_BITS - ARENA_BITS + 2) / 3) +#else +#define INTERIOR_BITS 0 +#endif + +#define MAP_TOP_BITS INTERIOR_BITS +#define MAP_TOP_LENGTH (1 << MAP_TOP_BITS) +#define MAP_TOP_MASK (MAP_BOT_LENGTH - 1) + +#define MAP_MID_BITS INTERIOR_BITS +#define MAP_MID_LENGTH (1 << MAP_MID_BITS) +#define MAP_MID_MASK (MAP_MID_LENGTH - 1) + +#define MAP_BOT_BITS (ADDRESS_BITS - ARENA_BITS - 2*INTERIOR_BITS) +#define MAP_BOT_LENGTH (1 << MAP_BOT_BITS) +#define MAP_BOT_MASK (MAP_BOT_LENGTH - 1) + +#define MAP_BOT_SHIFT ARENA_BITS +#define MAP_MID_SHIFT (MAP_BOT_BITS + MAP_BOT_SHIFT) +#define MAP_TOP_SHIFT (MAP_MID_BITS + MAP_MID_SHIFT) + +#define AS_UINT(p) ((uintptr_t)(p)) +#define MAP_BOT_INDEX(p) ((AS_UINT(p) >> MAP_BOT_SHIFT) & MAP_BOT_MASK) +#define MAP_MID_INDEX(p) ((AS_UINT(p) >> MAP_MID_SHIFT) & MAP_MID_MASK) +#define MAP_TOP_INDEX(p) ((AS_UINT(p) >> MAP_TOP_SHIFT) & MAP_TOP_MASK) + +#if ADDRESS_BITS > POINTER_BITS +/* Return non-physical address bits of a pointer. Those bits should be same + * for all valid pointers if ADDRESS_BITS set correctly. Linux has support for + * 57-bit address space (Intel 5-level paging) but will not currently give + * those addresses to user space. + */ +#define HIGH_BITS(p) (AS_UINT(p) >> ADDRESS_BITS) +#else +#define HIGH_BITS(p) 0 +#endif + + +/* This is the leaf of the radix tree. See arena_map_mark_used() for the + * meaning of these members. */ +typedef struct { + int32_t tail_hi; + int32_t tail_lo; +} arena_coverage_t; + +typedef struct arena_map_bot { + /* The members tail_hi and tail_lo are accessed together. So, it + * better to have them as an array of structs, rather than two + * arrays. + */ + arena_coverage_t arenas[MAP_BOT_LENGTH]; +} arena_map_bot_t; + +#ifdef USE_INTERIOR_NODES +typedef struct arena_map_mid { + struct arena_map_bot *ptrs[MAP_MID_LENGTH]; +} arena_map_mid_t; + +typedef struct arena_map_top { + struct arena_map_mid *ptrs[MAP_TOP_LENGTH]; +} arena_map_top_t; +#endif + +/* The root of radix tree. Note that by initializing like this, the memory + * should be in the BSS. The OS will only memory map pages as the MAP_MID + * nodes get used (OS pages are demand loaded as needed). + */ +#ifdef USE_INTERIOR_NODES +static arena_map_top_t arena_map_root; +/* accounting for number of used interior nodes */ +static int arena_map_mid_count; +static int arena_map_bot_count; +#else +static arena_map_bot_t arena_map_root; +#endif + +/* Return a pointer to a bottom tree node, return NULL if it doesn't exist or + * it cannot be created */ +static arena_map_bot_t * +arena_map_get(block *p, int create) +{ +#ifdef USE_INTERIOR_NODES + /* sanity check that ADDRESS_BITS is correct */ + assert(HIGH_BITS(p) == HIGH_BITS(&arena_map_root)); + int i1 = MAP_TOP_INDEX(p); + if (arena_map_root.ptrs[i1] == NULL) { + if (!create) { + return NULL; + } + arena_map_mid_t *n = PyMem_RawCalloc(1, sizeof(arena_map_mid_t)); + if (n == NULL) { + return NULL; + } + arena_map_root.ptrs[i1] = n; + arena_map_mid_count++; + } + int i2 = MAP_MID_INDEX(p); + if (arena_map_root.ptrs[i1]->ptrs[i2] == NULL) { + if (!create) { + return NULL; + } + arena_map_bot_t *n = PyMem_RawCalloc(1, sizeof(arena_map_bot_t)); + if (n == NULL) { + return NULL; + } + arena_map_root.ptrs[i1]->ptrs[i2] = n; + arena_map_bot_count++; + } + return arena_map_root.ptrs[i1]->ptrs[i2]; +#else + return &arena_map_root; +#endif +} + + +/* The radix tree only tracks arenas. So, for 16 MiB arenas, we throw + * away 24 bits of the address. That reduces the space requirement of + * the tree compared to similar radix tree page-map schemes. In + * exchange for slashing the space requirement, it needs more + * computation to check an address. + * + * Tracking coverage is done by "ideal" arena address. It is easier to + * explain in decimal so let's say that the arena size is 100 bytes. + * Then, ideal addresses are 100, 200, 300, etc. For checking if a + * pointer address is inside an actual arena, we have to check two ideal + * arena addresses. E.g. if pointer is 357, we need to check 200 and + * 300. In the rare case that an arena is aligned in the ideal way + * (e.g. base address of arena is 200) then we only have to check one + * ideal address. + * + * The tree nodes for 200 and 300 both store the address of arena. + * There are two cases: the arena starts at a lower ideal arena and + * extends to this one, or the arena starts in this arena and extends to + * the next ideal arena. The tail_lo and tail_hi members correspond to + * these two cases. + */ + + +/* mark or unmark addresses covered by arena */ +static int +arena_map_mark_used(uintptr_t arena_base, int is_used) +{ + /* sanity check that ADDRESS_BITS is correct */ + assert(HIGH_BITS(arena_base) == HIGH_BITS(&arena_map_root)); + arena_map_bot_t *n_hi = arena_map_get((block *)arena_base, is_used); + if (n_hi == NULL) { + assert(is_used); /* otherwise node should already exist */ + return 0; /* failed to allocate space for node */ + } + int i3 = MAP_BOT_INDEX((block *)arena_base); + int32_t tail = (int32_t)(arena_base & ARENA_SIZE_MASK); + if (tail == 0) { + /* is ideal arena address */ + n_hi->arenas[i3].tail_hi = is_used ? -1 : 0; + } + else { + /* arena_base address is not ideal (aligned to arena size) and + * so it potentially covers two MAP_BOT nodes. Get the MAP_BOT node + * for the next arena. Note that it might be in different MAP_TOP + * and MAP_MID nodes as well so we need to call arena_map_get() + * again (do the full tree traversal). + */ + n_hi->arenas[i3].tail_hi = is_used ? tail : 0; + uintptr_t arena_base_next = arena_base + ARENA_SIZE; + /* If arena_base is a legit arena address, so is arena_base_next - 1 + * (last address in arena). If arena_base_next overflows then it + * must overflow to 0. However, that would mean arena_base was + * "ideal" and we should not be in this case. */ + assert(arena_base < arena_base_next); + arena_map_bot_t *n_lo = arena_map_get((block *)arena_base_next, is_used); + if (n_lo == NULL) { + assert(is_used); /* otherwise should already exist */ + n_hi->arenas[i3].tail_hi = 0; + return 0; /* failed to allocate space for node */ + } + int i3_next = MAP_BOT_INDEX(arena_base_next); + n_lo->arenas[i3_next].tail_lo = is_used ? tail : 0; + } + return 1; +} + +/* Return true if 'p' is a pointer inside an obmalloc arena. + * _PyObject_Free() calls this so it needs to be very fast. */ +static int +arena_map_is_used(block *p) +{ + arena_map_bot_t *n = arena_map_get(p, 0); + if (n == NULL) { + return 0; + } + int i3 = MAP_BOT_INDEX(p); + /* ARENA_BITS must be < 32 so that the tail is a non-negative int32_t. */ + int32_t hi = n->arenas[i3].tail_hi; + int32_t lo = n->arenas[i3].tail_lo; + int32_t tail = (int32_t)(AS_UINT(p) & ARENA_SIZE_MASK); + return (tail < lo) || (tail >= hi && hi != 0); +} + +/* end of radix tree logic */ +/*==========================================================================*/ +#endif /* WITH_PYMALLOC_RADIX_TREE */ + /* Allocate a new arena. If we run out of memory, return NULL. Else * allocate a new arena, and return the address of an arena_object @@ -1302,6 +1592,15 @@ unused_arena_objects = arenaobj->nextarena; assert(arenaobj->address == 0); address = _PyObject_Arena.alloc(_PyObject_Arena.ctx, ARENA_SIZE); +#if WITH_PYMALLOC_RADIX_TREE + if (address != NULL) { + if (!arena_map_mark_used((uintptr_t)address, 1)) { + /* marking arena in radix tree failed, abort */ + _PyObject_Arena.free(_PyObject_Arena.ctx, address, ARENA_SIZE); + address = NULL; + } + } +#endif if (address == NULL) { /* The allocation failed: return NULL after putting the * arenaobj back. @@ -1332,6 +1631,17 @@ } + +#if WITH_PYMALLOC_RADIX_TREE +/* Return true if and only if P is an address that was allocated by + pymalloc. When the radix tree is used, 'poolp' is unused. + */ +static bool +address_in_range(void *p, poolp pool) +{ + return arena_map_is_used(p); +} +#else /* address_in_range(P, POOL) @@ -1423,6 +1733,7 @@ arenas[arenaindex].address != 0; } +#endif /* !WITH_PYMALLOC_RADIX_TREE */ /*==========================================================================*/ @@ -1768,6 +2079,11 @@ ao->nextarena = unused_arena_objects; unused_arena_objects = ao; +#if WITH_PYMALLOC_RADIX_TREE + /* mark arena region as not under control of obmalloc */ + arena_map_mark_used(ao->address, 0); +#endif + /* Free the entire arena. */ _PyObject_Arena.free(_PyObject_Arena.ctx, (void *)ao->address, ARENA_SIZE); @@ -2723,6 +3039,7 @@ fputc('\n', out); + /* Account for what all of those arena bytes are being used for. */ total = printone(out, "# bytes in allocated blocks", allocated_bytes); total += printone(out, "# bytes in available blocks", available_bytes); @@ -2734,6 +3051,25 @@ total += printone(out, "# bytes lost to quantization", quantization); total += printone(out, "# bytes lost to arena alignment", arena_alignment); (void)printone(out, "Total", total); + assert(narenas * ARENA_SIZE == total); + +#if WITH_PYMALLOC_RADIX_TREE + fputs("\narena map counts\n", out); +#ifdef USE_INTERIOR_NODES + (void)printone(out, "# arena map mid nodes", arena_map_mid_count); + (void)printone(out, "# arena map bot nodes", arena_map_bot_count); + fputc('\n', out); +#endif + total = printone(out, "# bytes lost to arena map root", sizeof(arena_map_root)); +#ifdef USE_INTERIOR_NODES + total += printone(out, "# bytes lost to arena map mid", + sizeof(arena_map_mid_t) * arena_map_mid_count); + total += printone(out, "# bytes lost to arena map bot", + sizeof(arena_map_bot_t) * arena_map_bot_count); + (void)printone(out, "Total", total); +#endif +#endif + return 1; } diff --git a/Objects/setobject.c b/Objects/setobject.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9zZXRvYmplY3QuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9zZXRvYmplY3QuYw== 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -103,6 +103,7 @@ set_add_entry(PySetObject *so, PyObject *key, Py_hash_t hash) { setentry *table; + setentry *freeslot; setentry *entry; size_t perturb; size_t mask; @@ -118,6 +119,7 @@ mask = so->mask; i = (size_t)hash & mask; + freeslot = NULL; perturb = hash; while (1) { @@ -125,7 +127,7 @@ probes = (i + LINEAR_PROBES <= mask) ? LINEAR_PROBES: 0; do { if (entry->hash == 0 && entry->key == NULL) - goto found_unused; + goto found_unused_or_dummy; if (entry->hash == hash) { PyObject *startkey = entry->key; assert(startkey != dummy); @@ -147,9 +149,13 @@ goto restart; mask = so->mask; } + else if (entry->hash == -1) { + assert (entry->key == dummy); + freeslot = entry; + } entry++; } while (probes--); perturb >>= PERTURB_SHIFT; i = (i * 5 + 1 + perturb) & mask; } @@ -150,9 +156,17 @@ entry++; } while (probes--); perturb >>= PERTURB_SHIFT; i = (i * 5 + 1 + perturb) & mask; } + found_unused_or_dummy: + if (freeslot == NULL) + goto found_unused; + so->used++; + freeslot->key = key; + freeslot->hash = hash; + return 0; + found_unused: so->fill++; so->used++; diff --git a/Objects/stringlib/codecs.h b/Objects/stringlib/codecs.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9zdHJpbmdsaWIvY29kZWNzLmg=..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9zdHJpbmdsaWIvY29kZWNzLmg= 100644 --- a/Objects/stringlib/codecs.h +++ b/Objects/stringlib/codecs.h @@ -26,7 +26,6 @@ { Py_UCS4 ch; const char *s = *inptr; - const char *aligned_end = (const char *) _Py_ALIGN_DOWN(end, SIZEOF_SIZE_T); STRINGLIB_CHAR *p = dest + *outpos; while (s < end) { @@ -40,7 +39,7 @@ First, check if we can do an aligned read, as most CPUs have a penalty for unaligned reads. */ - if (_Py_IS_ALIGNED(s, SIZEOF_SIZE_T)) { + if (_Py_IS_ALIGNED(s, ALIGNOF_SIZE_T)) { /* Help register allocation */ const char *_s = s; STRINGLIB_CHAR *_p = p; @@ -44,7 +43,7 @@ /* Help register allocation */ const char *_s = s; STRINGLIB_CHAR *_p = p; - while (_s < aligned_end) { + while (_s + SIZEOF_SIZE_T <= end) { /* Read a whole size_t at a time (either 4 or 8 bytes), and do a fast unrolled copy if it only contains ASCII characters. */ @@ -496,8 +495,6 @@ int native_ordering) { Py_UCS4 ch; - const unsigned char *aligned_end = - (const unsigned char *) _Py_ALIGN_DOWN(e, SIZEOF_LONG); const unsigned char *q = *inptr; STRINGLIB_CHAR *p = dest + *outpos; /* Offsets from q for retrieving byte pairs in the right order. */ @@ -512,6 +509,6 @@ Py_UCS4 ch2; /* First check for possible aligned read of a C 'long'. Unaligned reads are more expensive, better to defer to another iteration. */ - if (_Py_IS_ALIGNED(q, SIZEOF_LONG)) { + if (_Py_IS_ALIGNED(q, ALIGNOF_LONG)) { /* Fast path for runs of in-range non-surrogate chars. */ const unsigned char *_q = q; @@ -516,6 +513,6 @@ /* Fast path for runs of in-range non-surrogate chars. */ const unsigned char *_q = q; - while (_q < aligned_end) { + while (_q + SIZEOF_LONG <= e) { unsigned long block = * (const unsigned long *) _q; if (native_ordering) { /* Can use buffer directly */ diff --git a/Objects/stringlib/find_max_char.h b/Objects/stringlib/find_max_char.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9zdHJpbmdsaWIvZmluZF9tYXhfY2hhci5o..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9zdHJpbmdsaWIvZmluZF9tYXhfY2hhci5o 100644 --- a/Objects/stringlib/find_max_char.h +++ b/Objects/stringlib/find_max_char.h @@ -20,7 +20,5 @@ STRINGLIB(find_max_char)(const STRINGLIB_CHAR *begin, const STRINGLIB_CHAR *end) { const unsigned char *p = (const unsigned char *) begin; - const unsigned char *aligned_end = - (const unsigned char *) _Py_ALIGN_DOWN(end, SIZEOF_SIZE_T); while (p < end) { @@ -25,5 +23,5 @@ while (p < end) { - if (_Py_IS_ALIGNED(p, SIZEOF_SIZE_T)) { + if (_Py_IS_ALIGNED(p, ALIGNOF_SIZE_T)) { /* Help register allocation */ const unsigned char *_p = p; @@ -28,6 +26,6 @@ /* Help register allocation */ const unsigned char *_p = p; - while (_p < aligned_end) { + while (_p + SIZEOF_SIZE_T <= end) { size_t value = *(const size_t *) _p; if (value & UCS1_ASCII_CHAR_MASK) return 255; diff --git a/Objects/structseq.c b/Objects/structseq.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy9zdHJ1Y3RzZXEuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy9zdHJ1Y3RzZXEuYw== 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -579,4 +579,5 @@ if (_PyUnicode_FromId(&PyId_n_sequence_fields) == NULL || _PyUnicode_FromId(&PyId_n_fields) == NULL || _PyUnicode_FromId(&PyId_n_unnamed_fields) == NULL) + { return -1; @@ -582,4 +583,4 @@ return -1; - + } return 0; } diff --git a/Objects/typeobject.c b/Objects/typeobject.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy90eXBlb2JqZWN0LmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy90eXBlb2JqZWN0LmM= 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -2,6 +2,7 @@ #include "Python.h" #include "pycore_call.h" +#include "pycore_compile.h" // _Py_Mangle() #include "pycore_initconfig.h" #include "pycore_object.h" #include "pycore_pyerrors.h" @@ -32,8 +33,7 @@ & ((1 << MCACHE_SIZE_EXP) - 1)) #define MCACHE_HASH_METHOD(type, name) \ - MCACHE_HASH((type)->tp_version_tag, \ - ((PyASCIIObject *)(name))->hash) + MCACHE_HASH((type)->tp_version_tag, ((Py_ssize_t)(name)) >> 3) #define MCACHE_CACHEABLE_NAME(name) \ PyUnicode_CheckExact(name) && \ PyUnicode_IS_READY(name) && \ @@ -53,6 +53,7 @@ _Py_IDENTIFIER(__abstractmethods__); _Py_IDENTIFIER(__class__); _Py_IDENTIFIER(__class_getitem__); +_Py_IDENTIFIER(__classcell__); _Py_IDENTIFIER(__delitem__); _Py_IDENTIFIER(__dict__); _Py_IDENTIFIER(__doc__); @@ -64,5 +65,6 @@ _Py_IDENTIFIER(__module__); _Py_IDENTIFIER(__name__); _Py_IDENTIFIER(__new__); +_Py_IDENTIFIER(__qualname__); _Py_IDENTIFIER(__set_name__); _Py_IDENTIFIER(__setitem__); @@ -67,5 +69,6 @@ _Py_IDENTIFIER(__set_name__); _Py_IDENTIFIER(__setitem__); +_Py_IDENTIFIER(__weakref__); _Py_IDENTIFIER(builtins); _Py_IDENTIFIER(mro); @@ -338,6 +341,7 @@ } } type->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + type->tp_version_tag = 0; /* 0 is not a valid version tag */ } static void @@ -396,6 +400,7 @@ Py_XDECREF(type_mro_meth); type->tp_flags &= ~(Py_TPFLAGS_HAVE_VERSION_TAG| Py_TPFLAGS_VALID_VERSION_TAG); + type->tp_version_tag = 0; /* 0 is not a valid version tag */ } static int @@ -422,7 +427,7 @@ if (type->tp_version_tag == 0) { // Wrap-around or just starting Python - clear the whole cache type_cache_clear(cache, 1); - return 1; + return 0; } bases = type->tp_bases; @@ -1810,7 +1815,7 @@ PyObject **to_merge; Py_ssize_t i, n; - if (type->tp_dict == NULL) { + if (!_PyType_IsReady(type)) { if (PyType_Ready(type) < 0) return NULL; } @@ -2079,7 +2084,7 @@ return NULL; } base_i = (PyTypeObject *)base_proto; - if (base_i->tp_dict == NULL) { + if (!_PyType_IsReady(base_i)) { if (PyType_Ready(base_i) < 0) return NULL; } @@ -2156,8 +2161,8 @@ static int object_init(PyObject *, PyObject *, PyObject *); static int update_slot(PyTypeObject *, PyObject *); static void fixup_slot_dispatchers(PyTypeObject *); -static int set_names(PyTypeObject *); -static int init_subclass(PyTypeObject *, PyObject *); +static int type_new_set_names(PyTypeObject *); +static int type_new_init_subclass(PyTypeObject *, PyObject *); /* * Helpers for __dict__ descriptor. We don't want to expose the dicts @@ -2402,4 +2407,6 @@ return winner; } + +// Forward declaration static PyObject * @@ -2405,21 +2412,70 @@ static PyObject * -type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds) -{ - PyObject *name, *bases = NULL, *orig_dict, *dict = NULL; - PyObject *qualname, *slots = NULL, *tmp, *newslots, *cell; - PyTypeObject *type = NULL, *base, *tmptype, *winner; - PyHeapTypeObject *et; - PyMemberDef *mp; - Py_ssize_t i, nbases, nslots, slotoffset, name_size; - int j, r, may_add_dict, may_add_weak, add_dict, add_weak; - _Py_IDENTIFIER(__qualname__); - _Py_IDENTIFIER(__slots__); - _Py_IDENTIFIER(__classcell__); - - assert(args != NULL && PyTuple_Check(args)); - assert(kwds == NULL || PyDict_Check(kwds)); - - /* Check arguments: (name, bases, dict) */ - if (!PyArg_ParseTuple(args, "UO!O!:type.__new__", &name, &PyTuple_Type, - &bases, &PyDict_Type, &orig_dict)) +type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds); + +typedef struct { + PyTypeObject *metatype; + PyObject *args; + PyObject *kwds; + PyObject *orig_dict; + PyObject *name; + PyObject *bases; + PyTypeObject *base; + PyObject *slots; + Py_ssize_t nslot; + int add_dict; + int add_weak; + int may_add_dict; + int may_add_weak; +} type_new_ctx; + + +/* Check for valid slot names and two special cases */ +static int +type_new_visit_slots(type_new_ctx *ctx) +{ + PyObject *slots = ctx->slots; + Py_ssize_t nslot = ctx->nslot; + for (Py_ssize_t i = 0; i < nslot; i++) { + PyObject *name = PyTuple_GET_ITEM(slots, i); + if (!valid_identifier(name)) { + return -1; + } + assert(PyUnicode_Check(name)); + if (_PyUnicode_EqualToASCIIId(name, &PyId___dict__)) { + if (!ctx->may_add_dict || ctx->add_dict != 0) { + PyErr_SetString(PyExc_TypeError, + "__dict__ slot disallowed: " + "we already got one"); + return -1; + } + ctx->add_dict++; + } + if (_PyUnicode_EqualToASCIIId(name, &PyId___weakref__)) { + if (!ctx->may_add_weak || ctx->add_weak != 0) { + PyErr_SetString(PyExc_TypeError, + "__weakref__ slot disallowed: " + "either we already got one, " + "or __itemsize__ != 0"); + return -1; + } + ctx->add_weak++; + } + } + return 0; +} + + +/* Copy slots into a list, mangle names and sort them. + Sorted names are needed for __class__ assignment. + Convert them back to tuple at the end. +*/ +static PyObject* +type_new_copy_slots(type_new_ctx *ctx, PyObject *dict) +{ + PyObject *slots = ctx->slots; + Py_ssize_t nslot = ctx->nslot; + + Py_ssize_t new_nslot = nslot - ctx->add_dict - ctx->add_weak; + PyObject *new_slots = PyList_New(new_nslot); + if (new_slots == NULL) { return NULL; @@ -2425,18 +2481,75 @@ return NULL; - - /* Adjust for empty tuple bases */ - nbases = PyTuple_GET_SIZE(bases); - if (nbases == 0) { - base = &PyBaseObject_Type; - bases = PyTuple_Pack(1, base); - if (bases == NULL) - return NULL; - nbases = 1; - } - else { - _Py_IDENTIFIER(__mro_entries__); - for (i = 0; i < nbases; i++) { - tmp = PyTuple_GET_ITEM(bases, i); - if (PyType_Check(tmp)) { + } + + Py_ssize_t j = 0; + for (Py_ssize_t i = 0; i < nslot; i++) { + PyObject *slot = PyTuple_GET_ITEM(slots, i); + if ((ctx->add_dict && + _PyUnicode_EqualToASCIIId(slot, &PyId___dict__)) || + (ctx->add_weak && + _PyUnicode_EqualToASCIIString(slot, "__weakref__"))) + { + continue; + } + + slot =_Py_Mangle(ctx->name, slot); + if (!slot) { + goto error; + } + PyList_SET_ITEM(new_slots, j, slot); + + int r = PyDict_Contains(dict, slot); + if (r < 0) { + goto error; + } + if (r > 0) { + /* CPython inserts __qualname__ and __classcell__ (when needed) + into the namespace when creating a class. They will be deleted + below so won't act as class variables. */ + if (!_PyUnicode_EqualToASCIIId(slot, &PyId___qualname__) && + !_PyUnicode_EqualToASCIIId(slot, &PyId___classcell__)) + { + PyErr_Format(PyExc_ValueError, + "%R in __slots__ conflicts with class variable", + slot); + goto error; + } + } + + j++; + } + assert(j == new_nslot); + + if (PyList_Sort(new_slots) == -1) { + goto error; + } + + PyObject *tuple = PyList_AsTuple(new_slots); + Py_DECREF(new_slots); + if (tuple == NULL) { + return NULL; + } + + assert(PyTuple_GET_SIZE(tuple) == new_nslot); + return tuple; + +error: + Py_DECREF(new_slots); + return NULL; +} + + +static void +type_new_slots_bases(type_new_ctx *ctx) +{ + Py_ssize_t nbases = PyTuple_GET_SIZE(ctx->bases); + if (nbases > 1 && + ((ctx->may_add_dict && ctx->add_dict == 0) || + (ctx->may_add_weak && ctx->add_weak == 0))) + { + for (Py_ssize_t i = 0; i < nbases; i++) { + PyObject *base = PyTuple_GET_ITEM(ctx->bases, i); + if (base == (PyObject *)ctx->base) { + /* Skip primary base */ continue; } @@ -2441,5 +2554,10 @@ continue; } - if (_PyObject_LookupAttrId(tmp, &PyId___mro_entries__, &tmp) < 0) { - return NULL; + + assert(PyType_Check(base)); + PyTypeObject *type = (PyTypeObject *)base; + if (ctx->may_add_dict && ctx->add_dict == 0 && + type->tp_dictoffset != 0) + { + ctx->add_dict++; } @@ -2445,8 +2563,12 @@ } - if (tmp != NULL) { - PyErr_SetString(PyExc_TypeError, - "type() doesn't support MRO entry resolution; " - "use types.new_class()"); - Py_DECREF(tmp); - return NULL; + if (ctx->may_add_weak && ctx->add_weak == 0 && + type->tp_weaklistoffset != 0) + { + ctx->add_weak++; + } + if (ctx->may_add_dict && ctx->add_dict == 0) { + continue; + } + if (ctx->may_add_weak && ctx->add_weak == 0) { + continue; } @@ -2452,49 +2574,58 @@ } - } - /* Search the bases for the proper metatype to deal with this: */ - winner = _PyType_CalculateMetaclass(metatype, bases); - if (winner == NULL) { - return NULL; - } - - if (winner != metatype) { - if (winner->tp_new != type_new) /* Pass it to the winner */ - return winner->tp_new(winner, args, kwds); - metatype = winner; - } - - /* Calculate best base, and check that all bases are type objects */ - base = best_base(bases); - if (base == NULL) { - return NULL; - } - - Py_INCREF(bases); - } - - /* Use "goto error" from this point on as we now own the reference to "bases". */ - - dict = PyDict_Copy(orig_dict); - if (dict == NULL) - goto error; - - /* Check for a __slots__ sequence variable in dict, and count it */ - slots = _PyDict_GetItemIdWithError(dict, &PyId___slots__); - nslots = 0; - add_dict = 0; - add_weak = 0; - may_add_dict = base->tp_dictoffset == 0; - may_add_weak = base->tp_weaklistoffset == 0 && base->tp_itemsize == 0; - if (slots == NULL) { - if (PyErr_Occurred()) { - goto error; - } - if (may_add_dict) { - add_dict++; - } - if (may_add_weak) { - add_weak++; + /* Nothing more to check */ + break; + } + } +} + + +static int +type_new_slots_impl(type_new_ctx *ctx, PyObject *dict) +{ + /* Are slots allowed? */ + if (ctx->nslot > 0 && ctx->base->tp_itemsize != 0) { + PyErr_Format(PyExc_TypeError, + "nonempty __slots__ not supported for subtype of '%s'", + ctx->base->tp_name); + return -1; + } + + if (type_new_visit_slots(ctx) < 0) { + return -1; + } + + PyObject *new_slots = type_new_copy_slots(ctx, dict); + if (new_slots == NULL) { + return -1; + } + assert(PyTuple_CheckExact(new_slots)); + + Py_XSETREF(ctx->slots, new_slots); + ctx->nslot = PyTuple_GET_SIZE(new_slots); + + /* Secondary bases may provide weakrefs or dict */ + type_new_slots_bases(ctx); + return 0; +} + + +static Py_ssize_t +type_new_slots(type_new_ctx *ctx, PyObject *dict) +{ + // Check for a __slots__ sequence variable in dict, and count it + ctx->add_dict = 0; + ctx->add_weak = 0; + ctx->may_add_dict = (ctx->base->tp_dictoffset == 0); + ctx->may_add_weak = (ctx->base->tp_weaklistoffset == 0 + && ctx->base->tp_itemsize == 0); + + if (ctx->slots == NULL) { + if (ctx->may_add_dict) { + ctx->add_dict++; + } + if (ctx->may_add_weak) { + ctx->add_weak++; } } else { /* Have slots */ @@ -2497,143 +2628,27 @@ } } else { /* Have slots */ - - /* Make it into a tuple */ - if (PyUnicode_Check(slots)) - slots = PyTuple_Pack(1, slots); - else - slots = PySequence_Tuple(slots); - if (slots == NULL) - goto error; - assert(PyTuple_Check(slots)); - - /* Are slots allowed? */ - nslots = PyTuple_GET_SIZE(slots); - if (nslots > 0 && base->tp_itemsize != 0) { - PyErr_Format(PyExc_TypeError, - "nonempty __slots__ " - "not supported for subtype of '%s'", - base->tp_name); - goto error; - } - - /* Check for valid slot names and two special cases */ - for (i = 0; i < nslots; i++) { - PyObject *tmp = PyTuple_GET_ITEM(slots, i); - if (!valid_identifier(tmp)) - goto error; - assert(PyUnicode_Check(tmp)); - if (_PyUnicode_EqualToASCIIId(tmp, &PyId___dict__)) { - if (!may_add_dict || add_dict) { - PyErr_SetString(PyExc_TypeError, - "__dict__ slot disallowed: " - "we already got one"); - goto error; - } - add_dict++; - } - if (_PyUnicode_EqualToASCIIString(tmp, "__weakref__")) { - if (!may_add_weak || add_weak) { - PyErr_SetString(PyExc_TypeError, - "__weakref__ slot disallowed: " - "either we already got one, " - "or __itemsize__ != 0"); - goto error; - } - add_weak++; - } - } - - /* Copy slots into a list, mangle names and sort them. - Sorted names are needed for __class__ assignment. - Convert them back to tuple at the end. - */ - newslots = PyList_New(nslots - add_dict - add_weak); - if (newslots == NULL) - goto error; - for (i = j = 0; i < nslots; i++) { - tmp = PyTuple_GET_ITEM(slots, i); - if ((add_dict && - _PyUnicode_EqualToASCIIId(tmp, &PyId___dict__)) || - (add_weak && - _PyUnicode_EqualToASCIIString(tmp, "__weakref__"))) - continue; - tmp =_Py_Mangle(name, tmp); - if (!tmp) { - Py_DECREF(newslots); - goto error; - } - PyList_SET_ITEM(newslots, j, tmp); - r = PyDict_Contains(dict, tmp); - if (r < 0) { - Py_DECREF(newslots); - goto error; - } - if (r > 0) { - /* CPython inserts __qualname__ and __classcell__ (when needed) - into the namespace when creating a class. They will be deleted - below so won't act as class variables. */ - if (!_PyUnicode_EqualToASCIIId(tmp, &PyId___qualname__) && - !_PyUnicode_EqualToASCIIId(tmp, &PyId___classcell__)) { - PyErr_Format(PyExc_ValueError, - "%R in __slots__ conflicts with class variable", - tmp); - Py_DECREF(newslots); - goto error; - } - } - j++; - } - assert(j == nslots - add_dict - add_weak); - nslots = j; - Py_CLEAR(slots); - if (PyList_Sort(newslots) == -1) { - Py_DECREF(newslots); - goto error; - } - slots = PyList_AsTuple(newslots); - Py_DECREF(newslots); - if (slots == NULL) - goto error; - - /* Secondary bases may provide weakrefs or dict */ - if (nbases > 1 && - ((may_add_dict && !add_dict) || - (may_add_weak && !add_weak))) { - for (i = 0; i < nbases; i++) { - tmp = PyTuple_GET_ITEM(bases, i); - if (tmp == (PyObject *)base) - continue; /* Skip primary base */ - assert(PyType_Check(tmp)); - tmptype = (PyTypeObject *)tmp; - if (may_add_dict && !add_dict && - tmptype->tp_dictoffset != 0) - add_dict++; - if (may_add_weak && !add_weak && - tmptype->tp_weaklistoffset != 0) - add_weak++; - if (may_add_dict && !add_dict) - continue; - if (may_add_weak && !add_weak) - continue; - /* Nothing more to check */ - break; - } - } - } - - /* Allocate the type object */ - type = (PyTypeObject *)metatype->tp_alloc(metatype, nslots); - if (type == NULL) - goto error; - - /* Keep name and slots alive in the extended type object */ - et = (PyHeapTypeObject *)type; - Py_INCREF(name); - et->ht_name = name; - et->ht_slots = slots; - slots = NULL; - - /* Initialize tp_flags */ + if (type_new_slots_impl(ctx, dict) < 0) { + return -1; + } + } + return 0; +} + + +static PyTypeObject* +type_new_alloc(type_new_ctx *ctx) +{ + PyTypeObject *metatype = ctx->metatype; + PyTypeObject *type; + + // Allocate the type object + type = (PyTypeObject *)metatype->tp_alloc(metatype, ctx->nslot); + if (type == NULL) { + return NULL; + } + PyHeapTypeObject *et = (PyHeapTypeObject *)type; + + // Initialize tp_flags. // All heap types need GC, since we can create a reference cycle by storing @@ -2639,11 +2654,11 @@ // All heap types need GC, since we can create a reference cycle by storing - // an instance on one of its parents: - type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HEAPTYPE | - Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC; - - /* Initialize essential fields */ + // an instance on one of its parents. + type->tp_flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HEAPTYPE | + Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC); + + // Initialize essential fields type->tp_as_async = &et->as_async; type->tp_as_number = &et->as_number; type->tp_as_sequence = &et->as_sequence; type->tp_as_mapping = &et->as_mapping; type->tp_as_buffer = &et->as_buffer; @@ -2645,11 +2660,35 @@ type->tp_as_async = &et->as_async; type->tp_as_number = &et->as_number; type->tp_as_sequence = &et->as_sequence; type->tp_as_mapping = &et->as_mapping; type->tp_as_buffer = &et->as_buffer; - type->tp_name = PyUnicode_AsUTF8AndSize(name, &name_size); - if (!type->tp_name) - goto error; + + type->tp_bases = Py_NewRef(ctx->bases); + type->tp_base = (PyTypeObject *)Py_NewRef(ctx->base); + + type->tp_dealloc = subtype_dealloc; + /* Always override allocation strategy to use regular heap */ + type->tp_alloc = PyType_GenericAlloc; + type->tp_free = PyObject_GC_Del; + + type->tp_traverse = subtype_traverse; + type->tp_clear = subtype_clear; + + et->ht_name = Py_NewRef(ctx->name); + et->ht_module = NULL; + + return type; +} + + +static int +type_new_set_name(const type_new_ctx *ctx, PyTypeObject *type) +{ + Py_ssize_t name_size; + type->tp_name = PyUnicode_AsUTF8AndSize(ctx->name, &name_size); + if (!type->tp_name) { + return -1; + } if (strlen(type->tp_name) != (size_t)name_size) { PyErr_SetString(PyExc_ValueError, "type name must not contain null characters"); @@ -2653,19 +2692,15 @@ if (strlen(type->tp_name) != (size_t)name_size) { PyErr_SetString(PyExc_ValueError, "type name must not contain null characters"); - goto error; - } - - /* Set tp_base and tp_bases */ - type->tp_bases = bases; - bases = NULL; - Py_INCREF(base); - type->tp_base = base; - - /* Initialize tp_dict from passed-in dict */ - Py_INCREF(dict); - type->tp_dict = dict; - - /* Set __module__ in the dict */ - r = _PyDict_ContainsId(dict, &PyId___module__); + return -1; + } + return 0; +} + + +/* Set __module__ in the dict */ +static int +type_new_set_module(PyTypeObject *type) +{ + int r = _PyDict_ContainsId(type->tp_dict, &PyId___module__); if (r < 0) { @@ -2671,25 +2706,38 @@ if (r < 0) { - goto error; - } - if (r == 0) { - tmp = PyEval_GetGlobals(); - if (tmp != NULL) { - tmp = _PyDict_GetItemIdWithError(tmp, &PyId___name__); - if (tmp != NULL) { - if (_PyDict_SetItemId(dict, &PyId___module__, - tmp) < 0) - goto error; - } - else if (PyErr_Occurred()) { - goto error; - } - } - } - - /* Set ht_qualname to dict['__qualname__'] if available, else to - __name__. The __qualname__ accessor will look for ht_qualname. - */ - qualname = _PyDict_GetItemIdWithError(dict, &PyId___qualname__); + return -1; + } + if (r > 0) { + return 0; + } + + PyObject *globals = PyEval_GetGlobals(); + if (globals == NULL) { + return 0; + } + + PyObject *module = _PyDict_GetItemIdWithError(globals, &PyId___name__); + if (module == NULL) { + if (PyErr_Occurred()) { + return -1; + } + return 0; + } + + if (_PyDict_SetItemId(type->tp_dict, &PyId___module__, module) < 0) { + return -1; + } + return 0; +} + + +/* Set ht_qualname to dict['__qualname__'] if available, else to + __name__. The __qualname__ accessor will look for ht_qualname. */ +static int +type_new_set_ht_name(PyTypeObject *type) +{ + PyHeapTypeObject *et = (PyHeapTypeObject *)type; + PyObject *qualname = _PyDict_GetItemIdWithError(type->tp_dict, + &PyId___qualname__); if (qualname != NULL) { if (!PyUnicode_Check(qualname)) { PyErr_Format(PyExc_TypeError, @@ -2693,101 +2741,122 @@ if (qualname != NULL) { if (!PyUnicode_Check(qualname)) { PyErr_Format(PyExc_TypeError, - "type __qualname__ must be a str, not %s", - Py_TYPE(qualname)->tp_name); - goto error; - } - } - else if (PyErr_Occurred()) { - goto error; - } - et->ht_qualname = qualname ? qualname : et->ht_name; - Py_INCREF(et->ht_qualname); - if (qualname != NULL && _PyDict_DelItemId(dict, &PyId___qualname__) < 0) - goto error; - - /* Set ht_module */ - et->ht_module = NULL; - - /* Set tp_doc to a copy of dict['__doc__'], if the latter is there - and is a string. The __doc__ accessor will first look for tp_doc; - if that fails, it will still look into __dict__. - */ - { - PyObject *doc = _PyDict_GetItemIdWithError(dict, &PyId___doc__); - if (doc != NULL && PyUnicode_Check(doc)) { - Py_ssize_t len; - const char *doc_str; - char *tp_doc; - - doc_str = PyUnicode_AsUTF8(doc); - if (doc_str == NULL) - goto error; - /* Silently truncate the docstring if it contains null bytes. */ - len = strlen(doc_str); - tp_doc = (char *)PyObject_Malloc(len + 1); - if (tp_doc == NULL) { - PyErr_NoMemory(); - goto error; - } - memcpy(tp_doc, doc_str, len + 1); - type->tp_doc = tp_doc; - } - else if (doc == NULL && PyErr_Occurred()) { - goto error; - } - } - - /* Special-case __new__: if it's a plain function, - make it a static function */ - tmp = _PyDict_GetItemIdWithError(dict, &PyId___new__); - if (tmp != NULL && PyFunction_Check(tmp)) { - tmp = PyStaticMethod_New(tmp); - if (tmp == NULL) - goto error; - if (_PyDict_SetItemId(dict, &PyId___new__, tmp) < 0) { - Py_DECREF(tmp); - goto error; - } - Py_DECREF(tmp); - } - else if (tmp == NULL && PyErr_Occurred()) { - goto error; - } - - /* Special-case __init_subclass__ and __class_getitem__: - if they are plain functions, make them classmethods */ - tmp = _PyDict_GetItemIdWithError(dict, &PyId___init_subclass__); - if (tmp != NULL && PyFunction_Check(tmp)) { - tmp = PyClassMethod_New(tmp); - if (tmp == NULL) - goto error; - if (_PyDict_SetItemId(dict, &PyId___init_subclass__, tmp) < 0) { - Py_DECREF(tmp); - goto error; - } - Py_DECREF(tmp); - } - else if (tmp == NULL && PyErr_Occurred()) { - goto error; - } - - tmp = _PyDict_GetItemIdWithError(dict, &PyId___class_getitem__); - if (tmp != NULL && PyFunction_Check(tmp)) { - tmp = PyClassMethod_New(tmp); - if (tmp == NULL) - goto error; - if (_PyDict_SetItemId(dict, &PyId___class_getitem__, tmp) < 0) { - Py_DECREF(tmp); - goto error; - } - Py_DECREF(tmp); - } - else if (tmp == NULL && PyErr_Occurred()) { - goto error; - } - - /* Add descriptors for custom slots from __slots__, or for __dict__ */ - mp = PyHeapType_GET_MEMBERS(et); - slotoffset = base->tp_basicsize; + "type __qualname__ must be a str, not %s", + Py_TYPE(qualname)->tp_name); + return -1; + } + et->ht_qualname = Py_NewRef(qualname); + if (_PyDict_DelItemId(type->tp_dict, &PyId___qualname__) < 0) { + return -1; + } + } + else { + if (PyErr_Occurred()) { + return -1; + } + et->ht_qualname = Py_NewRef(et->ht_name); + } + return 0; +} + + +/* Set tp_doc to a copy of dict['__doc__'], if the latter is there + and is a string. The __doc__ accessor will first look for tp_doc; + if that fails, it will still look into __dict__. */ +static int +type_new_set_doc(PyTypeObject *type) +{ + PyObject *doc = _PyDict_GetItemIdWithError(type->tp_dict, &PyId___doc__); + if (doc == NULL) { + if (PyErr_Occurred()) { + return -1; + } + // no __doc__ key + return 0; + } + if (!PyUnicode_Check(doc)) { + // ignore non-string __doc__ + return 0; + } + + const char *doc_str = PyUnicode_AsUTF8(doc); + if (doc_str == NULL) { + return -1; + } + + // Silently truncate the docstring if it contains a null byte + Py_ssize_t size = strlen(doc_str) + 1; + char *tp_doc = (char *)PyObject_Malloc(size); + if (tp_doc == NULL) { + PyErr_NoMemory(); + return -1; + } + + memcpy(tp_doc, doc_str, size); + type->tp_doc = tp_doc; + return 0; +} + + +static int +type_new_staticmethod(PyTypeObject *type, _Py_Identifier *attr_id) +{ + PyObject *func = _PyDict_GetItemIdWithError(type->tp_dict, attr_id); + if (func == NULL) { + if (PyErr_Occurred()) { + return -1; + } + return 0; + } + if (!PyFunction_Check(func)) { + return 0; + } + + PyObject *static_func = PyStaticMethod_New(func); + if (static_func == NULL) { + return -1; + } + if (_PyDict_SetItemId(type->tp_dict, attr_id, static_func) < 0) { + Py_DECREF(static_func); + return -1; + } + Py_DECREF(static_func); + return 0; +} + + +static int +type_new_classmethod(PyTypeObject *type, _Py_Identifier *attr_id) +{ + PyObject *func = _PyDict_GetItemIdWithError(type->tp_dict, attr_id); + if (func == NULL) { + if (PyErr_Occurred()) { + return -1; + } + return 0; + } + if (!PyFunction_Check(func)) { + return 0; + } + + PyObject *method = PyClassMethod_New(func); + if (method == NULL) { + return -1; + } + + if (_PyDict_SetItemId(type->tp_dict, attr_id, method) < 0) { + Py_DECREF(method); + return -1; + } + Py_DECREF(method); + return 0; +} + + +/* Add descriptors for custom slots from __slots__, or for __dict__ */ +static int +type_new_descriptors(const type_new_ctx *ctx, PyTypeObject *type) +{ + PyHeapTypeObject *et = (PyHeapTypeObject *)type; + Py_ssize_t slotoffset = ctx->base->tp_basicsize; if (et->ht_slots != NULL) { @@ -2793,4 +2862,6 @@ if (et->ht_slots != NULL) { - for (i = 0; i < nslots; i++, mp++) { + PyMemberDef *mp = PyHeapType_GET_MEMBERS(et); + Py_ssize_t nslot = PyTuple_GET_SIZE(et->ht_slots); + for (Py_ssize_t i = 0; i < nslot; i++, mp++) { mp->name = PyUnicode_AsUTF8( PyTuple_GET_ITEM(et->ht_slots, i)); @@ -2795,7 +2866,8 @@ mp->name = PyUnicode_AsUTF8( PyTuple_GET_ITEM(et->ht_slots, i)); - if (mp->name == NULL) - goto error; + if (mp->name == NULL) { + return -1; + } mp->type = T_OBJECT_EX; mp->offset = slotoffset; @@ -2806,6 +2878,7 @@ slotoffset += sizeof(PyObject *); } } - if (add_dict) { - if (base->tp_itemsize) + + if (ctx->add_dict) { + if (ctx->base->tp_itemsize) { type->tp_dictoffset = -(long)sizeof(PyObject *); @@ -2811,3 +2884,4 @@ type->tp_dictoffset = -(long)sizeof(PyObject *); - else + } + else { type->tp_dictoffset = slotoffset; @@ -2813,3 +2887,4 @@ type->tp_dictoffset = slotoffset; + } slotoffset += sizeof(PyObject *); } @@ -2814,7 +2889,8 @@ slotoffset += sizeof(PyObject *); } - if (add_weak) { - assert(!base->tp_itemsize); + + if (ctx->add_weak) { + assert(!ctx->base->tp_itemsize); type->tp_weaklistoffset = slotoffset; slotoffset += sizeof(PyObject *); } @@ -2818,4 +2894,5 @@ type->tp_weaklistoffset = slotoffset; slotoffset += sizeof(PyObject *); } + type->tp_basicsize = slotoffset; @@ -2821,3 +2898,3 @@ type->tp_basicsize = slotoffset; - type->tp_itemsize = base->tp_itemsize; + type->tp_itemsize = ctx->base->tp_itemsize; type->tp_members = PyHeapType_GET_MEMBERS(et); @@ -2823,4 +2900,10 @@ type->tp_members = PyHeapType_GET_MEMBERS(et); - - if (type->tp_weaklistoffset && type->tp_dictoffset) + return 0; +} + + +static void +type_new_set_slots(const type_new_ctx *ctx, PyTypeObject *type) +{ + if (type->tp_weaklistoffset && type->tp_dictoffset) { type->tp_getset = subtype_getsets_full; @@ -2826,3 +2909,4 @@ type->tp_getset = subtype_getsets_full; - else if (type->tp_weaklistoffset && !type->tp_dictoffset) + } + else if (type->tp_weaklistoffset && !type->tp_dictoffset) { type->tp_getset = subtype_getsets_weakref_only; @@ -2828,3 +2912,4 @@ type->tp_getset = subtype_getsets_weakref_only; - else if (!type->tp_weaklistoffset && type->tp_dictoffset) + } + else if (!type->tp_weaklistoffset && type->tp_dictoffset) { type->tp_getset = subtype_getsets_dict_only; @@ -2830,3 +2915,4 @@ type->tp_getset = subtype_getsets_dict_only; - else + } + else { type->tp_getset = NULL; @@ -2832,3 +2918,4 @@ type->tp_getset = NULL; + } /* Special case some slots */ @@ -2833,5 +2920,6 @@ /* Special case some slots */ - if (type->tp_dictoffset != 0 || nslots > 0) { - if (base->tp_getattr == NULL && base->tp_getattro == NULL) + if (type->tp_dictoffset != 0 || ctx->nslot > 0) { + PyTypeObject *base = ctx->base; + if (base->tp_getattr == NULL && base->tp_getattro == NULL) { type->tp_getattro = PyObject_GenericGetAttr; @@ -2837,3 +2925,4 @@ type->tp_getattro = PyObject_GenericGetAttr; - if (base->tp_setattr == NULL && base->tp_setattro == NULL) + } + if (base->tp_setattr == NULL && base->tp_setattro == NULL) { type->tp_setattro = PyObject_GenericSetAttr; @@ -2839,30 +2928,164 @@ type->tp_setattro = PyObject_GenericSetAttr; - } - type->tp_dealloc = subtype_dealloc; - - /* Always override allocation strategy to use regular heap */ - type->tp_alloc = PyType_GenericAlloc; - type->tp_free = PyObject_GC_Del; - type->tp_traverse = subtype_traverse; - type->tp_clear = subtype_clear; - - /* store type in class' cell if one is supplied */ - cell = _PyDict_GetItemIdWithError(dict, &PyId___classcell__); - if (cell != NULL) { - /* At least one method requires a reference to its defining class */ - if (!PyCell_Check(cell)) { - PyErr_Format(PyExc_TypeError, - "__classcell__ must be a nonlocal cell, not %.200R", - Py_TYPE(cell)); - goto error; - } - PyCell_Set(cell, (PyObject *) type); - if (_PyDict_DelItemId(dict, &PyId___classcell__) < 0) { - goto error; - } - } - else if (PyErr_Occurred()) { + } + } +} + + +/* store type in class' cell if one is supplied */ +static int +type_new_set_classcell(PyTypeObject *type) +{ + PyObject *cell = _PyDict_GetItemIdWithError(type->tp_dict, + &PyId___classcell__); + if (cell == NULL) { + if (PyErr_Occurred()) { + return -1; + } + return 0; + } + + /* At least one method requires a reference to its defining class */ + if (!PyCell_Check(cell)) { + PyErr_Format(PyExc_TypeError, + "__classcell__ must be a nonlocal cell, not %.200R", + Py_TYPE(cell)); + return -1; + } + + (void)PyCell_Set(cell, (PyObject *) type); + if (_PyDict_DelItemId(type->tp_dict, &PyId___classcell__) < 0) { + return -1; + } + return 0; +} + + +static int +type_new_set_attrs(const type_new_ctx *ctx, PyTypeObject *type) +{ + if (type_new_set_name(ctx, type) < 0) { + return -1; + } + + if (type_new_set_module(type) < 0) { + return -1; + } + + if (type_new_set_ht_name(type) < 0) { + return -1; + } + + if (type_new_set_doc(type) < 0) { + return -1; + } + + /* Special-case __new__: if it's a plain function, + make it a static function */ + if (type_new_staticmethod(type, &PyId___new__) < 0) { + return -1; + } + + /* Special-case __init_subclass__ and __class_getitem__: + if they are plain functions, make them classmethods */ + if (type_new_classmethod(type, &PyId___init_subclass__) < 0) { + return -1; + } + if (type_new_classmethod(type, &PyId___class_getitem__) < 0) { + return -1; + } + + if (type_new_descriptors(ctx, type) < 0) { + return -1; + } + + type_new_set_slots(ctx, type); + + if (type_new_set_classcell(type) < 0) { + return -1; + } + return 0; +} + + +static int +type_new_get_slots(type_new_ctx *ctx, PyObject *dict) +{ + _Py_IDENTIFIER(__slots__); + PyObject *slots = _PyDict_GetItemIdWithError(dict, &PyId___slots__); + if (slots == NULL) { + if (PyErr_Occurred()) { + return -1; + } + ctx->slots = NULL; + ctx->nslot = 0; + return 0; + } + + // Make it into a tuple + PyObject *new_slots; + if (PyUnicode_Check(slots)) { + new_slots = PyTuple_Pack(1, slots); + } + else { + new_slots = PySequence_Tuple(slots); + } + if (new_slots == NULL) { + return -1; + } + assert(PyTuple_CheckExact(new_slots)); + ctx->slots = new_slots; + ctx->nslot = PyTuple_GET_SIZE(new_slots); + return 0; +} + + +static PyTypeObject* +type_new_init(type_new_ctx *ctx) +{ + PyObject *dict = PyDict_Copy(ctx->orig_dict); + if (dict == NULL) { + goto error; + } + + if (type_new_get_slots(ctx, dict) < 0) { + goto error; + } + assert(!PyErr_Occurred()); + + if (type_new_slots(ctx, dict) < 0) { + goto error; + } + + PyTypeObject *type = type_new_alloc(ctx); + if (type == NULL) { + goto error; + } + + type->tp_dict = dict; + + PyHeapTypeObject *et = (PyHeapTypeObject*)type; + et->ht_slots = ctx->slots; + ctx->slots = NULL; + + return type; + +error: + Py_CLEAR(ctx->slots); + Py_XDECREF(dict); + return NULL; +} + + +static PyObject* +type_new_impl(type_new_ctx *ctx) +{ + PyTypeObject *type = type_new_init(ctx); + if (type == NULL) { + return NULL; + } + + if (type_new_set_attrs(ctx, type) < 0) { goto error; } /* Initialize the rest */ @@ -2865,6 +3088,6 @@ goto error; } /* Initialize the rest */ - if (PyType_Ready(type) < 0) + if (PyType_Ready(type) < 0) { goto error; @@ -2870,6 +3093,7 @@ goto error; - - /* Put the proper slots in place */ + } + + // Put the proper slots in place fixup_slot_dispatchers(type); if (type->tp_dictoffset) { @@ -2873,6 +3097,7 @@ fixup_slot_dispatchers(type); if (type->tp_dictoffset) { + PyHeapTypeObject *et = (PyHeapTypeObject*)type; et->ht_cached_keys = _PyDict_NewKeysForClass(); } @@ -2876,5 +3101,5 @@ et->ht_cached_keys = _PyDict_NewKeysForClass(); } - if (set_names(type) < 0) + if (type_new_set_names(type) < 0) { goto error; @@ -2880,4 +3105,5 @@ goto error; - - if (init_subclass(type, kwds) < 0) + } + + if (type_new_init_subclass(type, ctx->kwds) < 0) { goto error; @@ -2883,6 +3109,5 @@ goto error; - - Py_DECREF(dict); + } return (PyObject *)type; error: @@ -2886,10 +3111,7 @@ return (PyObject *)type; error: - Py_XDECREF(dict); - Py_XDECREF(bases); - Py_XDECREF(slots); - Py_XDECREF(type); + Py_DECREF(type); return NULL; } @@ -2893,6 +3115,119 @@ return NULL; } + +static int +type_new_get_bases(type_new_ctx *ctx, PyObject **type) +{ + Py_ssize_t nbases = PyTuple_GET_SIZE(ctx->bases); + if (nbases == 0) { + // Adjust for empty tuple bases + ctx->base = &PyBaseObject_Type; + PyObject *new_bases = PyTuple_Pack(1, ctx->base); + if (new_bases == NULL) { + return -1; + } + ctx->bases = new_bases; + return 0; + } + + _Py_IDENTIFIER(__mro_entries__); + for (Py_ssize_t i = 0; i < nbases; i++) { + PyObject *base = PyTuple_GET_ITEM(ctx->bases, i); + if (PyType_Check(base)) { + continue; + } + PyObject *mro_entries; + if (_PyObject_LookupAttrId(base, &PyId___mro_entries__, + &mro_entries) < 0) { + return -1; + } + if (mro_entries != NULL) { + PyErr_SetString(PyExc_TypeError, + "type() doesn't support MRO entry resolution; " + "use types.new_class()"); + Py_DECREF(mro_entries); + return -1; + } + } + + // Search the bases for the proper metatype to deal with this + PyTypeObject *winner; + winner = _PyType_CalculateMetaclass(ctx->metatype, ctx->bases); + if (winner == NULL) { + return -1; + } + + if (winner != ctx->metatype) { + if (winner->tp_new != type_new) { + /* Pass it to the winner */ + *type = winner->tp_new(winner, ctx->args, ctx->kwds); + return 1; + } + + ctx->metatype = winner; + } + + /* Calculate best base, and check that all bases are type objects */ + PyTypeObject *base = best_base(ctx->bases); + if (base == NULL) { + return -1; + } + + ctx->base = base; + ctx->bases = Py_NewRef(ctx->bases); + return 0; +} + + +static PyObject * +type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds) +{ + assert(args != NULL && PyTuple_Check(args)); + assert(kwds == NULL || PyDict_Check(kwds)); + + /* Parse arguments: (name, bases, dict) */ + PyObject *name, *bases, *orig_dict; + if (!PyArg_ParseTuple(args, "UO!O!:type.__new__", + &name, + &PyTuple_Type, &bases, + &PyDict_Type, &orig_dict)) + { + return NULL; + } + + type_new_ctx ctx = { + .metatype = metatype, + .args = args, + .kwds = kwds, + .orig_dict = orig_dict, + .name = name, + .bases = bases, + .base = NULL, + .slots = NULL, + .nslot = 0, + .add_dict = 0, + .add_weak = 0, + .may_add_dict = 0, + .may_add_weak = 0}; + PyObject *type = NULL; + int res = type_new_get_bases(&ctx, &type); + if (res < 0) { + return NULL; + } + if (res == 1) { + assert(type != NULL); + return type; + } + assert(ctx.base != NULL); + assert(ctx.bases != NULL); + + type = type_new_impl(&ctx); + Py_DECREF(ctx.bases); + return type; +} + + static PyObject * type_vectorcall(PyObject *metatype, PyObject *const *args, size_t nargsf, PyObject *kwnames) @@ -3351,11 +3686,9 @@ PyObject *res; int error; - if (MCACHE_CACHEABLE_NAME(name) && - _PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG)) { - /* fast path */ - unsigned int h = MCACHE_HASH_METHOD(type, name); - struct type_cache *cache = get_type_cache(); - struct type_cache_entry *entry = &cache->hashtable[h]; - if (entry->version == type->tp_version_tag && entry->name == name) { + unsigned int h = MCACHE_HASH_METHOD(type, name); + struct type_cache *cache = get_type_cache(); + struct type_cache_entry *entry = &cache->hashtable[h]; + if (entry->version == type->tp_version_tag && + entry->name == name) { #if MCACHE_STATS @@ -3361,3 +3694,3 @@ #if MCACHE_STATS - cache->hits++; + cache->hits++; #endif @@ -3363,6 +3696,6 @@ #endif - return entry->value; - } + assert(_PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG)); + return entry->value; } /* We may end up clearing live exceptions below, so make sure it's ours. */ @@ -3385,12 +3718,10 @@ return NULL; } - if (MCACHE_CACHEABLE_NAME(name)) { - struct type_cache *cache = get_type_cache(); - if (assign_version_tag(cache, type)) { - unsigned int h = MCACHE_HASH_METHOD(type, name); - struct type_cache_entry *entry = &cache->hashtable[h]; - entry->version = type->tp_version_tag; - entry->value = res; /* borrowed */ - assert(((PyASCIIObject *)(name))->hash != -1); + if (MCACHE_CACHEABLE_NAME(name) && assign_version_tag(cache, type)) { + h = MCACHE_HASH_METHOD(type, name); + struct type_cache_entry *entry = &cache->hashtable[h]; + entry->version = type->tp_version_tag; + entry->value = res; /* borrowed */ + assert(((PyASCIIObject *)(name))->hash != -1); #if MCACHE_STATS @@ -3396,8 +3727,8 @@ #if MCACHE_STATS - if (entry->name != Py_None && entry->name != name) { - cache->collisions++; - } - else { - cache->misses++; - } + if (entry->name != Py_None && entry->name != name) { + cache->collisions++; + } + else { + cache->misses++; + } #endif @@ -3403,6 +3734,6 @@ #endif - Py_SETREF(entry->name, Py_NewRef(name)); - } + assert(_PyType_HasFeature(type, Py_TPFLAGS_VALID_VERSION_TAG)); + Py_SETREF(entry->name, Py_NewRef(name)); } return res; } @@ -3453,7 +3784,7 @@ } /* Initialize this type (we'll assume the metatype is initialized) */ - if (type->tp_dict == NULL) { + if (!_PyType_IsReady(type)) { if (PyType_Ready(type) < 0) return NULL; } @@ -5106,6 +5437,4 @@ }; -/* Add the methods from tp_methods to the __dict__ in a type object */ - static int @@ -5111,5 +5440,30 @@ static int -add_methods(PyTypeObject *type, PyMethodDef *meth) -{ - PyObject *dict = type->tp_dict; +type_add_method(PyTypeObject *type, PyMethodDef *meth) +{ + PyObject *descr; + int isdescr = 1; + if (meth->ml_flags & METH_CLASS) { + if (meth->ml_flags & METH_STATIC) { + PyErr_SetString(PyExc_ValueError, + "method cannot be both class and static"); + return -1; + } + descr = PyDescr_NewClassMethod(type, meth); + } + else if (meth->ml_flags & METH_STATIC) { + PyObject *cfunc = PyCFunction_NewEx(meth, (PyObject*)type, NULL); + if (cfunc == NULL) { + return -1; + } + descr = PyStaticMethod_New(cfunc); + isdescr = 0; // PyStaticMethod is not PyDescrObject + Py_DECREF(cfunc); + } + else { + descr = PyDescr_NewMethod(type, meth); + } + if (descr == NULL) { + return -1; + } + PyObject *name; @@ -5115,3 +5469,40 @@ PyObject *name; + if (isdescr) { + name = PyDescr_NAME(descr); + } + else { + name = PyUnicode_FromString(meth->ml_name); + if (name == NULL) { + Py_DECREF(descr); + return -1; + } + } + + int err; + if (!(meth->ml_flags & METH_COEXIST)) { + err = PyDict_SetDefault(type->tp_dict, name, descr) == NULL; + } + else { + err = PyDict_SetItem(type->tp_dict, name, descr) < 0; + } + if (!isdescr) { + Py_DECREF(name); + } + Py_DECREF(descr); + if (err) { + return -1; + } + return 0; +} + + +/* Add the methods from tp_methods to the __dict__ in a type object */ +static int +type_add_methods(PyTypeObject *type) +{ + PyMethodDef *meth = type->tp_methods; + if (meth == NULL) { + return 0; + } for (; meth->ml_name != NULL; meth++) { @@ -5116,26 +5507,4 @@ for (; meth->ml_name != NULL; meth++) { - PyObject *descr; - int err; - int isdescr = 1; - if (meth->ml_flags & METH_CLASS) { - if (meth->ml_flags & METH_STATIC) { - PyErr_SetString(PyExc_ValueError, - "method cannot be both class and static"); - return -1; - } - descr = PyDescr_NewClassMethod(type, meth); - } - else if (meth->ml_flags & METH_STATIC) { - PyObject *cfunc = PyCFunction_NewEx(meth, (PyObject*)type, NULL); - if (cfunc == NULL) - return -1; - descr = PyStaticMethod_New(cfunc); - isdescr = 0; // PyStaticMethod is not PyDescrObject - Py_DECREF(cfunc); - } - else { - descr = PyDescr_NewMethod(type, meth); - } - if (descr == NULL) + if (type_add_method(type, meth) < 0) { return -1; @@ -5141,29 +5510,6 @@ return -1; - - if (isdescr) { - name = PyDescr_NAME(descr); - } - else { - name = PyUnicode_FromString(meth->ml_name); - if (name == NULL) { - Py_DECREF(descr); - return -1; - } - } - - if (!(meth->ml_flags & METH_COEXIST)) { - err = PyDict_SetDefault(dict, name, descr) == NULL; - } - else { - err = PyDict_SetItem(dict, name, descr) < 0; - } - if (!isdescr) { - Py_DECREF(name); - } - Py_DECREF(descr); - if (err) - return -1; + } } return 0; } @@ -5166,5 +5512,6 @@ } return 0; } + static int @@ -5170,4 +5517,9 @@ static int -add_members(PyTypeObject *type, PyMemberDef *memb) -{ +type_add_members(PyTypeObject *type) +{ + PyMemberDef *memb = type->tp_members; + if (memb == NULL) { + return 0; + } + PyObject *dict = type->tp_dict; @@ -5173,5 +5525,4 @@ PyObject *dict = type->tp_dict; - for (; memb->name != NULL; memb++) { PyObject *descr = PyDescr_NewMember(type, memb); if (descr == NULL) @@ -5186,4 +5537,5 @@ return 0; } + static int @@ -5189,4 +5541,9 @@ static int -add_getset(PyTypeObject *type, PyGetSetDef *gsp) -{ +type_add_getset(PyTypeObject *type) +{ + PyGetSetDef *gsp = type->tp_getset; + if (gsp == NULL) { + return 0; + } + PyObject *dict = type->tp_dict; @@ -5192,4 +5549,3 @@ PyObject *dict = type->tp_dict; - for (; gsp->name != NULL; gsp++) { PyObject *descr = PyDescr_NewGetSet(type, gsp); @@ -5194,4 +5550,4 @@ for (; gsp->name != NULL; gsp++) { PyObject *descr = PyDescr_NewGetSet(type, gsp); - if (descr == NULL) + if (descr == NULL) { return -1; @@ -5197,4 +5553,5 @@ return -1; + } if (PyDict_SetDefault(dict, PyDescr_NAME(descr), descr) == NULL) { Py_DECREF(descr); @@ -5205,6 +5562,7 @@ return 0; } + static void inherit_special(PyTypeObject *type, PyTypeObject *base) { @@ -5241,5 +5599,4 @@ /* Copy other non-function slots */ -#undef COPYVAL #define COPYVAL(SLOT) \ @@ -5245,6 +5602,6 @@ #define COPYVAL(SLOT) \ - if (type->SLOT == 0) type->SLOT = base->SLOT + if (type->SLOT == 0) { type->SLOT = base->SLOT; } COPYVAL(tp_itemsize); COPYVAL(tp_weaklistoffset); COPYVAL(tp_dictoffset); @@ -5247,6 +5604,7 @@ COPYVAL(tp_itemsize); COPYVAL(tp_weaklistoffset); COPYVAL(tp_dictoffset); +#undef COPYVAL /* Setup fast subclass flags */ @@ -5251,4 +5609,4 @@ /* Setup fast subclass flags */ - if (PyType_IsSubtype(base, (PyTypeObject*)PyExc_BaseException)) + if (PyType_IsSubtype(base, (PyTypeObject*)PyExc_BaseException)) { type->tp_flags |= Py_TPFLAGS_BASE_EXC_SUBCLASS; @@ -5254,3 +5612,4 @@ type->tp_flags |= Py_TPFLAGS_BASE_EXC_SUBCLASS; - else if (PyType_IsSubtype(base, &PyType_Type)) + } + else if (PyType_IsSubtype(base, &PyType_Type)) { type->tp_flags |= Py_TPFLAGS_TYPE_SUBCLASS; @@ -5256,3 +5615,4 @@ type->tp_flags |= Py_TPFLAGS_TYPE_SUBCLASS; - else if (PyType_IsSubtype(base, &PyLong_Type)) + } + else if (PyType_IsSubtype(base, &PyLong_Type)) { type->tp_flags |= Py_TPFLAGS_LONG_SUBCLASS; @@ -5258,3 +5618,4 @@ type->tp_flags |= Py_TPFLAGS_LONG_SUBCLASS; - else if (PyType_IsSubtype(base, &PyBytes_Type)) + } + else if (PyType_IsSubtype(base, &PyBytes_Type)) { type->tp_flags |= Py_TPFLAGS_BYTES_SUBCLASS; @@ -5260,3 +5621,4 @@ type->tp_flags |= Py_TPFLAGS_BYTES_SUBCLASS; - else if (PyType_IsSubtype(base, &PyUnicode_Type)) + } + else if (PyType_IsSubtype(base, &PyUnicode_Type)) { type->tp_flags |= Py_TPFLAGS_UNICODE_SUBCLASS; @@ -5262,3 +5624,4 @@ type->tp_flags |= Py_TPFLAGS_UNICODE_SUBCLASS; - else if (PyType_IsSubtype(base, &PyTuple_Type)) + } + else if (PyType_IsSubtype(base, &PyTuple_Type)) { type->tp_flags |= Py_TPFLAGS_TUPLE_SUBCLASS; @@ -5264,3 +5627,4 @@ type->tp_flags |= Py_TPFLAGS_TUPLE_SUBCLASS; - else if (PyType_IsSubtype(base, &PyList_Type)) + } + else if (PyType_IsSubtype(base, &PyList_Type)) { type->tp_flags |= Py_TPFLAGS_LIST_SUBCLASS; @@ -5266,3 +5630,4 @@ type->tp_flags |= Py_TPFLAGS_LIST_SUBCLASS; - else if (PyType_IsSubtype(base, &PyDict_Type)) + } + else if (PyType_IsSubtype(base, &PyDict_Type)) { type->tp_flags |= Py_TPFLAGS_DICT_SUBCLASS; @@ -5268,4 +5633,5 @@ type->tp_flags |= Py_TPFLAGS_DICT_SUBCLASS; + } if (PyType_HasFeature(base, _Py_TPFLAGS_MATCH_SELF)) { type->tp_flags |= _Py_TPFLAGS_MATCH_SELF; @@ -5486,20 +5852,10 @@ static int add_operators(PyTypeObject *); -int -PyType_Ready(PyTypeObject *type) -{ - PyObject *dict, *bases; - PyTypeObject *base; - Py_ssize_t i, n; - - if (type->tp_flags & Py_TPFLAGS_READY) { - assert(_PyType_CheckConsistency(type)); - return 0; - } - _PyObject_ASSERT((PyObject *)type, - (type->tp_flags & Py_TPFLAGS_READYING) == 0); - + +static int +type_ready_checks(PyTypeObject *type) +{ /* Consistency checks for PEP 590: * - Py_TPFLAGS_METHOD_DESCRIPTOR requires tp_descr_get * - Py_TPFLAGS_HAVE_VECTORCALL requires tp_call and @@ -5513,6 +5869,7 @@ _PyObject_ASSERT((PyObject *)type, type->tp_vectorcall_offset > 0); _PyObject_ASSERT((PyObject *)type, type->tp_call != NULL); } + /* Consistency check for Py_TPFLAGS_HAVE_AM_SEND - flag requires * type->tp_as_async->am_send to be present. */ @@ -5521,17 +5878,6 @@ _PyObject_ASSERT((PyObject *)type, type->tp_as_async->am_send != NULL); } - type->tp_flags |= Py_TPFLAGS_READYING; - -#ifdef Py_TRACE_REFS - /* PyType_Ready is the closest thing we have to a choke point - * for type objects, so is the best place I can think of to try - * to get type objects into the doubly-linked list of all objects. - * Still, not all type objects go through PyType_Ready. - */ - _Py_AddToAllObjects((PyObject *)type, 0); -#endif - if (type->tp_name == NULL) { PyErr_Format(PyExc_SystemError, "Type does not define the tp_name field."); @@ -5535,7 +5881,13 @@ if (type->tp_name == NULL) { PyErr_Format(PyExc_SystemError, "Type does not define the tp_name field."); - goto error; - } - + return -1; + } + return 0; +} + + +static int +type_ready_set_bases(PyTypeObject *type) +{ /* Initialize tp_base (defaults to BaseObject unless that's us) */ @@ -5541,5 +5893,5 @@ /* Initialize tp_base (defaults to BaseObject unless that's us) */ - base = type->tp_base; + PyTypeObject *base = type->tp_base; if (base == NULL && type != &PyBaseObject_Type) { base = &PyBaseObject_Type; if (type->tp_flags & Py_TPFLAGS_HEAPTYPE) { @@ -5551,7 +5903,6 @@ } /* Now the only way base can still be NULL is if type is - * &PyBaseObject_Type. - */ + * &PyBaseObject_Type. */ /* Initialize the base class */ @@ -5556,8 +5907,9 @@ /* Initialize the base class */ - if (base != NULL && base->tp_dict == NULL) { - if (PyType_Ready(base) < 0) - goto error; + if (base != NULL && !_PyType_IsReady(base)) { + if (PyType_Ready(base) < 0) { + return -1; + } } /* Initialize ob_type if NULL. This means extensions that want to be @@ -5572,5 +5924,5 @@ } /* Initialize tp_bases */ - bases = type->tp_bases; + PyObject *bases = type->tp_bases; if (bases == NULL) { @@ -5576,3 +5928,4 @@ if (bases == NULL) { - if (base == NULL) + PyTypeObject *base = type->tp_base; + if (base == NULL) { bases = PyTuple_New(0); @@ -5578,3 +5931,4 @@ bases = PyTuple_New(0); - else + } + else { bases = PyTuple_Pack(1, base); @@ -5580,5 +5934,7 @@ bases = PyTuple_Pack(1, base); - if (bases == NULL) - goto error; + } + if (bases == NULL) { + return -1; + } type->tp_bases = bases; } @@ -5583,6 +5939,15 @@ type->tp_bases = bases; } - - /* Initialize tp_dict */ - dict = type->tp_dict; + return 0; +} + + +static int +type_ready_set_dict(PyTypeObject *type) +{ + if (type->tp_dict != NULL) { + return 0; + } + + PyObject *dict = PyDict_New(); if (dict == NULL) { @@ -5588,8 +5953,48 @@ if (dict == NULL) { - dict = PyDict_New(); - if (dict == NULL) - goto error; - type->tp_dict = dict; - } - + return -1; + } + type->tp_dict = dict; + return 0; +} + + +/* If the type dictionary doesn't contain a __doc__, set it from + the tp_doc slot. */ +static int +type_dict_set_doc(PyTypeObject *type) +{ + int r = _PyDict_ContainsId(type->tp_dict, &PyId___doc__); + if (r < 0) { + return -1; + } + if (r > 0) { + return 0; + } + + if (type->tp_doc != NULL) { + const char *doc_str; + doc_str = _PyType_DocWithoutSignature(type->tp_name, type->tp_doc); + PyObject *doc = PyUnicode_FromString(doc_str); + if (doc == NULL) { + return -1; + } + + if (_PyDict_SetItemId(type->tp_dict, &PyId___doc__, doc) < 0) { + Py_DECREF(doc); + return -1; + } + Py_DECREF(doc); + } + else { + if (_PyDict_SetItemId(type->tp_dict, &PyId___doc__, Py_None) < 0) { + return -1; + } + } + return 0; +} + + +static int +type_ready_fill_dict(PyTypeObject *type) +{ /* Add type-specific descriptors to tp_dict */ @@ -5595,17 +6000,24 @@ /* Add type-specific descriptors to tp_dict */ - if (add_operators(type) < 0) - goto error; - if (type->tp_methods != NULL) { - if (add_methods(type, type->tp_methods) < 0) - goto error; - } - if (type->tp_members != NULL) { - if (add_members(type, type->tp_members) < 0) - goto error; - } - if (type->tp_getset != NULL) { - if (add_getset(type, type->tp_getset) < 0) - goto error; - } - + if (add_operators(type) < 0) { + return -1; + } + if (type_add_methods(type) < 0) { + return -1; + } + if (type_add_members(type) < 0) { + return -1; + } + if (type_add_getset(type) < 0) { + return -1; + } + if (type_dict_set_doc(type) < 0) { + return -1; + } + return 0; +} + + +static int +type_ready_mro(PyTypeObject *type) +{ /* Calculate method resolution order */ @@ -5611,23 +6023,8 @@ /* Calculate method resolution order */ - if (mro_internal(type, NULL) < 0) - goto error; - - /* Inherit special flags from dominant base */ - if (type->tp_base != NULL) - inherit_special(type, type->tp_base); - - /* Initialize tp_dict properly */ - bases = type->tp_mro; - assert(bases != NULL); - assert(PyTuple_Check(bases)); - n = PyTuple_GET_SIZE(bases); - for (i = 1; i < n; i++) { - PyObject *b = PyTuple_GET_ITEM(bases, i); - if (PyType_Check(b)) { - if (inherit_slots(type, (PyTypeObject *)b) < 0) { - goto error; - } - } - } + if (mro_internal(type, NULL) < 0) { + return -1; + } + assert(type->tp_mro != NULL); + assert(PyTuple_Check(type->tp_mro)); /* All bases of statically allocated type should be statically allocated */ @@ -5632,10 +6029,11 @@ /* All bases of statically allocated type should be statically allocated */ - if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE)) - for (i = 0; i < n; i++) { - PyObject *b = PyTuple_GET_ITEM(bases, i); - if (PyType_Check(b) && - (((PyTypeObject *)b)->tp_flags & Py_TPFLAGS_HEAPTYPE)) { + if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE)) { + PyObject *mro = type->tp_mro; + Py_ssize_t n = PyTuple_GET_SIZE(mro); + for (Py_ssize_t i = 0; i < n; i++) { + PyTypeObject *base = (PyTypeObject *)PyTuple_GET_ITEM(mro, i); + if (PyType_Check(base) && (base->tp_flags & Py_TPFLAGS_HEAPTYPE)) { PyErr_Format(PyExc_TypeError, "type '%.100s' is not dynamically allocated but " "its base type '%.100s' is dynamically allocated", @@ -5639,7 +6037,7 @@ PyErr_Format(PyExc_TypeError, "type '%.100s' is not dynamically allocated but " "its base type '%.100s' is dynamically allocated", - type->tp_name, ((PyTypeObject *)b)->tp_name); - goto error; + type->tp_name, base->tp_name); + return -1; } } @@ -5644,5 +6042,60 @@ } } + } + return 0; +} + + +// For static types, inherit tp_as_xxx structures from the base class +// if it's NULL. +// +// For heap types, tp_as_xxx structures are not NULL: they are set to the +// PyHeapTypeObject.as_xxx fields by type_new_alloc(). +static void +type_ready_inherit_as_structs(PyTypeObject *type, PyTypeObject *base) +{ + if (type->tp_as_async == NULL) { + type->tp_as_async = base->tp_as_async; + } + if (type->tp_as_number == NULL) { + type->tp_as_number = base->tp_as_number; + } + if (type->tp_as_sequence == NULL) { + type->tp_as_sequence = base->tp_as_sequence; + } + if (type->tp_as_mapping == NULL) { + type->tp_as_mapping = base->tp_as_mapping; + } + if (type->tp_as_buffer == NULL) { + type->tp_as_buffer = base->tp_as_buffer; + } +} + + +static int +type_ready_inherit(PyTypeObject *type) +{ + /* Inherit special flags from dominant base */ + PyTypeObject *base = type->tp_base; + if (base != NULL) { + inherit_special(type, base); + } + + // Inherit slots + PyObject *mro = type->tp_mro; + Py_ssize_t n = PyTuple_GET_SIZE(type->tp_mro); + for (Py_ssize_t i = 1; i < n; i++) { + PyObject *b = PyTuple_GET_ITEM(mro, i); + if (PyType_Check(b)) { + if (inherit_slots(type, (PyTypeObject *)b) < 0) { + return -1; + } + } + } + + if (base != NULL) { + type_ready_inherit_as_structs(type, base); + } /* Sanity check for tp_free. */ if (_PyType_IS_GC(type) && (type->tp_flags & Py_TPFLAGS_BASETYPE) && @@ -5646,7 +6099,8 @@ /* Sanity check for tp_free. */ if (_PyType_IS_GC(type) && (type->tp_flags & Py_TPFLAGS_BASETYPE) && - (type->tp_free == NULL || type->tp_free == PyObject_Del)) { + (type->tp_free == NULL || type->tp_free == PyObject_Del)) + { /* This base class needs to call tp_free, but doesn't have * one, or its tp_free is for non-gc'ed objects. */ @@ -5654,11 +6108,24 @@ "gc and is a base type but has inappropriate " "tp_free slot", type->tp_name); - goto error; - } - - /* if the type dictionary doesn't contain a __doc__, set it from - the tp_doc slot. - */ - int r = _PyDict_ContainsId(type->tp_dict, &PyId___doc__); + return -1; + } + + return 0; +} + + +/* Hack for tp_hash and __hash__. + If after all that, tp_hash is still NULL, and __hash__ is not in + tp_dict, set tp_hash to PyObject_HashNotImplemented and + tp_dict['__hash__'] equal to None. + This signals that __hash__ is not inherited. */ +static int +type_ready_set_hash(PyTypeObject *type) +{ + if (type->tp_hash != NULL) { + return 0; + } + + int r = _PyDict_ContainsId(type->tp_dict, &PyId___hash__); if (r < 0) { @@ -5664,28 +6131,44 @@ if (r < 0) { - goto error; - } - if (r == 0) { - if (type->tp_doc != NULL) { - const char *old_doc = _PyType_DocWithoutSignature(type->tp_name, - type->tp_doc); - PyObject *doc = PyUnicode_FromString(old_doc); - if (doc == NULL) - goto error; - if (_PyDict_SetItemId(type->tp_dict, &PyId___doc__, doc) < 0) { - Py_DECREF(doc); - goto error; - } - Py_DECREF(doc); - } else { - if (_PyDict_SetItemId(type->tp_dict, - &PyId___doc__, Py_None) < 0) - goto error; - } - } - - /* Hack for tp_hash and __hash__. - If after all that, tp_hash is still NULL, and __hash__ is not in - tp_dict, set tp_hash to PyObject_HashNotImplemented and - tp_dict['__hash__'] equal to None. - This signals that __hash__ is not inherited. + return -1; + } + if (r > 0) { + return 0; + } + + if (_PyDict_SetItemId(type->tp_dict, &PyId___hash__, Py_None) < 0) { + return -1; + } + type->tp_hash = PyObject_HashNotImplemented; + return 0; +} + + +/* Link into each base class's list of subclasses */ +static int +type_ready_add_subclasses(PyTypeObject *type) +{ + PyObject *bases = type->tp_bases; + Py_ssize_t nbase = PyTuple_GET_SIZE(bases); + for (Py_ssize_t i = 0; i < nbase; i++) { + PyObject *b = PyTuple_GET_ITEM(bases, i); + if (PyType_Check(b) && add_subclass((PyTypeObject *)b, type) < 0) { + return -1; + } + } + return 0; +} + + +static int +type_ready(PyTypeObject *type) +{ + if (type_ready_checks(type) < 0) { + return -1; + } + +#ifdef Py_TRACE_REFS + /* PyType_Ready is the closest thing we have to a choke point + * for type objects, so is the best place I can think of to try + * to get type objects into the doubly-linked list of all objects. + * Still, not all type objects go through PyType_Ready. */ @@ -5691,39 +6174,48 @@ */ - if (type->tp_hash == NULL) { - r = _PyDict_ContainsId(type->tp_dict, &PyId___hash__); - if (r < 0) { - goto error; - } - if (r == 0) { - if (_PyDict_SetItemId(type->tp_dict, &PyId___hash__, Py_None) < 0) { - goto error; - } - type->tp_hash = PyObject_HashNotImplemented; - } - } - - /* Some more special stuff */ - base = type->tp_base; - if (base != NULL) { - if (type->tp_as_async == NULL) - type->tp_as_async = base->tp_as_async; - if (type->tp_as_number == NULL) - type->tp_as_number = base->tp_as_number; - if (type->tp_as_sequence == NULL) - type->tp_as_sequence = base->tp_as_sequence; - if (type->tp_as_mapping == NULL) - type->tp_as_mapping = base->tp_as_mapping; - if (type->tp_as_buffer == NULL) - type->tp_as_buffer = base->tp_as_buffer; - } - - /* Link into each base class's list of subclasses */ - bases = type->tp_bases; - n = PyTuple_GET_SIZE(bases); - for (i = 0; i < n; i++) { - PyObject *b = PyTuple_GET_ITEM(bases, i); - if (PyType_Check(b) && - add_subclass((PyTypeObject *)b, type) < 0) - goto error; - } + _Py_AddToAllObjects((PyObject *)type, 0); +#endif + + /* Initialize tp_dict: _PyType_IsReady() tests if tp_dict != NULL */ + if (type_ready_set_dict(type) < 0) { + return -1; + } + if (type_ready_set_bases(type) < 0) { + return -1; + } + if (type_ready_mro(type) < 0) { + return -1; + } + if (type_ready_fill_dict(type) < 0) { + return -1; + } + if (type_ready_inherit(type) < 0) { + return -1; + } + if (type_ready_set_hash(type) < 0) { + return -1; + } + if (type_ready_add_subclasses(type) < 0) { + return -1; + } + return 0; +} + + +int +PyType_Ready(PyTypeObject *type) +{ + if (type->tp_flags & Py_TPFLAGS_READY) { + assert(_PyType_CheckConsistency(type)); + return 0; + } + _PyObject_ASSERT((PyObject *)type, + (type->tp_flags & Py_TPFLAGS_READYING) == 0); + + type->tp_flags |= Py_TPFLAGS_READYING; + + if (type_ready(type) < 0) { + type->tp_flags &= ~Py_TPFLAGS_READYING; + return -1; + } + /* All done -- set the ready flag */ @@ -5729,5 +6221,4 @@ /* All done -- set the ready flag */ - type->tp_flags = - (type->tp_flags & ~Py_TPFLAGS_READYING) | Py_TPFLAGS_READY; + type->tp_flags = (type->tp_flags & ~Py_TPFLAGS_READYING) | Py_TPFLAGS_READY; assert(_PyType_CheckConsistency(type)); return 0; @@ -5732,10 +6223,7 @@ assert(_PyType_CheckConsistency(type)); return 0; - - error: - type->tp_flags &= ~Py_TPFLAGS_READYING; - return -1; -} +} + static int add_subclass(PyTypeObject *base, PyTypeObject *type) @@ -7764,6 +8252,5 @@ static void fixup_slot_dispatchers(PyTypeObject *type) { - slotdef *p; - + assert(!PyErr_Occurred()); assert(slotdefs_initialized); @@ -7769,3 +8256,3 @@ assert(slotdefs_initialized); - for (p = slotdefs; p->name; ) + for (slotdef *p = slotdefs; p->name; ) { p = update_one_slot(type, p); @@ -7771,4 +8258,5 @@ p = update_one_slot(type, p); + } } static void @@ -7786,5 +8274,6 @@ } } + /* Call __set_name__ on all descriptors in a newly generated type */ static int @@ -7789,6 +8278,10 @@ /* Call __set_name__ on all descriptors in a newly generated type */ static int -set_names(PyTypeObject *type) -{ - PyObject *names_to_set, *key, *value, *set_name, *tmp; +type_new_set_names(PyTypeObject *type) +{ + PyObject *names_to_set = PyDict_Copy(type->tp_dict); + if (names_to_set == NULL) { + return -1; + } + Py_ssize_t i = 0; @@ -7794,7 +8287,3 @@ Py_ssize_t i = 0; - - names_to_set = PyDict_Copy(type->tp_dict); - if (names_to_set == NULL) - return -1; - + PyObject *key, *value; while (PyDict_Next(names_to_set, &i, &key, &value)) { @@ -7800,13 +8289,6 @@ while (PyDict_Next(names_to_set, &i, &key, &value)) { - set_name = _PyObject_LookupSpecial(value, &PyId___set_name__); - if (set_name != NULL) { - tmp = PyObject_CallFunctionObjArgs(set_name, type, key, NULL); - Py_DECREF(set_name); - if (tmp == NULL) { - _PyErr_FormatFromCause(PyExc_RuntimeError, - "Error calling __set_name__ on '%.100s' instance %R " - "in '%.100s'", - Py_TYPE(value)->tp_name, key, type->tp_name); - Py_DECREF(names_to_set); - return -1; + PyObject *set_name = _PyObject_LookupSpecial(value, &PyId___set_name__); + if (set_name == NULL) { + if (PyErr_Occurred()) { + goto error; } @@ -7812,12 +8294,19 @@ } - else - Py_DECREF(tmp); - } - else if (PyErr_Occurred()) { - Py_DECREF(names_to_set); - return -1; - } + continue; + } + + PyObject *res = PyObject_CallFunctionObjArgs(set_name, type, key, NULL); + Py_DECREF(set_name); + + if (res == NULL) { + _PyErr_FormatFromCause(PyExc_RuntimeError, + "Error calling __set_name__ on '%.100s' instance %R " + "in '%.100s'", + Py_TYPE(value)->tp_name, key, type->tp_name); + goto error; + } + Py_DECREF(res); } Py_DECREF(names_to_set); return 0; @@ -7820,8 +8309,13 @@ } Py_DECREF(names_to_set); return 0; -} + +error: + Py_DECREF(names_to_set); + return -1; +} + /* Call __init_subclass__ on the parent of a newly generated type */ static int @@ -7825,7 +8319,6 @@ /* Call __init_subclass__ on the parent of a newly generated type */ static int -init_subclass(PyTypeObject *type, PyObject *kwds) -{ - PyObject *super, *func, *result; +type_new_init_subclass(PyTypeObject *type, PyObject *kwds) +{ PyObject *args[2] = {(PyObject *)type, (PyObject *)type}; @@ -7831,7 +8324,6 @@ PyObject *args[2] = {(PyObject *)type, (PyObject *)type}; - - super = _PyObject_FastCall((PyObject *)&PySuper_Type, args, 2); + PyObject *super = _PyObject_FastCall((PyObject *)&PySuper_Type, args, 2); if (super == NULL) { return -1; } @@ -7834,10 +8326,10 @@ if (super == NULL) { return -1; } - func = _PyObject_GetAttrId(super, &PyId___init_subclass__); + PyObject *func = _PyObject_GetAttrId(super, &PyId___init_subclass__); Py_DECREF(super); if (func == NULL) { return -1; } @@ -7839,10 +8331,9 @@ Py_DECREF(super); if (func == NULL) { return -1; } - - result = PyObject_VectorcallDict(func, NULL, 0, kwds); + PyObject *result = PyObject_VectorcallDict(func, NULL, 0, kwds); Py_DECREF(func); if (result == NULL) { return -1; @@ -7852,6 +8343,7 @@ return 0; } + /* recurse_down_subclasses() and update_subclasses() are mutually recursive functions to call a callback for all subclasses, but refraining from recursing into subclasses that define 'name'. */ @@ -7972,5 +8464,5 @@ } } if (type->tp_new != NULL) { - if (add_tp_new_wrapper(type) < 0) + if (add_tp_new_wrapper(type) < 0) { return -1; @@ -7976,4 +8468,5 @@ return -1; + } } return 0; } diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_T2JqZWN0cy91bmljb2Rlb2JqZWN0LmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_T2JqZWN0cy91bmljb2Rlb2JqZWN0LmM= 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5070,14 +5070,5 @@ ascii_decode(const char *start, const char *end, Py_UCS1 *dest) { const char *p = start; - const char *aligned_end = (const char *) _Py_ALIGN_DOWN(end, SIZEOF_SIZE_T); - - /* - * Issue #17237: m68k is a bit different from most architectures in - * that objects do not use "natural alignment" - for example, int and - * long are only aligned at 2-byte boundaries. Therefore the assert() - * won't work; also, tests have shown that skipping the "optimised - * version" will even speed up m68k. - */ -#if !defined(__m68k__) + #if SIZEOF_SIZE_T <= SIZEOF_VOID_P @@ -5083,8 +5074,8 @@ #if SIZEOF_SIZE_T <= SIZEOF_VOID_P - assert(_Py_IS_ALIGNED(dest, SIZEOF_SIZE_T)); - if (_Py_IS_ALIGNED(p, SIZEOF_SIZE_T)) { + assert(_Py_IS_ALIGNED(dest, ALIGNOF_SIZE_T)); + if (_Py_IS_ALIGNED(p, ALIGNOF_SIZE_T)) { /* Fast path, see in STRINGLIB(utf8_decode) for an explanation. */ /* Help allocation */ const char *_p = p; Py_UCS1 * q = dest; @@ -5086,9 +5077,9 @@ /* Fast path, see in STRINGLIB(utf8_decode) for an explanation. */ /* Help allocation */ const char *_p = p; Py_UCS1 * q = dest; - while (_p < aligned_end) { + while (_p + SIZEOF_SIZE_T <= end) { size_t value = *(const size_t *) _p; if (value & ASCII_CHAR_MASK) break; @@ -5105,7 +5096,6 @@ return p - start; } #endif -#endif while (p < end) { /* Fast path, see in STRINGLIB(utf8_decode) in stringlib/codecs.h for an explanation. */ @@ -5109,6 +5099,6 @@ while (p < end) { /* Fast path, see in STRINGLIB(utf8_decode) in stringlib/codecs.h for an explanation. */ - if (_Py_IS_ALIGNED(p, SIZEOF_SIZE_T)) { + if (_Py_IS_ALIGNED(p, ALIGNOF_SIZE_T)) { /* Help allocation */ const char *_p = p; @@ -5113,6 +5103,6 @@ /* Help allocation */ const char *_p = p; - while (_p < aligned_end) { + while (_p + SIZEOF_SIZE_T <= end) { size_t value = *(const size_t *) _p; if (value & ASCII_CHAR_MASK) break; @@ -15686,18 +15676,6 @@ PyStatus _PyUnicode_Init(PyInterpreterState *interp) { - /* XXX - move this array to unicodectype.c ? */ - const Py_UCS2 linebreak[] = { - 0x000A, /* LINE FEED */ - 0x000D, /* CARRIAGE RETURN */ - 0x001C, /* FILE SEPARATOR */ - 0x001D, /* GROUP SEPARATOR */ - 0x001E, /* RECORD SEPARATOR */ - 0x0085, /* NEXT LINE */ - 0x2028, /* LINE SEPARATOR */ - 0x2029, /* PARAGRAPH SEPARATOR */ - }; - struct _Py_unicode_state *state = &interp->unicode; if (unicode_create_empty_string_singleton(state) < 0) { return _PyStatus_NO_MEMORY(); @@ -15705,6 +15683,16 @@ if (_Py_IsMainInterpreter(interp)) { /* initialize the linebreak bloom filter */ + const Py_UCS2 linebreak[] = { + 0x000A, /* LINE FEED */ + 0x000D, /* CARRIAGE RETURN */ + 0x001C, /* FILE SEPARATOR */ + 0x001D, /* GROUP SEPARATOR */ + 0x001E, /* RECORD SEPARATOR */ + 0x0085, /* NEXT LINE */ + 0x2028, /* LINE SEPARATOR */ + 0x2029, /* PARAGRAPH SEPARATOR */ + }; bloom_linebreak = make_bloom_mask( PyUnicode_2BYTE_KIND, linebreak, Py_ARRAY_LENGTH(linebreak)); @@ -15708,20 +15696,26 @@ bloom_linebreak = make_bloom_mask( PyUnicode_2BYTE_KIND, linebreak, Py_ARRAY_LENGTH(linebreak)); - - if (PyType_Ready(&PyUnicode_Type) < 0) { - return _PyStatus_ERR("Can't initialize unicode type"); - } - - if (PyType_Ready(&EncodingMapType) < 0) { - return _PyStatus_ERR("Can't initialize encoding map type"); - } - if (PyType_Ready(&PyFieldNameIter_Type) < 0) { - return _PyStatus_ERR("Can't initialize field name iterator type"); - } - if (PyType_Ready(&PyFormatterIter_Type) < 0) { - return _PyStatus_ERR("Can't initialize formatter iter type"); - } + } + + return _PyStatus_OK(); +} + + +PyStatus +_PyUnicode_InitTypes(void) +{ + if (PyType_Ready(&PyUnicode_Type) < 0) { + return _PyStatus_ERR("Can't initialize unicode type"); + } + if (PyType_Ready(&EncodingMapType) < 0) { + return _PyStatus_ERR("Can't initialize encoding map type"); + } + if (PyType_Ready(&PyFieldNameIter_Type) < 0) { + return _PyStatus_ERR("Can't initialize field name iterator type"); + } + if (PyType_Ready(&PyFormatterIter_Type) < 0) { + return _PyStatus_ERR("Can't initialize formatter iter type"); } return _PyStatus_OK(); } diff --git a/PC/pyconfig.h b/PC/pyconfig.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UEMvcHljb25maWcuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UEMvcHljb25maWcuaA== 100644 --- a/PC/pyconfig.h +++ b/PC/pyconfig.h @@ -289,6 +289,7 @@ # define SIZEOF_FPOS_T 8 # define SIZEOF_HKEY 8 # define SIZEOF_SIZE_T 8 +# define ALIGNOF_SIZE_T 8 /* configure.ac defines HAVE_LARGEFILE_SUPPORT iff sizeof(off_t) > sizeof(long), and sizeof(long long) >= sizeof(off_t). On Win64 the second condition is not true, but if fpos_t replaces off_t @@ -303,6 +304,7 @@ # define SIZEOF_FPOS_T 8 # define SIZEOF_HKEY 4 # define SIZEOF_SIZE_T 4 +# define ALIGNOF_SIZE_T 4 /* MS VS2005 changes time_t to a 64-bit type on all platforms */ # if defined(_MSC_VER) && _MSC_VER >= 1400 # define SIZEOF_TIME_T 8 @@ -321,6 +323,7 @@ #define SIZEOF_SHORT 2 #define SIZEOF_INT 4 #define SIZEOF_LONG 4 +#define ALIGNOF_LONG 4 #define SIZEOF_LONG_LONG 8 #define SIZEOF_DOUBLE 8 #define SIZEOF_FLOAT 4 diff --git a/PC/python3dll.c b/PC/python3dll.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UEMvcHl0aG9uM2RsbC5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_UEMvcHl0aG9uM2RsbC5j 100644 --- a/PC/python3dll.c +++ b/PC/python3dll.c @@ -36,6 +36,8 @@ EXPORT_FUNC(_PyTrash_destroy_chain) EXPORT_FUNC(_PyTrash_thread_deposit_object) EXPORT_FUNC(_PyTrash_thread_destroy_chain) +EXPORT_FUNC(_Py_IncRef) +EXPORT_FUNC(_Py_DecRef) EXPORT_FUNC(Py_AddPendingCall) EXPORT_FUNC(Py_AtExit) EXPORT_FUNC(Py_BuildValue) @@ -724,6 +726,7 @@ EXPORT_DATA(PyExc_BrokenPipeError) EXPORT_DATA(PyExc_BufferError) EXPORT_DATA(PyExc_BytesWarning) +EXPORT_DATA(PyExc_EncodingWarning) EXPORT_DATA(PyExc_ChildProcessError) EXPORT_DATA(PyExc_ConnectionAbortedError) EXPORT_DATA(PyExc_ConnectionError) diff --git a/PC/winreg.c b/PC/winreg.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UEMvd2lucmVnLmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_UEMvd2lucmVnLmM= 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -1813,6 +1813,7 @@ if (PySys_Audit("winreg.SetValue", "nunO", (Py_ssize_t)key, value_name, (Py_ssize_t)type, value) < 0) { + PyMem_Free(data); return NULL; } Py_BEGIN_ALLOW_THREADS diff --git a/PCbuild/_freeze_importlib.vcxproj b/PCbuild/_freeze_importlib.vcxproj index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UENidWlsZC9fZnJlZXplX2ltcG9ydGxpYi52Y3hwcm9q..8dd72af26abae4c1395bdd7572059de8fccc8d87_UENidWlsZC9fZnJlZXplX2ltcG9ydGxpYi52Y3hwcm9q 100644 --- a/PCbuild/_freeze_importlib.vcxproj +++ b/PCbuild/_freeze_importlib.vcxproj @@ -140,6 +140,8 @@ Condition="!Exists(%(None.OutFile)) or (Exists(%(None.IntFile)) and '$([System.IO.File]::ReadAllText(%(None.OutFile)).Replace(`
`, `
`))' != '$([System.IO.File]::ReadAllText(%(None.IntFile)).Replace(`
`, `
`))')"> <Output TaskParameter="CopiedFiles" ItemName="_Updated" /> </Copy> - - <Warning Text="@(_Updated->'%(Filename)%(Extension)',', ') updated. You will need to rebuild pythoncore to see the changes.%0D%0A%0D%0AIf you are not developing on Windows but you see this error on a continuous integration build, you need to run 'make regen-all' and commit any changes." + + <Message Text="Updated files: @(_Updated->'%(Filename)%(Extension)',', ')" + Condition="'@(_Updated)' != ''" Importance="high" /> + <Warning Text="Frozen importlib files were updated. Please rebuild to pick up the changes.%0D%0A%0D%0AIf you are not developing on Windows but you see this error on a continuous integration build, please run 'make regen-all' and commit anything that changes." Condition="'@(_Updated)' != '' and $(Configuration) == 'Debug'" /> @@ -145,5 +147,5 @@ Condition="'@(_Updated)' != '' and $(Configuration) == 'Debug'" /> - <Error Text="@(_Updated->'%(Filename)%(Extension)',', ') updated. You will need to rebuild pythoncore to see the changes.%0D%0A%0D%0AIf you are not developing on Windows but you see this error on a continuous integration build, you need to run 'make regen-all' and commit any changes." + <Error Text="Frozen importlib files were updated. Please rebuild to pick up the changes.%0D%0A%0D%0AIf you are not developing on Windows but you see this error on a continuous integration build, please run 'make regen-all' and commit anything that changes." Condition="'@(_Updated)' != '' and $(Configuration) == 'Release'" /> </Target> <Target Name="RebuildImportLib" AfterTargets="AfterBuild" Condition="$(Configuration) == 'Debug' or $(Configuration) == 'Release'" diff --git a/PCbuild/build.bat b/PCbuild/build.bat index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UENidWlsZC9idWlsZC5iYXQ=..8dd72af26abae4c1395bdd7572059de8fccc8d87_UENidWlsZC9idWlsZC5iYXQ= 100644 --- a/PCbuild/build.bat +++ b/PCbuild/build.bat @@ -34,7 +34,7 @@ echo. --pgo Build with Profile-Guided Optimization. This flag echo. overrides -c and -d echo. --test-marker Enable the test marker within the build. -echo. --regen Regenerate all opcodes, grammar and tokens +echo. --regen Regenerate all opcodes, grammar and tokens. echo. echo.Available flags to avoid building certain modules. echo.These flags have no effect if '-e' is not given: @@ -116,4 +116,8 @@ call "%dir%find_msbuild.bat" %MSBUILD% if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2) +call "%dir%find_python.bat" %PYTHON% +if ERRORLEVEL 1 (echo Cannot locate python.exe on PATH or as PYTHON variable & exit /b 3) +set PythonForBuild=%PYTHON% + if "%kill%"=="true" call :Kill @@ -119,5 +123,7 @@ if "%kill%"=="true" call :Kill -if ERRORLEVEL 1 exit /B 3 +if ERRORLEVEL 1 exit /B %ERRORLEVEL% + +if "%regen%"=="true" goto :Regen if "%do_pgo%"=="true" ( set conf=PGInstrument @@ -147,6 +153,15 @@ @echo off exit /B %ERRORLEVEL% +:Regen +echo on +%MSBUILD% "%dir%\pythoncore.vcxproj" /t:Regen %verbose%^ + /p:Configuration=%conf% /p:Platform=%platf%^ + /p:ForceRegen=true + +@echo off +exit /B %ERRORLEVEL% + :Build rem Call on MSBuild to do the work, echo the command. rem Passing %1-9 is not the preferred option, but argument parsing in @@ -160,14 +175,6 @@ /p:UseTestMarker=%UseTestMarker% %GITProperty%^ %1 %2 %3 %4 %5 %6 %7 %8 %9 -@if not ERRORLEVEL 1 @if "%Regen%"=="true" ( - %MSBUILD% "%dir%regen.vcxproj" /t:%target% %parallel% %verbose%^ - /p:IncludeExternals=%IncludeExternals%^ - /p:Configuration=%conf% /p:Platform=%platf%^ - /p:UseTestMarker=%UseTestMarker% %GITProperty%^ - %1 %2 %3 %4 %5 %6 %7 %8 %9 -) - @echo off exit /b %ERRORLEVEL% diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UENidWlsZC9nZXRfZXh0ZXJuYWxzLmJhdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UENidWlsZC9nZXRfZXh0ZXJuYWxzLmJhdA== 100644 --- a/PCbuild/get_externals.bat +++ b/PCbuild/get_externals.bat @@ -53,7 +53,7 @@ set libraries= set libraries=%libraries% bzip2-1.0.6 if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi -if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1i +if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1k set libraries=%libraries% sqlite-3.34.0.0 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.10.0 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.10.0 @@ -77,7 +77,7 @@ set binaries= if NOT "%IncludeLibffi%"=="false" set binaries=%binaries% libffi -if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1i +if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1k-1 if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.10.0 if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06 diff --git a/PCbuild/python.props b/PCbuild/python.props index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UENidWlsZC9weXRob24ucHJvcHM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_UENidWlsZC9weXRob24ucHJvcHM= 100644 --- a/PCbuild/python.props +++ b/PCbuild/python.props @@ -62,8 +62,8 @@ <libffiDir>$(ExternalsDir)libffi\</libffiDir> <libffiOutDir>$(ExternalsDir)libffi\$(ArchName)\</libffiOutDir> <libffiIncludeDir>$(libffiOutDir)include</libffiIncludeDir> - <opensslDir>$(ExternalsDir)openssl-1.1.1i\</opensslDir> - <opensslOutDir>$(ExternalsDir)openssl-bin-1.1.1i\$(ArchName)\</opensslOutDir> + <opensslDir>$(ExternalsDir)openssl-1.1.1k\</opensslDir> + <opensslOutDir>$(ExternalsDir)openssl-bin-1.1.1k-1\$(ArchName)\</opensslOutDir> <opensslIncludeDir>$(opensslOutDir)include</opensslIncludeDir> <nasmDir>$(ExternalsDir)\nasm-2.11.06\</nasmDir> <zlibDir>$(ExternalsDir)\zlib-1.2.11\</zlibDir> diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UENidWlsZC9weXRob25jb3JlLnZjeHByb2o=..8dd72af26abae4c1395bdd7572059de8fccc8d87_UENidWlsZC9weXRob25jb3JlLnZjeHByb2o= 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -110,6 +110,5 @@ </Link> </ItemDefinitionGroup> <ItemGroup> - <ClInclude Include="..\Include\Python-ast.h" /> <ClInclude Include="..\Include\Python.h" /> <ClInclude Include="..\Include\abstract.h" /> @@ -114,7 +113,5 @@ <ClInclude Include="..\Include\Python.h" /> <ClInclude Include="..\Include\abstract.h" /> - <ClInclude Include="..\Include\asdl.h" /> - <ClInclude Include="..\Include\ast.h" /> <ClInclude Include="..\Include\boolobject.h" /> <ClInclude Include="..\Include\bytearrayobject.h" /> <ClInclude Include="..\Include\bytesobject.h" /> @@ -131,6 +128,7 @@ <ClInclude Include="..\Include\cpython\bytesobject.h" /> <ClInclude Include="..\Include\cpython\ceval.h" /> <ClInclude Include="..\Include\cpython\code.h" /> + <ClInclude Include="..\Include\cpython\compile.h" /> <ClInclude Include="..\Include\cpython\dictobject.h" /> <ClInclude Include="..\Include\cpython\fileobject.h" /> <ClInclude Include="..\Include\cpython\fileutils.h" /> @@ -175,6 +173,7 @@ <ClInclude Include="..\Include\import.h" /> <ClInclude Include="..\Include\internal\pycore_abstract.h" /> <ClInclude Include="..\Include\internal\pycore_accu.h" /> + <ClInclude Include="..\Include\internal\pycore_asdl.h" /> <ClInclude Include="..\Include\internal\pycore_ast.h" /> <ClInclude Include="..\Include\internal\pycore_ast_state.h" /> <ClInclude Include="..\Include\internal\pycore_atomic.h" /> @@ -184,6 +183,7 @@ <ClInclude Include="..\Include\internal\pycore_call.h" /> <ClInclude Include="..\Include\internal\pycore_ceval.h" /> <ClInclude Include="..\Include\internal\pycore_code.h" /> + <ClInclude Include="..\Include\internal\pycore_compile.h" /> <ClInclude Include="..\Include\internal\pycore_condvar.h" /> <ClInclude Include="..\Include\internal\pycore_context.h" /> <ClInclude Include="..\Include\internal\pycore_dtoa.h" /> @@ -201,6 +201,7 @@ <ClInclude Include="..\Include\internal\pycore_long.h" /> <ClInclude Include="..\Include\internal\pycore_object.h" /> <ClInclude Include="..\Include\internal\pycore_pathconfig.h" /> + <ClInclude Include="..\Include\internal\pycore_pyarena.h" /> <ClInclude Include="..\Include\internal\pycore_pyerrors.h" /> <ClInclude Include="..\Include\internal\pycore_pyhash.h" /> <ClInclude Include="..\Include\internal\pycore_pylifecycle.h" /> @@ -484,6 +485,7 @@ <ClCompile Include="..\Python\dtoa.c" /> <ClCompile Include="..\Python\Python-ast.c" /> <ClCompile Include="..\Python\pythonrun.c" /> + <ClCompile Include="..\Python\suggestions.c" /> <ClCompile Include="..\Python\structmember.c" /> <ClCompile Include="..\Python\symtable.c" /> <ClCompile Include="..\Python\sysmodule.c" /> @@ -512,4 +514,5 @@ </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> + <Import Project="regen.targets" /> </ImportGroup> @@ -515,4 +518,5 @@ </ImportGroup> + <Target Name="_TriggerRegen" BeforeTargets="PrepareForBuild" DependsOnTargets="Regen" /> <Target Name="_GetBuildInfo" BeforeTargets="PrepareForBuild"> <PropertyGroup> <GIT Condition="$(GIT) == ''">git</GIT> diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UENidWlsZC9weXRob25jb3JlLnZjeHByb2ouZmlsdGVycw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UENidWlsZC9weXRob25jb3JlLnZjeHByb2ouZmlsdGVycw== 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -42,12 +42,6 @@ <ClInclude Include="..\Include\abstract.h"> <Filter>Include</Filter> </ClInclude> - <ClInclude Include="..\Include\asdl.h"> - <Filter>Include</Filter> - </ClInclude> - <ClInclude Include="..\Include\ast.h"> - <Filter>Include</Filter> - </ClInclude> <ClInclude Include="..\Include\boolobject.h"> <Filter>Include</Filter> </ClInclude> @@ -210,9 +204,6 @@ <ClInclude Include="..\Include\pystrhex.h"> <Filter>Include</Filter> </ClInclude> - <ClInclude Include="..\Include\Python-ast.h"> - <Filter>Include</Filter> - </ClInclude> <ClInclude Include="..\Include\Python.h"> <Filter>Include</Filter> </ClInclude> @@ -393,6 +384,9 @@ <ClInclude Include="..\Include\cpython\code.h"> <Filter>Include\cpython</Filter> </ClInclude> + <ClInclude Include="..\Include\cpython\compile.h"> + <Filter>Include</Filter> + </ClInclude> <ClInclude Include="..\Include\cpython\dictobject.h"> <Filter>Include\cpython</Filter> </ClInclude> @@ -486,6 +480,9 @@ <ClInclude Include="..\Include\internal\pycore_accu.h"> <Filter>Include\internal</Filter> </ClInclude> + <ClInclude Include="..\Include\internal\pycore_asdl.h"> + <Filter>Include\internal</Filter> + </ClInclude> <ClInclude Include="..\Include\internal\pycore_ast.h"> <Filter>Include\internal</Filter> </ClInclude> @@ -513,6 +510,9 @@ <ClInclude Include="..\Include\internal\pycore_code.h"> <Filter>Include\internal</Filter> </ClInclude> + <ClInclude Include="..\Include\internal\pycore_compile.h"> + <Filter>Include\internal</Filter> + </ClInclude> <ClInclude Include="..\Include\internal\pycore_condvar.h"> <Filter>Include\internal</Filter> </ClInclude> @@ -564,6 +564,9 @@ <ClInclude Include="..\Include\internal\pycore_pathconfig.h"> <Filter>Include\internal</Filter> </ClInclude> + <ClInclude Include="..\Include\internal\pycore_pyarena.h"> + <Filter>Include\internal</Filter> + </ClInclude> <ClInclude Include="..\Include\internal\pycore_pyerrors.h"> <Filter>Include\internal</Filter> </ClInclude> diff --git a/PCbuild/readme.txt b/PCbuild/readme.txt index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UENidWlsZC9yZWFkbWUudHh0..8dd72af26abae4c1395bdd7572059de8fccc8d87_UENidWlsZC9yZWFkbWUudHh0 100644 --- a/PCbuild/readme.txt +++ b/PCbuild/readme.txt @@ -169,7 +169,7 @@ Homepage: http://tukaani.org/xz/ _ssl - Python wrapper for version 1.1.1i of the OpenSSL secure sockets + Python wrapper for version 1.1.1k of the OpenSSL secure sockets library, which is downloaded from our binaries repository at https://github.com/python/cpython-bin-deps. diff --git a/PCbuild/regen.targets b/PCbuild/regen.targets new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_UENidWlsZC9yZWdlbi50YXJnZXRz --- /dev/null +++ b/PCbuild/regen.targets @@ -0,0 +1,84 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <Target Name="_SetPythonForBuild"> + <PropertyGroup> + <PythonForBuild>$(PYTHON)</PythonForBuild> + </PropertyGroup> + </Target> + + <ItemGroup> + <_PegenSources Include="$(PySourcePath)Grammar\python.gram;$(PySourcePath)Grammar\Tokens" /> + <_PegenOutputs Include="$(PySourcePath)Parser\parser.c" /> + <_ASTSources Include="$(PySourcePath)Parser\Python.asdl" /> + <_ASTOutputs Include="$(PySourcePath)Include\internal\pycore_ast.h"> + <Argument>-H</Argument> + </_ASTOutputs> + <_ASTOutputs Include="$(PySourcePath)Include\internal\pycore_ast_state.h"> + <Argument>-I</Argument> + </_ASTOutputs> + <_ASTOutputs Include="$(PySourcePath)Python\Python-ast.c"> + <Argument>-C</Argument> + </_ASTOutputs> + <_OpcodeSources Include="$(PySourcePath)Tools\scripts\generate_opcode_h.py;$(PySourcePath)Lib\opcode.py" /> + <_OpcodeOutputs Include="$(PySourcePath)Include\opcode.h;$(PySourcePath)Python\opcode_targets.h" /> + <_TokenSources Include="$(PySourcePath)Grammar\Tokens" /> + <_TokenOutputs Include="$(PySourcePath)Doc\library\token-list.inc"> + <Format>rst</Format> + </_TokenOutputs> + <_TokenOutputs Include="$(PySourcePath)Include\token.h"> + <Format>h</Format> + </_TokenOutputs> + <_TokenOutputs Include="$(PySourcePath)Parser\token.c"> + <Format>c</Format> + </_TokenOutputs> + <_TokenOutputs Include="$(PySourcePath)Lib\token.py"> + <Format>py</Format> + </_TokenOutputs> + <_KeywordSources Include="$(PySourcePath)Grammar\python.gram;$(PySourcePath)Grammar\Tokens" /> + <_KeywordOutputs Include="$(PySourcePath)Lib\keyword.py" /> + </ItemGroup> + + <Target Name="_TouchRegenSources" Condition="$(ForceRegen) == 'true'"> + <Message Text="Touching source files to force regeneration" Importance="high" /> + <Touch Files="@(_PegenSources);@(_ASTSources);@(_OpcodeSources);@(_TokenSources);@(_KeywordOutputs)" + AlwaysCreate="False" /> + </Target> + + <Target Name="_RegenPegen" Inputs="@(_PegenSources)" Outputs="@(_PegenOutputs)"> + <Message Text="Regenerate @(_PegenOutputs->'%(Filename)%(Extension)',' ')" Importance="high" /> + <!-- Specify python.gram with POSIX-like path because the argument gets written into the file verbatim --> + <Exec Command="set PYTHONPATH=Tools\peg_generator%0D%0A$(PythonForBuild) -m pegen -q c ./Grammar/python.gram Grammar\Tokens -o Parser\parser.c" + WorkingDirectory="$(PySourcePath)" /> + </Target> + + <Target Name="_RegenAST_H" Inputs="@(_ASTSources)" Outputs="@(_ASTOutputs)"> + <Message Text="Regenerate @(_ASTOutputs->'%(Filename)%(Extension)',' ')" Importance="high" /> + <Exec Command="$(PythonForBuild) Parser\asdl_c.py Parser\Python.asdl @(_ASTOutputs->'%(Argument) "%(Identity)"',' ')" + WorkingDirectory="$(PySourcePath)" /> + </Target> + + <Target Name="_RegenOpcodes" Inputs="@(_OpcodeSources)" Outputs="@(_OpcodeOutputs)"> + <Message Text="Regenerate @(_OpcodeOutputs->'%(Filename)%(Extension)',' ')" Importance="high" /> + <Exec Command="$(PythonForBuild) Tools\scripts\generate_opcode_h.py Lib\opcode.py Include\opcode.h" + WorkingDirectory="$(PySourcePath)" /> + <Exec Command="$(PythonForBuild) Python\makeopcodetargets.py Python\opcode_targets.h" + WorkingDirectory="$(PySourcePath)" /> + </Target> + + <Target Name="_RegenTokens" Inputs="@(_TokenSources)" Outputs="@(_TokenOutputs)"> + <Message Text="Regenerate @(_TokenOutputs->'%(Filename)%(Extension)',' ')" Importance="high" /> + <Exec Command="$(PythonForBuild) Tools\scripts\generate_token.py %(_TokenOutputs.Format) Grammar\Tokens "%(_TokenOutputs.Identity)"" + WorkingDirectory="$(PySourcePath)" /> + <Touch Files="@(_TokenOutputs)" /> + </Target> + + <Target Name="_RegenKeywords" Inputs="@(_KeywordSources)" Outputs="@(_KeywordOutputs)"> + <Message Text="Regenerate @(KeywordOutputs->'%(Filename)%(Extension)',' ')" Importance="high" /> + <Exec Command="set PYTHONPATH=Tools\peg_generator%0D%0A$(PythonForBuild) -m pegen.keywordgen Grammar\python.gram Grammar\Tokens Lib\keyword.py" + WorkingDirectory="$(PySourcePath)" /> + </Target> + + <Target Name="Regen" DependsOnTargets="_TouchRegenSources;_RegenPegen;_RegenAST_H;_RegenOpcodes;_RegenTokens;_RegenKeywords"> + <Message Text="Generated sources are up to date" Importance="high" /> + </Target> +</Project> diff --git a/PCbuild/regen.vcxproj b/PCbuild/regen.vcxproj deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UENidWlsZC9yZWdlbi52Y3hwcm9q..0000000000000000000000000000000000000000 --- a/PCbuild/regen.vcxproj +++ /dev/null @@ -1,215 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug|ARM"> - <Configuration>Debug</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="PGInstrument|ARM"> - <Configuration>PGInstrument</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="PGInstrument|Win32"> - <Configuration>PGInstrument</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="PGInstrument|x64"> - <Configuration>PGInstrument</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="PGUpdate|ARM"> - <Configuration>PGUpdate</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="PGUpdate|Win32"> - <Configuration>PGUpdate</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="PGUpdate|x64"> - <Configuration>PGUpdate</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|ARM"> - <Configuration>Release</Configuration> - <Platform>ARM</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{21CF2108-2CC9-4005-A6ED-B7965ADE3854}</ProjectGuid> - <Keyword>Win32Proj</Keyword> - <RootNamespace>regen</RootNamespace> - <SupportPGO>false</SupportPGO> - <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> - </PropertyGroup> - <Import Project="python.props" /> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Label="Configuration"> - <ConfigurationType>Utility</ConfigurationType> - <CharacterSet>Unicode</CharacterSet> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGUpdate|x64'"> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGUpdate|ARM'"> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGUpdate|Win32'"> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGInstrument|ARM'"> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGInstrument|x64'"> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> - <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='PGInstrument|Win32'"> - <PlatformToolset>v142</PlatformToolset> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> - <ImportGroup Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="pyproject.props" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <ItemDefinitionGroup> - <ClCompile> - <PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - </ClCompile> - <Link> - <SubSystem>Console</SubSystem> - </Link> - </ItemDefinitionGroup> - <ItemGroup> - <ClCompile Include="..\Programs\_freeze_importlib.c" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="pythoncore.vcxproj"> - <Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project> - <Private>true</Private> - <ReferenceOutputAssembly>true</ReferenceOutputAssembly> - <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies> - <LinkLibraryDependencies>true</LinkLibraryDependencies> - <UseLibraryDependencyInputs>false</UseLibraryDependencyInputs> - </ProjectReference> - </ItemGroup> - <ItemGroup> - <None Include="..\Grammar\Grammar"> - </None> - <None Include="..\Grammar\Tokens"> - </None> - <None Include="..\Include\token.h"> - </None> - <None Include="..\Include\opcode.h"> - </None> - <None Include="..\Include\internal\pycore_ast_state.h"> - </None> - <None Include="..\Include\Python-ast.h"> - </None> - <None Include="..\Python\Python-ast.c"> - </None> - <None Include="..\Lib\keyword.py"> - </None> - <None Include="..\Lib\symbol.py"> - </None> - <None Include="..\Doc\library\token-list.inc"> - </None> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> - <Target Name="_RegenPegen" BeforeTargets="Build"> - <!-- Regenerate Parser/parser.c --> - <SetEnv Name="PYTHONPATH" Prefix="true" Value="$(PySourcePath)Tools\peg_generator\" /> - <Exec Command=""$(PythonExe)" -m pegen -q c "$(PySourcePath)Grammar\python.gram" "$(PySourcePath)Grammar\Tokens" -o "$(IntDir)parser.c"" /> - <Copy SourceFiles="$(IntDir)parser.c" DestinationFiles="$(PySourcePath)Parser\parser.c"> - <Output TaskParameter="CopiedFiles" ItemName="_UpdatedParse" /> - </Copy> - <Warning Text="Pegen updated. You will need to rebuild pythoncore to see the changes." Condition="'@(_UpdatedParse)' != ''" /> - </Target> - <Target Name="_RegenAST_H" AfterTargets="_RegenGrammar"> - <!-- Regenerate Include/Python-ast.h, Python/Python-ast.c and Include/internal/pycore_ast_state.h using Parser/asdl_c.py -h --> - <Exec Command=""$(PythonExe)" "$(PySourcePath)Parser\asdl_c.py" "$(PySourcePath)Parser\Python.asdl" -H "$(IntDir)Python-ast.h" -C "$(IntDir)Python-ast.c" -I "$(IntDir)pycore_ast_state.h"" /> - <Copy SourceFiles="$(IntDir)Python-ast.h" DestinationFiles="$(PySourcePath)Include\Python-ast.h"> - <Output TaskParameter="CopiedFiles" ItemName="_UpdatedH" /> - </Copy> - <Copy SourceFiles="$(IntDir)Python-ast.c" DestinationFiles="$(PySourcePath)Python\Python-ast.c"> - <Output TaskParameter="CopiedFiles" ItemName="_UpdatedC" /> - </Copy> - <Copy SourceFiles="$(IntDir)pycore_ast_state.h" DestinationFiles="$(PySourcePath)Include\internal\pycore_ast_state.h"> - <Output TaskParameter="CopiedFiles" ItemName="_UpdatedInternalH" /> - </Copy> - <Warning Text="ASDL is updated. You will need to rebuild pythoncore to see the changes." Condition="'@(_UpdatedH)' != '' != '' and '@(_UpdatedC)' != '' and @(_UpdatedInternalH)'" /> - </Target> - <Target Name="_RegenOpcodes" AfterTargets="_RegenAST_C"> - <!-- Regenerate Include/opcode.h from Lib/opcode.py using Tools/scripts/generate_opcode_h.py--> - <Exec Command=""$(PythonExe)" $(PySourcePath)Tools\scripts\generate_opcode_h.py "$(PySourcePath)Lib\opcode.py" "$(IntDir)opcode.h"" /> - <Copy SourceFiles="$(IntDir)opcode.h" DestinationFiles="$(PySourcePath)Include\opcode.h"> - <Output TaskParameter="CopiedFiles" ItemName="_Updated" /> - </Copy> - <Warning Text="Opcodes updated. You will need to rebuild pythoncore to see the changes." Condition="'@(_Updated)' != ''" /> - </Target> - <Target Name="_RegenTokens" AfterTargets="_RegenOpcodes"> - <!-- Regenerate Doc/library/token-list.inc from Grammar/Tokens using Tools/scripts/generate_token.py--> - <Exec Command=""$(PythonExe)" $(PySourcePath)Tools\scripts\generate_token.py rst "$(PySourcePath)Grammar\Tokens" "$(PySourcePath)Doc\library\token-list.inc"" /> - <!-- Regenerate Include/token.h from Grammar/Tokens using Tools/scripts/generate_token.py--> - <Exec Command=""$(PythonExe)" $(PySourcePath)Tools\scripts\generate_token.py h "$(PySourcePath)Grammar\Tokens" "$(PySourcePath)Include\token.h"" /> - <!-- Regenerate Parser/token.c from Grammar/Tokens using Tools/scripts/generate_token.py--> - <Exec Command=""$(PythonExe)" $(PySourcePath)Tools\scripts\generate_token.py c "$(PySourcePath)Grammar\Tokens" "$(PySourcePath)Parser\token.c"" /> - <!-- Regenerate Lib/token.py from Grammar/Tokens using Tools/scripts/generate_token.py --> - <Exec Command=""$(PythonExe)" $(PySourcePath)Tools\scripts\generate_token.py py "$(PySourcePath)Grammar\Tokens" "$(PySourcePath)Lib\token.py"" /> - </Target> - <Target Name="_RegenKeywords" AfterTargets="_RegenTokens"> - <!-- Regenerate Lib/keyword.py from Grammar/python.gram and Grammar/Tokens using Tools/peg_generator/pegen--> - <SetEnv Name="PYTHONPATH" Prefix="true" Value="$(PySourcePath)Tools\peg_generator\" /> - <Exec Command=""$(PythonExe)" -m pegen.keywordgen "$(PySourcePath)Grammar\python.gram" "$(PySourcePath)Grammar\Tokens" "$(IntDir)keyword.py"" /> - <Copy SourceFiles="$(IntDir)keyword.py" DestinationFiles="$(PySourcePath)Lib\keyword.py"> - <Output TaskParameter="CopiedFiles" ItemName="_Updated" /> - </Copy> - <Warning Text="Keywords updated. You will need to rebuild pythoncore to see the changes." Condition="'@(_Updated)' != ''" /> - </Target> - <Target Name="_CleanFiles" BeforeTargets="CoreClean"> - <ItemGroup> - <Clean Include="$(IntDir)keyword.py" /> - <Clean Include="$(IntDir)opcode.h" /> - <Clean Include="$(IntDir)Python-ast.c" /> - <Clean Include="$(IntDir)Python-ast.h" /> - <Clean Include="$(IntDir)pycore_ast_state.h" /> - </ItemGroup> - </Target> -</Project> diff --git a/PCbuild/xxlimited.vcxproj b/PCbuild/xxlimited.vcxproj index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UENidWlsZC94eGxpbWl0ZWQudmN4cHJvag==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UENidWlsZC94eGxpbWl0ZWQudmN4cHJvag== 100644 --- a/PCbuild/xxlimited.vcxproj +++ b/PCbuild/xxlimited.vcxproj @@ -93,9 +93,6 @@ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> </PropertyGroup> <ItemDefinitionGroup> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);Py_LIMITED_API=0x03100000</PreprocessorDefinitions> - </ClCompile> <Link> <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> diff --git a/PCbuild/xxlimited_35.vcxproj b/PCbuild/xxlimited_35.vcxproj index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UENidWlsZC94eGxpbWl0ZWRfMzUudmN4cHJvag==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UENidWlsZC94eGxpbWl0ZWRfMzUudmN4cHJvag== 100644 --- a/PCbuild/xxlimited_35.vcxproj +++ b/PCbuild/xxlimited_35.vcxproj @@ -93,9 +93,6 @@ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> </PropertyGroup> <ItemDefinitionGroup> - <ClCompile> - <PreprocessorDefinitions>%(PreprocessorDefinitions);Py_LIMITED_API=0x03060000</PreprocessorDefinitions> - </ClCompile> <Link> <AdditionalDependencies>wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> diff --git a/Parser/Python.asdl b/Parser/Python.asdl index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UGFyc2VyL1B5dGhvbi5hc2Rs..8dd72af26abae4c1395bdd7572059de8fccc8d87_UGFyc2VyL1B5dGhvbi5hc2Rs 100644 --- a/Parser/Python.asdl +++ b/Parser/Python.asdl @@ -124,6 +124,7 @@ -- import name with optional 'as' alias. alias = (identifier name, identifier? asname) + attributes (int lineno, int col_offset, int? end_lineno, int? end_col_offset) withitem = (expr context_expr, expr? optional_vars) diff --git a/Parser/asdl.py b/Parser/asdl.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UGFyc2VyL2FzZGwucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_UGFyc2VyL2FzZGwucHk= 100644 --- a/Parser/asdl.py +++ b/Parser/asdl.py @@ -204,7 +204,7 @@ def parse(filename): """Parse ASDL from the given file and return a Module node describing it.""" - with open(filename) as f: + with open(filename, encoding="utf-8") as f: parser = ASDLParser() return parser.parse(f.read()) diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UGFyc2VyL2FzZGxfYy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UGFyc2VyL2FzZGxfYy5weQ== 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -264,6 +264,10 @@ self.emit("", depth) +def ast_func_name(name): + return f"_PyAST_{name}" + + class PrototypeVisitor(EmitVisitor): """Generate function prototypes for the .h file""" @@ -322,12 +326,7 @@ argstr += ", PyArena *arena" else: argstr = "PyArena *arena" - margs = "a0" - for i in range(1, len(args)+1): - margs += ", a%d" % i - self.emit("#define %s(%s) _Py_%s(%s)" % (name, margs, name, margs), 0, - reflow=False) - self.emit("%s _Py_%s(%s);" % (ctype, name, argstr), False) + self.emit("%s %s(%s);" % (ctype, ast_func_name(name), argstr), False) def visitProduct(self, prod, name): self.emit_function(name, get_c_type(name), @@ -349,7 +348,7 @@ else: argstr = "PyArena *arena" self.emit("%s" % ctype, 0) - emit("%s(%s)" % (name, argstr)) + emit("%s(%s)" % (ast_func_name(name), argstr)) emit("{") emit("%s p;" % ctype, 1) for argtype, argname, opt in args: @@ -362,7 +361,7 @@ emit('return NULL;', 2) emit('}', 1) - emit("p = (%s)PyArena_Malloc(arena, sizeof(*p));" % ctype, 1); + emit("p = (%s)_PyArena_Malloc(arena, sizeof(*p));" % ctype, 1); emit("if (!p)", 1) emit("return NULL;", 2) if union: @@ -488,7 +487,7 @@ for f in t.fields: self.visitField(f, t.name, sum=sum, depth=2) args = [f.name for f in t.fields] + [a.name for a in sum.attributes] - self.emit("*out = %s(%s);" % (t.name, self.buildArgs(args)), 2) + self.emit("*out = %s(%s);" % (ast_func_name(t.name), self.buildArgs(args)), 2) self.emit("if (*out == NULL) goto failed;", 2) self.emit("return 0;", 2) self.emit("}", 1) @@ -521,7 +520,7 @@ self.visitField(a, name, prod=prod, depth=1) args = [f.name for f in prod.fields] args.extend([a.name for a in prod.attributes]) - self.emit("*out = %s(%s);" % (name, self.buildArgs(args)), 1) + self.emit("*out = %s(%s);" % (ast_func_name(name), self.buildArgs(args)), 1) self.emit("return 0;", 1) self.emit("failed:", 0) self.emit("Py_XDECREF(tmp);", 1) @@ -946,7 +945,7 @@ if (obj == Py_None) obj = NULL; if (obj) { - if (PyArena_AddPyObject(arena, obj) < 0) { + if (_PyArena_AddPyObject(arena, obj) < 0) { *out = NULL; return -1; } @@ -958,7 +957,7 @@ static int obj2ast_constant(struct ast_state *Py_UNUSED(state), PyObject* obj, PyObject** out, PyArena* arena) { - if (PyArena_AddPyObject(arena, obj) < 0) { + if (_PyArena_AddPyObject(arena, obj) < 0) { *out = NULL; return -1; } @@ -1423,7 +1422,9 @@ generate_ast_state(module_state, internal_h) - print(textwrap.dedent(f""" + print(textwrap.dedent(""" + #include "Python.h" + #include "pycore_ast.h" #include "pycore_ast_state.h" // struct ast_state #include "pycore_interp.h" // _PyInterpreterState.ast #include "pycore_pystate.h" // _PyInterpreterState_GET() @@ -1427,5 +1428,6 @@ #include "pycore_ast_state.h" // struct ast_state #include "pycore_interp.h" // _PyInterpreterState.ast #include "pycore_pystate.h" // _PyInterpreterState_GET() - """).rstrip(), file=f) + #include "structmember.h" + #include <stddef.h> @@ -1431,5 +1433,4 @@ - f.write(""" -// Forward declaration -static int init_types(struct ast_state *state); + // Forward declaration + static int init_types(struct ast_state *state); @@ -1435,23 +1436,15 @@ -static struct ast_state* -get_ast_state(void) -{ - PyInterpreterState *interp = _PyInterpreterState_GET(); - struct ast_state *state = &interp->ast; - if (!init_types(state)) { - return NULL; - } - return state; -} -""") - - # f-string for {mod.name} - f.write(f""" -// Include {mod.name}-ast.h after pycore_interp.h to avoid conflicts -// with the Yield macro redefined by <winbase.h> -#include "{mod.name}-ast.h" -#include "structmember.h" -""") + static struct ast_state* + get_ast_state(void) + { + PyInterpreterState *interp = _PyInterpreterState_GET(); + struct ast_state *state = &interp->ast; + if (!init_types(state)) { + return NULL; + } + return state; + } + """).strip(), file=f) generate_ast_fini(module_state, f) @@ -1465,20 +1458,23 @@ f.write('};\n\n') def write_header(mod, f): - f.write('#ifndef Py_PYTHON_AST_H\n') - f.write('#define Py_PYTHON_AST_H\n') - f.write('#ifdef __cplusplus\n') - f.write('extern "C" {\n') - f.write('#endif\n') - f.write('\n') - f.write('#ifndef Py_LIMITED_API\n') - f.write('#include "asdl.h"\n') - f.write('\n') - f.write('#undef Yield /* undefine macro conflicting with <winbase.h> */\n') - f.write('\n') + f.write(textwrap.dedent(""" + #ifndef Py_INTERNAL_AST_H + #define Py_INTERNAL_AST_H + #ifdef __cplusplus + extern "C" { + #endif + + #ifndef Py_BUILD_CORE + # error "this header requires Py_BUILD_CORE define" + #endif + + #include "pycore_asdl.h" + + """).lstrip()) c = ChainOfVisitors(TypeDefVisitor(f), SequenceDefVisitor(f), StructVisitor(f)) c.visit(mod) f.write("// Note: these macros affect function definitions, not only call sites.\n") PrototypeVisitor(f).visit(mod) @@ -1479,19 +1475,30 @@ c = ChainOfVisitors(TypeDefVisitor(f), SequenceDefVisitor(f), StructVisitor(f)) c.visit(mod) f.write("// Note: these macros affect function definitions, not only call sites.\n") PrototypeVisitor(f).visit(mod) - f.write("\n") - f.write("PyObject* PyAST_mod2obj(mod_ty t);\n") - f.write("mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode);\n") - f.write("int PyAST_Check(PyObject* obj);\n") - f.write("#endif /* !Py_LIMITED_API */\n") - f.write('\n') - f.write('#ifdef __cplusplus\n') - f.write('}\n') - f.write('#endif\n') - f.write('#endif /* !Py_PYTHON_AST_H */\n') + f.write(textwrap.dedent(""" + + PyObject* PyAST_mod2obj(mod_ty t); + mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode); + int PyAST_Check(PyObject* obj); + + extern int _PyAST_Validate(mod_ty); + + /* _PyAST_ExprAsUnicode is defined in ast_unparse.c */ + extern PyObject* _PyAST_ExprAsUnicode(expr_ty); + + /* Return the borrowed reference to the first literal string in the + sequence of statements or NULL if it doesn't start from a literal string. + Doesn't set exception. */ + extern PyObject* _PyAST_GetDocString(asdl_stmt_seq *); + + #ifdef __cplusplus + } + #endif + #endif /* !Py_INTERNAL_AST_H */ + """)) def write_internal_h_header(mod, f): @@ -1519,12 +1526,6 @@ def write_source(mod, f, internal_h_file): - print(textwrap.dedent(f""" - #include <stddef.h> - - #include "Python.h" - """), file=f) - generate_module_def(mod, f, internal_h_file) v = ChainOfVisitors( diff --git a/Parser/parser.c b/Parser/parser.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UGFyc2VyL3BhcnNlci5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_UGFyc2VyL3BhcnNlci5j 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -159,293 +159,300 @@ #define star_named_expressions_type 1091 #define star_named_expression_type 1092 #define named_expression_type 1093 -#define annotated_rhs_type 1094 -#define expressions_type 1095 -#define expression_type 1096 -#define lambdef_type 1097 -#define lambda_params_type 1098 -#define lambda_parameters_type 1099 -#define lambda_slash_no_default_type 1100 -#define lambda_slash_with_default_type 1101 -#define lambda_star_etc_type 1102 -#define lambda_kwds_type 1103 -#define lambda_param_no_default_type 1104 -#define lambda_param_with_default_type 1105 -#define lambda_param_maybe_default_type 1106 -#define lambda_param_type 1107 -#define disjunction_type 1108 -#define conjunction_type 1109 -#define inversion_type 1110 -#define comparison_type 1111 -#define compare_op_bitwise_or_pair_type 1112 -#define eq_bitwise_or_type 1113 -#define noteq_bitwise_or_type 1114 -#define lte_bitwise_or_type 1115 -#define lt_bitwise_or_type 1116 -#define gte_bitwise_or_type 1117 -#define gt_bitwise_or_type 1118 -#define notin_bitwise_or_type 1119 -#define in_bitwise_or_type 1120 -#define isnot_bitwise_or_type 1121 -#define is_bitwise_or_type 1122 -#define bitwise_or_type 1123 // Left-recursive -#define bitwise_xor_type 1124 // Left-recursive -#define bitwise_and_type 1125 // Left-recursive -#define shift_expr_type 1126 // Left-recursive -#define sum_type 1127 // Left-recursive -#define term_type 1128 // Left-recursive -#define factor_type 1129 -#define power_type 1130 -#define await_primary_type 1131 -#define primary_type 1132 // Left-recursive -#define slices_type 1133 -#define slice_type 1134 -#define atom_type 1135 -#define strings_type 1136 -#define list_type 1137 -#define listcomp_type 1138 -#define tuple_type 1139 -#define group_type 1140 -#define genexp_type 1141 -#define set_type 1142 -#define setcomp_type 1143 -#define dict_type 1144 -#define dictcomp_type 1145 -#define double_starred_kvpairs_type 1146 -#define double_starred_kvpair_type 1147 -#define kvpair_type 1148 -#define for_if_clauses_type 1149 -#define for_if_clause_type 1150 -#define yield_expr_type 1151 -#define arguments_type 1152 -#define args_type 1153 -#define kwargs_type 1154 -#define starred_expression_type 1155 -#define kwarg_or_starred_type 1156 -#define kwarg_or_double_starred_type 1157 -#define star_targets_type 1158 -#define star_targets_list_seq_type 1159 -#define star_targets_tuple_seq_type 1160 -#define star_target_type 1161 -#define target_with_star_atom_type 1162 -#define star_atom_type 1163 -#define single_target_type 1164 -#define single_subscript_attribute_target_type 1165 -#define del_targets_type 1166 -#define del_target_type 1167 -#define del_t_atom_type 1168 -#define targets_type 1169 -#define target_type 1170 -#define t_primary_type 1171 // Left-recursive -#define t_lookahead_type 1172 -#define t_atom_type 1173 -#define invalid_arguments_type 1174 -#define invalid_kwarg_type 1175 -#define invalid_named_expression_type 1176 -#define invalid_assignment_type 1177 -#define invalid_ann_assign_target_type 1178 -#define invalid_del_stmt_type 1179 -#define invalid_block_type 1180 -#define invalid_primary_type 1181 // Left-recursive -#define invalid_comprehension_type 1182 -#define invalid_dict_comprehension_type 1183 -#define invalid_parameters_type 1184 -#define invalid_parameters_helper_type 1185 -#define invalid_lambda_parameters_type 1186 -#define invalid_lambda_parameters_helper_type 1187 -#define invalid_star_etc_type 1188 -#define invalid_lambda_star_etc_type 1189 -#define invalid_double_type_comments_type 1190 -#define invalid_with_item_type 1191 -#define invalid_for_target_type 1192 -#define invalid_group_type 1193 -#define invalid_import_from_targets_type 1194 -#define invalid_with_stmt_type 1195 -#define invalid_except_block_type 1196 -#define invalid_match_stmt_type 1197 -#define invalid_case_block_type 1198 -#define _loop0_1_type 1199 -#define _loop0_2_type 1200 -#define _loop0_4_type 1201 -#define _gather_3_type 1202 -#define _loop0_6_type 1203 -#define _gather_5_type 1204 -#define _loop0_8_type 1205 -#define _gather_7_type 1206 -#define _loop0_10_type 1207 -#define _gather_9_type 1208 -#define _loop1_11_type 1209 -#define _loop0_13_type 1210 -#define _gather_12_type 1211 -#define _tmp_14_type 1212 -#define _tmp_15_type 1213 -#define _tmp_16_type 1214 -#define _tmp_17_type 1215 -#define _tmp_18_type 1216 -#define _tmp_19_type 1217 -#define _tmp_20_type 1218 -#define _tmp_21_type 1219 -#define _loop1_22_type 1220 -#define _tmp_23_type 1221 -#define _tmp_24_type 1222 -#define _loop0_26_type 1223 -#define _gather_25_type 1224 -#define _loop0_28_type 1225 -#define _gather_27_type 1226 -#define _tmp_29_type 1227 -#define _tmp_30_type 1228 -#define _loop0_31_type 1229 -#define _loop1_32_type 1230 -#define _loop0_34_type 1231 -#define _gather_33_type 1232 -#define _tmp_35_type 1233 -#define _loop0_37_type 1234 -#define _gather_36_type 1235 -#define _tmp_38_type 1236 -#define _loop0_40_type 1237 -#define _gather_39_type 1238 -#define _loop0_42_type 1239 -#define _gather_41_type 1240 -#define _loop0_44_type 1241 -#define _gather_43_type 1242 -#define _loop0_46_type 1243 -#define _gather_45_type 1244 -#define _tmp_47_type 1245 -#define _loop1_48_type 1246 -#define _tmp_49_type 1247 -#define _loop1_50_type 1248 -#define _loop0_52_type 1249 -#define _gather_51_type 1250 -#define _tmp_53_type 1251 -#define _tmp_54_type 1252 -#define _tmp_55_type 1253 -#define _loop0_57_type 1254 -#define _gather_56_type 1255 -#define _tmp_58_type 1256 -#define _loop0_60_type 1257 -#define _gather_59_type 1258 -#define _tmp_61_type 1259 -#define _loop0_63_type 1260 -#define _gather_62_type 1261 -#define _loop0_65_type 1262 -#define _gather_64_type 1263 -#define _tmp_66_type 1264 -#define _tmp_67_type 1265 -#define _tmp_68_type 1266 -#define _tmp_69_type 1267 -#define _loop0_70_type 1268 -#define _loop0_71_type 1269 -#define _loop0_72_type 1270 -#define _loop1_73_type 1271 -#define _loop0_74_type 1272 -#define _loop1_75_type 1273 -#define _loop1_76_type 1274 -#define _loop1_77_type 1275 -#define _loop0_78_type 1276 -#define _loop1_79_type 1277 -#define _loop0_80_type 1278 -#define _loop1_81_type 1279 -#define _loop0_82_type 1280 -#define _loop1_83_type 1281 -#define _loop1_84_type 1282 -#define _tmp_85_type 1283 -#define _loop1_86_type 1284 -#define _loop0_88_type 1285 -#define _gather_87_type 1286 -#define _loop1_89_type 1287 -#define _loop0_90_type 1288 -#define _loop0_91_type 1289 -#define _loop0_92_type 1290 -#define _loop1_93_type 1291 -#define _loop0_94_type 1292 -#define _loop1_95_type 1293 -#define _loop1_96_type 1294 -#define _loop1_97_type 1295 -#define _loop0_98_type 1296 -#define _loop1_99_type 1297 -#define _loop0_100_type 1298 -#define _loop1_101_type 1299 -#define _loop0_102_type 1300 -#define _loop1_103_type 1301 -#define _loop1_104_type 1302 -#define _loop1_105_type 1303 -#define _loop1_106_type 1304 -#define _tmp_107_type 1305 -#define _loop0_109_type 1306 -#define _gather_108_type 1307 -#define _tmp_110_type 1308 -#define _tmp_111_type 1309 -#define _tmp_112_type 1310 -#define _tmp_113_type 1311 -#define _loop1_114_type 1312 -#define _tmp_115_type 1313 -#define _tmp_116_type 1314 -#define _loop0_118_type 1315 -#define _gather_117_type 1316 -#define _loop1_119_type 1317 -#define _loop0_120_type 1318 -#define _loop0_121_type 1319 -#define _loop0_123_type 1320 -#define _gather_122_type 1321 -#define _tmp_124_type 1322 -#define _loop0_126_type 1323 -#define _gather_125_type 1324 -#define _loop0_128_type 1325 -#define _gather_127_type 1326 -#define _loop0_130_type 1327 -#define _gather_129_type 1328 -#define _loop0_132_type 1329 -#define _gather_131_type 1330 -#define _loop0_133_type 1331 -#define _loop0_135_type 1332 -#define _gather_134_type 1333 -#define _loop1_136_type 1334 -#define _tmp_137_type 1335 -#define _loop0_139_type 1336 -#define _gather_138_type 1337 -#define _loop0_141_type 1338 -#define _gather_140_type 1339 -#define _tmp_142_type 1340 -#define _loop0_143_type 1341 -#define _loop0_144_type 1342 -#define _loop0_145_type 1343 -#define _tmp_146_type 1344 -#define _tmp_147_type 1345 -#define _tmp_148_type 1346 -#define _loop0_149_type 1347 -#define _loop1_150_type 1348 -#define _loop0_151_type 1349 -#define _loop1_152_type 1350 -#define _tmp_153_type 1351 -#define _tmp_154_type 1352 -#define _tmp_155_type 1353 -#define _loop0_157_type 1354 -#define _gather_156_type 1355 -#define _loop0_159_type 1356 -#define _gather_158_type 1357 -#define _tmp_160_type 1358 -#define _tmp_161_type 1359 -#define _tmp_162_type 1360 -#define _tmp_163_type 1361 -#define _tmp_164_type 1362 -#define _tmp_165_type 1363 -#define _tmp_166_type 1364 -#define _tmp_167_type 1365 -#define _tmp_168_type 1366 -#define _tmp_169_type 1367 -#define _tmp_170_type 1368 -#define _tmp_171_type 1369 -#define _tmp_172_type 1370 -#define _tmp_173_type 1371 -#define _tmp_174_type 1372 -#define _tmp_175_type 1373 -#define _tmp_176_type 1374 -#define _tmp_177_type 1375 -#define _tmp_178_type 1376 -#define _tmp_179_type 1377 -#define _tmp_180_type 1378 -#define _tmp_181_type 1379 -#define _tmp_182_type 1380 +#define direct_named_expression_type 1094 +#define annotated_rhs_type 1095 +#define expressions_type 1096 +#define expression_type 1097 +#define lambdef_type 1098 +#define lambda_params_type 1099 +#define lambda_parameters_type 1100 +#define lambda_slash_no_default_type 1101 +#define lambda_slash_with_default_type 1102 +#define lambda_star_etc_type 1103 +#define lambda_kwds_type 1104 +#define lambda_param_no_default_type 1105 +#define lambda_param_with_default_type 1106 +#define lambda_param_maybe_default_type 1107 +#define lambda_param_type 1108 +#define disjunction_type 1109 +#define conjunction_type 1110 +#define inversion_type 1111 +#define comparison_type 1112 +#define compare_op_bitwise_or_pair_type 1113 +#define eq_bitwise_or_type 1114 +#define noteq_bitwise_or_type 1115 +#define lte_bitwise_or_type 1116 +#define lt_bitwise_or_type 1117 +#define gte_bitwise_or_type 1118 +#define gt_bitwise_or_type 1119 +#define notin_bitwise_or_type 1120 +#define in_bitwise_or_type 1121 +#define isnot_bitwise_or_type 1122 +#define is_bitwise_or_type 1123 +#define bitwise_or_type 1124 // Left-recursive +#define bitwise_xor_type 1125 // Left-recursive +#define bitwise_and_type 1126 // Left-recursive +#define shift_expr_type 1127 // Left-recursive +#define sum_type 1128 // Left-recursive +#define term_type 1129 // Left-recursive +#define factor_type 1130 +#define power_type 1131 +#define await_primary_type 1132 +#define primary_type 1133 // Left-recursive +#define slices_type 1134 +#define slice_type 1135 +#define atom_type 1136 +#define strings_type 1137 +#define list_type 1138 +#define listcomp_type 1139 +#define tuple_type 1140 +#define group_type 1141 +#define genexp_type 1142 +#define set_type 1143 +#define setcomp_type 1144 +#define dict_type 1145 +#define dictcomp_type 1146 +#define double_starred_kvpairs_type 1147 +#define double_starred_kvpair_type 1148 +#define kvpair_type 1149 +#define for_if_clauses_type 1150 +#define for_if_clause_type 1151 +#define yield_expr_type 1152 +#define arguments_type 1153 +#define args_type 1154 +#define kwargs_type 1155 +#define starred_expression_type 1156 +#define kwarg_or_starred_type 1157 +#define kwarg_or_double_starred_type 1158 +#define star_targets_type 1159 +#define star_targets_list_seq_type 1160 +#define star_targets_tuple_seq_type 1161 +#define star_target_type 1162 +#define target_with_star_atom_type 1163 +#define star_atom_type 1164 +#define single_target_type 1165 +#define single_subscript_attribute_target_type 1166 +#define del_targets_type 1167 +#define del_target_type 1168 +#define del_t_atom_type 1169 +#define targets_type 1170 +#define target_type 1171 +#define t_primary_type 1172 // Left-recursive +#define t_lookahead_type 1173 +#define t_atom_type 1174 +#define invalid_arguments_type 1175 +#define invalid_kwarg_type 1176 +#define invalid_named_expression_type 1177 +#define invalid_assignment_type 1178 +#define invalid_ann_assign_target_type 1179 +#define invalid_del_stmt_type 1180 +#define invalid_block_type 1181 +#define invalid_primary_type 1182 // Left-recursive +#define invalid_comprehension_type 1183 +#define invalid_dict_comprehension_type 1184 +#define invalid_parameters_type 1185 +#define invalid_parameters_helper_type 1186 +#define invalid_lambda_parameters_type 1187 +#define invalid_lambda_parameters_helper_type 1188 +#define invalid_star_etc_type 1189 +#define invalid_lambda_star_etc_type 1190 +#define invalid_double_type_comments_type 1191 +#define invalid_with_item_type 1192 +#define invalid_for_target_type 1193 +#define invalid_group_type 1194 +#define invalid_import_from_targets_type 1195 +#define invalid_with_stmt_type 1196 +#define invalid_except_block_type 1197 +#define invalid_match_stmt_type 1198 +#define invalid_case_block_type 1199 +#define invalid_if_stmt_type 1200 +#define invalid_elif_stmt_type 1201 +#define invalid_while_stmt_type 1202 +#define _loop0_1_type 1203 +#define _loop0_2_type 1204 +#define _loop0_4_type 1205 +#define _gather_3_type 1206 +#define _loop0_6_type 1207 +#define _gather_5_type 1208 +#define _loop0_8_type 1209 +#define _gather_7_type 1210 +#define _loop0_10_type 1211 +#define _gather_9_type 1212 +#define _loop1_11_type 1213 +#define _loop0_13_type 1214 +#define _gather_12_type 1215 +#define _tmp_14_type 1216 +#define _tmp_15_type 1217 +#define _tmp_16_type 1218 +#define _tmp_17_type 1219 +#define _tmp_18_type 1220 +#define _tmp_19_type 1221 +#define _tmp_20_type 1222 +#define _tmp_21_type 1223 +#define _loop1_22_type 1224 +#define _tmp_23_type 1225 +#define _tmp_24_type 1226 +#define _loop0_26_type 1227 +#define _gather_25_type 1228 +#define _loop0_28_type 1229 +#define _gather_27_type 1230 +#define _tmp_29_type 1231 +#define _tmp_30_type 1232 +#define _loop0_31_type 1233 +#define _loop1_32_type 1234 +#define _loop0_34_type 1235 +#define _gather_33_type 1236 +#define _tmp_35_type 1237 +#define _loop0_37_type 1238 +#define _gather_36_type 1239 +#define _tmp_38_type 1240 +#define _loop0_40_type 1241 +#define _gather_39_type 1242 +#define _loop0_42_type 1243 +#define _gather_41_type 1244 +#define _loop0_44_type 1245 +#define _gather_43_type 1246 +#define _loop0_46_type 1247 +#define _gather_45_type 1248 +#define _tmp_47_type 1249 +#define _loop1_48_type 1250 +#define _tmp_49_type 1251 +#define _loop1_50_type 1252 +#define _loop0_52_type 1253 +#define _gather_51_type 1254 +#define _tmp_53_type 1255 +#define _tmp_54_type 1256 +#define _tmp_55_type 1257 +#define _loop0_57_type 1258 +#define _gather_56_type 1259 +#define _tmp_58_type 1260 +#define _loop0_60_type 1261 +#define _gather_59_type 1262 +#define _tmp_61_type 1263 +#define _loop0_63_type 1264 +#define _gather_62_type 1265 +#define _loop0_65_type 1266 +#define _gather_64_type 1267 +#define _tmp_66_type 1268 +#define _tmp_67_type 1269 +#define _tmp_68_type 1270 +#define _tmp_69_type 1271 +#define _loop0_70_type 1272 +#define _loop0_71_type 1273 +#define _loop0_72_type 1274 +#define _loop1_73_type 1275 +#define _loop0_74_type 1276 +#define _loop1_75_type 1277 +#define _loop1_76_type 1278 +#define _loop1_77_type 1279 +#define _loop0_78_type 1280 +#define _loop1_79_type 1281 +#define _loop0_80_type 1282 +#define _loop1_81_type 1283 +#define _loop0_82_type 1284 +#define _loop1_83_type 1285 +#define _loop1_84_type 1286 +#define _tmp_85_type 1287 +#define _loop1_86_type 1288 +#define _loop0_88_type 1289 +#define _gather_87_type 1290 +#define _loop1_89_type 1291 +#define _loop0_90_type 1292 +#define _loop0_91_type 1293 +#define _loop0_92_type 1294 +#define _loop1_93_type 1295 +#define _loop0_94_type 1296 +#define _loop1_95_type 1297 +#define _loop1_96_type 1298 +#define _loop1_97_type 1299 +#define _loop0_98_type 1300 +#define _loop1_99_type 1301 +#define _loop0_100_type 1302 +#define _loop1_101_type 1303 +#define _loop0_102_type 1304 +#define _loop1_103_type 1305 +#define _loop1_104_type 1306 +#define _loop1_105_type 1307 +#define _loop1_106_type 1308 +#define _tmp_107_type 1309 +#define _loop0_109_type 1310 +#define _gather_108_type 1311 +#define _tmp_110_type 1312 +#define _tmp_111_type 1313 +#define _tmp_112_type 1314 +#define _tmp_113_type 1315 +#define _loop1_114_type 1316 +#define _tmp_115_type 1317 +#define _tmp_116_type 1318 +#define _loop0_118_type 1319 +#define _gather_117_type 1320 +#define _loop1_119_type 1321 +#define _loop0_120_type 1322 +#define _loop0_121_type 1323 +#define _loop0_123_type 1324 +#define _gather_122_type 1325 +#define _tmp_124_type 1326 +#define _loop0_126_type 1327 +#define _gather_125_type 1328 +#define _loop0_128_type 1329 +#define _gather_127_type 1330 +#define _loop0_130_type 1331 +#define _gather_129_type 1332 +#define _loop0_132_type 1333 +#define _gather_131_type 1334 +#define _loop0_133_type 1335 +#define _loop0_135_type 1336 +#define _gather_134_type 1337 +#define _loop1_136_type 1338 +#define _tmp_137_type 1339 +#define _loop0_139_type 1340 +#define _gather_138_type 1341 +#define _loop0_141_type 1342 +#define _gather_140_type 1343 +#define _tmp_142_type 1344 +#define _tmp_143_type 1345 +#define _tmp_144_type 1346 +#define _tmp_145_type 1347 +#define _loop0_146_type 1348 +#define _loop0_147_type 1349 +#define _loop0_148_type 1350 +#define _tmp_149_type 1351 +#define _tmp_150_type 1352 +#define _tmp_151_type 1353 +#define _loop0_152_type 1354 +#define _loop1_153_type 1355 +#define _loop0_154_type 1356 +#define _loop1_155_type 1357 +#define _tmp_156_type 1358 +#define _tmp_157_type 1359 +#define _tmp_158_type 1360 +#define _loop0_160_type 1361 +#define _gather_159_type 1362 +#define _loop0_162_type 1363 +#define _gather_161_type 1364 +#define _tmp_163_type 1365 +#define _tmp_164_type 1366 +#define _tmp_165_type 1367 +#define _tmp_166_type 1368 +#define _tmp_167_type 1369 +#define _tmp_168_type 1370 +#define _tmp_169_type 1371 +#define _tmp_170_type 1372 +#define _tmp_171_type 1373 +#define _tmp_172_type 1374 +#define _tmp_173_type 1375 +#define _tmp_174_type 1376 +#define _tmp_175_type 1377 +#define _tmp_176_type 1378 +#define _tmp_177_type 1379 +#define _tmp_178_type 1380 +#define _tmp_179_type 1381 +#define _tmp_180_type 1382 +#define _tmp_181_type 1383 +#define _tmp_182_type 1384 +#define _tmp_183_type 1385 +#define _tmp_184_type 1386 +#define _tmp_185_type 1387 static mod_ty file_rule(Parser *p); static mod_ty interactive_rule(Parser *p); @@ -541,6 +548,7 @@ static asdl_expr_seq* star_named_expressions_rule(Parser *p); static expr_ty star_named_expression_rule(Parser *p); static expr_ty named_expression_rule(Parser *p); +static expr_ty direct_named_expression_rule(Parser *p); static expr_ty annotated_rhs_rule(Parser *p); static expr_ty expressions_rule(Parser *p); static expr_ty expression_rule(Parser *p); @@ -646,6 +654,9 @@ static void *invalid_except_block_rule(Parser *p); static void *invalid_match_stmt_rule(Parser *p); static void *invalid_case_block_rule(Parser *p); +static void *invalid_if_stmt_rule(Parser *p); +static void *invalid_elif_stmt_rule(Parser *p); +static void *invalid_while_stmt_rule(Parser *p); static asdl_seq *_loop0_1_rule(Parser *p); static asdl_seq *_loop0_2_rule(Parser *p); static asdl_seq *_loop0_4_rule(Parser *p); @@ -788,26 +799,26 @@ static asdl_seq *_loop0_141_rule(Parser *p); static asdl_seq *_gather_140_rule(Parser *p); static void *_tmp_142_rule(Parser *p); -static asdl_seq *_loop0_143_rule(Parser *p); -static asdl_seq *_loop0_144_rule(Parser *p); -static asdl_seq *_loop0_145_rule(Parser *p); -static void *_tmp_146_rule(Parser *p); -static void *_tmp_147_rule(Parser *p); -static void *_tmp_148_rule(Parser *p); -static asdl_seq *_loop0_149_rule(Parser *p); -static asdl_seq *_loop1_150_rule(Parser *p); -static asdl_seq *_loop0_151_rule(Parser *p); -static asdl_seq *_loop1_152_rule(Parser *p); -static void *_tmp_153_rule(Parser *p); -static void *_tmp_154_rule(Parser *p); -static void *_tmp_155_rule(Parser *p); -static asdl_seq *_loop0_157_rule(Parser *p); -static asdl_seq *_gather_156_rule(Parser *p); -static asdl_seq *_loop0_159_rule(Parser *p); -static asdl_seq *_gather_158_rule(Parser *p); -static void *_tmp_160_rule(Parser *p); -static void *_tmp_161_rule(Parser *p); -static void *_tmp_162_rule(Parser *p); +static void *_tmp_143_rule(Parser *p); +static void *_tmp_144_rule(Parser *p); +static void *_tmp_145_rule(Parser *p); +static asdl_seq *_loop0_146_rule(Parser *p); +static asdl_seq *_loop0_147_rule(Parser *p); +static asdl_seq *_loop0_148_rule(Parser *p); +static void *_tmp_149_rule(Parser *p); +static void *_tmp_150_rule(Parser *p); +static void *_tmp_151_rule(Parser *p); +static asdl_seq *_loop0_152_rule(Parser *p); +static asdl_seq *_loop1_153_rule(Parser *p); +static asdl_seq *_loop0_154_rule(Parser *p); +static asdl_seq *_loop1_155_rule(Parser *p); +static void *_tmp_156_rule(Parser *p); +static void *_tmp_157_rule(Parser *p); +static void *_tmp_158_rule(Parser *p); +static asdl_seq *_loop0_160_rule(Parser *p); +static asdl_seq *_gather_159_rule(Parser *p); +static asdl_seq *_loop0_162_rule(Parser *p); +static asdl_seq *_gather_161_rule(Parser *p); static void *_tmp_163_rule(Parser *p); static void *_tmp_164_rule(Parser *p); static void *_tmp_165_rule(Parser *p); @@ -828,6 +839,9 @@ static void *_tmp_180_rule(Parser *p); static void *_tmp_181_rule(Parser *p); static void *_tmp_182_rule(Parser *p); +static void *_tmp_183_rule(Parser *p); +static void *_tmp_184_rule(Parser *p); +static void *_tmp_185_rule(Parser *p); // file: statements? $ @@ -897,7 +911,7 @@ ) { D(fprintf(stderr, "%*c+ interactive[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "statement_newline")); - _res = Interactive ( a , p -> arena ); + _res = _PyAST_Interactive ( a , p -> arena ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -944,7 +958,7 @@ ) { D(fprintf(stderr, "%*c+ eval[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expressions NEWLINE* $")); - _res = Expression ( a , p -> arena ); + _res = _PyAST_Expression ( a , p -> arena ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -1003,7 +1017,7 @@ ) { D(fprintf(stderr, "%*c+ func_type[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' type_expressions? ')' '->' expression NEWLINE* $")); - _res = FunctionType ( a , b , p -> arena ); + _res = _PyAST_FunctionType ( a , b , p -> arena ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -1496,7 +1510,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = ( asdl_stmt_seq * ) _PyPegen_singleton_seq ( p , CHECK ( stmt_ty , _Py_Pass ( EXTRA ) ) ); + _res = ( asdl_stmt_seq * ) _PyPegen_singleton_seq ( p , CHECK ( stmt_ty , _PyAST_Pass ( EXTRA ) ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -1692,7 +1706,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Expr ( e , EXTRA ); + _res = _PyAST_Expr ( e , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -1788,7 +1802,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Pass ( EXTRA ); + _res = _PyAST_Pass ( EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -1884,7 +1898,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Break ( EXTRA ); + _res = _PyAST_Break ( EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -1917,7 +1931,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Continue ( EXTRA ); + _res = _PyAST_Continue ( EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -2224,7 +2238,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = CHECK_VERSION ( stmt_ty , 6 , "Variable annotation syntax is" , _Py_AnnAssign ( CHECK ( expr_ty , _PyPegen_set_expr_context ( p , a , Store ) ) , b , c , 1 , EXTRA ) ); + _res = CHECK_VERSION ( stmt_ty , 6 , "Variable annotation syntax is" , _PyAST_AnnAssign ( CHECK ( expr_ty , _PyPegen_set_expr_context ( p , a , Store ) ) , b , c , 1 , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -2266,7 +2280,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = CHECK_VERSION ( stmt_ty , 6 , "Variable annotations syntax is" , _Py_AnnAssign ( a , b , c , 0 , EXTRA ) ); + _res = CHECK_VERSION ( stmt_ty , 6 , "Variable annotations syntax is" , _PyAST_AnnAssign ( a , b , c , 0 , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -2307,7 +2321,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Assign ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); + _res = _PyAST_Assign ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -2349,7 +2363,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_AugAssign ( a , b -> kind , c , EXTRA ); + _res = _PyAST_AugAssign ( a , b -> kind , c , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -2776,7 +2790,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Global ( CHECK ( asdl_identifier_seq * , _PyPegen_map_names_to_ids ( p , a ) ) , EXTRA ); + _res = _PyAST_Global ( CHECK ( asdl_identifier_seq * , _PyPegen_map_names_to_ids ( p , a ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -2838,7 +2852,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Nonlocal ( CHECK ( asdl_identifier_seq * , _PyPegen_map_names_to_ids ( p , a ) ) , EXTRA ); + _res = _PyAST_Nonlocal ( CHECK ( asdl_identifier_seq * , _PyPegen_map_names_to_ids ( p , a ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -2897,7 +2911,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Expr ( y , EXTRA ); + _res = _PyAST_Expr ( y , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -2962,7 +2976,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Assert ( a , b , EXTRA ); + _res = _PyAST_Assert ( a , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -3026,7 +3040,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Delete ( a , EXTRA ); + _res = _PyAST_Delete ( a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -3162,7 +3176,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Import ( a , EXTRA ); + _res = _PyAST_Import ( a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -3235,7 +3249,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_ImportFrom ( b -> v . Name . id , c , _PyPegen_seq_count_dots ( a ) , EXTRA ); + _res = _PyAST_ImportFrom ( b -> v . Name . id , c , _PyPegen_seq_count_dots ( a ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -3277,7 +3291,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_ImportFrom ( NULL , b , _PyPegen_seq_count_dots ( a ) , EXTRA ); + _res = _PyAST_ImportFrom ( NULL , b , _PyPegen_seq_count_dots ( a ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -3310,6 +3324,15 @@ } asdl_alias_seq* _res = NULL; int _mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + int _start_lineno = p->tokens[_mark]->lineno; + UNUSED(_start_lineno); // Only used by EXTRA macro + int _start_col_offset = p->tokens[_mark]->col_offset; + UNUSED(_start_col_offset); // Only used by EXTRA macro { // '(' import_from_as_names ','? ')' if (p->error_indicator) { D(p->level--); @@ -3377,7 +3400,16 @@ ) { D(fprintf(stderr, "%*c+ import_from_targets[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*'")); - _res = ( asdl_alias_seq * ) _PyPegen_singleton_seq ( p , CHECK ( alias_ty , _PyPegen_alias_for_star ( p ) ) ); + Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); + if (_token == NULL) { + D(p->level--); + return NULL; + } + int _end_lineno = _token->end_lineno; + UNUSED(_end_lineno); // Only used by EXTRA macro + int _end_col_offset = _token->end_col_offset; + UNUSED(_end_col_offset); // Only used by EXTRA macro + _res = ( asdl_alias_seq * ) _PyPegen_singleton_seq ( p , CHECK ( alias_ty , _PyPegen_alias_for_star ( p , EXTRA ) ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -3466,6 +3498,15 @@ } alias_ty _res = NULL; int _mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + int _start_lineno = p->tokens[_mark]->lineno; + UNUSED(_start_lineno); // Only used by EXTRA macro + int _start_col_offset = p->tokens[_mark]->col_offset; + UNUSED(_start_col_offset); // Only used by EXTRA macro { // NAME ['as' NAME] if (p->error_indicator) { D(p->level--); @@ -3481,7 +3522,16 @@ ) { D(fprintf(stderr, "%*c+ import_from_as_name[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME ['as' NAME]")); - _res = _Py_alias ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Name . id : NULL , p -> arena ); + Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); + if (_token == NULL) { + D(p->level--); + return NULL; + } + int _end_lineno = _token->end_lineno; + UNUSED(_end_lineno); // Only used by EXTRA macro + int _end_col_offset = _token->end_col_offset; + UNUSED(_end_col_offset); // Only used by EXTRA macro + _res = _PyAST_alias ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Name . id : NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -3551,6 +3601,15 @@ } alias_ty _res = NULL; int _mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + int _start_lineno = p->tokens[_mark]->lineno; + UNUSED(_start_lineno); // Only used by EXTRA macro + int _start_col_offset = p->tokens[_mark]->col_offset; + UNUSED(_start_col_offset); // Only used by EXTRA macro { // dotted_name ['as' NAME] if (p->error_indicator) { D(p->level--); @@ -3566,7 +3625,16 @@ ) { D(fprintf(stderr, "%*c+ dotted_as_name[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "dotted_name ['as' NAME]")); - _res = _Py_alias ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Name . id : NULL , p -> arena ); + Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); + if (_token == NULL) { + D(p->level--); + return NULL; + } + int _end_lineno = _token->end_lineno; + UNUSED(_end_lineno); // Only used by EXTRA macro + int _end_col_offset = _token->end_col_offset; + UNUSED(_end_col_offset); // Only used by EXTRA macro + _res = _PyAST_alias ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Name . id : NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -3683,8 +3751,9 @@ } // if_stmt: -// | 'if' named_expression &&':' block elif_stmt -// | 'if' named_expression &&':' block else_block? +// | 'if' named_expression ':' block elif_stmt +// | 'if' named_expression ':' block else_block? +// | invalid_if_stmt static stmt_ty if_stmt_rule(Parser *p) { @@ -3704,12 +3773,12 @@ UNUSED(_start_lineno); // Only used by EXTRA macro int _start_col_offset = p->tokens[_mark]->col_offset; UNUSED(_start_col_offset); // Only used by EXTRA macro - { // 'if' named_expression &&':' block elif_stmt - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> if_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' named_expression &&':' block elif_stmt")); + { // 'if' named_expression ':' block elif_stmt + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> if_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' named_expression ':' block elif_stmt")); Token * _keyword; Token * _literal; expr_ty a; @@ -3720,10 +3789,10 @@ && (a = named_expression_rule(p)) // named_expression && - (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' + (_literal = _PyPegen_expect_token(p, 11)) // token=':' && (b = block_rule(p)) // block && (c = elif_stmt_rule(p)) // elif_stmt ) { @@ -3724,20 +3793,20 @@ && (b = block_rule(p)) // block && (c = elif_stmt_rule(p)) // elif_stmt ) { - D(fprintf(stderr, "%*c+ if_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' named_expression &&':' block elif_stmt")); - Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); - if (_token == NULL) { - D(p->level--); - return NULL; - } - int _end_lineno = _token->end_lineno; - UNUSED(_end_lineno); // Only used by EXTRA macro - int _end_col_offset = _token->end_col_offset; - UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_If ( a , b , CHECK ( asdl_stmt_seq * , _PyPegen_singleton_seq ( p , c ) ) , EXTRA ); + D(fprintf(stderr, "%*c+ if_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' named_expression ':' block elif_stmt")); + Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); + if (_token == NULL) { + D(p->level--); + return NULL; + } + int _end_lineno = _token->end_lineno; + UNUSED(_end_lineno); // Only used by EXTRA macro + int _end_col_offset = _token->end_col_offset; + UNUSED(_end_col_offset); // Only used by EXTRA macro + _res = _PyAST_If ( a , b , CHECK ( asdl_stmt_seq * , _PyPegen_singleton_seq ( p , c ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -3747,14 +3816,14 @@ } p->mark = _mark; D(fprintf(stderr, "%*c%s if_stmt[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' named_expression &&':' block elif_stmt")); - } - { // 'if' named_expression &&':' block else_block? - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> if_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' named_expression &&':' block else_block?")); + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' named_expression ':' block elif_stmt")); + } + { // 'if' named_expression ':' block else_block? + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> if_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' named_expression ':' block else_block?")); Token * _keyword; Token * _literal; expr_ty a; @@ -3765,10 +3834,10 @@ && (a = named_expression_rule(p)) // named_expression && - (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' + (_literal = _PyPegen_expect_token(p, 11)) // token=':' && (b = block_rule(p)) // block && (c = else_block_rule(p), 1) // else_block? ) { @@ -3769,20 +3838,20 @@ && (b = block_rule(p)) // block && (c = else_block_rule(p), 1) // else_block? ) { - D(fprintf(stderr, "%*c+ if_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' named_expression &&':' block else_block?")); - Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); - if (_token == NULL) { - D(p->level--); - return NULL; - } - int _end_lineno = _token->end_lineno; - UNUSED(_end_lineno); // Only used by EXTRA macro - int _end_col_offset = _token->end_col_offset; - UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_If ( a , b , c , EXTRA ); + D(fprintf(stderr, "%*c+ if_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' named_expression ':' block else_block?")); + Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); + if (_token == NULL) { + D(p->level--); + return NULL; + } + int _end_lineno = _token->end_lineno; + UNUSED(_end_lineno); // Only used by EXTRA macro + int _end_col_offset = _token->end_col_offset; + UNUSED(_end_col_offset); // Only used by EXTRA macro + _res = _PyAST_If ( a , b , c , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -3792,7 +3861,26 @@ } p->mark = _mark; D(fprintf(stderr, "%*c%s if_stmt[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' named_expression &&':' block else_block?")); + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' named_expression ':' block else_block?")); + } + if (p->call_invalid_rules) { // invalid_if_stmt + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> if_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_if_stmt")); + void *invalid_if_stmt_var; + if ( + (invalid_if_stmt_var = invalid_if_stmt_rule(p)) // invalid_if_stmt + ) + { + D(fprintf(stderr, "%*c+ if_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_if_stmt")); + _res = invalid_if_stmt_var; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s if_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_if_stmt")); } _res = NULL; done: @@ -3801,8 +3889,9 @@ } // elif_stmt: -// | 'elif' named_expression &&':' block elif_stmt -// | 'elif' named_expression &&':' block else_block? +// | 'elif' named_expression ':' block elif_stmt +// | 'elif' named_expression ':' block else_block? +// | invalid_elif_stmt static stmt_ty elif_stmt_rule(Parser *p) { @@ -3822,12 +3911,12 @@ UNUSED(_start_lineno); // Only used by EXTRA macro int _start_col_offset = p->tokens[_mark]->col_offset; UNUSED(_start_col_offset); // Only used by EXTRA macro - { // 'elif' named_expression &&':' block elif_stmt - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> elif_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'elif' named_expression &&':' block elif_stmt")); + { // 'elif' named_expression ':' block elif_stmt + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> elif_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'elif' named_expression ':' block elif_stmt")); Token * _keyword; Token * _literal; expr_ty a; @@ -3838,10 +3927,10 @@ && (a = named_expression_rule(p)) // named_expression && - (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' + (_literal = _PyPegen_expect_token(p, 11)) // token=':' && (b = block_rule(p)) // block && (c = elif_stmt_rule(p)) // elif_stmt ) { @@ -3842,20 +3931,20 @@ && (b = block_rule(p)) // block && (c = elif_stmt_rule(p)) // elif_stmt ) { - D(fprintf(stderr, "%*c+ elif_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'elif' named_expression &&':' block elif_stmt")); - Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); - if (_token == NULL) { - D(p->level--); - return NULL; - } - int _end_lineno = _token->end_lineno; - UNUSED(_end_lineno); // Only used by EXTRA macro - int _end_col_offset = _token->end_col_offset; - UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_If ( a , b , CHECK ( asdl_stmt_seq * , _PyPegen_singleton_seq ( p , c ) ) , EXTRA ); + D(fprintf(stderr, "%*c+ elif_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'elif' named_expression ':' block elif_stmt")); + Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); + if (_token == NULL) { + D(p->level--); + return NULL; + } + int _end_lineno = _token->end_lineno; + UNUSED(_end_lineno); // Only used by EXTRA macro + int _end_col_offset = _token->end_col_offset; + UNUSED(_end_col_offset); // Only used by EXTRA macro + _res = _PyAST_If ( a , b , CHECK ( asdl_stmt_seq * , _PyPegen_singleton_seq ( p , c ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -3865,14 +3954,14 @@ } p->mark = _mark; D(fprintf(stderr, "%*c%s elif_stmt[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'elif' named_expression &&':' block elif_stmt")); - } - { // 'elif' named_expression &&':' block else_block? - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> elif_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'elif' named_expression &&':' block else_block?")); + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'elif' named_expression ':' block elif_stmt")); + } + { // 'elif' named_expression ':' block else_block? + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> elif_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'elif' named_expression ':' block else_block?")); Token * _keyword; Token * _literal; expr_ty a; @@ -3883,10 +3972,10 @@ && (a = named_expression_rule(p)) // named_expression && - (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' + (_literal = _PyPegen_expect_token(p, 11)) // token=':' && (b = block_rule(p)) // block && (c = else_block_rule(p), 1) // else_block? ) { @@ -3887,20 +3976,20 @@ && (b = block_rule(p)) // block && (c = else_block_rule(p), 1) // else_block? ) { - D(fprintf(stderr, "%*c+ elif_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'elif' named_expression &&':' block else_block?")); - Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); - if (_token == NULL) { - D(p->level--); - return NULL; - } - int _end_lineno = _token->end_lineno; - UNUSED(_end_lineno); // Only used by EXTRA macro - int _end_col_offset = _token->end_col_offset; - UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_If ( a , b , c , EXTRA ); + D(fprintf(stderr, "%*c+ elif_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'elif' named_expression ':' block else_block?")); + Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); + if (_token == NULL) { + D(p->level--); + return NULL; + } + int _end_lineno = _token->end_lineno; + UNUSED(_end_lineno); // Only used by EXTRA macro + int _end_col_offset = _token->end_col_offset; + UNUSED(_end_col_offset); // Only used by EXTRA macro + _res = _PyAST_If ( a , b , c , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -3910,7 +3999,26 @@ } p->mark = _mark; D(fprintf(stderr, "%*c%s elif_stmt[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'elif' named_expression &&':' block else_block?")); + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'elif' named_expression ':' block else_block?")); + } + if (p->call_invalid_rules) { // invalid_elif_stmt + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> elif_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_elif_stmt")); + void *invalid_elif_stmt_var; + if ( + (invalid_elif_stmt_var = invalid_elif_stmt_rule(p)) // invalid_elif_stmt + ) + { + D(fprintf(stderr, "%*c+ elif_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_elif_stmt")); + _res = invalid_elif_stmt_var; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s elif_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_elif_stmt")); } _res = NULL; done: @@ -3965,7 +4073,7 @@ return _res; } -// while_stmt: 'while' named_expression &&':' block else_block? +// while_stmt: 'while' named_expression ':' block else_block? | invalid_while_stmt static stmt_ty while_stmt_rule(Parser *p) { @@ -3985,12 +4093,12 @@ UNUSED(_start_lineno); // Only used by EXTRA macro int _start_col_offset = p->tokens[_mark]->col_offset; UNUSED(_start_col_offset); // Only used by EXTRA macro - { // 'while' named_expression &&':' block else_block? - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> while_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'while' named_expression &&':' block else_block?")); + { // 'while' named_expression ':' block else_block? + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> while_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'while' named_expression ':' block else_block?")); Token * _keyword; Token * _literal; expr_ty a; @@ -4001,10 +4109,10 @@ && (a = named_expression_rule(p)) // named_expression && - (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' + (_literal = _PyPegen_expect_token(p, 11)) // token=':' && (b = block_rule(p)) // block && (c = else_block_rule(p), 1) // else_block? ) { @@ -4005,20 +4113,20 @@ && (b = block_rule(p)) // block && (c = else_block_rule(p), 1) // else_block? ) { - D(fprintf(stderr, "%*c+ while_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'while' named_expression &&':' block else_block?")); - Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); - if (_token == NULL) { - D(p->level--); - return NULL; - } - int _end_lineno = _token->end_lineno; - UNUSED(_end_lineno); // Only used by EXTRA macro - int _end_col_offset = _token->end_col_offset; - UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_While ( a , b , c , EXTRA ); + D(fprintf(stderr, "%*c+ while_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'while' named_expression ':' block else_block?")); + Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); + if (_token == NULL) { + D(p->level--); + return NULL; + } + int _end_lineno = _token->end_lineno; + UNUSED(_end_lineno); // Only used by EXTRA macro + int _end_col_offset = _token->end_col_offset; + UNUSED(_end_col_offset); // Only used by EXTRA macro + _res = _PyAST_While ( a , b , c , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -4028,7 +4136,26 @@ } p->mark = _mark; D(fprintf(stderr, "%*c%s while_stmt[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'while' named_expression &&':' block else_block?")); + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'while' named_expression ':' block else_block?")); + } + if (p->call_invalid_rules) { // invalid_while_stmt + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> while_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_while_stmt")); + void *invalid_while_stmt_var; + if ( + (invalid_while_stmt_var = invalid_while_stmt_rule(p)) // invalid_while_stmt + ) + { + D(fprintf(stderr, "%*c+ while_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_while_stmt")); + _res = invalid_while_stmt_var; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s while_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_while_stmt")); } _res = NULL; done: @@ -4104,7 +4231,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_For ( t , ex , b , el , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); + _res = _PyAST_For ( t , ex , b , el , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -4168,7 +4295,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = CHECK_VERSION ( stmt_ty , 5 , "Async for loops are" , _Py_AsyncFor ( t , ex , b , el , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) ); + _res = CHECK_VERSION ( stmt_ty , 5 , "Async for loops are" , _PyAST_AsyncFor ( t , ex , b , el , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -4274,7 +4401,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_With ( a , b , NULL , EXTRA ); + _res = _PyAST_With ( a , b , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -4319,7 +4446,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_With ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); + _res = _PyAST_With ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -4374,7 +4501,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = CHECK_VERSION ( stmt_ty , 5 , "Async with statements are" , _Py_AsyncWith ( a , b , NULL , EXTRA ) ); + _res = CHECK_VERSION ( stmt_ty , 5 , "Async with statements are" , _PyAST_AsyncWith ( a , b , NULL , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -4422,7 +4549,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = CHECK_VERSION ( stmt_ty , 5 , "Async with statements are" , _Py_AsyncWith ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) ); + _res = CHECK_VERSION ( stmt_ty , 5 , "Async with statements are" , _PyAST_AsyncWith ( a , b , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -4493,7 +4620,7 @@ ) { D(fprintf(stderr, "%*c+ with_item[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression 'as' star_target &(',' | ')' | ':')")); - _res = _Py_withitem ( e , t , p -> arena ); + _res = _PyAST_withitem ( e , t , p -> arena ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -4536,7 +4663,7 @@ ) { D(fprintf(stderr, "%*c+ with_item[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression")); - _res = _Py_withitem ( e , NULL , p -> arena ); + _res = _PyAST_withitem ( e , NULL , p -> arena ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -4606,7 +4733,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Try ( b , NULL , NULL , f , EXTRA ); + _res = _PyAST_Try ( b , NULL , NULL , f , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -4654,7 +4781,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Try ( b , ex , el , f , EXTRA ); + _res = _PyAST_Try ( b , ex , el , f , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -4728,7 +4855,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_ExceptHandler ( e , ( t ) ? ( ( expr_ty ) t ) -> v . Name . id : NULL , b , EXTRA ); + _res = _PyAST_ExceptHandler ( e , ( t ) ? ( ( expr_ty ) t ) -> v . Name . id : NULL , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -4767,7 +4894,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_ExceptHandler ( NULL , NULL , b , EXTRA ); + _res = _PyAST_ExceptHandler ( NULL , NULL , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -4912,7 +5039,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = CHECK_VERSION ( stmt_ty , 10 , "Pattern matching is" , _Py_Match ( subject , cases , EXTRA ) ); + _res = CHECK_VERSION ( stmt_ty , 10 , "Pattern matching is" , _PyAST_Match ( subject , cases , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -4996,7 +5123,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_seq_insert_in_front ( p , value , values ) ) , Load , EXTRA ); + _res = _PyAST_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_seq_insert_in_front ( p , value , values ) ) , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -5068,7 +5195,7 @@ ) { D(fprintf(stderr, "%*c+ case_block[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "\"case\" patterns guard? ':' block")); - _res = _Py_match_case ( pattern , guard , body , p -> arena ); + _res = _PyAST_match_case ( pattern , guard , body , p -> arena ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -5190,7 +5317,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Tuple ( values , Load , EXTRA ); + _res = _PyAST_Tuple ( values , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -5329,7 +5456,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_MatchAs ( pattern , target -> v . Name . id , EXTRA ); + _res = _PyAST_MatchAs ( pattern , target -> v . Name . id , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -5388,7 +5515,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = asdl_seq_LEN ( patterns ) == 1 ? asdl_seq_GET ( patterns , 0 ) : _Py_MatchOr ( patterns , EXTRA ); + _res = asdl_seq_LEN ( patterns ) == 1 ? asdl_seq_GET ( patterns , 0 ) : _PyAST_MatchOr ( patterns , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -5658,7 +5785,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BinOp ( real , Add , imag , EXTRA ); + _res = _PyAST_BinOp ( real , Add , imag , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -5697,7 +5824,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BinOp ( real , Sub , imag , EXTRA ); + _res = _PyAST_BinOp ( real , Sub , imag , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -5749,7 +5876,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Constant ( Py_None , NULL , EXTRA ); + _res = _PyAST_Constant ( Py_None , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -5782,7 +5909,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Constant ( Py_True , NULL , EXTRA ); + _res = _PyAST_Constant ( Py_True , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -5815,7 +5942,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Constant ( Py_False , NULL , EXTRA ); + _res = _PyAST_Constant ( Py_False , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -5896,7 +6023,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_UnaryOp ( USub , number , EXTRA ); + _res = _PyAST_UnaryOp ( USub , number , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -6000,7 +6127,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Name ( CHECK ( PyObject * , _PyPegen_new_identifier ( p , "_" ) ) , Store , EXTRA ); + _res = _PyAST_Name ( CHECK ( PyObject * , _PyPegen_new_identifier ( p , "_" ) ) , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -6140,7 +6267,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Attribute ( value , attr -> v . Name . id , Load , EXTRA ); + _res = _PyAST_Attribute ( value , attr -> v . Name . id , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -6308,7 +6435,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_List ( values , Load , EXTRA ); + _res = _PyAST_List ( values , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -6347,7 +6474,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Tuple ( values , Load , EXTRA ); + _res = _PyAST_Tuple ( values , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -6556,7 +6683,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Starred ( value , Store , EXTRA ); + _res = _PyAST_Starred ( value , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -6621,7 +6748,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Dict ( CHECK ( asdl_expr_seq * , _PyPegen_get_keys ( p , items ) ) , CHECK ( asdl_expr_seq * , _PyPegen_get_values ( p , items ) ) , EXTRA ); + _res = _PyAST_Dict ( CHECK ( asdl_expr_seq * , _PyPegen_get_keys ( p , items ) ) , CHECK ( asdl_expr_seq * , _PyPegen_get_values ( p , items ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -6845,7 +6972,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Call ( func , NULL , NULL , EXTRA ); + _res = _PyAST_Call ( func , NULL , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -6891,7 +7018,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Call ( func , args , NULL , EXTRA ); + _res = _PyAST_Call ( func , args , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -6937,7 +7064,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Call ( func , NULL , keywords , EXTRA ); + _res = _PyAST_Call ( func , NULL , keywords , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -6989,7 +7116,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Call ( func , args , keywords , EXTRA ); + _res = _PyAST_Call ( func , args , keywords , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -7136,7 +7263,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_keyword ( arg -> v . Name . id , value , EXTRA ); + _res = _PyAST_keyword ( arg -> v . Name . id , value , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -7198,7 +7325,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Return ( a , EXTRA ); + _res = _PyAST_Return ( a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -7263,7 +7390,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Raise ( a , b , EXTRA ); + _res = _PyAST_Raise ( a , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -7296,7 +7423,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Raise ( NULL , NULL , EXTRA ); + _res = _PyAST_Raise ( NULL , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -7444,7 +7571,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_FunctionDef ( n -> v . Name . id , ( params ) ? params : CHECK ( arguments_ty , _PyPegen_empty_arguments ( p ) ) , b , NULL , a , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); + _res = _PyAST_FunctionDef ( n -> v . Name . id , ( params ) ? params : CHECK ( arguments_ty , _PyPegen_empty_arguments ( p ) ) , b , NULL , a , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -7504,7 +7631,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = CHECK_VERSION ( stmt_ty , 5 , "Async functions are" , _Py_AsyncFunctionDef ( n -> v . Name . id , ( params ) ? params : CHECK ( arguments_ty , _PyPegen_empty_arguments ( p ) ) , b , NULL , a , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) ); + _res = CHECK_VERSION ( stmt_ty , 5 , "Async functions are" , _PyAST_AsyncFunctionDef ( n -> v . Name . id , ( params ) ? params : CHECK ( arguments_ty , _PyPegen_empty_arguments ( p ) ) , b , NULL , a , NEW_TYPE_COMMENT ( p , tc ) , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -8450,7 +8577,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_arg ( a -> v . Name . id , b , NULL , EXTRA ); + _res = _PyAST_arg ( a -> v . Name . id , b , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -8713,7 +8840,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_ClassDef ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Call . args : NULL , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , c , NULL , EXTRA ); + _res = _PyAST_ClassDef ( a -> v . Name . id , ( b ) ? ( ( expr_ty ) b ) -> v . Call . args : NULL , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , c , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -8875,7 +9002,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_seq_insert_in_front ( p , a , b ) ) , Load , EXTRA ); + _res = _PyAST_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_seq_insert_in_front ( p , a , b ) ) , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -8911,7 +9038,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_singleton_seq ( p , a ) ) , Load , EXTRA ); + _res = _PyAST_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_singleton_seq ( p , a ) ) , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -8996,7 +9123,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Starred ( a , Load , EXTRA ); + _res = _PyAST_Starred ( a , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -9123,7 +9250,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Starred ( a , Load , EXTRA ); + _res = _PyAST_Starred ( a , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -9160,7 +9287,7 @@ return _res; } -// named_expression: NAME ':=' ~ expression | expression !':=' | invalid_named_expression +// named_expression: NAME ':=' ~ expression | invalid_named_expression | expression !':=' static expr_ty named_expression_rule(Parser *p) { @@ -9210,7 +9337,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_NamedExpr ( CHECK ( expr_ty , _PyPegen_set_expr_context ( p , a , Store ) ) , b , EXTRA ); + _res = _PyAST_NamedExpr ( CHECK ( expr_ty , _PyPegen_set_expr_context ( p , a , Store ) ) , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -9226,6 +9353,25 @@ return NULL; } } + if (p->call_invalid_rules) { // invalid_named_expression + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_named_expression")); + void *invalid_named_expression_var; + if ( + (invalid_named_expression_var = invalid_named_expression_rule(p)) // invalid_named_expression + ) + { + D(fprintf(stderr, "%*c+ named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_named_expression")); + _res = invalid_named_expression_var; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s named_expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_named_expression")); + } { // expression !':=' if (p->error_indicator) { D(p->level--); @@ -9247,24 +9393,98 @@ D(fprintf(stderr, "%*c%s named_expression[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression !':='")); } - if (p->call_invalid_rules) { // invalid_named_expression - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "invalid_named_expression")); - void *invalid_named_expression_var; - if ( - (invalid_named_expression_var = invalid_named_expression_rule(p)) // invalid_named_expression - ) - { - D(fprintf(stderr, "%*c+ named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "invalid_named_expression")); - _res = invalid_named_expression_var; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s named_expression[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "invalid_named_expression")); + _res = NULL; + done: + D(p->level--); + return _res; +} + +// direct_named_expression: NAME ':=' ~ expression | expression !':=' +static expr_ty +direct_named_expression_rule(Parser *p) +{ + D(p->level++); + if (p->error_indicator) { + D(p->level--); + return NULL; + } + expr_ty _res = NULL; + int _mark = p->mark; + if (p->mark == p->fill && _PyPegen_fill_token(p) < 0) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + int _start_lineno = p->tokens[_mark]->lineno; + UNUSED(_start_lineno); // Only used by EXTRA macro + int _start_col_offset = p->tokens[_mark]->col_offset; + UNUSED(_start_col_offset); // Only used by EXTRA macro + { // NAME ':=' ~ expression + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> direct_named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME ':=' ~ expression")); + int _cut_var = 0; + Token * _literal; + expr_ty a; + expr_ty b; + if ( + (a = _PyPegen_name_token(p)) // NAME + && + (_literal = _PyPegen_expect_token(p, 53)) // token=':=' + && + (_cut_var = 1) + && + (b = expression_rule(p)) // expression + ) + { + D(fprintf(stderr, "%*c+ direct_named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME ':=' ~ expression")); + Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); + if (_token == NULL) { + D(p->level--); + return NULL; + } + int _end_lineno = _token->end_lineno; + UNUSED(_end_lineno); // Only used by EXTRA macro + int _end_col_offset = _token->end_col_offset; + UNUSED(_end_col_offset); // Only used by EXTRA macro + _res = _PyAST_NamedExpr ( CHECK ( expr_ty , _PyPegen_set_expr_context ( p , a , Store ) ) , b , EXTRA ); + if (_res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s direct_named_expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME ':=' ~ expression")); + if (_cut_var) { + D(p->level--); + return NULL; + } + } + { // expression !':=' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> direct_named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression !':='")); + expr_ty expression_var; + if ( + (expression_var = expression_rule(p)) // expression + && + _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 53) // token=':=' + ) + { + D(fprintf(stderr, "%*c+ direct_named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression !':='")); + _res = expression_var; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s direct_named_expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression !':='")); } _res = NULL; done: @@ -9375,7 +9595,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_seq_insert_in_front ( p , a , b ) ) , Load , EXTRA ); + _res = _PyAST_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_seq_insert_in_front ( p , a , b ) ) , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -9411,7 +9631,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_singleton_seq ( p , a ) ) , Load , EXTRA ); + _res = _PyAST_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_singleton_seq ( p , a ) ) , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -9505,7 +9725,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_IfExp ( b , a , c , EXTRA ); + _res = _PyAST_IfExp ( b , a , c , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -9612,7 +9832,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Lambda ( ( a ) ? a : CHECK ( arguments_ty , _PyPegen_empty_arguments ( p ) ) , b , EXTRA ); + _res = _PyAST_Lambda ( ( a ) ? a : CHECK ( arguments_ty , _PyPegen_empty_arguments ( p ) ) , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -10450,7 +10670,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_arg ( a -> v . Name . id , NULL , NULL , EXTRA ); + _res = _PyAST_arg ( a -> v . Name . id , NULL , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -10516,7 +10736,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BoolOp ( Or , CHECK ( asdl_expr_seq * , _PyPegen_seq_insert_in_front ( p , a , b ) ) , EXTRA ); + _res = _PyAST_BoolOp ( Or , CHECK ( asdl_expr_seq * , _PyPegen_seq_insert_in_front ( p , a , b ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -10602,7 +10822,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BoolOp ( And , CHECK ( asdl_expr_seq * , _PyPegen_seq_insert_in_front ( p , a , b ) ) , EXTRA ); + _res = _PyAST_BoolOp ( And , CHECK ( asdl_expr_seq * , _PyPegen_seq_insert_in_front ( p , a , b ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -10688,7 +10908,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_UnaryOp ( Not , a , EXTRA ); + _res = _PyAST_UnaryOp ( Not , a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -10770,7 +10990,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Compare ( a , CHECK ( asdl_int_seq * , _PyPegen_get_cmpops ( p , b ) ) , CHECK ( asdl_expr_seq * , _PyPegen_get_exprs ( p , b ) ) , EXTRA ); + _res = _PyAST_Compare ( a , CHECK ( asdl_int_seq * , _PyPegen_get_cmpops ( p , b ) ) , CHECK ( asdl_expr_seq * , _PyPegen_get_exprs ( p , b ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -11549,7 +11769,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BinOp ( a , BitOr , b , EXTRA ); + _res = _PyAST_BinOp ( a , BitOr , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -11665,7 +11885,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BinOp ( a , BitXor , b , EXTRA ); + _res = _PyAST_BinOp ( a , BitXor , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -11781,7 +12001,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BinOp ( a , BitAnd , b , EXTRA ); + _res = _PyAST_BinOp ( a , BitAnd , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -11897,7 +12117,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BinOp ( a , LShift , b , EXTRA ); + _res = _PyAST_BinOp ( a , LShift , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -11936,7 +12156,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BinOp ( a , RShift , b , EXTRA ); + _res = _PyAST_BinOp ( a , RShift , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12052,7 +12272,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BinOp ( a , Add , b , EXTRA ); + _res = _PyAST_BinOp ( a , Add , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12091,7 +12311,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BinOp ( a , Sub , b , EXTRA ); + _res = _PyAST_BinOp ( a , Sub , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12213,7 +12433,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BinOp ( a , Mult , b , EXTRA ); + _res = _PyAST_BinOp ( a , Mult , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12252,7 +12472,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BinOp ( a , Div , b , EXTRA ); + _res = _PyAST_BinOp ( a , Div , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12291,7 +12511,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BinOp ( a , FloorDiv , b , EXTRA ); + _res = _PyAST_BinOp ( a , FloorDiv , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12330,7 +12550,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BinOp ( a , Mod , b , EXTRA ); + _res = _PyAST_BinOp ( a , Mod , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12369,7 +12589,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = CHECK_VERSION ( expr_ty , 5 , "The '@' operator is" , _Py_BinOp ( a , MatMult , b , EXTRA ) ); + _res = CHECK_VERSION ( expr_ty , 5 , "The '@' operator is" , _PyAST_BinOp ( a , MatMult , b , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12454,7 +12674,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_UnaryOp ( UAdd , a , EXTRA ); + _res = _PyAST_UnaryOp ( UAdd , a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12490,7 +12710,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_UnaryOp ( USub , a , EXTRA ); + _res = _PyAST_UnaryOp ( USub , a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12526,7 +12746,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_UnaryOp ( Invert , a , EXTRA ); + _res = _PyAST_UnaryOp ( Invert , a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12611,7 +12831,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_BinOp ( a , Pow , b , EXTRA ); + _res = _PyAST_BinOp ( a , Pow , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12696,7 +12916,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = CHECK_VERSION ( expr_ty , 5 , "Await expressions are" , _Py_Await ( a , EXTRA ) ); + _res = CHECK_VERSION ( expr_ty , 5 , "Await expressions are" , _PyAST_Await ( a , EXTRA ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12838,7 +13058,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Attribute ( a , b -> v . Name . id , Load , EXTRA ); + _res = _PyAST_Attribute ( a , b -> v . Name . id , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12874,7 +13094,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Call ( a , CHECK ( asdl_expr_seq * , ( asdl_expr_seq * ) _PyPegen_singleton_seq ( p , b ) ) , NULL , EXTRA ); + _res = _PyAST_Call ( a , CHECK ( asdl_expr_seq * , ( asdl_expr_seq * ) _PyPegen_singleton_seq ( p , b ) ) , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12916,7 +13136,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Call ( a , ( b ) ? ( ( expr_ty ) b ) -> v . Call . args : NULL , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , EXTRA ); + _res = _PyAST_Call ( a , ( b ) ? ( ( expr_ty ) b ) -> v . Call . args : NULL , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -12958,7 +13178,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Subscript ( a , b , Load , EXTRA ); + _res = _PyAST_Subscript ( a , b , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -13066,7 +13286,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Tuple ( a , Load , EXTRA ); + _res = _PyAST_Tuple ( a , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -13134,7 +13354,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Slice ( a , b , c , EXTRA ); + _res = _PyAST_Slice ( a , b , c , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -13246,7 +13466,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Constant ( Py_True , NULL , EXTRA ); + _res = _PyAST_Constant ( Py_True , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -13279,7 +13499,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Constant ( Py_False , NULL , EXTRA ); + _res = _PyAST_Constant ( Py_False , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -13312,7 +13532,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Constant ( Py_None , NULL , EXTRA ); + _res = _PyAST_Constant ( Py_None , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -13448,7 +13668,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Constant ( Py_Ellipsis , NULL , EXTRA ); + _res = _PyAST_Constant ( Py_Ellipsis , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -13559,7 +13779,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_List ( a , Load , EXTRA ); + _res = _PyAST_List ( a , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -13627,7 +13847,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_ListComp ( a , b , EXTRA ); + _res = _PyAST_ListComp ( a , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -13711,7 +13931,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Tuple ( a , Load , EXTRA ); + _res = _PyAST_Tuple ( a , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -13795,7 +14015,7 @@ return _res; } -// genexp: '(' named_expression for_if_clauses ')' | invalid_comprehension +// genexp: '(' direct_named_expression for_if_clauses ')' | invalid_comprehension static expr_ty genexp_rule(Parser *p) { @@ -13815,12 +14035,12 @@ UNUSED(_start_lineno); // Only used by EXTRA macro int _start_col_offset = p->tokens[_mark]->col_offset; UNUSED(_start_col_offset); // Only used by EXTRA macro - { // '(' named_expression for_if_clauses ')' - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> genexp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' named_expression for_if_clauses ')'")); + { // '(' direct_named_expression for_if_clauses ')' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> genexp[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' direct_named_expression for_if_clauses ')'")); Token * _literal; Token * _literal_1; expr_ty a; @@ -13828,10 +14048,10 @@ if ( (_literal = _PyPegen_expect_token(p, 7)) // token='(' && - (a = named_expression_rule(p)) // named_expression + (a = direct_named_expression_rule(p)) // direct_named_expression && (b = for_if_clauses_rule(p)) // for_if_clauses && (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { @@ -13832,20 +14052,20 @@ && (b = for_if_clauses_rule(p)) // for_if_clauses && (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' ) { - D(fprintf(stderr, "%*c+ genexp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' named_expression for_if_clauses ')'")); - Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); - if (_token == NULL) { - D(p->level--); - return NULL; - } - int _end_lineno = _token->end_lineno; - UNUSED(_end_lineno); // Only used by EXTRA macro - int _end_col_offset = _token->end_col_offset; - UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_GeneratorExp ( a , b , EXTRA ); + D(fprintf(stderr, "%*c+ genexp[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' direct_named_expression for_if_clauses ')'")); + Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); + if (_token == NULL) { + D(p->level--); + return NULL; + } + int _end_lineno = _token->end_lineno; + UNUSED(_end_lineno); // Only used by EXTRA macro + int _end_col_offset = _token->end_col_offset; + UNUSED(_end_col_offset); // Only used by EXTRA macro + _res = _PyAST_GeneratorExp ( a , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -13855,7 +14075,7 @@ } p->mark = _mark; D(fprintf(stderr, "%*c%s genexp[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' named_expression for_if_clauses ')'")); + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' direct_named_expression for_if_clauses ')'")); } if (p->call_invalid_rules) { // invalid_comprehension if (p->error_indicator) { @@ -13929,7 +14149,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Set ( a , EXTRA ); + _res = _PyAST_Set ( a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -13997,7 +14217,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_SetComp ( a , b , EXTRA ); + _res = _PyAST_SetComp ( a , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -14081,7 +14301,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Dict ( CHECK ( asdl_expr_seq * , _PyPegen_get_keys ( p , a ) ) , CHECK ( asdl_expr_seq * , _PyPegen_get_values ( p , a ) ) , EXTRA ); + _res = _PyAST_Dict ( CHECK ( asdl_expr_seq * , _PyPegen_get_keys ( p , a ) ) , CHECK ( asdl_expr_seq * , _PyPegen_get_values ( p , a ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -14149,7 +14369,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_DictComp ( a -> key , a -> value , b , EXTRA ); + _res = _PyAST_DictComp ( a -> key , a -> value , b , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -14426,7 +14646,7 @@ ) { D(fprintf(stderr, "%*c+ for_if_clause[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC 'for' star_targets 'in' ~ disjunction (('if' disjunction))*")); - _res = CHECK_VERSION ( comprehension_ty , 6 , "Async comprehensions are" , _Py_comprehension ( a , b , c , 1 , p -> arena ) ); + _res = CHECK_VERSION ( comprehension_ty , 6 , "Async comprehensions are" , _PyAST_comprehension ( a , b , c , 1 , p -> arena ) ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -14469,7 +14689,7 @@ ) { D(fprintf(stderr, "%*c+ for_if_clause[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'for' star_targets 'in' ~ disjunction (('if' disjunction))*")); - _res = _Py_comprehension ( a , b , c , 0 , p -> arena ); + _res = _PyAST_comprehension ( a , b , c , 0 , p -> arena ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -14557,7 +14777,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_YieldFrom ( a , EXTRA ); + _res = _PyAST_YieldFrom ( a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -14593,7 +14813,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Yield ( a , EXTRA ); + _res = _PyAST_Yield ( a , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -14682,7 +14902,7 @@ return _res; } -// args: ','.(starred_expression | named_expression !'=')+ [',' kwargs] | kwargs +// args: ','.(starred_expression | direct_named_expression !'=')+ [',' kwargs] | kwargs static expr_ty args_rule(Parser *p) { @@ -14702,12 +14922,12 @@ UNUSED(_start_lineno); // Only used by EXTRA macro int _start_col_offset = p->tokens[_mark]->col_offset; UNUSED(_start_col_offset); // Only used by EXTRA macro - { // ','.(starred_expression | named_expression !'=')+ [',' kwargs] - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> args[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.(starred_expression | named_expression !'=')+ [',' kwargs]")); + { // ','.(starred_expression | direct_named_expression !'=')+ [',' kwargs] + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> args[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','.(starred_expression | direct_named_expression !'=')+ [',' kwargs]")); asdl_expr_seq* a; void *b; if ( @@ -14711,8 +14931,8 @@ asdl_expr_seq* a; void *b; if ( - (a = (asdl_expr_seq*)_gather_122_rule(p)) // ','.(starred_expression | named_expression !'=')+ + (a = (asdl_expr_seq*)_gather_122_rule(p)) // ','.(starred_expression | direct_named_expression !'=')+ && (b = _tmp_124_rule(p), 1) // [',' kwargs] ) { @@ -14715,8 +14935,8 @@ && (b = _tmp_124_rule(p), 1) // [',' kwargs] ) { - D(fprintf(stderr, "%*c+ args[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.(starred_expression | named_expression !'=')+ [',' kwargs]")); + D(fprintf(stderr, "%*c+ args[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','.(starred_expression | direct_named_expression !'=')+ [',' kwargs]")); Token *_token = _PyPegen_get_last_nonnwhitespace_token(p); if (_token == NULL) { D(p->level--); @@ -14736,7 +14956,7 @@ } p->mark = _mark; D(fprintf(stderr, "%*c%s args[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.(starred_expression | named_expression !'=')+ [',' kwargs]")); + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','.(starred_expression | direct_named_expression !'=')+ [',' kwargs]")); } { // kwargs if (p->error_indicator) { @@ -14759,7 +14979,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Call ( _PyPegen_dummy_name ( p ) , CHECK_NULL_ALLOWED ( asdl_expr_seq * , _PyPegen_seq_extract_starred_exprs ( p , a ) ) , CHECK_NULL_ALLOWED ( asdl_keyword_seq * , _PyPegen_seq_delete_starred_exprs ( p , a ) ) , EXTRA ); + _res = _PyAST_Call ( _PyPegen_dummy_name ( p ) , CHECK_NULL_ALLOWED ( asdl_expr_seq * , _PyPegen_seq_extract_starred_exprs ( p , a ) ) , CHECK_NULL_ALLOWED ( asdl_keyword_seq * , _PyPegen_seq_delete_starred_exprs ( p , a ) ) , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -14909,7 +15129,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Starred ( a , Load , EXTRA ); + _res = _PyAST_Starred ( a , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -14974,7 +15194,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _PyPegen_keyword_or_starred ( p , CHECK ( keyword_ty , _Py_keyword ( a -> v . Name . id , b , EXTRA ) ) , 1 ); + _res = _PyPegen_keyword_or_starred ( p , CHECK ( keyword_ty , _PyAST_keyword ( a -> v . Name . id , b , EXTRA ) ) , 1 ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -15082,7 +15302,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _PyPegen_keyword_or_starred ( p , CHECK ( keyword_ty , _Py_keyword ( a -> v . Name . id , b , EXTRA ) ) , 1 ); + _res = _PyPegen_keyword_or_starred ( p , CHECK ( keyword_ty , _PyAST_keyword ( a -> v . Name . id , b , EXTRA ) ) , 1 ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -15118,7 +15338,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _PyPegen_keyword_or_starred ( p , CHECK ( keyword_ty , _Py_keyword ( NULL , a , EXTRA ) ) , 1 ); + _res = _PyPegen_keyword_or_starred ( p , CHECK ( keyword_ty , _PyAST_keyword ( NULL , a , EXTRA ) ) , 1 ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -15229,7 +15449,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_seq_insert_in_front ( p , a , b ) ) , Store , EXTRA ); + _res = _PyAST_Tuple ( CHECK ( asdl_expr_seq * , _PyPegen_seq_insert_in_front ( p , a , b ) ) , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -15415,7 +15635,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Starred ( CHECK ( expr_ty , _PyPegen_set_expr_context ( p , a , Store ) ) , Store , EXTRA ); + _res = _PyAST_Starred ( CHECK ( expr_ty , _PyPegen_set_expr_context ( p , a , Store ) ) , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -15509,7 +15729,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Attribute ( a , b -> v . Name . id , Store , EXTRA ); + _res = _PyAST_Attribute ( a , b -> v . Name . id , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -15553,7 +15773,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Subscript ( a , b , Store , EXTRA ); + _res = _PyAST_Subscript ( a , b , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -15696,7 +15916,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Tuple ( a , Store , EXTRA ); + _res = _PyAST_Tuple ( a , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -15735,7 +15955,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_List ( a , Store , EXTRA ); + _res = _PyAST_List ( a , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -15894,7 +16114,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Attribute ( a , b -> v . Name . id , Store , EXTRA ); + _res = _PyAST_Attribute ( a , b -> v . Name . id , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -15938,7 +16158,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Subscript ( a , b , Store , EXTRA ); + _res = _PyAST_Subscript ( a , b , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -16057,7 +16277,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Attribute ( a , b -> v . Name . id , Del , EXTRA ); + _res = _PyAST_Attribute ( a , b -> v . Name . id , Del , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -16101,7 +16321,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Subscript ( a , b , Del , EXTRA ); + _res = _PyAST_Subscript ( a , b , Del , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -16240,7 +16460,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Tuple ( a , Del , EXTRA ); + _res = _PyAST_Tuple ( a , Del , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -16279,7 +16499,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_List ( a , Del , EXTRA ); + _res = _PyAST_List ( a , Del , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -16398,7 +16618,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Attribute ( a , b -> v . Name . id , Store , EXTRA ); + _res = _PyAST_Attribute ( a , b -> v . Name . id , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -16442,7 +16662,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Subscript ( a , b , Store , EXTRA ); + _res = _PyAST_Subscript ( a , b , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -16566,7 +16786,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Attribute ( a , b -> v . Name . id , Load , EXTRA ); + _res = _PyAST_Attribute ( a , b -> v . Name . id , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -16610,7 +16830,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Subscript ( a , b , Load , EXTRA ); + _res = _PyAST_Subscript ( a , b , Load , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -16648,7 +16868,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Call ( a , CHECK ( asdl_expr_seq * , ( asdl_expr_seq * ) _PyPegen_singleton_seq ( p , b ) ) , NULL , EXTRA ); + _res = _PyAST_Call ( a , CHECK ( asdl_expr_seq * , ( asdl_expr_seq * ) _PyPegen_singleton_seq ( p , b ) ) , NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -16692,7 +16912,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Call ( a , ( b ) ? ( ( expr_ty ) b ) -> v . Call . args : NULL , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , EXTRA ); + _res = _PyAST_Call ( a , ( b ) ? ( ( expr_ty ) b ) -> v . Call . args : NULL , ( b ) ? ( ( expr_ty ) b ) -> v . Call . keywords : NULL , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -16911,7 +17131,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_Tuple ( b , Store , EXTRA ); + _res = _PyAST_Tuple ( b , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -16950,7 +17170,7 @@ UNUSED(_end_lineno); // Only used by EXTRA macro int _end_col_offset = _token->end_col_offset; UNUSED(_end_col_offset); // Only used by EXTRA macro - _res = _Py_List ( b , Store , EXTRA ); + _res = _PyAST_List ( b , Store , EXTRA ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -17188,7 +17408,10 @@ return _res; } -// invalid_named_expression: expression ':=' expression +// invalid_named_expression: +// | expression ':=' expression +// | NAME '=' bitwise_or !('=' | ':=' | ',') +// | !(list | tuple | genexp | 'True' | 'None' | 'False') bitwise_or '=' bitwise_or !('=' | ':=' | ',') static void * invalid_named_expression_rule(Parser *p) { @@ -17229,6 +17452,72 @@ D(fprintf(stderr, "%*c%s invalid_named_expression[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ':=' expression")); } + { // NAME '=' bitwise_or !('=' | ':=' | ',') + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> invalid_named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME '=' bitwise_or !('=' | ':=' | ',')")); + expr_ty a; + Token * b; + expr_ty bitwise_or_var; + if ( + (a = _PyPegen_name_token(p)) // NAME + && + (b = _PyPegen_expect_token(p, 22)) // token='=' + && + (bitwise_or_var = bitwise_or_rule(p)) // bitwise_or + && + _PyPegen_lookahead(0, _tmp_143_rule, p) + ) + { + D(fprintf(stderr, "%*c+ invalid_named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME '=' bitwise_or !('=' | ':=' | ',')")); + _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( b , "invalid syntax. Maybe you meant '==' or ':=' instead of '='?" ); + if (_res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_named_expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME '=' bitwise_or !('=' | ':=' | ',')")); + } + { // !(list | tuple | genexp | 'True' | 'None' | 'False') bitwise_or '=' bitwise_or !('=' | ':=' | ',') + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> invalid_named_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "!(list | tuple | genexp | 'True' | 'None' | 'False') bitwise_or '=' bitwise_or !('=' | ':=' | ',')")); + expr_ty a; + Token * b; + expr_ty bitwise_or_var; + if ( + _PyPegen_lookahead(0, _tmp_144_rule, p) + && + (a = bitwise_or_rule(p)) // bitwise_or + && + (b = _PyPegen_expect_token(p, 22)) // token='=' + && + (bitwise_or_var = bitwise_or_rule(p)) // bitwise_or + && + _PyPegen_lookahead(0, _tmp_145_rule, p) + ) + { + D(fprintf(stderr, "%*c+ invalid_named_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "!(list | tuple | genexp | 'True' | 'None' | 'False') bitwise_or '=' bitwise_or !('=' | ':=' | ',')")); + _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( b , "cannot assign to %s here. Maybe you meant '==' instead of '='?" , _PyPegen_get_expr_name ( a ) ); + if (_res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_named_expression[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "!(list | tuple | genexp | 'True' | 'None' | 'False') bitwise_or '=' bitwise_or !('=' | ':=' | ',')")); + } _res = NULL; done: D(p->level--); @@ -17290,7 +17579,7 @@ D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_named_expression ',' star_named_expressions* ':' expression")); Token * _literal; Token * _literal_1; - asdl_seq * _loop0_143_var; + asdl_seq * _loop0_146_var; expr_ty a; expr_ty expression_var; if ( @@ -17298,7 +17587,7 @@ && (_literal = _PyPegen_expect_token(p, 12)) // token=',' && - (_loop0_143_var = _loop0_143_rule(p)) // star_named_expressions* + (_loop0_146_var = _loop0_146_rule(p)) // star_named_expressions* && (_literal_1 = _PyPegen_expect_token(p, 11)) // token=':' && @@ -17355,10 +17644,10 @@ } D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "((star_targets '='))* star_expressions '='")); Token * _literal; - asdl_seq * _loop0_144_var; - expr_ty a; - if ( - (_loop0_144_var = _loop0_144_rule(p)) // ((star_targets '='))* + asdl_seq * _loop0_147_var; + expr_ty a; + if ( + (_loop0_147_var = _loop0_147_rule(p)) // ((star_targets '='))* && (a = star_expressions_rule(p)) // star_expressions && @@ -17385,10 +17674,10 @@ } D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "((star_targets '='))* yield_expr '='")); Token * _literal; - asdl_seq * _loop0_145_var; - expr_ty a; - if ( - (_loop0_145_var = _loop0_145_rule(p)) // ((star_targets '='))* + asdl_seq * _loop0_148_var; + expr_ty a; + if ( + (_loop0_148_var = _loop0_148_rule(p)) // ((star_targets '='))* && (a = yield_expr_rule(p)) // yield_expr && @@ -17414,7 +17703,7 @@ return NULL; } D(fprintf(stderr, "%*c> invalid_assignment[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions augassign (yield_expr | star_expressions)")); - void *_tmp_146_var; + void *_tmp_149_var; expr_ty a; AugOperator* augassign_var; if ( @@ -17422,7 +17711,7 @@ && (augassign_var = augassign_rule(p)) // augassign && - (_tmp_146_var = _tmp_146_rule(p)) // yield_expr | star_expressions + (_tmp_149_var = _tmp_149_rule(p)) // yield_expr | star_expressions ) { D(fprintf(stderr, "%*c+ invalid_assignment[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions augassign (yield_expr | star_expressions)")); @@ -17680,7 +17969,7 @@ return NULL; } D(fprintf(stderr, "%*c> invalid_comprehension[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('[' | '(' | '{') starred_expression for_if_clauses")); - void *_tmp_147_var; + void *_tmp_150_var; expr_ty a; asdl_comprehension_seq* for_if_clauses_var; if ( @@ -17684,7 +17973,7 @@ expr_ty a; asdl_comprehension_seq* for_if_clauses_var; if ( - (_tmp_147_var = _tmp_147_rule(p)) // '[' | '(' | '{' + (_tmp_150_var = _tmp_150_rule(p)) // '[' | '(' | '{' && (a = starred_expression_rule(p)) // starred_expression && @@ -17713,7 +18002,7 @@ Token * _literal; void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings - void *_tmp_148_var; + void *_tmp_151_var; expr_ty a; asdl_comprehension_seq* for_if_clauses_var; if ( @@ -17717,7 +18006,7 @@ expr_ty a; asdl_comprehension_seq* for_if_clauses_var; if ( - (_tmp_148_var = _tmp_148_rule(p)) // '[' | '{' + (_tmp_151_var = _tmp_151_rule(p)) // '[' | '{' && (a = star_named_expression_rule(p)) // star_named_expression && @@ -17817,7 +18106,7 @@ return NULL; } D(fprintf(stderr, "%*c> invalid_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default* invalid_parameters_helper param_no_default")); - asdl_seq * _loop0_149_var; + asdl_seq * _loop0_152_var; void *invalid_parameters_helper_var; arg_ty param_no_default_var; if ( @@ -17821,7 +18110,7 @@ void *invalid_parameters_helper_var; arg_ty param_no_default_var; if ( - (_loop0_149_var = _loop0_149_rule(p)) // param_no_default* + (_loop0_152_var = _loop0_152_rule(p)) // param_no_default* && (invalid_parameters_helper_var = invalid_parameters_helper_rule(p)) // invalid_parameters_helper && @@ -17888,9 +18177,9 @@ return NULL; } D(fprintf(stderr, "%*c> invalid_parameters_helper[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default+")); - asdl_seq * _loop1_150_var; - if ( - (_loop1_150_var = _loop1_150_rule(p)) // param_with_default+ + asdl_seq * _loop1_153_var; + if ( + (_loop1_153_var = _loop1_153_rule(p)) // param_with_default+ ) { D(fprintf(stderr, "%*c+ invalid_parameters_helper[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_with_default+")); @@ -17894,7 +18183,7 @@ ) { D(fprintf(stderr, "%*c+ invalid_parameters_helper[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "param_with_default+")); - _res = _loop1_150_var; + _res = _loop1_153_var; goto done; } p->mark = _mark; @@ -17925,7 +18214,7 @@ return NULL; } D(fprintf(stderr, "%*c> invalid_lambda_parameters[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default* invalid_lambda_parameters_helper lambda_param_no_default")); - asdl_seq * _loop0_151_var; + asdl_seq * _loop0_154_var; void *invalid_lambda_parameters_helper_var; arg_ty lambda_param_no_default_var; if ( @@ -17929,7 +18218,7 @@ void *invalid_lambda_parameters_helper_var; arg_ty lambda_param_no_default_var; if ( - (_loop0_151_var = _loop0_151_rule(p)) // lambda_param_no_default* + (_loop0_154_var = _loop0_154_rule(p)) // lambda_param_no_default* && (invalid_lambda_parameters_helper_var = invalid_lambda_parameters_helper_rule(p)) // invalid_lambda_parameters_helper && @@ -17998,9 +18287,9 @@ return NULL; } D(fprintf(stderr, "%*c> invalid_lambda_parameters_helper[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default+")); - asdl_seq * _loop1_152_var; - if ( - (_loop1_152_var = _loop1_152_rule(p)) // lambda_param_with_default+ + asdl_seq * _loop1_155_var; + if ( + (_loop1_155_var = _loop1_155_rule(p)) // lambda_param_with_default+ ) { D(fprintf(stderr, "%*c+ invalid_lambda_parameters_helper[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default+")); @@ -18004,7 +18293,7 @@ ) { D(fprintf(stderr, "%*c+ invalid_lambda_parameters_helper[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default+")); - _res = _loop1_152_var; + _res = _loop1_155_var; goto done; } p->mark = _mark; @@ -18035,7 +18324,7 @@ } D(fprintf(stderr, "%*c> invalid_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' (')' | ',' (')' | '**'))")); Token * _literal; - void *_tmp_153_var; + void *_tmp_156_var; if ( (_literal = _PyPegen_expect_token(p, 16)) // token='*' && @@ -18039,7 +18328,7 @@ if ( (_literal = _PyPegen_expect_token(p, 16)) // token='*' && - (_tmp_153_var = _tmp_153_rule(p)) // ')' | ',' (')' | '**') + (_tmp_156_var = _tmp_156_rule(p)) // ')' | ',' (')' | '**') ) { D(fprintf(stderr, "%*c+ invalid_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' (')' | ',' (')' | '**'))")); @@ -18109,7 +18398,7 @@ } D(fprintf(stderr, "%*c> invalid_lambda_star_etc[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'*' (':' | ',' (':' | '**'))")); Token * _literal; - void *_tmp_154_var; + void *_tmp_157_var; if ( (_literal = _PyPegen_expect_token(p, 16)) // token='*' && @@ -18113,7 +18402,7 @@ if ( (_literal = _PyPegen_expect_token(p, 16)) // token='*' && - (_tmp_154_var = _tmp_154_rule(p)) // ':' | ',' (':' | '**') + (_tmp_157_var = _tmp_157_rule(p)) // ':' | ',' (':' | '**') ) { D(fprintf(stderr, "%*c+ invalid_lambda_star_etc[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'*' (':' | ',' (':' | '**'))")); @@ -18215,7 +18504,7 @@ && (a = expression_rule(p)) // expression && - _PyPegen_lookahead(1, _tmp_155_rule, p) + _PyPegen_lookahead(1, _tmp_158_rule, p) ) { D(fprintf(stderr, "%*c+ invalid_with_item[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression 'as' expression &(',' | ')' | ':')")); @@ -18285,7 +18574,7 @@ return _res; } -// invalid_group: '(' starred_expression ')' +// invalid_group: '(' starred_expression ')' | '(' '**' expression ')' static void * invalid_group_rule(Parser *p) { @@ -18314,7 +18603,7 @@ ) { D(fprintf(stderr, "%*c+ invalid_group[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' starred_expression ')'")); - _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "can't use starred expression here" ); + _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "cannot use starred expression here" ); if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -18326,6 +18615,39 @@ D(fprintf(stderr, "%*c%s invalid_group[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' starred_expression ')'")); } + { // '(' '**' expression ')' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> invalid_group[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'(' '**' expression ')'")); + Token * _literal; + Token * _literal_1; + Token * a; + expr_ty expression_var; + if ( + (_literal = _PyPegen_expect_token(p, 7)) // token='(' + && + (a = _PyPegen_expect_token(p, 35)) // token='**' + && + (expression_var = expression_rule(p)) // expression + && + (_literal_1 = _PyPegen_expect_token(p, 8)) // token=')' + ) + { + D(fprintf(stderr, "%*c+ invalid_group[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'(' '**' expression ')'")); + _res = RAISE_SYNTAX_ERROR_KNOWN_LOCATION ( a , "cannot use double starred expression here" ); + if (_res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_group[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'(' '**' expression ')'")); + } _res = NULL; done: D(p->level--); @@ -18395,7 +18717,7 @@ return NULL; } D(fprintf(stderr, "%*c> invalid_with_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC? 'with' ','.(expression ['as' star_target])+ &&':'")); - asdl_seq * _gather_156_var; + asdl_seq * _gather_159_var; Token * _keyword; Token * _literal; void *_opt_var; @@ -18405,9 +18727,9 @@ && (_keyword = _PyPegen_expect_token(p, 519)) // token='with' && - (_gather_156_var = _gather_156_rule(p)) // ','.(expression ['as' star_target])+ + (_gather_159_var = _gather_159_rule(p)) // ','.(expression ['as' star_target])+ && (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' ) { D(fprintf(stderr, "%*c+ invalid_with_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC? 'with' ','.(expression ['as' star_target])+ &&':'")); @@ -18409,9 +18731,9 @@ && (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' ) { D(fprintf(stderr, "%*c+ invalid_with_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC? 'with' ','.(expression ['as' star_target])+ &&':'")); - _res = _PyPegen_dummy_name(p, _opt_var, _keyword, _gather_156_var, _literal); + _res = _PyPegen_dummy_name(p, _opt_var, _keyword, _gather_159_var, _literal); goto done; } p->mark = _mark; @@ -18424,7 +18746,7 @@ return NULL; } D(fprintf(stderr, "%*c> invalid_with_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "ASYNC? 'with' '(' ','.(expressions ['as' star_target])+ ','? ')' &&':'")); - asdl_seq * _gather_158_var; + asdl_seq * _gather_161_var; Token * _keyword; Token * _literal; Token * _literal_1; @@ -18440,7 +18762,7 @@ && (_literal = _PyPegen_expect_token(p, 7)) // token='(' && - (_gather_158_var = _gather_158_rule(p)) // ','.(expressions ['as' star_target])+ + (_gather_161_var = _gather_161_rule(p)) // ','.(expressions ['as' star_target])+ && (_opt_var_1 = _PyPegen_expect_token(p, 12), 1) // ','? && @@ -18450,7 +18772,7 @@ ) { D(fprintf(stderr, "%*c+ invalid_with_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "ASYNC? 'with' '(' ','.(expressions ['as' star_target])+ ','? ')' &&':'")); - _res = _PyPegen_dummy_name(p, _opt_var, _keyword, _literal, _gather_158_var, _opt_var_1, _literal_1, _literal_2); + _res = _PyPegen_dummy_name(p, _opt_var, _keyword, _literal, _gather_161_var, _opt_var_1, _literal_1, _literal_2); goto done; } p->mark = _mark; @@ -18499,7 +18821,7 @@ && (expressions_var = expressions_rule(p)) // expressions && - (_opt_var = _tmp_160_rule(p), 1) // ['as' NAME] + (_opt_var = _tmp_163_rule(p), 1) // ['as' NAME] && (_literal_1 = _PyPegen_expect_token(p, 11)) // token=':' ) @@ -18533,7 +18855,7 @@ && (expression_var = expression_rule(p)) // expression && - (_opt_var = _tmp_161_rule(p), 1) // ['as' NAME] + (_opt_var = _tmp_164_rule(p), 1) // ['as' NAME] && (_literal = _PyPegen_expect_forced_token(p, 11, ":")) // forced_token=':' ) @@ -18670,6 +18992,147 @@ return _res; } +// invalid_if_stmt: 'if' named_expression NEWLINE +static void * +invalid_if_stmt_rule(Parser *p) +{ + D(p->level++); + if (p->error_indicator) { + D(p->level--); + return NULL; + } + void * _res = NULL; + int _mark = p->mark; + { // 'if' named_expression NEWLINE + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> invalid_if_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' named_expression NEWLINE")); + Token * _keyword; + expr_ty named_expression_var; + Token * newline_var; + if ( + (_keyword = _PyPegen_expect_token(p, 510)) // token='if' + && + (named_expression_var = named_expression_rule(p)) // named_expression + && + (newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' + ) + { + D(fprintf(stderr, "%*c+ invalid_if_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' named_expression NEWLINE")); + _res = RAISE_SYNTAX_ERROR ( "expected ':'" ); + if (_res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_if_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' named_expression NEWLINE")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + +// invalid_elif_stmt: 'elif' named_expression NEWLINE +static void * +invalid_elif_stmt_rule(Parser *p) +{ + D(p->level++); + if (p->error_indicator) { + D(p->level--); + return NULL; + } + void * _res = NULL; + int _mark = p->mark; + { // 'elif' named_expression NEWLINE + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> invalid_elif_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'elif' named_expression NEWLINE")); + Token * _keyword; + expr_ty named_expression_var; + Token * newline_var; + if ( + (_keyword = _PyPegen_expect_token(p, 515)) // token='elif' + && + (named_expression_var = named_expression_rule(p)) // named_expression + && + (newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' + ) + { + D(fprintf(stderr, "%*c+ invalid_elif_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'elif' named_expression NEWLINE")); + _res = RAISE_SYNTAX_ERROR ( "expected ':'" ); + if (_res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_elif_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'elif' named_expression NEWLINE")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + +// invalid_while_stmt: 'while' named_expression NEWLINE +static void * +invalid_while_stmt_rule(Parser *p) +{ + D(p->level++); + if (p->error_indicator) { + D(p->level--); + return NULL; + } + void * _res = NULL; + int _mark = p->mark; + { // 'while' named_expression NEWLINE + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> invalid_while_stmt[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'while' named_expression NEWLINE")); + Token * _keyword; + expr_ty named_expression_var; + Token * newline_var; + if ( + (_keyword = _PyPegen_expect_token(p, 512)) // token='while' + && + (named_expression_var = named_expression_rule(p)) // named_expression + && + (newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' + ) + { + D(fprintf(stderr, "%*c+ invalid_while_stmt[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'while' named_expression NEWLINE")); + _res = RAISE_SYNTAX_ERROR ( "expected ':'" ); + if (_res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s invalid_while_stmt[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'while' named_expression NEWLINE")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + // _loop0_1: NEWLINE static asdl_seq * _loop0_1_rule(Parser *p) @@ -19918,12 +20381,12 @@ return NULL; } D(fprintf(stderr, "%*c> _loop1_22[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(star_targets '=')")); - void *_tmp_162_var; - while ( - (_tmp_162_var = _tmp_162_rule(p)) // star_targets '=' - ) - { - _res = _tmp_162_var; + void *_tmp_165_var; + while ( + (_tmp_165_var = _tmp_165_rule(p)) // star_targets '=' + ) + { + _res = _tmp_165_var; if (_n == _children_capacity) { _children_capacity *= 2; void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); @@ -20426,12 +20889,12 @@ return NULL; } D(fprintf(stderr, "%*c> _loop0_31[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('.' | '...')")); - void *_tmp_163_var; - while ( - (_tmp_163_var = _tmp_163_rule(p)) // '.' | '...' - ) - { - _res = _tmp_163_var; + void *_tmp_166_var; + while ( + (_tmp_166_var = _tmp_166_rule(p)) // '.' | '...' + ) + { + _res = _tmp_166_var; if (_n == _children_capacity) { _children_capacity *= 2; void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); @@ -20492,12 +20955,12 @@ return NULL; } D(fprintf(stderr, "%*c> _loop1_32[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('.' | '...')")); - void *_tmp_164_var; - while ( - (_tmp_164_var = _tmp_164_rule(p)) // '.' | '...' - ) - { - _res = _tmp_164_var; + void *_tmp_167_var; + while ( + (_tmp_167_var = _tmp_167_rule(p)) // '.' | '...' + ) + { + _res = _tmp_167_var; if (_n == _children_capacity) { _children_capacity *= 2; void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); @@ -23608,12 +24071,12 @@ return NULL; } D(fprintf(stderr, "%*c> _loop1_84[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('@' named_expression NEWLINE)")); - void *_tmp_165_var; - while ( - (_tmp_165_var = _tmp_165_rule(p)) // '@' named_expression NEWLINE - ) - { - _res = _tmp_165_var; + void *_tmp_168_var; + while ( + (_tmp_168_var = _tmp_168_rule(p)) // '@' named_expression NEWLINE + ) + { + _res = _tmp_168_var; if (_n == _children_capacity) { _children_capacity *= 2; void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); @@ -23726,12 +24189,12 @@ return NULL; } D(fprintf(stderr, "%*c> _loop1_86[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(',' star_expression)")); - void *_tmp_166_var; - while ( - (_tmp_166_var = _tmp_166_rule(p)) // ',' star_expression - ) - { - _res = _tmp_166_var; + void *_tmp_169_var; + while ( + (_tmp_169_var = _tmp_169_rule(p)) // ',' star_expression + ) + { + _res = _tmp_169_var; if (_n == _children_capacity) { _children_capacity *= 2; void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); @@ -23911,12 +24374,12 @@ return NULL; } D(fprintf(stderr, "%*c> _loop1_89[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(',' expression)")); - void *_tmp_167_var; - while ( - (_tmp_167_var = _tmp_167_rule(p)) // ',' expression - ) - { - _res = _tmp_167_var; + void *_tmp_170_var; + while ( + (_tmp_170_var = _tmp_170_rule(p)) // ',' expression + ) + { + _res = _tmp_170_var; if (_n == _children_capacity) { _children_capacity *= 2; void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); @@ -24941,12 +25404,12 @@ return NULL; } D(fprintf(stderr, "%*c> _loop1_104[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('or' conjunction)")); - void *_tmp_168_var; - while ( - (_tmp_168_var = _tmp_168_rule(p)) // 'or' conjunction - ) - { - _res = _tmp_168_var; + void *_tmp_171_var; + while ( + (_tmp_171_var = _tmp_171_rule(p)) // 'or' conjunction + ) + { + _res = _tmp_171_var; if (_n == _children_capacity) { _children_capacity *= 2; void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); @@ -25012,12 +25475,12 @@ return NULL; } D(fprintf(stderr, "%*c> _loop1_105[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('and' inversion)")); - void *_tmp_169_var; - while ( - (_tmp_169_var = _tmp_169_rule(p)) // 'and' inversion - ) - { - _res = _tmp_169_var; + void *_tmp_172_var; + while ( + (_tmp_172_var = _tmp_172_rule(p)) // 'and' inversion + ) + { + _res = _tmp_172_var; if (_n == _children_capacity) { _children_capacity *= 2; void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); @@ -25933,12 +26396,12 @@ return NULL; } D(fprintf(stderr, "%*c> _loop0_120[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('if' disjunction)")); - void *_tmp_170_var; - while ( - (_tmp_170_var = _tmp_170_rule(p)) // 'if' disjunction - ) - { - _res = _tmp_170_var; + void *_tmp_173_var; + while ( + (_tmp_173_var = _tmp_173_rule(p)) // 'if' disjunction + ) + { + _res = _tmp_173_var; if (_n == _children_capacity) { _children_capacity *= 2; void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); @@ -25999,12 +26462,12 @@ return NULL; } D(fprintf(stderr, "%*c> _loop0_121[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "('if' disjunction)")); - void *_tmp_171_var; - while ( - (_tmp_171_var = _tmp_171_rule(p)) // 'if' disjunction - ) - { - _res = _tmp_171_var; + void *_tmp_174_var; + while ( + (_tmp_174_var = _tmp_174_rule(p)) // 'if' disjunction + ) + { + _res = _tmp_174_var; if (_n == _children_capacity) { _children_capacity *= 2; void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); @@ -26038,7 +26501,7 @@ return _seq; } -// _loop0_123: ',' (starred_expression | named_expression !'=') +// _loop0_123: ',' (starred_expression | direct_named_expression !'=') static asdl_seq * _loop0_123_rule(Parser *p) { @@ -26059,14 +26522,14 @@ } Py_ssize_t _children_capacity = 1; Py_ssize_t _n = 0; - { // ',' (starred_expression | named_expression !'=') - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> _loop0_123[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (starred_expression | named_expression !'=')")); + { // ',' (starred_expression | direct_named_expression !'=') + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _loop0_123[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (starred_expression | direct_named_expression !'=')")); Token * _literal; void *elem; while ( (_literal = _PyPegen_expect_token(p, 12)) // token=',' && @@ -26068,9 +26531,9 @@ Token * _literal; void *elem; while ( (_literal = _PyPegen_expect_token(p, 12)) // token=',' && - (elem = _tmp_172_rule(p)) // starred_expression | named_expression !'=' + (elem = _tmp_175_rule(p)) // starred_expression | direct_named_expression !'=' ) { _res = elem; @@ -26096,7 +26559,7 @@ } p->mark = _mark; D(fprintf(stderr, "%*c%s _loop0_123[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (starred_expression | named_expression !'=')")); + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (starred_expression | direct_named_expression !'=')")); } asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena); if (!_seq) { @@ -26113,7 +26576,7 @@ return _seq; } -// _gather_122: (starred_expression | named_expression !'=') _loop0_123 +// _gather_122: (starred_expression | direct_named_expression !'=') _loop0_123 static asdl_seq * _gather_122_rule(Parser *p) { @@ -26124,12 +26587,12 @@ } asdl_seq * _res = NULL; int _mark = p->mark; - { // (starred_expression | named_expression !'=') _loop0_123 - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> _gather_122[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(starred_expression | named_expression !'=') _loop0_123")); + { // (starred_expression | direct_named_expression !'=') _loop0_123 + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _gather_122[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(starred_expression | direct_named_expression !'=') _loop0_123")); void *elem; asdl_seq * seq; if ( @@ -26133,8 +26596,8 @@ void *elem; asdl_seq * seq; if ( - (elem = _tmp_172_rule(p)) // starred_expression | named_expression !'=' + (elem = _tmp_175_rule(p)) // starred_expression | direct_named_expression !'=' && (seq = _loop0_123_rule(p)) // _loop0_123 ) { @@ -26137,10 +26600,10 @@ && (seq = _loop0_123_rule(p)) // _loop0_123 ) { - D(fprintf(stderr, "%*c+ _gather_122[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(starred_expression | named_expression !'=') _loop0_123")); + D(fprintf(stderr, "%*c+ _gather_122[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(starred_expression | direct_named_expression !'=') _loop0_123")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; D(fprintf(stderr, "%*c%s _gather_122[%d-%d]: %s failed!\n", p->level, ' ', @@ -26142,9 +26605,9 @@ _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; D(fprintf(stderr, "%*c%s _gather_122[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(starred_expression | named_expression !'=') _loop0_123")); + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(starred_expression | direct_named_expression !'=') _loop0_123")); } _res = NULL; done: @@ -26679,12 +27142,12 @@ return NULL; } D(fprintf(stderr, "%*c> _loop0_133[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(',' star_target)")); - void *_tmp_173_var; - while ( - (_tmp_173_var = _tmp_173_rule(p)) // ',' star_target - ) - { - _res = _tmp_173_var; + void *_tmp_176_var; + while ( + (_tmp_176_var = _tmp_176_rule(p)) // ',' star_target + ) + { + _res = _tmp_176_var; if (_n == _children_capacity) { _children_capacity *= 2; void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); @@ -26859,12 +27322,12 @@ return NULL; } D(fprintf(stderr, "%*c> _loop1_136[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(',' star_target)")); - void *_tmp_174_var; - while ( - (_tmp_174_var = _tmp_174_rule(p)) // ',' star_target - ) - { - _res = _tmp_174_var; + void *_tmp_177_var; + while ( + (_tmp_177_var = _tmp_177_rule(p)) // ',' star_target + ) + { + _res = _tmp_177_var; if (_n == _children_capacity) { _children_capacity *= 2; void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); @@ -27227,9 +27690,288 @@ return _res; } -// _loop0_143: star_named_expressions -static asdl_seq * -_loop0_143_rule(Parser *p) +// _tmp_143: '=' | ':=' | ',' +static void * +_tmp_143_rule(Parser *p) +{ + D(p->level++); + if (p->error_indicator) { + D(p->level--); + return NULL; + } + void * _res = NULL; + int _mark = p->mark; + { // '=' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_143[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'='")); + Token * _literal; + if ( + (_literal = _PyPegen_expect_token(p, 22)) // token='=' + ) + { + D(fprintf(stderr, "%*c+ _tmp_143[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'='")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_143[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'='")); + } + { // ':=' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_143[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':='")); + Token * _literal; + if ( + (_literal = _PyPegen_expect_token(p, 53)) // token=':=' + ) + { + D(fprintf(stderr, "%*c+ _tmp_143[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':='")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_143[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':='")); + } + { // ',' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_143[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','")); + Token * _literal; + if ( + (_literal = _PyPegen_expect_token(p, 12)) // token=',' + ) + { + D(fprintf(stderr, "%*c+ _tmp_143[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_143[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + +// _tmp_144: list | tuple | genexp | 'True' | 'None' | 'False' +static void * +_tmp_144_rule(Parser *p) +{ + D(p->level++); + if (p->error_indicator) { + D(p->level--); + return NULL; + } + void * _res = NULL; + int _mark = p->mark; + { // list + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_144[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "list")); + expr_ty list_var; + if ( + (list_var = list_rule(p)) // list + ) + { + D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "list")); + _res = list_var; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_144[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "list")); + } + { // tuple + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_144[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "tuple")); + expr_ty tuple_var; + if ( + (tuple_var = tuple_rule(p)) // tuple + ) + { + D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "tuple")); + _res = tuple_var; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_144[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "tuple")); + } + { // genexp + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_144[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "genexp")); + expr_ty genexp_var; + if ( + (genexp_var = genexp_rule(p)) // genexp + ) + { + D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "genexp")); + _res = genexp_var; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_144[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "genexp")); + } + { // 'True' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_144[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'True'")); + Token * _keyword; + if ( + (_keyword = _PyPegen_expect_token(p, 524)) // token='True' + ) + { + D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'True'")); + _res = _keyword; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_144[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'True'")); + } + { // 'None' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_144[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'None'")); + Token * _keyword; + if ( + (_keyword = _PyPegen_expect_token(p, 523)) // token='None' + ) + { + D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'None'")); + _res = _keyword; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_144[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'None'")); + } + { // 'False' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_144[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'False'")); + Token * _keyword; + if ( + (_keyword = _PyPegen_expect_token(p, 525)) // token='False' + ) + { + D(fprintf(stderr, "%*c+ _tmp_144[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'False'")); + _res = _keyword; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_144[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'False'")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + +// _tmp_145: '=' | ':=' | ',' +static void * +_tmp_145_rule(Parser *p) +{ + D(p->level++); + if (p->error_indicator) { + D(p->level--); + return NULL; + } + void * _res = NULL; + int _mark = p->mark; + { // '=' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_145[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'='")); + Token * _literal; + if ( + (_literal = _PyPegen_expect_token(p, 22)) // token='=' + ) + { + D(fprintf(stderr, "%*c+ _tmp_145[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'='")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_145[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'='")); + } + { // ':=' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_145[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':='")); + Token * _literal; + if ( + (_literal = _PyPegen_expect_token(p, 53)) // token=':=' + ) + { + D(fprintf(stderr, "%*c+ _tmp_145[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':='")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_145[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':='")); + } + { // ',' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_145[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','")); + Token * _literal; + if ( + (_literal = _PyPegen_expect_token(p, 12)) // token=',' + ) + { + D(fprintf(stderr, "%*c+ _tmp_145[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_145[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + +// _loop0_146: star_named_expressions +static asdl_seq * +_loop0_146_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -27253,7 +27995,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _loop0_143[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_named_expressions")); + D(fprintf(stderr, "%*c> _loop0_146[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_named_expressions")); asdl_expr_seq* star_named_expressions_var; while ( (star_named_expressions_var = star_named_expressions_rule(p)) // star_named_expressions @@ -27275,7 +28017,7 @@ _mark = p->mark; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _loop0_143[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _loop0_146[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_named_expressions")); } asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena); @@ -27288,80 +28030,14 @@ } for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]); PyMem_Free(_children); - _PyPegen_insert_memo(p, _start_mark, _loop0_143_type, _seq); - D(p->level--); - return _seq; -} - -// _loop0_144: (star_targets '=') -static asdl_seq * -_loop0_144_rule(Parser *p) -{ - D(p->level++); - if (p->error_indicator) { - D(p->level--); - return NULL; - } - void *_res = NULL; - int _mark = p->mark; - int _start_mark = p->mark; - void **_children = PyMem_Malloc(sizeof(void *)); - if (!_children) { - p->error_indicator = 1; - PyErr_NoMemory(); - D(p->level--); - return NULL; - } - Py_ssize_t _children_capacity = 1; - Py_ssize_t _n = 0; - { // (star_targets '=') - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> _loop0_144[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(star_targets '=')")); - void *_tmp_175_var; - while ( - (_tmp_175_var = _tmp_175_rule(p)) // star_targets '=' - ) - { - _res = _tmp_175_var; - if (_n == _children_capacity) { - _children_capacity *= 2; - void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); - if (!_new_children) { - p->error_indicator = 1; - PyErr_NoMemory(); - D(p->level--); - return NULL; - } - _children = _new_children; - } - _children[_n++] = _res; - _mark = p->mark; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _loop0_144[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(star_targets '=')")); - } - asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena); - if (!_seq) { - PyMem_Free(_children); - p->error_indicator = 1; - PyErr_NoMemory(); - D(p->level--); - return NULL; - } - for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]); - PyMem_Free(_children); - _PyPegen_insert_memo(p, _start_mark, _loop0_144_type, _seq); - D(p->level--); - return _seq; -} - -// _loop0_145: (star_targets '=') -static asdl_seq * -_loop0_145_rule(Parser *p) + _PyPegen_insert_memo(p, _start_mark, _loop0_146_type, _seq); + D(p->level--); + return _seq; +} + +// _loop0_147: (star_targets '=') +static asdl_seq * +_loop0_147_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -27385,29 +28061,29 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _loop0_145[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(star_targets '=')")); - void *_tmp_176_var; - while ( - (_tmp_176_var = _tmp_176_rule(p)) // star_targets '=' - ) - { - _res = _tmp_176_var; - if (_n == _children_capacity) { - _children_capacity *= 2; - void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); - if (!_new_children) { - p->error_indicator = 1; - PyErr_NoMemory(); - D(p->level--); - return NULL; - } - _children = _new_children; - } - _children[_n++] = _res; - _mark = p->mark; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _loop0_145[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c> _loop0_147[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(star_targets '=')")); + void *_tmp_178_var; + while ( + (_tmp_178_var = _tmp_178_rule(p)) // star_targets '=' + ) + { + _res = _tmp_178_var; + if (_n == _children_capacity) { + _children_capacity *= 2; + void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); + if (!_new_children) { + p->error_indicator = 1; + PyErr_NoMemory(); + D(p->level--); + return NULL; + } + _children = _new_children; + } + _children[_n++] = _res; + _mark = p->mark; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_147[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(star_targets '=')")); } asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena); @@ -27420,14 +28096,80 @@ } for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]); PyMem_Free(_children); - _PyPegen_insert_memo(p, _start_mark, _loop0_145_type, _seq); - D(p->level--); - return _seq; -} - -// _tmp_146: yield_expr | star_expressions -static void * -_tmp_146_rule(Parser *p) + _PyPegen_insert_memo(p, _start_mark, _loop0_147_type, _seq); + D(p->level--); + return _seq; +} + +// _loop0_148: (star_targets '=') +static asdl_seq * +_loop0_148_rule(Parser *p) +{ + D(p->level++); + if (p->error_indicator) { + D(p->level--); + return NULL; + } + void *_res = NULL; + int _mark = p->mark; + int _start_mark = p->mark; + void **_children = PyMem_Malloc(sizeof(void *)); + if (!_children) { + p->error_indicator = 1; + PyErr_NoMemory(); + D(p->level--); + return NULL; + } + Py_ssize_t _children_capacity = 1; + Py_ssize_t _n = 0; + { // (star_targets '=') + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _loop0_148[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(star_targets '=')")); + void *_tmp_179_var; + while ( + (_tmp_179_var = _tmp_179_rule(p)) // star_targets '=' + ) + { + _res = _tmp_179_var; + if (_n == _children_capacity) { + _children_capacity *= 2; + void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *)); + if (!_new_children) { + p->error_indicator = 1; + PyErr_NoMemory(); + D(p->level--); + return NULL; + } + _children = _new_children; + } + _children[_n++] = _res; + _mark = p->mark; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _loop0_148[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(star_targets '=')")); + } + asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena); + if (!_seq) { + PyMem_Free(_children); + p->error_indicator = 1; + PyErr_NoMemory(); + D(p->level--); + return NULL; + } + for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]); + PyMem_Free(_children); + _PyPegen_insert_memo(p, _start_mark, _loop0_148_type, _seq); + D(p->level--); + return _seq; +} + +// _tmp_149: yield_expr | star_expressions +static void * +_tmp_149_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -27441,9 +28183,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_146[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr")); + D(fprintf(stderr, "%*c> _tmp_149[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "yield_expr")); expr_ty yield_expr_var; if ( (yield_expr_var = yield_expr_rule(p)) // yield_expr ) { @@ -27445,10 +28187,10 @@ expr_ty yield_expr_var; if ( (yield_expr_var = yield_expr_rule(p)) // yield_expr ) { - D(fprintf(stderr, "%*c+ _tmp_146[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr")); + D(fprintf(stderr, "%*c+ _tmp_149[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "yield_expr")); _res = yield_expr_var; goto done; } p->mark = _mark; @@ -27451,8 +28193,8 @@ _res = yield_expr_var; goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_146[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_149[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "yield_expr")); } { // star_expressions @@ -27460,9 +28202,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_146[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions")); + D(fprintf(stderr, "%*c> _tmp_149[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_expressions")); expr_ty star_expressions_var; if ( (star_expressions_var = star_expressions_rule(p)) // star_expressions ) { @@ -27464,10 +28206,10 @@ expr_ty star_expressions_var; if ( (star_expressions_var = star_expressions_rule(p)) // star_expressions ) { - D(fprintf(stderr, "%*c+ _tmp_146[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions")); + D(fprintf(stderr, "%*c+ _tmp_149[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_expressions")); _res = star_expressions_var; goto done; } p->mark = _mark; @@ -27470,8 +28212,8 @@ _res = star_expressions_var; goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_146[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_149[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_expressions")); } _res = NULL; @@ -27480,9 +28222,9 @@ return _res; } -// _tmp_147: '[' | '(' | '{' -static void * -_tmp_147_rule(Parser *p) +// _tmp_150: '[' | '(' | '{' +static void * +_tmp_150_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -27496,9 +28238,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_147[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'['")); + D(fprintf(stderr, "%*c> _tmp_150[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'['")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 9)) // token='[' ) { @@ -27500,14 +28242,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 9)) // token='[' ) { - D(fprintf(stderr, "%*c+ _tmp_147[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'['")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_147[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_150[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'['")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_150[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'['")); } { // '(' @@ -27515,18 +28257,18 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_147[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'('")); - Token * _literal; - if ( - (_literal = _PyPegen_expect_token(p, 7)) // token='(' - ) - { - D(fprintf(stderr, "%*c+ _tmp_147[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'('")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_147[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c> _tmp_150[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'('")); + Token * _literal; + if ( + (_literal = _PyPegen_expect_token(p, 7)) // token='(' + ) + { + D(fprintf(stderr, "%*c+ _tmp_150[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'('")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_150[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'('")); } { // '{' @@ -27534,9 +28276,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_147[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{'")); + D(fprintf(stderr, "%*c> _tmp_150[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 25)) // token='{' ) { @@ -27538,14 +28280,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 25)) // token='{' ) { - D(fprintf(stderr, "%*c+ _tmp_147[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{'")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_147[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_150[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{'")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_150[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{'")); } _res = NULL; @@ -27554,9 +28296,9 @@ return _res; } -// _tmp_148: '[' | '{' -static void * -_tmp_148_rule(Parser *p) +// _tmp_151: '[' | '{' +static void * +_tmp_151_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -27570,9 +28312,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_148[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'['")); + D(fprintf(stderr, "%*c> _tmp_151[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'['")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 9)) // token='[' ) { @@ -27574,14 +28316,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 9)) // token='[' ) { - D(fprintf(stderr, "%*c+ _tmp_148[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'['")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_148[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_151[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'['")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_151[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'['")); } { // '{' @@ -27589,9 +28331,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_148[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{'")); + D(fprintf(stderr, "%*c> _tmp_151[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'{'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 25)) // token='{' ) { @@ -27593,14 +28335,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 25)) // token='{' ) { - D(fprintf(stderr, "%*c+ _tmp_148[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{'")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_148[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_151[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'{'")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_151[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'{'")); } _res = NULL; @@ -27609,9 +28351,9 @@ return _res; } -// _loop0_149: param_no_default -static asdl_seq * -_loop0_149_rule(Parser *p) +// _loop0_152: param_no_default +static asdl_seq * +_loop0_152_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -27635,7 +28377,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _loop0_149[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default")); + D(fprintf(stderr, "%*c> _loop0_152[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_no_default")); arg_ty param_no_default_var; while ( (param_no_default_var = param_no_default_rule(p)) // param_no_default @@ -27657,7 +28399,7 @@ _mark = p->mark; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _loop0_149[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _loop0_152[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_no_default")); } asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena); @@ -27670,14 +28412,14 @@ } for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]); PyMem_Free(_children); - _PyPegen_insert_memo(p, _start_mark, _loop0_149_type, _seq); - D(p->level--); - return _seq; -} - -// _loop1_150: param_with_default -static asdl_seq * -_loop1_150_rule(Parser *p) + _PyPegen_insert_memo(p, _start_mark, _loop0_152_type, _seq); + D(p->level--); + return _seq; +} + +// _loop1_153: param_with_default +static asdl_seq * +_loop1_153_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -27701,7 +28443,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _loop1_150[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default")); + D(fprintf(stderr, "%*c> _loop1_153[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "param_with_default")); NameDefaultPair* param_with_default_var; while ( (param_with_default_var = param_with_default_rule(p)) // param_with_default @@ -27723,7 +28465,7 @@ _mark = p->mark; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _loop1_150[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _loop1_153[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "param_with_default")); } if (_n == 0 || p->error_indicator) { @@ -27741,14 +28483,14 @@ } for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]); PyMem_Free(_children); - _PyPegen_insert_memo(p, _start_mark, _loop1_150_type, _seq); - D(p->level--); - return _seq; -} - -// _loop0_151: lambda_param_no_default -static asdl_seq * -_loop0_151_rule(Parser *p) + _PyPegen_insert_memo(p, _start_mark, _loop1_153_type, _seq); + D(p->level--); + return _seq; +} + +// _loop0_154: lambda_param_no_default +static asdl_seq * +_loop0_154_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -27772,7 +28514,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _loop0_151[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default")); + D(fprintf(stderr, "%*c> _loop0_154[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_no_default")); arg_ty lambda_param_no_default_var; while ( (lambda_param_no_default_var = lambda_param_no_default_rule(p)) // lambda_param_no_default @@ -27794,7 +28536,7 @@ _mark = p->mark; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _loop0_151[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _loop0_154[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_no_default")); } asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena); @@ -27807,14 +28549,14 @@ } for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]); PyMem_Free(_children); - _PyPegen_insert_memo(p, _start_mark, _loop0_151_type, _seq); - D(p->level--); - return _seq; -} - -// _loop1_152: lambda_param_with_default -static asdl_seq * -_loop1_152_rule(Parser *p) + _PyPegen_insert_memo(p, _start_mark, _loop0_154_type, _seq); + D(p->level--); + return _seq; +} + +// _loop1_155: lambda_param_with_default +static asdl_seq * +_loop1_155_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -27838,7 +28580,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _loop1_152[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default")); + D(fprintf(stderr, "%*c> _loop1_155[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "lambda_param_with_default")); NameDefaultPair* lambda_param_with_default_var; while ( (lambda_param_with_default_var = lambda_param_with_default_rule(p)) // lambda_param_with_default @@ -27860,7 +28602,7 @@ _mark = p->mark; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _loop1_152[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _loop1_155[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "lambda_param_with_default")); } if (_n == 0 || p->error_indicator) { @@ -27878,14 +28620,14 @@ } for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]); PyMem_Free(_children); - _PyPegen_insert_memo(p, _start_mark, _loop1_152_type, _seq); - D(p->level--); - return _seq; -} - -// _tmp_153: ')' | ',' (')' | '**') -static void * -_tmp_153_rule(Parser *p) + _PyPegen_insert_memo(p, _start_mark, _loop1_155_type, _seq); + D(p->level--); + return _seq; +} + +// _tmp_156: ')' | ',' (')' | '**') +static void * +_tmp_156_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -27899,9 +28641,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_153[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'")); + D(fprintf(stderr, "%*c> _tmp_156[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 8)) // token=')' ) { @@ -27903,14 +28645,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 8)) // token=')' ) { - D(fprintf(stderr, "%*c+ _tmp_153[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_153[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_156[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_156[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "')'")); } { // ',' (')' | '**') @@ -27918,21 +28660,21 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_153[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (')' | '**')")); - Token * _literal; - void *_tmp_177_var; - if ( - (_literal = _PyPegen_expect_token(p, 12)) // token=',' - && - (_tmp_177_var = _tmp_177_rule(p)) // ')' | '**' - ) - { - D(fprintf(stderr, "%*c+ _tmp_153[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' (')' | '**')")); - _res = _PyPegen_dummy_name(p, _literal, _tmp_177_var); - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_153[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c> _tmp_156[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (')' | '**')")); + Token * _literal; + void *_tmp_180_var; + if ( + (_literal = _PyPegen_expect_token(p, 12)) // token=',' + && + (_tmp_180_var = _tmp_180_rule(p)) // ')' | '**' + ) + { + D(fprintf(stderr, "%*c+ _tmp_156[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' (')' | '**')")); + _res = _PyPegen_dummy_name(p, _literal, _tmp_180_var); + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_156[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (')' | '**')")); } _res = NULL; @@ -27941,9 +28683,9 @@ return _res; } -// _tmp_154: ':' | ',' (':' | '**') -static void * -_tmp_154_rule(Parser *p) +// _tmp_157: ':' | ',' (':' | '**') +static void * +_tmp_157_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -27957,9 +28699,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_154[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'")); + D(fprintf(stderr, "%*c> _tmp_157[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 11)) // token=':' ) { @@ -27961,14 +28703,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 11)) // token=':' ) { - D(fprintf(stderr, "%*c+ _tmp_154[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_154[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_157[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_157[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':'")); } { // ',' (':' | '**') @@ -27976,21 +28718,21 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_154[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (':' | '**')")); - Token * _literal; - void *_tmp_178_var; - if ( - (_literal = _PyPegen_expect_token(p, 12)) // token=',' - && - (_tmp_178_var = _tmp_178_rule(p)) // ':' | '**' - ) - { - D(fprintf(stderr, "%*c+ _tmp_154[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' (':' | '**')")); - _res = _PyPegen_dummy_name(p, _literal, _tmp_178_var); - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_154[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c> _tmp_157[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (':' | '**')")); + Token * _literal; + void *_tmp_181_var; + if ( + (_literal = _PyPegen_expect_token(p, 12)) // token=',' + && + (_tmp_181_var = _tmp_181_rule(p)) // ':' | '**' + ) + { + D(fprintf(stderr, "%*c+ _tmp_157[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' (':' | '**')")); + _res = _PyPegen_dummy_name(p, _literal, _tmp_181_var); + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_157[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (':' | '**')")); } _res = NULL; @@ -27999,9 +28741,9 @@ return _res; } -// _tmp_155: ',' | ')' | ':' -static void * -_tmp_155_rule(Parser *p) +// _tmp_158: ',' | ')' | ':' +static void * +_tmp_158_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -28015,18 +28757,18 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_155[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','")); - Token * _literal; - if ( - (_literal = _PyPegen_expect_token(p, 12)) // token=',' - ) - { - D(fprintf(stderr, "%*c+ _tmp_155[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_155[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c> _tmp_158[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "','")); + Token * _literal; + if ( + (_literal = _PyPegen_expect_token(p, 12)) // token=',' + ) + { + D(fprintf(stderr, "%*c+ _tmp_158[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "','")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_158[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "','")); } { // ')' @@ -28034,9 +28776,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_155[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'")); + D(fprintf(stderr, "%*c> _tmp_158[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 8)) // token=')' ) { @@ -28038,14 +28780,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 8)) // token=')' ) { - D(fprintf(stderr, "%*c+ _tmp_155[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_155[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_158[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_158[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "')'")); } { // ':' @@ -28053,9 +28795,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_155[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'")); + D(fprintf(stderr, "%*c> _tmp_158[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 11)) // token=':' ) { @@ -28057,14 +28799,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 11)) // token=':' ) { - D(fprintf(stderr, "%*c+ _tmp_155[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_155[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_158[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_158[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':'")); } _res = NULL; @@ -28073,9 +28815,9 @@ return _res; } -// _loop0_157: ',' (expression ['as' star_target]) -static asdl_seq * -_loop0_157_rule(Parser *p) +// _loop0_160: ',' (expression ['as' star_target]) +static asdl_seq * +_loop0_160_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -28099,9 +28841,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _loop0_157[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (expression ['as' star_target])")); + D(fprintf(stderr, "%*c> _loop0_160[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (expression ['as' star_target])")); Token * _literal; void *elem; while ( (_literal = _PyPegen_expect_token(p, 12)) // token=',' && @@ -28103,9 +28845,9 @@ Token * _literal; void *elem; while ( (_literal = _PyPegen_expect_token(p, 12)) // token=',' && - (elem = _tmp_179_rule(p)) // expression ['as' star_target] + (elem = _tmp_182_rule(p)) // expression ['as' star_target] ) { _res = elem; @@ -28130,7 +28872,7 @@ _mark = p->mark; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _loop0_157[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _loop0_160[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (expression ['as' star_target])")); } asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena); @@ -28143,14 +28885,14 @@ } for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]); PyMem_Free(_children); - _PyPegen_insert_memo(p, _start_mark, _loop0_157_type, _seq); - D(p->level--); - return _seq; -} - -// _gather_156: (expression ['as' star_target]) _loop0_157 -static asdl_seq * -_gather_156_rule(Parser *p) + _PyPegen_insert_memo(p, _start_mark, _loop0_160_type, _seq); + D(p->level--); + return _seq; +} + +// _gather_159: (expression ['as' star_target]) _loop0_160 +static asdl_seq * +_gather_159_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -28159,12 +28901,12 @@ } asdl_seq * _res = NULL; int _mark = p->mark; - { // (expression ['as' star_target]) _loop0_157 - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> _gather_156[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(expression ['as' star_target]) _loop0_157")); + { // (expression ['as' star_target]) _loop0_160 + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _gather_159[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(expression ['as' star_target]) _loop0_160")); void *elem; asdl_seq * seq; if ( @@ -28168,13 +28910,13 @@ void *elem; asdl_seq * seq; if ( - (elem = _tmp_179_rule(p)) // expression ['as' star_target] - && - (seq = _loop0_157_rule(p)) // _loop0_157 - ) - { - D(fprintf(stderr, "%*c+ _gather_156[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(expression ['as' star_target]) _loop0_157")); + (elem = _tmp_182_rule(p)) // expression ['as' star_target] + && + (seq = _loop0_160_rule(p)) // _loop0_160 + ) + { + D(fprintf(stderr, "%*c+ _gather_159[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(expression ['as' star_target]) _loop0_160")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; @@ -28177,19 +28919,19 @@ _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _gather_156[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(expression ['as' star_target]) _loop0_157")); - } - _res = NULL; - done: - D(p->level--); - return _res; -} - -// _loop0_159: ',' (expressions ['as' star_target]) -static asdl_seq * -_loop0_159_rule(Parser *p) + D(fprintf(stderr, "%*c%s _gather_159[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(expression ['as' star_target]) _loop0_160")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + +// _loop0_162: ',' (expressions ['as' star_target]) +static asdl_seq * +_loop0_162_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -28213,9 +28955,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _loop0_159[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (expressions ['as' star_target])")); + D(fprintf(stderr, "%*c> _loop0_162[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' (expressions ['as' star_target])")); Token * _literal; void *elem; while ( (_literal = _PyPegen_expect_token(p, 12)) // token=',' && @@ -28217,9 +28959,9 @@ Token * _literal; void *elem; while ( (_literal = _PyPegen_expect_token(p, 12)) // token=',' && - (elem = _tmp_180_rule(p)) // expressions ['as' star_target] + (elem = _tmp_183_rule(p)) // expressions ['as' star_target] ) { _res = elem; @@ -28244,7 +28986,7 @@ _mark = p->mark; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _loop0_159[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _loop0_162[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' (expressions ['as' star_target])")); } asdl_seq *_seq = (asdl_seq*)_Py_asdl_generic_seq_new(_n, p->arena); @@ -28257,14 +28999,14 @@ } for (int i = 0; i < _n; i++) asdl_seq_SET_UNTYPED(_seq, i, _children[i]); PyMem_Free(_children); - _PyPegen_insert_memo(p, _start_mark, _loop0_159_type, _seq); - D(p->level--); - return _seq; -} - -// _gather_158: (expressions ['as' star_target]) _loop0_159 -static asdl_seq * -_gather_158_rule(Parser *p) + _PyPegen_insert_memo(p, _start_mark, _loop0_162_type, _seq); + D(p->level--); + return _seq; +} + +// _gather_161: (expressions ['as' star_target]) _loop0_162 +static asdl_seq * +_gather_161_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -28273,12 +29015,12 @@ } asdl_seq * _res = NULL; int _mark = p->mark; - { // (expressions ['as' star_target]) _loop0_159 - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> _gather_158[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(expressions ['as' star_target]) _loop0_159")); + { // (expressions ['as' star_target]) _loop0_162 + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _gather_161[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "(expressions ['as' star_target]) _loop0_162")); void *elem; asdl_seq * seq; if ( @@ -28282,13 +29024,13 @@ void *elem; asdl_seq * seq; if ( - (elem = _tmp_180_rule(p)) // expressions ['as' star_target] - && - (seq = _loop0_159_rule(p)) // _loop0_159 - ) - { - D(fprintf(stderr, "%*c+ _gather_158[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(expressions ['as' star_target]) _loop0_159")); + (elem = _tmp_183_rule(p)) // expressions ['as' star_target] + && + (seq = _loop0_162_rule(p)) // _loop0_162 + ) + { + D(fprintf(stderr, "%*c+ _gather_161[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "(expressions ['as' star_target]) _loop0_162")); _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; @@ -28291,19 +29033,19 @@ _res = _PyPegen_seq_insert_in_front(p, elem, seq); goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _gather_158[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(expressions ['as' star_target]) _loop0_159")); - } - _res = NULL; - done: - D(p->level--); - return _res; -} - -// _tmp_160: 'as' NAME -static void * -_tmp_160_rule(Parser *p) + D(fprintf(stderr, "%*c%s _gather_161[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "(expressions ['as' star_target]) _loop0_162")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + +// _tmp_163: 'as' NAME +static void * +_tmp_163_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -28317,7 +29059,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_160[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME")); + D(fprintf(stderr, "%*c> _tmp_163[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME")); Token * _keyword; expr_ty name_var; if ( @@ -28326,8 +29068,8 @@ (name_var = _PyPegen_name_token(p)) // NAME ) { - D(fprintf(stderr, "%*c+ _tmp_160[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME")); + D(fprintf(stderr, "%*c+ _tmp_163[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME")); _res = _PyPegen_dummy_name(p, _keyword, name_var); goto done; } p->mark = _mark; @@ -28330,8 +29072,8 @@ _res = _PyPegen_dummy_name(p, _keyword, name_var); goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_160[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_163[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' NAME")); } _res = NULL; @@ -28340,9 +29082,9 @@ return _res; } -// _tmp_161: 'as' NAME -static void * -_tmp_161_rule(Parser *p) +// _tmp_164: 'as' NAME +static void * +_tmp_164_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -28356,7 +29098,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_161[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME")); + D(fprintf(stderr, "%*c> _tmp_164[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' NAME")); Token * _keyword; expr_ty name_var; if ( @@ -28365,8 +29107,8 @@ (name_var = _PyPegen_name_token(p)) // NAME ) { - D(fprintf(stderr, "%*c+ _tmp_161[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME")); + D(fprintf(stderr, "%*c+ _tmp_164[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' NAME")); _res = _PyPegen_dummy_name(p, _keyword, name_var); goto done; } p->mark = _mark; @@ -28369,8 +29111,8 @@ _res = _PyPegen_dummy_name(p, _keyword, name_var); goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_161[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_164[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' NAME")); } _res = NULL; @@ -28379,9 +29121,9 @@ return _res; } -// _tmp_162: star_targets '=' -static void * -_tmp_162_rule(Parser *p) +// _tmp_165: star_targets '=' +static void * +_tmp_165_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -28395,7 +29137,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_162[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='")); + D(fprintf(stderr, "%*c> _tmp_165[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='")); Token * _literal; expr_ty z; if ( @@ -28404,7 +29146,7 @@ (_literal = _PyPegen_expect_token(p, 22)) // token='=' ) { - D(fprintf(stderr, "%*c+ _tmp_162[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='")); + D(fprintf(stderr, "%*c+ _tmp_165[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='")); _res = z; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; @@ -28414,7 +29156,7 @@ goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_162[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_165[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_targets '='")); } _res = NULL; @@ -28423,9 +29165,9 @@ return _res; } -// _tmp_163: '.' | '...' -static void * -_tmp_163_rule(Parser *p) +// _tmp_166: '.' | '...' +static void * +_tmp_166_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -28439,9 +29181,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_163[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'.'")); + D(fprintf(stderr, "%*c> _tmp_166[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'.'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 23)) // token='.' ) { @@ -28443,14 +29185,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 23)) // token='.' ) { - D(fprintf(stderr, "%*c+ _tmp_163[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'.'")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_163[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_166[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'.'")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_166[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'.'")); } { // '...' @@ -28458,9 +29200,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_163[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'...'")); + D(fprintf(stderr, "%*c> _tmp_166[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'...'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 52)) // token='...' ) { @@ -28462,14 +29204,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 52)) // token='...' ) { - D(fprintf(stderr, "%*c+ _tmp_163[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'...'")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_163[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_166[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'...'")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_166[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'...'")); } _res = NULL; @@ -28478,9 +29220,9 @@ return _res; } -// _tmp_164: '.' | '...' -static void * -_tmp_164_rule(Parser *p) +// _tmp_167: '.' | '...' +static void * +_tmp_167_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -28494,9 +29236,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_164[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'.'")); + D(fprintf(stderr, "%*c> _tmp_167[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'.'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 23)) // token='.' ) { @@ -28498,14 +29240,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 23)) // token='.' ) { - D(fprintf(stderr, "%*c+ _tmp_164[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'.'")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_164[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_167[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'.'")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_167[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'.'")); } { // '...' @@ -28513,9 +29255,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_164[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'...'")); + D(fprintf(stderr, "%*c> _tmp_167[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'...'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 52)) // token='...' ) { @@ -28517,14 +29259,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 52)) // token='...' ) { - D(fprintf(stderr, "%*c+ _tmp_164[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'...'")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_164[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_167[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'...'")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_167[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'...'")); } _res = NULL; @@ -28533,9 +29275,9 @@ return _res; } -// _tmp_165: '@' named_expression NEWLINE -static void * -_tmp_165_rule(Parser *p) +// _tmp_168: '@' named_expression NEWLINE +static void * +_tmp_168_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -28549,7 +29291,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_165[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'@' named_expression NEWLINE")); + D(fprintf(stderr, "%*c> _tmp_168[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'@' named_expression NEWLINE")); Token * _literal; expr_ty f; Token * newline_var; @@ -28561,7 +29303,7 @@ (newline_var = _PyPegen_expect_token(p, NEWLINE)) // token='NEWLINE' ) { - D(fprintf(stderr, "%*c+ _tmp_165[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'@' named_expression NEWLINE")); + D(fprintf(stderr, "%*c+ _tmp_168[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'@' named_expression NEWLINE")); _res = f; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; @@ -28571,7 +29313,7 @@ goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_165[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_168[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'@' named_expression NEWLINE")); } _res = NULL; @@ -28580,9 +29322,9 @@ return _res; } -// _tmp_166: ',' star_expression -static void * -_tmp_166_rule(Parser *p) +// _tmp_169: ',' star_expression +static void * +_tmp_169_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -28596,7 +29338,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_166[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_expression")); + D(fprintf(stderr, "%*c> _tmp_169[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_expression")); Token * _literal; expr_ty c; if ( @@ -28605,139 +29347,7 @@ (c = star_expression_rule(p)) // star_expression ) { - D(fprintf(stderr, "%*c+ _tmp_166[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_expression")); - _res = c; - if (_res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - D(p->level--); - return NULL; - } - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_166[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_expression")); - } - _res = NULL; - done: - D(p->level--); - return _res; -} - -// _tmp_167: ',' expression -static void * -_tmp_167_rule(Parser *p) -{ - D(p->level++); - if (p->error_indicator) { - D(p->level--); - return NULL; - } - void * _res = NULL; - int _mark = p->mark; - { // ',' expression - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> _tmp_167[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression")); - Token * _literal; - expr_ty c; - if ( - (_literal = _PyPegen_expect_token(p, 12)) // token=',' - && - (c = expression_rule(p)) // expression - ) - { - D(fprintf(stderr, "%*c+ _tmp_167[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' expression")); - _res = c; - if (_res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - D(p->level--); - return NULL; - } - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_167[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression")); - } - _res = NULL; - done: - D(p->level--); - return _res; -} - -// _tmp_168: 'or' conjunction -static void * -_tmp_168_rule(Parser *p) -{ - D(p->level++); - if (p->error_indicator) { - D(p->level--); - return NULL; - } - void * _res = NULL; - int _mark = p->mark; - { // 'or' conjunction - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> _tmp_168[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'or' conjunction")); - Token * _keyword; - expr_ty c; - if ( - (_keyword = _PyPegen_expect_token(p, 531)) // token='or' - && - (c = conjunction_rule(p)) // conjunction - ) - { - D(fprintf(stderr, "%*c+ _tmp_168[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'or' conjunction")); - _res = c; - if (_res == NULL && PyErr_Occurred()) { - p->error_indicator = 1; - D(p->level--); - return NULL; - } - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_168[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'or' conjunction")); - } - _res = NULL; - done: - D(p->level--); - return _res; -} - -// _tmp_169: 'and' inversion -static void * -_tmp_169_rule(Parser *p) -{ - D(p->level++); - if (p->error_indicator) { - D(p->level--); - return NULL; - } - void * _res = NULL; - int _mark = p->mark; - { // 'and' inversion - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> _tmp_169[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'and' inversion")); - Token * _keyword; - expr_ty c; - if ( - (_keyword = _PyPegen_expect_token(p, 532)) // token='and' - && - (c = inversion_rule(p)) // inversion - ) - { - D(fprintf(stderr, "%*c+ _tmp_169[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'and' inversion")); + D(fprintf(stderr, "%*c+ _tmp_169[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_expression")); _res = c; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; @@ -28748,15 +29358,15 @@ } p->mark = _mark; D(fprintf(stderr, "%*c%s _tmp_169[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'and' inversion")); - } - _res = NULL; - done: - D(p->level--); - return _res; -} - -// _tmp_170: 'if' disjunction + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_expression")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + +// _tmp_170: ',' expression static void * _tmp_170_rule(Parser *p) { @@ -28767,22 +29377,22 @@ } void * _res = NULL; int _mark = p->mark; - { // 'if' disjunction - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> _tmp_170[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' disjunction")); - Token * _keyword; - expr_ty z; - if ( - (_keyword = _PyPegen_expect_token(p, 510)) // token='if' - && - (z = disjunction_rule(p)) // disjunction - ) - { - D(fprintf(stderr, "%*c+ _tmp_170[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' disjunction")); - _res = z; + { // ',' expression + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_170[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' expression")); + Token * _literal; + expr_ty c; + if ( + (_literal = _PyPegen_expect_token(p, 12)) // token=',' + && + (c = expression_rule(p)) // expression + ) + { + D(fprintf(stderr, "%*c+ _tmp_170[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' expression")); + _res = c; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -28792,15 +29402,15 @@ } p->mark = _mark; D(fprintf(stderr, "%*c%s _tmp_170[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' disjunction")); - } - _res = NULL; - done: - D(p->level--); - return _res; -} - -// _tmp_171: 'if' disjunction + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' expression")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + +// _tmp_171: 'or' conjunction static void * _tmp_171_rule(Parser *p) { @@ -28811,8 +29421,96 @@ } void * _res = NULL; int _mark = p->mark; + { // 'or' conjunction + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_171[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'or' conjunction")); + Token * _keyword; + expr_ty c; + if ( + (_keyword = _PyPegen_expect_token(p, 531)) // token='or' + && + (c = conjunction_rule(p)) // conjunction + ) + { + D(fprintf(stderr, "%*c+ _tmp_171[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'or' conjunction")); + _res = c; + if (_res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_171[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'or' conjunction")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + +// _tmp_172: 'and' inversion +static void * +_tmp_172_rule(Parser *p) +{ + D(p->level++); + if (p->error_indicator) { + D(p->level--); + return NULL; + } + void * _res = NULL; + int _mark = p->mark; + { // 'and' inversion + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_172[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'and' inversion")); + Token * _keyword; + expr_ty c; + if ( + (_keyword = _PyPegen_expect_token(p, 532)) // token='and' + && + (c = inversion_rule(p)) // inversion + ) + { + D(fprintf(stderr, "%*c+ _tmp_172[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'and' inversion")); + _res = c; + if (_res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_172[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'and' inversion")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + +// _tmp_173: 'if' disjunction +static void * +_tmp_173_rule(Parser *p) +{ + D(p->level++); + if (p->error_indicator) { + D(p->level--); + return NULL; + } + void * _res = NULL; + int _mark = p->mark; { // 'if' disjunction if (p->error_indicator) { D(p->level--); return NULL; } @@ -28814,9 +29512,9 @@ { // 'if' disjunction if (p->error_indicator) { D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_171[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' disjunction")); + D(fprintf(stderr, "%*c> _tmp_173[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' disjunction")); Token * _keyword; expr_ty z; if ( @@ -28825,7 +29523,7 @@ (z = disjunction_rule(p)) // disjunction ) { - D(fprintf(stderr, "%*c+ _tmp_171[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' disjunction")); + D(fprintf(stderr, "%*c+ _tmp_173[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' disjunction")); _res = z; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; @@ -28835,7 +29533,7 @@ goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_171[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_173[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' disjunction")); } _res = NULL; @@ -28844,9 +29542,53 @@ return _res; } -// _tmp_172: starred_expression | named_expression !'=' -static void * -_tmp_172_rule(Parser *p) +// _tmp_174: 'if' disjunction +static void * +_tmp_174_rule(Parser *p) +{ + D(p->level++); + if (p->error_indicator) { + D(p->level--); + return NULL; + } + void * _res = NULL; + int _mark = p->mark; + { // 'if' disjunction + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_174[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'if' disjunction")); + Token * _keyword; + expr_ty z; + if ( + (_keyword = _PyPegen_expect_token(p, 510)) // token='if' + && + (z = disjunction_rule(p)) // disjunction + ) + { + D(fprintf(stderr, "%*c+ _tmp_174[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'if' disjunction")); + _res = z; + if (_res == NULL && PyErr_Occurred()) { + p->error_indicator = 1; + D(p->level--); + return NULL; + } + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_174[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'if' disjunction")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + +// _tmp_175: starred_expression | direct_named_expression !'=' +static void * +_tmp_175_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -28860,9 +29602,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_172[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "starred_expression")); + D(fprintf(stderr, "%*c> _tmp_175[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "starred_expression")); expr_ty starred_expression_var; if ( (starred_expression_var = starred_expression_rule(p)) // starred_expression ) { @@ -28864,10 +29606,10 @@ expr_ty starred_expression_var; if ( (starred_expression_var = starred_expression_rule(p)) // starred_expression ) { - D(fprintf(stderr, "%*c+ _tmp_172[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "starred_expression")); + D(fprintf(stderr, "%*c+ _tmp_175[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "starred_expression")); _res = starred_expression_var; goto done; } p->mark = _mark; @@ -28870,7 +29612,7 @@ _res = starred_expression_var; goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_172[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_175[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "starred_expression")); } @@ -28875,15 +29617,15 @@ p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "starred_expression")); } - { // named_expression !'=' - if (p->error_indicator) { - D(p->level--); - return NULL; - } - D(fprintf(stderr, "%*c> _tmp_172[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "named_expression !'='")); - expr_ty named_expression_var; - if ( - (named_expression_var = named_expression_rule(p)) // named_expression + { // direct_named_expression !'=' + if (p->error_indicator) { + D(p->level--); + return NULL; + } + D(fprintf(stderr, "%*c> _tmp_175[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "direct_named_expression !'='")); + expr_ty direct_named_expression_var; + if ( + (direct_named_expression_var = direct_named_expression_rule(p)) // direct_named_expression && _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 22) // token='=' ) { @@ -28886,24 +29628,24 @@ && _PyPegen_lookahead_with_int(0, _PyPegen_expect_token, p, 22) // token='=' ) { - D(fprintf(stderr, "%*c+ _tmp_172[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "named_expression !'='")); - _res = named_expression_var; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_172[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "named_expression !'='")); - } - _res = NULL; - done: - D(p->level--); - return _res; -} - -// _tmp_173: ',' star_target -static void * -_tmp_173_rule(Parser *p) + D(fprintf(stderr, "%*c+ _tmp_175[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "direct_named_expression !'='")); + _res = direct_named_expression_var; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_175[%d-%d]: %s failed!\n", p->level, ' ', + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "direct_named_expression !'='")); + } + _res = NULL; + done: + D(p->level--); + return _res; +} + +// _tmp_176: ',' star_target +static void * +_tmp_176_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -28917,7 +29659,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_173[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_target")); + D(fprintf(stderr, "%*c> _tmp_176[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_target")); Token * _literal; expr_ty c; if ( @@ -28926,7 +29668,7 @@ (c = star_target_rule(p)) // star_target ) { - D(fprintf(stderr, "%*c+ _tmp_173[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_target")); + D(fprintf(stderr, "%*c+ _tmp_176[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_target")); _res = c; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; @@ -28936,7 +29678,7 @@ goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_173[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_176[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_target")); } _res = NULL; @@ -28945,9 +29687,9 @@ return _res; } -// _tmp_174: ',' star_target -static void * -_tmp_174_rule(Parser *p) +// _tmp_177: ',' star_target +static void * +_tmp_177_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -28961,7 +29703,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_174[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_target")); + D(fprintf(stderr, "%*c> _tmp_177[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "',' star_target")); Token * _literal; expr_ty c; if ( @@ -28970,7 +29712,7 @@ (c = star_target_rule(p)) // star_target ) { - D(fprintf(stderr, "%*c+ _tmp_174[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_target")); + D(fprintf(stderr, "%*c+ _tmp_177[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "',' star_target")); _res = c; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; @@ -28980,7 +29722,7 @@ goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_174[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_177[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "',' star_target")); } _res = NULL; @@ -28989,9 +29731,9 @@ return _res; } -// _tmp_175: star_targets '=' -static void * -_tmp_175_rule(Parser *p) +// _tmp_178: star_targets '=' +static void * +_tmp_178_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -29005,7 +29747,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_175[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='")); + D(fprintf(stderr, "%*c> _tmp_178[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='")); Token * _literal; expr_ty star_targets_var; if ( @@ -29014,8 +29756,8 @@ (_literal = _PyPegen_expect_token(p, 22)) // token='=' ) { - D(fprintf(stderr, "%*c+ _tmp_175[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='")); + D(fprintf(stderr, "%*c+ _tmp_178[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='")); _res = _PyPegen_dummy_name(p, star_targets_var, _literal); goto done; } p->mark = _mark; @@ -29018,8 +29760,8 @@ _res = _PyPegen_dummy_name(p, star_targets_var, _literal); goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_175[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_178[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_targets '='")); } _res = NULL; @@ -29028,9 +29770,9 @@ return _res; } -// _tmp_176: star_targets '=' -static void * -_tmp_176_rule(Parser *p) +// _tmp_179: star_targets '=' +static void * +_tmp_179_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -29044,7 +29786,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_176[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='")); + D(fprintf(stderr, "%*c> _tmp_179[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "star_targets '='")); Token * _literal; expr_ty star_targets_var; if ( @@ -29053,8 +29795,8 @@ (_literal = _PyPegen_expect_token(p, 22)) // token='=' ) { - D(fprintf(stderr, "%*c+ _tmp_176[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='")); + D(fprintf(stderr, "%*c+ _tmp_179[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "star_targets '='")); _res = _PyPegen_dummy_name(p, star_targets_var, _literal); goto done; } p->mark = _mark; @@ -29057,8 +29799,8 @@ _res = _PyPegen_dummy_name(p, star_targets_var, _literal); goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_176[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_179[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "star_targets '='")); } _res = NULL; @@ -29067,9 +29809,9 @@ return _res; } -// _tmp_177: ')' | '**' -static void * -_tmp_177_rule(Parser *p) +// _tmp_180: ')' | '**' +static void * +_tmp_180_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -29083,9 +29825,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_177[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'")); + D(fprintf(stderr, "%*c> _tmp_180[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "')'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 8)) // token=')' ) { @@ -29087,14 +29829,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 8)) // token=')' ) { - D(fprintf(stderr, "%*c+ _tmp_177[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_177[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_180[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "')'")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_180[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "')'")); } { // '**' @@ -29102,9 +29844,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_177[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'")); + D(fprintf(stderr, "%*c> _tmp_180[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 35)) // token='**' ) { @@ -29106,14 +29848,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 35)) // token='**' ) { - D(fprintf(stderr, "%*c+ _tmp_177[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_177[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_180[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_180[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**'")); } _res = NULL; @@ -29122,9 +29864,9 @@ return _res; } -// _tmp_178: ':' | '**' -static void * -_tmp_178_rule(Parser *p) +// _tmp_181: ':' | '**' +static void * +_tmp_181_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -29138,9 +29880,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_178[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'")); + D(fprintf(stderr, "%*c> _tmp_181[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "':'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 11)) // token=':' ) { @@ -29142,14 +29884,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 11)) // token=':' ) { - D(fprintf(stderr, "%*c+ _tmp_178[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_178[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_181[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "':'")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_181[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "':'")); } { // '**' @@ -29157,9 +29899,9 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_178[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'")); + D(fprintf(stderr, "%*c> _tmp_181[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'**'")); Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 35)) // token='**' ) { @@ -29161,14 +29903,14 @@ Token * _literal; if ( (_literal = _PyPegen_expect_token(p, 35)) // token='**' ) { - D(fprintf(stderr, "%*c+ _tmp_178[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'")); - _res = _literal; - goto done; - } - p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_178[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c+ _tmp_181[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'**'")); + _res = _literal; + goto done; + } + p->mark = _mark; + D(fprintf(stderr, "%*c%s _tmp_181[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'**'")); } _res = NULL; @@ -29177,9 +29919,9 @@ return _res; } -// _tmp_179: expression ['as' star_target] -static void * -_tmp_179_rule(Parser *p) +// _tmp_182: expression ['as' star_target] +static void * +_tmp_182_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -29193,10 +29935,10 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_179[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ['as' star_target]")); + D(fprintf(stderr, "%*c> _tmp_182[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expression ['as' star_target]")); void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings expr_ty expression_var; if ( (expression_var = expression_rule(p)) // expression && @@ -29197,14 +29939,14 @@ void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings expr_ty expression_var; if ( (expression_var = expression_rule(p)) // expression && - (_opt_var = _tmp_181_rule(p), 1) // ['as' star_target] - ) - { - D(fprintf(stderr, "%*c+ _tmp_179[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ['as' star_target]")); + (_opt_var = _tmp_184_rule(p), 1) // ['as' star_target] + ) + { + D(fprintf(stderr, "%*c+ _tmp_182[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expression ['as' star_target]")); _res = _PyPegen_dummy_name(p, expression_var, _opt_var); goto done; } p->mark = _mark; @@ -29207,8 +29949,8 @@ _res = _PyPegen_dummy_name(p, expression_var, _opt_var); goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_179[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_182[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expression ['as' star_target]")); } _res = NULL; @@ -29217,9 +29959,9 @@ return _res; } -// _tmp_180: expressions ['as' star_target] -static void * -_tmp_180_rule(Parser *p) +// _tmp_183: expressions ['as' star_target] +static void * +_tmp_183_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -29233,10 +29975,10 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_180[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expressions ['as' star_target]")); + D(fprintf(stderr, "%*c> _tmp_183[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "expressions ['as' star_target]")); void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings expr_ty expressions_var; if ( (expressions_var = expressions_rule(p)) // expressions && @@ -29237,14 +29979,14 @@ void *_opt_var; UNUSED(_opt_var); // Silence compiler warnings expr_ty expressions_var; if ( (expressions_var = expressions_rule(p)) // expressions && - (_opt_var = _tmp_182_rule(p), 1) // ['as' star_target] - ) - { - D(fprintf(stderr, "%*c+ _tmp_180[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expressions ['as' star_target]")); + (_opt_var = _tmp_185_rule(p), 1) // ['as' star_target] + ) + { + D(fprintf(stderr, "%*c+ _tmp_183[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "expressions ['as' star_target]")); _res = _PyPegen_dummy_name(p, expressions_var, _opt_var); goto done; } p->mark = _mark; @@ -29247,8 +29989,8 @@ _res = _PyPegen_dummy_name(p, expressions_var, _opt_var); goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_180[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_183[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "expressions ['as' star_target]")); } _res = NULL; @@ -29257,9 +29999,9 @@ return _res; } -// _tmp_181: 'as' star_target -static void * -_tmp_181_rule(Parser *p) +// _tmp_184: 'as' star_target +static void * +_tmp_184_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -29273,7 +30015,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_181[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' star_target")); + D(fprintf(stderr, "%*c> _tmp_184[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' star_target")); Token * _keyword; expr_ty star_target_var; if ( @@ -29282,8 +30024,8 @@ (star_target_var = star_target_rule(p)) // star_target ) { - D(fprintf(stderr, "%*c+ _tmp_181[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' star_target")); + D(fprintf(stderr, "%*c+ _tmp_184[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' star_target")); _res = _PyPegen_dummy_name(p, _keyword, star_target_var); goto done; } p->mark = _mark; @@ -29286,8 +30028,8 @@ _res = _PyPegen_dummy_name(p, _keyword, star_target_var); goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_181[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_184[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' star_target")); } _res = NULL; @@ -29296,9 +30038,9 @@ return _res; } -// _tmp_182: 'as' star_target -static void * -_tmp_182_rule(Parser *p) +// _tmp_185: 'as' star_target +static void * +_tmp_185_rule(Parser *p) { D(p->level++); if (p->error_indicator) { @@ -29312,7 +30054,7 @@ D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> _tmp_182[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' star_target")); + D(fprintf(stderr, "%*c> _tmp_185[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "'as' star_target")); Token * _keyword; expr_ty star_target_var; if ( @@ -29321,8 +30063,8 @@ (star_target_var = star_target_rule(p)) // star_target ) { - D(fprintf(stderr, "%*c+ _tmp_182[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' star_target")); + D(fprintf(stderr, "%*c+ _tmp_185[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "'as' star_target")); _res = _PyPegen_dummy_name(p, _keyword, star_target_var); goto done; } p->mark = _mark; @@ -29325,8 +30067,8 @@ _res = _PyPegen_dummy_name(p, _keyword, star_target_var); goto done; } p->mark = _mark; - D(fprintf(stderr, "%*c%s _tmp_182[%d-%d]: %s failed!\n", p->level, ' ', + D(fprintf(stderr, "%*c%s _tmp_185[%d-%d]: %s failed!\n", p->level, ' ', p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "'as' star_target")); } _res = NULL; diff --git a/Parser/peg_api.c b/Parser/peg_api.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UGFyc2VyL3BlZ19hcGkuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UGFyc2VyL3BlZ19hcGkuYw== 100644 --- a/Parser/peg_api.c +++ b/Parser/peg_api.c @@ -4,21 +4,8 @@ #include "pegen.h" mod_ty -PyParser_ASTFromString(const char *str, const char *filename, int mode, - PyCompilerFlags *flags, PyArena *arena) -{ - PyObject *filename_ob = PyUnicode_FromString(filename); - if (filename_ob == NULL) { - return NULL; - } - mod_ty result = PyParser_ASTFromStringObject(str, filename_ob, mode, flags, arena); - Py_XDECREF(filename_ob); - return result; -} - -mod_ty -PyParser_ASTFromStringObject(const char *str, PyObject* filename, int mode, - PyCompilerFlags *flags, PyArena *arena) +_PyParser_ASTFromString(const char *str, PyObject* filename, int mode, + PyCompilerFlags *flags, PyArena *arena) { if (PySys_Audit("compile", "yO", str, filename) < 0) { return NULL; @@ -29,37 +16,9 @@ } mod_ty -PyParser_ASTFromFilename(const char *filename, int mode, PyCompilerFlags *flags, PyArena *arena) -{ - PyObject *filename_ob = PyUnicode_FromString(filename); - if (filename_ob == NULL) { - return NULL; - } - - mod_ty result = _PyPegen_run_parser_from_file(filename, mode, filename_ob, flags, arena); - Py_XDECREF(filename_ob); - return result; -} - -mod_ty -PyParser_ASTFromFile(FILE *fp, const char *filename, const char *enc, - int mode, const char *ps1, const char* ps2, - PyCompilerFlags *flags, int *errcode, PyArena *arena) -{ - PyObject *filename_ob = PyUnicode_FromString(filename); - if (filename_ob == NULL) { - return NULL; - } - mod_ty result = PyParser_ASTFromFileObject(fp, filename_ob, enc, mode, - ps1, ps2, flags, errcode, arena); - Py_XDECREF(filename_ob); - return result; -} - -mod_ty -PyParser_ASTFromFileObject(FILE *fp, PyObject *filename_ob, const char *enc, - int mode, const char *ps1, const char* ps2, - PyCompilerFlags *flags, int *errcode, PyArena *arena) +_PyParser_ASTFromFile(FILE *fp, PyObject *filename_ob, const char *enc, + int mode, const char *ps1, const char* ps2, + PyCompilerFlags *flags, int *errcode, PyArena *arena) { if (PySys_Audit("compile", "OO", Py_None, filename_ob) < 0) { return NULL; diff --git a/Parser/pegen.c b/Parser/pegen.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UGFyc2VyL3BlZ2VuLmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_UGFyc2VyL3BlZ2VuLmM= 100644 --- a/Parser/pegen.c +++ b/Parser/pegen.c @@ -5,7 +5,6 @@ #include "pegen.h" #include "string_parser.h" -#include "ast.h" PyObject * _PyPegen_new_type_comment(Parser *p, char *s) @@ -14,7 +13,7 @@ if (res == NULL) { return NULL; } - if (PyArena_AddPyObject(p->arena, res) < 0) { + if (_PyArena_AddPyObject(p->arena, res) < 0) { Py_DECREF(res); return NULL; } @@ -35,9 +34,9 @@ if (tco == NULL) { return NULL; } - return arg(a->arg, a->annotation, tco, - a->lineno, a->col_offset, a->end_lineno, a->end_col_offset, - p->arena); + return _PyAST_arg(a->arg, a->annotation, tco, + a->lineno, a->col_offset, a->end_lineno, a->end_col_offset, + p->arena); } static int @@ -122,7 +121,7 @@ id = id2; } PyUnicode_InternInPlace(&id); - if (PyArena_AddPyObject(p->arena, id) < 0) + if (_PyArena_AddPyObject(p->arena, id) < 0) { Py_DECREF(id); goto error; @@ -147,7 +146,11 @@ if (!str) { return 0; } - assert(col_offset >= 0 && (unsigned long)col_offset <= strlen(str)); + Py_ssize_t len = strlen(str); + if (col_offset > len + 1) { + col_offset = len + 1; + } + assert(col_offset >= 0); PyObject *text = PyUnicode_DecodeUTF8(str, col_offset, "replace"); if (!text) { return 0; @@ -181,7 +184,7 @@ case BoolOp_kind: case BinOp_kind: case UnaryOp_kind: - return "operator"; + return "expression"; case GeneratorExp_kind: return "generator expression"; case Yield_kind: @@ -196,7 +199,7 @@ case DictComp_kind: return "dict comprehension"; case Dict_kind: - return "dict display"; + return "dict literal"; case Set_kind: return "set display"; case JoinedStr_kind: @@ -324,6 +327,7 @@ const char *msg = NULL; PyObject* errtype = PyExc_SyntaxError; + Py_ssize_t col_offset = -1; switch (p->tok->done) { case E_TOKEN: msg = "invalid token"; @@ -355,9 +359,10 @@ msg = "too many levels of indentation"; break; case E_LINECONT: + col_offset = strlen(strtok(p->tok->buf, "\n")) - 1; msg = "unexpected character after line continuation character"; break; default: msg = "unknown parsing error"; } @@ -358,13 +363,10 @@ msg = "unexpected character after line continuation character"; break; default: msg = "unknown parsing error"; } - PyErr_Format(errtype, msg); - // There is no reliable column information for this error - PyErr_SyntaxLocationObject(p->tok->filename, p->tok->lineno, 0); - + RAISE_ERROR_KNOWN_LOCATION(p, errtype, p->tok->lineno, col_offset, msg); return -1; } @@ -392,10 +394,10 @@ static PyObject * get_error_line(Parser *p, Py_ssize_t lineno) { - /* If p->tok->fp == NULL, then we're parsing from a string, which means that - the whole source is stored in p->tok->str. If not, then we're parsing - from the REPL, so the source lines of the current (multi-line) statement - are stored in p->tok->stdin_content */ + /* If the file descriptor is interactive, the source lines of the current + * (multi-line) statement are stored in p->tok->interactive_src_start. + * If not, we're parsing from a string, which means that the whole source + * is stored in p->tok->str. */ assert(p->tok->fp == NULL || p->tok->fp == stdin); char *cur_line = p->tok->fp_interactive ? p->tok->interactive_src_start : p->tok->str; @@ -524,7 +526,7 @@ _PyPegen_insert_memo(Parser *p, int mark, int type, void *node) { // Insert in front - Memo *m = PyArena_Malloc(p->arena, sizeof(Memo)); + Memo *m = _PyArena_Malloc(p->arena, sizeof(Memo)); if (m == NULL) { return -1; } @@ -566,7 +568,7 @@ if (!id) { return NULL; } - cache = Name(id, Load, 1, 0, 1, 0, p->arena); + cache = _PyAST_Name(id, Load, 1, 0, 1, 0, p->arena); return cache; } @@ -623,6 +625,64 @@ PyMem_Free(arr->items); } +static int +initialize_token(Parser *p, Token *token, const char *start, const char *end, int token_type) { + assert(token != NULL); + + token->type = (token_type == NAME) ? _get_keyword_or_name_type(p, start, (int)(end - start)) : token_type; + token->bytes = PyBytes_FromStringAndSize(start, end - start); + if (token->bytes == NULL) { + return -1; + } + + if (_PyArena_AddPyObject(p->arena, token->bytes) < 0) { + Py_DECREF(token->bytes); + return -1; + } + + const char *line_start = token_type == STRING ? p->tok->multi_line_start : p->tok->line_start; + int lineno = token_type == STRING ? p->tok->first_lineno : p->tok->lineno; + int end_lineno = p->tok->lineno; + + int col_offset = (start != NULL && start >= line_start) ? (int)(start - line_start) : -1; + int end_col_offset = (end != NULL && end >= p->tok->line_start) ? (int)(end - p->tok->line_start) : -1; + + token->lineno = p->starting_lineno + lineno; + token->col_offset = p->tok->lineno == 1 ? p->starting_col_offset + col_offset : col_offset; + token->end_lineno = p->starting_lineno + end_lineno; + token->end_col_offset = p->tok->lineno == 1 ? p->starting_col_offset + end_col_offset : end_col_offset; + + p->fill += 1; + + if (token_type == ERRORTOKEN && p->tok->done == E_DECODE) { + return raise_decode_error(p); + } + + return (token_type == ERRORTOKEN ? tokenizer_error(p) : 0); +} + +static int +_resize_tokens_array(Parser *p) { + int newsize = p->size * 2; + Token **new_tokens = PyMem_Realloc(p->tokens, newsize * sizeof(Token *)); + if (new_tokens == NULL) { + PyErr_NoMemory(); + return -1; + } + p->tokens = new_tokens; + + for (int i = p->size; i < newsize; i++) { + p->tokens[i] = PyMem_Calloc(1, sizeof(Token)); + if (p->tokens[i] == NULL) { + p->size = i; // Needed, in order to cleanup correctly after parser fails + PyErr_NoMemory(); + return -1; + } + } + p->size = newsize; + return 0; +} + int _PyPegen_fill_token(Parser *p) { @@ -648,7 +708,8 @@ type = PyTokenizer_Get(p->tok, &start, &end); } - if (type == ENDMARKER && p->start_rule == Py_single_input && p->parsing_started) { + // If we have reached the end and we are in single input mode we need to insert a newline and reset the parsing + if (p->start_rule == Py_single_input && type == ENDMARKER && p->parsing_started) { type = NEWLINE; /* Add an extra newline */ p->parsing_started = 0; @@ -661,25 +722,9 @@ p->parsing_started = 1; } - if (p->fill == p->size) { - int newsize = p->size * 2; - Token **new_tokens = PyMem_Realloc(p->tokens, newsize * sizeof(Token *)); - if (new_tokens == NULL) { - PyErr_NoMemory(); - return -1; - } - p->tokens = new_tokens; - - for (int i = p->size; i < newsize; i++) { - p->tokens[i] = PyMem_Malloc(sizeof(Token)); - if (p->tokens[i] == NULL) { - p->size = i; // Needed, in order to cleanup correctly after parser fails - PyErr_NoMemory(); - return -1; - } - memset(p->tokens[i], '\0', sizeof(Token)); - } - p->size = newsize; + // Check if we are at the limit of the token array capacity and resize if needed + if ((p->fill == p->size) && (_resize_tokens_array(p) != 0)) { + return -1; } Token *t = p->tokens[p->fill]; @@ -683,40 +728,6 @@ } Token *t = p->tokens[p->fill]; - t->type = (type == NAME) ? _get_keyword_or_name_type(p, start, (int)(end - start)) : type; - t->bytes = PyBytes_FromStringAndSize(start, end - start); - if (t->bytes == NULL) { - return -1; - } - PyArena_AddPyObject(p->arena, t->bytes); - - int lineno = type == STRING ? p->tok->first_lineno : p->tok->lineno; - const char *line_start = type == STRING ? p->tok->multi_line_start : p->tok->line_start; - int end_lineno = p->tok->lineno; - int col_offset = -1; - int end_col_offset = -1; - if (start != NULL && start >= line_start) { - col_offset = (int)(start - line_start); - } - if (end != NULL && end >= p->tok->line_start) { - end_col_offset = (int)(end - p->tok->line_start); - } - - t->lineno = p->starting_lineno + lineno; - t->col_offset = p->tok->lineno == 1 ? p->starting_col_offset + col_offset : col_offset; - t->end_lineno = p->starting_lineno + end_lineno; - t->end_col_offset = p->tok->lineno == 1 ? p->starting_col_offset + end_col_offset : end_col_offset; - - p->fill += 1; - - if (type == ERRORTOKEN) { - if (p->tok->done == E_DECODE) { - return raise_decode_error(p); - } - return tokenizer_error(p); - - } - - return 0; + return initialize_token(p, t, start, end, type); } @@ -721,5 +732,7 @@ } + +#if defined(Py_DEBUG) // Instrumentation to count the effectiveness of memoization. // The array counts the number of tokens skipped by memoization, // indexed by type. @@ -756,6 +769,7 @@ } return ret; } +#endif int // bool _PyPegen_is_memoized(Parser *p, int type, void *pres) @@ -771,6 +785,7 @@ for (Memo *m = t->memo; m != NULL; m = m->next) { if (m->type == type) { +#if defined(PY_DEBUG) if (0 <= type && type < NSTATISTICS) { long count = m->mark - p->mark; // A memoized negative result counts for one. @@ -779,6 +794,7 @@ } memo_statistics[type] += count; } +#endif p->mark = m->mark; *(void **)(pres) = m->node; return 1; @@ -917,8 +933,8 @@ p->error_indicator = 1; return NULL; } - return Name(id, Load, t->lineno, t->col_offset, t->end_lineno, t->end_col_offset, - p->arena); + return _PyAST_Name(id, Load, t->lineno, t->col_offset, t->end_lineno, + t->end_col_offset, p->arena); } void * @@ -1027,9 +1043,9 @@ return NULL; } - if (PyArena_AddPyObject(p->arena, c) < 0) { + if (_PyArena_AddPyObject(p->arena, c) < 0) { Py_DECREF(c); p->error_indicator = 1; return NULL; } @@ -1031,10 +1047,10 @@ Py_DECREF(c); p->error_indicator = 1; return NULL; } - return Constant(c, NULL, t->lineno, t->col_offset, t->end_lineno, t->end_col_offset, - p->arena); + return _PyAST_Constant(c, NULL, t->lineno, t->col_offset, t->end_lineno, + t->end_col_offset, p->arena); } static int // bool @@ -1320,23 +1336,6 @@ } mod_ty -_PyPegen_run_parser_from_file(const char *filename, int start_rule, - PyObject *filename_ob, PyCompilerFlags *flags, PyArena *arena) -{ - FILE *fp = fopen(filename, "rb"); - if (fp == NULL) { - PyErr_SetFromErrnoWithFilename(PyExc_OSError, filename); - return NULL; - } - - mod_ty result = _PyPegen_run_parser_from_file_pointer(fp, start_rule, filename_ob, - NULL, NULL, NULL, flags, NULL, arena); - - fclose(fp); - return result; -} - -mod_ty _PyPegen_run_parser_from_string(const char *str, int start_rule, PyObject *filename_ob, PyCompilerFlags *flags, PyArena *arena) { @@ -1524,8 +1523,8 @@ return NULL; } PyUnicode_InternInPlace(&uni); - if (PyArena_AddPyObject(p->arena, uni) < 0) { + if (_PyArena_AddPyObject(p->arena, uni) < 0) { Py_DECREF(uni); return NULL; } @@ -1528,8 +1527,8 @@ Py_DECREF(uni); return NULL; } - return _Py_Name(uni, Load, EXTRA_EXPR(first_name, second_name)); + return _PyAST_Name(uni, Load, EXTRA_EXPR(first_name, second_name)); } /* Counts the total number of dots in seq's tokens */ @@ -1556,9 +1555,9 @@ /* Creates an alias with '*' as the identifier name */ alias_ty -_PyPegen_alias_for_star(Parser *p) -{ +_PyPegen_alias_for_star(Parser *p, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena) { PyObject *str = PyUnicode_InternFromString("*"); if (!str) { return NULL; } @@ -1561,8 +1560,8 @@ PyObject *str = PyUnicode_InternFromString("*"); if (!str) { return NULL; } - if (PyArena_AddPyObject(p->arena, str) < 0) { + if (_PyArena_AddPyObject(p->arena, str) < 0) { Py_DECREF(str); return NULL; } @@ -1566,7 +1565,7 @@ Py_DECREF(str); return NULL; } - return alias(str, NULL, p->arena); + return _PyAST_alias(str, NULL, lineno, col_offset, end_lineno, end_col_offset, arena); } /* Creates a new asdl_seq* with the identifiers of all the names in seq */ @@ -1592,7 +1591,7 @@ _PyPegen_cmpop_expr_pair(Parser *p, cmpop_ty cmpop, expr_ty expr) { assert(expr != NULL); - CmpopExprPair *a = PyArena_Malloc(p->arena, sizeof(CmpopExprPair)); + CmpopExprPair *a = _PyArena_Malloc(p->arena, sizeof(CmpopExprPair)); if (!a) { return NULL; } @@ -1658,9 +1657,9 @@ static expr_ty _set_name_context(Parser *p, expr_ty e, expr_context_ty ctx) { - return _Py_Name(e->v.Name.id, ctx, EXTRA_EXPR(e, e)); + return _PyAST_Name(e->v.Name.id, ctx, EXTRA_EXPR(e, e)); } static expr_ty _set_tuple_context(Parser *p, expr_ty e, expr_context_ty ctx) { @@ -1662,9 +1661,9 @@ } static expr_ty _set_tuple_context(Parser *p, expr_ty e, expr_context_ty ctx) { - return _Py_Tuple( + return _PyAST_Tuple( _set_seq_context(p, e->v.Tuple.elts, ctx), ctx, EXTRA_EXPR(e, e)); @@ -1673,7 +1672,7 @@ static expr_ty _set_list_context(Parser *p, expr_ty e, expr_context_ty ctx) { - return _Py_List( + return _PyAST_List( _set_seq_context(p, e->v.List.elts, ctx), ctx, EXTRA_EXPR(e, e)); @@ -1682,9 +1681,10 @@ static expr_ty _set_subscript_context(Parser *p, expr_ty e, expr_context_ty ctx) { - return _Py_Subscript(e->v.Subscript.value, e->v.Subscript.slice, ctx, EXTRA_EXPR(e, e)); + return _PyAST_Subscript(e->v.Subscript.value, e->v.Subscript.slice, + ctx, EXTRA_EXPR(e, e)); } static expr_ty _set_attribute_context(Parser *p, expr_ty e, expr_context_ty ctx) { @@ -1686,11 +1686,12 @@ } static expr_ty _set_attribute_context(Parser *p, expr_ty e, expr_context_ty ctx) { - return _Py_Attribute(e->v.Attribute.value, e->v.Attribute.attr, ctx, EXTRA_EXPR(e, e)); + return _PyAST_Attribute(e->v.Attribute.value, e->v.Attribute.attr, + ctx, EXTRA_EXPR(e, e)); } static expr_ty _set_starred_context(Parser *p, expr_ty e, expr_context_ty ctx) { @@ -1692,9 +1693,10 @@ } static expr_ty _set_starred_context(Parser *p, expr_ty e, expr_context_ty ctx) { - return _Py_Starred(_PyPegen_set_expr_context(p, e->v.Starred.value, ctx), ctx, EXTRA_EXPR(e, e)); + return _PyAST_Starred(_PyPegen_set_expr_context(p, e->v.Starred.value, ctx), + ctx, EXTRA_EXPR(e, e)); } /* Creates an `expr_ty` equivalent to `expr` but with `ctx` as context */ @@ -1733,7 +1735,7 @@ KeyValuePair * _PyPegen_key_value_pair(Parser *p, expr_ty key, expr_ty value) { - KeyValuePair *a = PyArena_Malloc(p->arena, sizeof(KeyValuePair)); + KeyValuePair *a = _PyArena_Malloc(p->arena, sizeof(KeyValuePair)); if (!a) { return NULL; } @@ -1778,7 +1780,7 @@ NameDefaultPair * _PyPegen_name_default_pair(Parser *p, arg_ty arg, expr_ty value, Token *tc) { - NameDefaultPair *a = PyArena_Malloc(p->arena, sizeof(NameDefaultPair)); + NameDefaultPair *a = _PyArena_Malloc(p->arena, sizeof(NameDefaultPair)); if (!a) { return NULL; } @@ -1791,7 +1793,7 @@ SlashWithDefault * _PyPegen_slash_with_default(Parser *p, asdl_arg_seq *plain_names, asdl_seq *names_with_defaults) { - SlashWithDefault *a = PyArena_Malloc(p->arena, sizeof(SlashWithDefault)); + SlashWithDefault *a = _PyArena_Malloc(p->arena, sizeof(SlashWithDefault)); if (!a) { return NULL; } @@ -1804,7 +1806,7 @@ StarEtc * _PyPegen_star_etc(Parser *p, arg_ty vararg, asdl_seq *kwonlyargs, arg_ty kwarg) { - StarEtc *a = PyArena_Malloc(p->arena, sizeof(StarEtc)); + StarEtc *a = _PyArena_Malloc(p->arena, sizeof(StarEtc)); if (!a) { return NULL; } @@ -1865,6 +1867,117 @@ return seq; } +static int +_make_posonlyargs(Parser *p, + asdl_arg_seq *slash_without_default, + SlashWithDefault *slash_with_default, + asdl_arg_seq **posonlyargs) { + if (slash_without_default != NULL) { + *posonlyargs = slash_without_default; + } + else if (slash_with_default != NULL) { + asdl_arg_seq *slash_with_default_names = + _get_names(p, slash_with_default->names_with_defaults); + if (!slash_with_default_names) { + return -1; + } + *posonlyargs = (asdl_arg_seq*)_PyPegen_join_sequences( + p, + (asdl_seq*)slash_with_default->plain_names, + (asdl_seq*)slash_with_default_names); + } + else { + *posonlyargs = _Py_asdl_arg_seq_new(0, p->arena); + } + return *posonlyargs == NULL ? -1 : 0; +} + +static int +_make_posargs(Parser *p, + asdl_arg_seq *plain_names, + asdl_seq *names_with_default, + asdl_arg_seq **posargs) { + if (plain_names != NULL && names_with_default != NULL) { + asdl_arg_seq *names_with_default_names = _get_names(p, names_with_default); + if (!names_with_default_names) { + return -1; + } + *posargs = (asdl_arg_seq*)_PyPegen_join_sequences( + p,(asdl_seq*)plain_names, (asdl_seq*)names_with_default_names); + } + else if (plain_names == NULL && names_with_default != NULL) { + *posargs = _get_names(p, names_with_default); + } + else if (plain_names != NULL && names_with_default == NULL) { + *posargs = plain_names; + } + else { + *posargs = _Py_asdl_arg_seq_new(0, p->arena); + } + return *posargs == NULL ? -1 : 0; +} + +static int +_make_posdefaults(Parser *p, + SlashWithDefault *slash_with_default, + asdl_seq *names_with_default, + asdl_expr_seq **posdefaults) { + if (slash_with_default != NULL && names_with_default != NULL) { + asdl_expr_seq *slash_with_default_values = + _get_defaults(p, slash_with_default->names_with_defaults); + if (!slash_with_default_values) { + return -1; + } + asdl_expr_seq *names_with_default_values = _get_defaults(p, names_with_default); + if (!names_with_default_values) { + return -1; + } + *posdefaults = (asdl_expr_seq*)_PyPegen_join_sequences( + p, + (asdl_seq*)slash_with_default_values, + (asdl_seq*)names_with_default_values); + } + else if (slash_with_default == NULL && names_with_default != NULL) { + *posdefaults = _get_defaults(p, names_with_default); + } + else if (slash_with_default != NULL && names_with_default == NULL) { + *posdefaults = _get_defaults(p, slash_with_default->names_with_defaults); + } + else { + *posdefaults = _Py_asdl_expr_seq_new(0, p->arena); + } + return *posdefaults == NULL ? -1 : 0; +} + +static int +_make_kwargs(Parser *p, StarEtc *star_etc, + asdl_arg_seq **kwonlyargs, + asdl_expr_seq **kwdefaults) { + if (star_etc != NULL && star_etc->kwonlyargs != NULL) { + *kwonlyargs = _get_names(p, star_etc->kwonlyargs); + } + else { + *kwonlyargs = _Py_asdl_arg_seq_new(0, p->arena); + } + + if (*kwonlyargs == NULL) { + return -1; + } + + if (star_etc != NULL && star_etc->kwonlyargs != NULL) { + *kwdefaults = _get_defaults(p, star_etc->kwonlyargs); + } + else { + *kwdefaults = _Py_asdl_expr_seq_new(0, p->arena); + } + + if (*kwdefaults == NULL) { + return -1; + } + + return 0; +} + /* Constructs an arguments_ty object out of all the parsed constructs in the parameters rule */ arguments_ty _PyPegen_make_arguments(Parser *p, asdl_arg_seq *slash_without_default, @@ -1872,28 +1985,8 @@ asdl_seq *names_with_default, StarEtc *star_etc) { asdl_arg_seq *posonlyargs; - if (slash_without_default != NULL) { - posonlyargs = slash_without_default; - } - else if (slash_with_default != NULL) { - asdl_arg_seq *slash_with_default_names = - _get_names(p, slash_with_default->names_with_defaults); - if (!slash_with_default_names) { - return NULL; - } - posonlyargs = (asdl_arg_seq*)_PyPegen_join_sequences( - p, - (asdl_seq*)slash_with_default->plain_names, - (asdl_seq*)slash_with_default_names); - if (!posonlyargs) { - return NULL; - } - } - else { - posonlyargs = _Py_asdl_arg_seq_new(0, p->arena); - if (!posonlyargs) { - return NULL; - } + if (_make_posonlyargs(p, slash_without_default, slash_with_default, &posonlyargs) == -1) { + return NULL; } asdl_arg_seq *posargs; @@ -1897,33 +1990,8 @@ } asdl_arg_seq *posargs; - if (plain_names != NULL && names_with_default != NULL) { - asdl_arg_seq *names_with_default_names = _get_names(p, names_with_default); - if (!names_with_default_names) { - return NULL; - } - posargs = (asdl_arg_seq*)_PyPegen_join_sequences( - p, - (asdl_seq*)plain_names, - (asdl_seq*)names_with_default_names); - if (!posargs) { - return NULL; - } - } - else if (plain_names == NULL && names_with_default != NULL) { - posargs = _get_names(p, names_with_default); - if (!posargs) { - return NULL; - } - } - else if (plain_names != NULL && names_with_default == NULL) { - posargs = plain_names; - } - else { - posargs = _Py_asdl_arg_seq_new(0, p->arena); - if (!posargs) { - return NULL; - } + if (_make_posargs(p, plain_names, names_with_default, &posargs) == -1) { + return NULL; } asdl_expr_seq *posdefaults; @@ -1927,41 +1995,8 @@ } asdl_expr_seq *posdefaults; - if (slash_with_default != NULL && names_with_default != NULL) { - asdl_expr_seq *slash_with_default_values = - _get_defaults(p, slash_with_default->names_with_defaults); - if (!slash_with_default_values) { - return NULL; - } - asdl_expr_seq *names_with_default_values = _get_defaults(p, names_with_default); - if (!names_with_default_values) { - return NULL; - } - posdefaults = (asdl_expr_seq*)_PyPegen_join_sequences( - p, - (asdl_seq*)slash_with_default_values, - (asdl_seq*)names_with_default_values); - if (!posdefaults) { - return NULL; - } - } - else if (slash_with_default == NULL && names_with_default != NULL) { - posdefaults = _get_defaults(p, names_with_default); - if (!posdefaults) { - return NULL; - } - } - else if (slash_with_default != NULL && names_with_default == NULL) { - posdefaults = _get_defaults(p, slash_with_default->names_with_defaults); - if (!posdefaults) { - return NULL; - } - } - else { - posdefaults = _Py_asdl_expr_seq_new(0, p->arena); - if (!posdefaults) { - return NULL; - } + if (_make_posdefaults(p,slash_with_default, names_with_default, &posdefaults) == -1) { + return NULL; } arg_ty vararg = NULL; @@ -1970,17 +2005,4 @@ } asdl_arg_seq *kwonlyargs; - if (star_etc != NULL && star_etc->kwonlyargs != NULL) { - kwonlyargs = _get_names(p, star_etc->kwonlyargs); - if (!kwonlyargs) { - return NULL; - } - } - else { - kwonlyargs = _Py_asdl_arg_seq_new(0, p->arena); - if (!kwonlyargs) { - return NULL; - } - } - asdl_expr_seq *kwdefaults; @@ -1986,15 +2008,6 @@ asdl_expr_seq *kwdefaults; - if (star_etc != NULL && star_etc->kwonlyargs != NULL) { - kwdefaults = _get_defaults(p, star_etc->kwonlyargs); - if (!kwdefaults) { - return NULL; - } - } - else { - kwdefaults = _Py_asdl_expr_seq_new(0, p->arena); - if (!kwdefaults) { - return NULL; - } + if (_make_kwargs(p, star_etc, &kwonlyargs, &kwdefaults) == -1) { + return NULL; } arg_ty kwarg = NULL; @@ -2002,7 +2015,7 @@ kwarg = star_etc->kwarg; } - return _Py_arguments(posonlyargs, posargs, vararg, kwonlyargs, kwdefaults, kwarg, - posdefaults, p->arena); + return _PyAST_arguments(posonlyargs, posargs, vararg, kwonlyargs, + kwdefaults, kwarg, posdefaults, p->arena); } @@ -2007,5 +2020,6 @@ } + /* Constructs an empty arguments_ty object, that gets used when a function accepts no * arguments. */ arguments_ty @@ -2032,11 +2046,11 @@ return NULL; } - return _Py_arguments(posonlyargs, posargs, NULL, kwonlyargs, kwdefaults, NULL, posdefaults, - p->arena); + return _PyAST_arguments(posonlyargs, posargs, NULL, kwonlyargs, + kwdefaults, NULL, posdefaults, p->arena); } /* Encapsulates the value of an operator_ty into an AugOperator struct */ AugOperator * _PyPegen_augoperator(Parser *p, operator_ty kind) { @@ -2037,10 +2051,10 @@ } /* Encapsulates the value of an operator_ty into an AugOperator struct */ AugOperator * _PyPegen_augoperator(Parser *p, operator_ty kind) { - AugOperator *a = PyArena_Malloc(p->arena, sizeof(AugOperator)); + AugOperator *a = _PyArena_Malloc(p->arena, sizeof(AugOperator)); if (!a) { return NULL; } @@ -2054,7 +2068,7 @@ { assert(function_def != NULL); if (function_def->kind == AsyncFunctionDef_kind) { - return _Py_AsyncFunctionDef( + return _PyAST_AsyncFunctionDef( function_def->v.FunctionDef.name, function_def->v.FunctionDef.args, function_def->v.FunctionDef.body, decorators, function_def->v.FunctionDef.returns, function_def->v.FunctionDef.type_comment, function_def->lineno, @@ -2062,12 +2076,13 @@ p->arena); } - return _Py_FunctionDef(function_def->v.FunctionDef.name, function_def->v.FunctionDef.args, - function_def->v.FunctionDef.body, decorators, - function_def->v.FunctionDef.returns, - function_def->v.FunctionDef.type_comment, function_def->lineno, - function_def->col_offset, function_def->end_lineno, - function_def->end_col_offset, p->arena); + return _PyAST_FunctionDef( + function_def->v.FunctionDef.name, function_def->v.FunctionDef.args, + function_def->v.FunctionDef.body, decorators, + function_def->v.FunctionDef.returns, + function_def->v.FunctionDef.type_comment, function_def->lineno, + function_def->col_offset, function_def->end_lineno, + function_def->end_col_offset, p->arena); } /* Construct a ClassDef equivalent to class_def, but with decorators */ @@ -2075,13 +2090,14 @@ _PyPegen_class_def_decorators(Parser *p, asdl_expr_seq *decorators, stmt_ty class_def) { assert(class_def != NULL); - return _Py_ClassDef(class_def->v.ClassDef.name, class_def->v.ClassDef.bases, - class_def->v.ClassDef.keywords, class_def->v.ClassDef.body, decorators, - class_def->lineno, class_def->col_offset, class_def->end_lineno, - class_def->end_col_offset, p->arena); + return _PyAST_ClassDef( + class_def->v.ClassDef.name, class_def->v.ClassDef.bases, + class_def->v.ClassDef.keywords, class_def->v.ClassDef.body, decorators, + class_def->lineno, class_def->col_offset, class_def->end_lineno, + class_def->end_col_offset, p->arena); } /* Construct a KeywordOrStarred */ KeywordOrStarred * _PyPegen_keyword_or_starred(Parser *p, void *element, int is_keyword) { @@ -2082,10 +2098,10 @@ } /* Construct a KeywordOrStarred */ KeywordOrStarred * _PyPegen_keyword_or_starred(Parser *p, void *element, int is_keyword) { - KeywordOrStarred *a = PyArena_Malloc(p->arena, sizeof(KeywordOrStarred)); + KeywordOrStarred *a = _PyArena_Malloc(p->arena, sizeof(KeywordOrStarred)); if (!a) { return NULL; } @@ -2226,6 +2242,6 @@ } if (bytesmode) { - if (PyArena_AddPyObject(p->arena, bytes_str) < 0) { + if (_PyArena_AddPyObject(p->arena, bytes_str) < 0) { goto error; } @@ -2230,7 +2246,8 @@ goto error; } - return Constant(bytes_str, NULL, first->lineno, first->col_offset, last->end_lineno, - last->end_col_offset, p->arena); + return _PyAST_Constant(bytes_str, NULL, first->lineno, + first->col_offset, last->end_lineno, + last->end_col_offset, p->arena); } return _PyPegen_FstringParser_Finish(p, &state, first, last); @@ -2259,10 +2276,11 @@ if (tag == NULL) { return NULL; } - type_ignore_ty ti = TypeIgnore(p->type_ignore_comments.items[i].lineno, tag, p->arena); + type_ignore_ty ti = _PyAST_TypeIgnore(p->type_ignore_comments.items[i].lineno, + tag, p->arena); if (ti == NULL) { return NULL; } asdl_seq_SET(type_ignores, i, ti); } } @@ -2263,10 +2281,10 @@ if (ti == NULL) { return NULL; } asdl_seq_SET(type_ignores, i, ti); } } - return Module(a, type_ignores, p->arena); + return _PyAST_Module(a, type_ignores, p->arena); } // Error reporting helpers @@ -2279,5 +2297,5 @@ } #define VISIT_CONTAINER(CONTAINER, TYPE) do { \ - Py_ssize_t len = asdl_seq_LEN(CONTAINER->v.TYPE.elts);\ + Py_ssize_t len = asdl_seq_LEN((CONTAINER)->v.TYPE.elts);\ for (Py_ssize_t i = 0; i < len; i++) {\ @@ -2283,5 +2301,5 @@ for (Py_ssize_t i = 0; i < len; i++) {\ - expr_ty other = asdl_seq_GET(CONTAINER->v.TYPE.elts, i);\ + expr_ty other = asdl_seq_GET((CONTAINER)->v.TYPE.elts, i);\ expr_ty child = _PyPegen_get_invalid_target(other, targets_type);\ if (child != NULL) {\ return child;\ @@ -2376,7 +2394,7 @@ Py_ssize_t total_len = args_len; if (b == NULL) { - return _Py_Call(_PyPegen_dummy_name(p), a, NULL, lineno, col_offset, + return _PyAST_Call(_PyPegen_dummy_name(p), a, NULL, lineno, col_offset, end_lineno, end_col_offset, arena); } @@ -2398,6 +2416,6 @@ asdl_seq_SET(args, i, asdl_seq_GET(starreds, i - args_len)); } - return _Py_Call(_PyPegen_dummy_name(p), args, keywords, lineno, - col_offset, end_lineno, end_col_offset, arena); + return _PyAST_Call(_PyPegen_dummy_name(p), args, keywords, lineno, + col_offset, end_lineno, end_col_offset, arena); } diff --git a/Parser/pegen.h b/Parser/pegen.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UGFyc2VyL3BlZ2VuLmg=..8dd72af26abae4c1395bdd7572059de8fccc8d87_UGFyc2VyL3BlZ2VuLmg= 100644 --- a/Parser/pegen.h +++ b/Parser/pegen.h @@ -4,7 +4,7 @@ #define PY_SSIZE_T_CLEAN #include <Python.h> #include <token.h> -#include <Python-ast.h> +#include <pycore_ast.h> #if 0 #define PyPARSE_YIELD_IS_KEYWORD 0x0001 @@ -101,9 +101,9 @@ arg_ty kwarg; } StarEtc; -typedef struct { operator_ty kind; } AugOperator; +typedef struct { operator_ty kind; } AugOperator; typedef struct { void *element; int is_keyword; } KeywordOrStarred; @@ -105,7 +105,8 @@ typedef struct { void *element; int is_keyword; } KeywordOrStarred; +#if defined(Py_DEBUG) void _PyPegen_clear_memo_statistics(void); PyObject *_PyPegen_get_memo_statistics(void); @@ -110,5 +111,6 @@ void _PyPegen_clear_memo_statistics(void); PyObject *_PyPegen_get_memo_statistics(void); +#endif int _PyPegen_insert_memo(Parser *p, int mark, int type, void *node); int _PyPegen_update_memo(Parser *p, int mark, int type, void *node); @@ -136,8 +138,9 @@ void *_PyPegen_dummy_name(Parser *p, ...); Py_LOCAL_INLINE(void *) -RAISE_ERROR_KNOWN_LOCATION(Parser *p, PyObject *errtype, int lineno, - int col_offset, const char *errmsg, ...) +RAISE_ERROR_KNOWN_LOCATION(Parser *p, PyObject *errtype, + Py_ssize_t lineno, Py_ssize_t col_offset, + const char *errmsg, ...) { va_list va; va_start(va, errmsg); @@ -149,7 +152,7 @@ #define UNUSED(expr) do { (void)(expr); } while (0) -#define EXTRA_EXPR(head, tail) head->lineno, head->col_offset, tail->end_lineno, tail->end_col_offset, p->arena +#define EXTRA_EXPR(head, tail) head->lineno, (head)->col_offset, (tail)->end_lineno, (tail)->end_col_offset, p->arena #define EXTRA _start_lineno, _start_col_offset, _end_lineno, _end_col_offset, p->arena #ifdef __vms #define RAISE_SYNTAX_ERROR(...) _PyPegen_raise_error(p, PyExc_SyntaxError, ##__VA_ARGS__) @@ -233,7 +236,6 @@ mod_ty _PyPegen_run_parser_from_file_pointer(FILE *, int, PyObject *, const char *, const char *, const char *, PyCompilerFlags *, int *, PyArena *); void *_PyPegen_run_parser(Parser *); -mod_ty _PyPegen_run_parser_from_file(const char *, int, PyObject *, PyCompilerFlags *, PyArena *); mod_ty _PyPegen_run_parser_from_string(const char *, int, PyObject *, PyCompilerFlags *, PyArena *); asdl_stmt_seq *_PyPegen_interactive_exit(Parser *); asdl_seq *_PyPegen_singleton_seq(Parser *, void *); @@ -242,7 +244,7 @@ asdl_seq *_PyPegen_seq_flatten(Parser *, asdl_seq *); expr_ty _PyPegen_join_names_with_dot(Parser *, expr_ty, expr_ty); int _PyPegen_seq_count_dots(asdl_seq *); -alias_ty _PyPegen_alias_for_star(Parser *); +alias_ty _PyPegen_alias_for_star(Parser *, int, int, int, int, PyArena *); asdl_identifier_seq *_PyPegen_map_names_to_ids(Parser *, asdl_expr_seq *); CmpopExprPair *_PyPegen_cmpop_expr_pair(Parser *, cmpop_ty, expr_ty); asdl_int_seq *_PyPegen_get_cmpops(Parser *p, asdl_seq *); diff --git a/Parser/string_parser.c b/Parser/string_parser.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UGFyc2VyL3N0cmluZ19wYXJzZXIuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UGFyc2VyL3N0cmluZ19wYXJzZXIuYw== 100644 --- a/Parser/string_parser.c +++ b/Parser/string_parser.c @@ -797,10 +797,11 @@ /* And now create the FormattedValue node that represents this entire expression with the conversion and format spec. */ //TODO: Fix this - *expression = FormattedValue(simple_expression, conversion, - format_spec, first_token->lineno, - first_token->col_offset, last_token->end_lineno, - last_token->end_col_offset, p->arena); + *expression = _PyAST_FormattedValue(simple_expression, conversion, + format_spec, first_token->lineno, + first_token->col_offset, + last_token->end_lineno, + last_token->end_col_offset, p->arena); if (!*expression) { goto error; } @@ -1031,7 +1032,7 @@ PyObject *kind = NULL; *str = NULL; assert(PyUnicode_CheckExact(s)); - if (PyArena_AddPyObject(p->arena, s) < 0) { + if (_PyArena_AddPyObject(p->arena, s) < 0) { Py_DECREF(s); return NULL; } @@ -1044,8 +1045,9 @@ return NULL; } - return Constant(s, kind, first_token->lineno, first_token->col_offset, - last_token->end_lineno, last_token->end_col_offset, p->arena); + return _PyAST_Constant(s, kind, first_token->lineno, first_token->col_offset, + last_token->end_lineno, last_token->end_col_offset, + p->arena); } @@ -1204,8 +1206,9 @@ goto error; } - return _Py_JoinedStr(seq, first_token->lineno, first_token->col_offset, - last_token->end_lineno, last_token->end_col_offset, p->arena); + return _PyAST_JoinedStr(seq, first_token->lineno, first_token->col_offset, + last_token->end_lineno, last_token->end_col_offset, + p->arena); error: _PyPegen_FstringParser_Dealloc(state); diff --git a/Parser/string_parser.h b/Parser/string_parser.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UGFyc2VyL3N0cmluZ19wYXJzZXIuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UGFyc2VyL3N0cmluZ19wYXJzZXIuaA== 100644 --- a/Parser/string_parser.h +++ b/Parser/string_parser.h @@ -2,7 +2,7 @@ #define STRINGS_H #include <Python.h> -#include <Python-ast.h> +#include <pycore_ast.h> #include "pegen.h" #define EXPRLIST_N_CACHED 64 diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UGFyc2VyL3Rva2VuaXplci5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_UGFyc2VyL3Rva2VuaXplci5j 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -13,7 +13,6 @@ #include "unicodeobject.h" #include "bytesobject.h" #include "fileobject.h" -#include "codecs.h" #include "abstract.h" /* Alternate tab spacing */ @@ -75,7 +74,6 @@ tok->altindstack[0] = 0; tok->decoding_state = STATE_INIT; tok->decoding_erred = 0; - tok->read_coding_spec = 0; tok->enc = NULL; tok->encoding = NULL; tok->cont_line = 0; @@ -164,10 +162,10 @@ } for (; i < size - 6; i++) { /* XXX inefficient search */ const char* t = s + i; - if (strncmp(t, "coding", 6) == 0) { + if (memcmp(t, "coding", 6) == 0) { const char* begin = NULL; t += 6; if (t[0] != ':' && t[0] != '=') continue; do { t++; @@ -168,10 +166,10 @@ const char* begin = NULL; t += 6; if (t[0] != ':' && t[0] != '=') continue; do { t++; - } while (t[0] == '\x20' || t[0] == '\t'); + } while (t[0] == ' ' || t[0] == '\t'); begin = t; while (Py_ISALNUM(t[0]) || @@ -208,7 +206,5 @@ int set_readline(struct tok_state *, const char *)) { char *cs; - int r = 1; - if (tok->cont_line) { /* It's a continuation line, so it can't be a coding spec. */ @@ -213,5 +209,5 @@ if (tok->cont_line) { /* It's a continuation line, so it can't be a coding spec. */ - tok->read_coding_spec = 1; + tok->decoding_state = STATE_NORMAL; return 1; } @@ -216,4 +212,4 @@ return 1; } - if (!get_coding_spec(line, &cs, size, tok)) + if (!get_coding_spec(line, &cs, size, tok)) { return 0; @@ -219,4 +215,5 @@ return 0; + } if (!cs) { Py_ssize_t i; for (i = 0; i < size; i++) { @@ -225,9 +222,9 @@ if (line[i] != ' ' && line[i] != '\t' && line[i] != '\014') { /* Stop checking coding spec after a line containing * anything except a comment. */ - tok->read_coding_spec = 1; + tok->decoding_state = STATE_NORMAL; break; } } return 1; } @@ -229,7 +226,7 @@ break; } } return 1; } - tok->read_coding_spec = 1; + tok->decoding_state = STATE_NORMAL; if (tok->encoding == NULL) { @@ -235,16 +232,8 @@ if (tok->encoding == NULL) { - assert(tok->decoding_state == STATE_RAW); - if (strcmp(cs, "utf-8") == 0) { - tok->encoding = cs; - } else { - r = set_readline(tok, cs); - if (r) { - tok->encoding = cs; - tok->decoding_state = STATE_NORMAL; - } - else { - PyErr_Format(PyExc_SyntaxError, - "encoding problem: %s", cs); - PyMem_Free(cs); - } + assert(tok->decoding_readline == NULL); + if (strcmp(cs, "utf-8") != 0 && !set_readline(tok, cs)) { + error_ret(tok); + PyErr_Format(PyExc_SyntaxError, "encoding problem: %s", cs); + PyMem_Free(cs); + return 0; } @@ -250,2 +239,3 @@ } + tok->encoding = cs; } else { /* then, compare cs with BOM */ @@ -251,5 +241,5 @@ } else { /* then, compare cs with BOM */ - r = (strcmp(tok->encoding, cs) == 0); - if (!r) + if (strcmp(tok->encoding, cs) != 0) { + error_ret(tok); PyErr_Format(PyExc_SyntaxError, "encoding problem: %s with BOM", cs); @@ -254,4 +244,7 @@ PyErr_Format(PyExc_SyntaxError, "encoding problem: %s with BOM", cs); + PyMem_Free(cs); + return 0; + } PyMem_Free(cs); } @@ -256,6 +249,6 @@ PyMem_Free(cs); } - return r; + return 1; } /* See whether the file starts with a BOM. If it does, @@ -270,7 +263,7 @@ { int ch1, ch2, ch3; ch1 = get_char(tok); - tok->decoding_state = STATE_RAW; + tok->decoding_state = STATE_SEEK_CODING; if (ch1 == EOF) { return 1; } else if (ch1 == 0xEF) { @@ -324,7 +317,8 @@ return 1; } -static int tok_concatenate_interactive_new_line(struct tok_state* tok, char* line) { +static int +tok_concatenate_interactive_new_line(struct tok_state *tok, const char *line) { assert(tok->fp_interactive); if (!line) { @@ -360,6 +354,6 @@ 1) NULL: need to call tok->decoding_readline to get a new line 2) PyUnicodeObject *: decoding_feof has called tok->decoding_readline and stored the result in tok->decoding_buffer - 3) PyByteArrayObject *: previous call to fp_readl did not have enough room + 3) PyByteArrayObject *: previous call to tok_readline_recode did not have enough room (in the s buffer) to copy entire contents of the line read by tok->decoding_readline. tok->decoding_buffer has the overflow. @@ -364,4 +358,4 @@ (in the s buffer) to copy entire contents of the line read by tok->decoding_readline. tok->decoding_buffer has the overflow. - In this case, fp_readl is called in a loop (with an expanded buffer) + In this case, tok_readline_recode is called in a loop (with an expanded buffer) until the buffer ends with a '\n' (or until the end of the file is @@ -367,4 +361,4 @@ until the buffer ends with a '\n' (or until the end of the file is - reached): see tok_nextc and its calls to decoding_fgets. + reached): see tok_nextc and its calls to tok_reserve_buf. */ @@ -369,5 +363,5 @@ */ -static char * -fp_readl(char *s, int size, struct tok_state *tok) +static int +tok_reserve_buf(struct tok_state *tok, Py_ssize_t size) { @@ -373,9 +367,21 @@ { - PyObject* bufobj; - const char *buf; - Py_ssize_t buflen; - - /* Ask for one less byte so we can terminate it */ - assert(size > 0); - size--; + Py_ssize_t cur = tok->cur - tok->buf; + Py_ssize_t oldsize = tok->inp - tok->buf; + Py_ssize_t newsize = oldsize + Py_MAX(size, oldsize >> 1); + if (newsize > tok->end - tok->buf) { + char *newbuf = tok->buf; + Py_ssize_t start = tok->start == NULL ? -1 : tok->start - tok->buf; + newbuf = (char *)PyMem_Realloc(newbuf, newsize); + if (newbuf == NULL) { + tok->done = E_NOMEM; + return 0; + } + tok->buf = newbuf; + tok->cur = tok->buf + cur; + tok->inp = tok->buf + oldsize; + tok->end = tok->buf + newsize; + tok->start = start < 0 ? NULL : tok->buf + start; + } + return 1; +} @@ -381,18 +387,14 @@ - if (tok->decoding_buffer) { - bufobj = tok->decoding_buffer; - Py_INCREF(bufobj); - } - else - { - bufobj = _PyObject_CallNoArg(tok->decoding_readline); - if (bufobj == NULL) - goto error; - } - if (PyUnicode_CheckExact(bufobj)) - { - buf = PyUnicode_AsUTF8AndSize(bufobj, &buflen); - if (buf == NULL) { +static int +tok_readline_recode(struct tok_state *tok) { + PyObject *line; + const char *buf; + Py_ssize_t buflen; + line = tok->decoding_buffer; + if (line == NULL) { + line = PyObject_CallNoArgs(tok->decoding_readline); + if (line == NULL) { + error_ret(tok); goto error; } } @@ -396,11 +398,14 @@ goto error; } } - else - { - buf = PyByteArray_AsString(bufobj); - if (buf == NULL) { - goto error; - } - buflen = PyByteArray_GET_SIZE(bufobj); + else { + tok->decoding_buffer = NULL; + } + buf = PyUnicode_AsUTF8AndSize(line, &buflen); + if (buf == NULL) { + error_ret(tok); + goto error; + } + if (!tok_reserve_buf(tok, buflen + 1)) { + goto error; } @@ -406,11 +411,8 @@ } - - Py_XDECREF(tok->decoding_buffer); - if (buflen > size) { - /* Too many chars, the rest goes into tok->decoding_buffer */ - tok->decoding_buffer = PyByteArray_FromStringAndSize(buf+size, - buflen-size); - if (tok->decoding_buffer == NULL) - goto error; - buflen = size; + memcpy(tok->inp, buf, buflen); + tok->inp += buflen; + *tok->inp = '\0'; + if (tok->fp_interactive && + tok_concatenate_interactive_new_line(tok, buf) == -1) { + goto error; } @@ -416,12 +418,4 @@ } - else - tok->decoding_buffer = NULL; - - memcpy(s, buf, buflen); - s[buflen] = '\0'; - if (buflen == 0) /* EOF */ - s = NULL; - Py_DECREF(bufobj); - return s; - + Py_DECREF(line); + return 1; error: @@ -427,6 +421,6 @@ error: - Py_XDECREF(bufobj); - return error_ret(tok); + Py_XDECREF(line); + return 0; } /* Set the readline function for TOK to a StreamReader's @@ -527,9 +521,6 @@ return length; } -/* Read a line of input from TOK. Determine encoding - if necessary. */ - -static char * -decoding_fgets(char *s, int size, struct tok_state *tok) +static int +ensure_utf8(char *line, struct tok_state *tok) { @@ -535,3 +526,2 @@ { - char *line = NULL; int badchar = 0; @@ -537,12 +527,7 @@ int badchar = 0; - for (;;) { - if (tok->decoding_state == STATE_NORMAL) { - /* We already have a codec associated with - this input. */ - line = fp_readl(s, size, tok); - break; - } else if (tok->decoding_state == STATE_RAW) { - /* We want a 'raw' read. */ - line = Py_UniversalNewlineFgets(s, size, - tok->fp, NULL); + unsigned char *c; + int length; + for (c = (unsigned char *)line; *c; c += length) { + if (!(length = valid_utf8(c))) { + badchar = *c; break; @@ -548,10 +533,3 @@ break; - } else { - /* We have not yet determined the encoding. - If an encoding is found, use the file-pointer - reader functions from now on. */ - if (!check_bom(fp_getc, fp_ungetc, fp_setreadl, tok)) - return error_ret(tok); - assert(tok->decoding_state != STATE_INIT); } } @@ -556,20 +534,4 @@ } } - if (line != NULL && tok->lineno < 2 && !tok->read_coding_spec) { - if (!check_coding_spec(line, strlen(line), tok, fp_setreadl)) { - return error_ret(tok); - } - } - /* The default encoding is UTF-8, so make sure we don't have any - non-UTF-8 sequences in it. */ - if (line && !tok->encoding) { - unsigned char *c; - int length; - for (c = (unsigned char *)line; *c; c += length) - if (!(length = valid_utf8(c))) { - badchar = *c; - break; - } - } if (badchar) { /* Need to add 1 to the line number, since this line @@ -574,4 +536,4 @@ if (badchar) { /* Need to add 1 to the line number, since this line - has not been counted, yet. */ + has not been counted, yet. */ PyErr_Format(PyExc_SyntaxError, @@ -577,13 +539,8 @@ PyErr_Format(PyExc_SyntaxError, - "Non-UTF-8 code starting with '\\x%.2x' " - "in file %U on line %i, " - "but no encoding declared; " - "see http://python.org/dev/peps/pep-0263/ for details", - badchar, tok->filename, tok->lineno + 1); - return error_ret(tok); - } - - if (tok->fp_interactive && - tok_concatenate_interactive_new_line(tok, line) == -1) { - return NULL; + "Non-UTF-8 code starting with '\\x%.2x' " + "in file %U on line %i, " + "but no encoding declared; " + "see http://python.org/dev/peps/pep-0263/ for details", + badchar, tok->filename, tok->lineno + 1); + return 0; } @@ -589,26 +546,5 @@ } - - return line; -} - -static int -decoding_feof(struct tok_state *tok) -{ - if (tok->decoding_state != STATE_NORMAL) { - return feof(tok->fp); - } else { - PyObject* buf = tok->decoding_buffer; - if (buf == NULL) { - buf = _PyObject_CallNoArg(tok->decoding_readline); - if (buf == NULL) { - error_ret(tok); - return 1; - } else { - tok->decoding_buffer = buf; - } - } - return PyObject_Length(buf) == 0; - } + return 1; } /* Fetch a byte from TOK, using the string buffer. */ @@ -736,8 +672,9 @@ /* need to check line 1 and 2 separately since check_coding_spec assumes a single line as input */ if (newl[0]) { - if (!check_coding_spec(str, newl[0] - str, tok, buf_setreadl)) - return error_ret(tok); - if (tok->enc == NULL && !tok->read_coding_spec && newl[1]) { + if (!check_coding_spec(str, newl[0] - str, tok, buf_setreadl)) { + return NULL; + } + if (tok->enc == NULL && tok->decoding_state != STATE_NORMAL && newl[1]) { if (!check_coding_spec(newl[0]+1, newl[1] - newl[0], tok, buf_setreadl)) @@ -742,6 +679,6 @@ if (!check_coding_spec(newl[0]+1, newl[1] - newl[0], tok, buf_setreadl)) - return error_ret(tok); + return NULL; } } if (tok->enc != NULL) { @@ -777,6 +714,8 @@ return tok; } +/* Set up tokenizer for UTF-8 string */ + struct tok_state * PyTokenizer_FromUTF8(const char *str, int exec_input) { @@ -789,7 +728,6 @@ PyTokenizer_Free(tok); return NULL; } - tok->decoding_state = STATE_RAW; - tok->read_coding_spec = 1; + tok->decoding_state = STATE_NORMAL; tok->enc = NULL; tok->str = translated; @@ -794,7 +732,7 @@ tok->enc = NULL; tok->str = translated; - tok->encoding = (char *)PyMem_Malloc(6); + tok->encoding = new_string("utf-8", 5, tok); if (!tok->encoding) { PyTokenizer_Free(tok); return NULL; } @@ -797,8 +735,7 @@ if (!tok->encoding) { PyTokenizer_Free(tok); return NULL; } - strcpy(tok->encoding, "utf-8"); tok->buf = tok->cur = tok->inp = translated; tok->end = translated; @@ -826,8 +763,8 @@ if (enc != NULL) { /* Must copy encoding declaration since it gets copied into the parse tree. */ - tok->encoding = PyMem_Malloc(strlen(enc)+1); + tok->encoding = new_string(enc, strlen(enc), tok); if (!tok->encoding) { PyTokenizer_Free(tok); return NULL; } @@ -830,10 +767,9 @@ if (!tok->encoding) { PyTokenizer_Free(tok); return NULL; } - strcpy(tok->encoding, enc); tok->decoding_state = STATE_NORMAL; } return tok; } @@ -835,9 +771,8 @@ tok->decoding_state = STATE_NORMAL; } return tok; } - /* Free a tok_state structure */ void @@ -861,8 +796,224 @@ PyMem_Free(tok); } +static int +tok_readline_raw(struct tok_state *tok) +{ + do { + if (!tok_reserve_buf(tok, BUFSIZ)) { + return 0; + } + char *line = Py_UniversalNewlineFgets(tok->inp, + (int)(tok->end - tok->inp), + tok->fp, NULL); + if (line == NULL) { + return 1; + } + if (tok->fp_interactive && + tok_concatenate_interactive_new_line(tok, line) == -1) { + return 0; + } + if (*tok->inp == '\0') { + return 0; + } + tok->inp = strchr(tok->inp, '\0'); + } while (tok->inp[-1] != '\n'); + return 1; +} + +static int +tok_underflow_string(struct tok_state *tok) { + char *end = strchr(tok->inp, '\n'); + if (end != NULL) { + end++; + } + else { + end = strchr(tok->inp, '\0'); + if (end == tok->inp) { + tok->done = E_EOF; + return 0; + } + } + if (tok->start == NULL) { + tok->buf = tok->cur; + } + tok->line_start = tok->cur; + tok->lineno++; + tok->inp = end; + return 1; +} + +static int +tok_underflow_interactive(struct tok_state *tok) { + char *newtok = PyOS_Readline(stdin, stdout, tok->prompt); + if (newtok != NULL) { + char *translated = translate_newlines(newtok, 0, tok); + PyMem_Free(newtok); + if (translated == NULL) { + return 0; + } + newtok = translated; + } + if (tok->encoding && newtok && *newtok) { + /* Recode to UTF-8 */ + Py_ssize_t buflen; + const char* buf; + PyObject *u = translate_into_utf8(newtok, tok->encoding); + PyMem_Free(newtok); + if (u == NULL) { + tok->done = E_DECODE; + return 0; + } + buflen = PyBytes_GET_SIZE(u); + buf = PyBytes_AS_STRING(u); + newtok = PyMem_Malloc(buflen+1); + if (newtok == NULL) { + Py_DECREF(u); + tok->done = E_NOMEM; + return 0; + } + strcpy(newtok, buf); + Py_DECREF(u); + } + if (tok->fp_interactive && + tok_concatenate_interactive_new_line(tok, newtok) == -1) { + PyMem_Free(newtok); + return 0; + } + if (tok->nextprompt != NULL) { + tok->prompt = tok->nextprompt; + } + if (newtok == NULL) { + tok->done = E_INTR; + } + else if (*newtok == '\0') { + PyMem_Free(newtok); + tok->done = E_EOF; + } + else if (tok->start != NULL) { + Py_ssize_t cur_multi_line_start = tok->multi_line_start - tok->buf; + size_t size = strlen(newtok); + tok->lineno++; + if (!tok_reserve_buf(tok, size + 1)) { + PyMem_Free(tok->buf); + tok->buf = NULL; + PyMem_Free(newtok); + return 0; + } + memcpy(tok->cur, newtok, size + 1); + PyMem_Free(newtok); + tok->inp += size; + tok->multi_line_start = tok->buf + cur_multi_line_start; + } + else { + tok->lineno++; + PyMem_Free(tok->buf); + tok->buf = newtok; + tok->cur = tok->buf; + tok->line_start = tok->buf; + tok->inp = strchr(tok->buf, '\0'); + tok->end = tok->inp + 1; + } + if (tok->done != E_OK) { + if (tok->prompt != NULL) { + PySys_WriteStderr("\n"); + } + return 0; + } + return 1; +} + +static int +tok_underflow_file(struct tok_state *tok) { + if (tok->start == NULL) { + tok->cur = tok->inp = tok->buf; + } + if (tok->decoding_state == STATE_INIT) { + /* We have not yet determined the encoding. + If an encoding is found, use the file-pointer + reader functions from now on. */ + if (!check_bom(fp_getc, fp_ungetc, fp_setreadl, tok)) { + error_ret(tok); + return 0; + } + assert(tok->decoding_state != STATE_INIT); + } + /* Read until '\n' or EOF */ + if (tok->decoding_readline != NULL) { + /* We already have a codec associated with this input. */ + if (!tok_readline_recode(tok)) { + return 0; + } + } + else { + /* We want a 'raw' read. */ + if (!tok_readline_raw(tok)) { + return 0; + } + } + if (tok->inp == tok->cur) { + tok->done = E_EOF; + return 0; + } + if (tok->inp[-1] != '\n') { + /* Last line does not end in \n, fake one */ + *tok->inp++ = '\n'; + *tok->inp = '\0'; + } + + tok->lineno++; + if (tok->decoding_state != STATE_NORMAL) { + if (tok->lineno > 2) { + tok->decoding_state = STATE_NORMAL; + } + else if (!check_coding_spec(tok->cur, strlen(tok->cur), + tok, fp_setreadl)) + { + return 0; + } + } + /* The default encoding is UTF-8, so make sure we don't have any + non-UTF-8 sequences in it. */ + if (!tok->encoding + && (tok->decoding_state != STATE_NORMAL || tok->lineno >= 2)) { + if (!ensure_utf8(tok->cur, tok)) { + error_ret(tok); + return 0; + } + } + assert(tok->done == E_OK); + return tok->done == E_OK; +} + +static void +print_escape(FILE *f, const char *s, Py_ssize_t size) +{ + if (s == NULL) { + fputs("NULL", f); + return; + } + putc('"', f); + while (size-- > 0) { + unsigned char c = *s++; + switch (c) { + case '\n': fputs("\\n", f); break; + case '\r': fputs("\\r", f); break; + case '\t': fputs("\\t", f); break; + case '\f': fputs("\\f", f); break; + case '\'': fputs("\\'", f); break; + case '"': fputs("\\\"", f); break; + default: + if (0x20 <= c && c <= 0x7f) + putc(c, f); + else + fprintf(f, "\\x%02x", c); + } + } + putc('"', f); +} + /* Get next char, updating state; error code goes into tok->done */ static int tok_nextc(struct tok_state *tok) { @@ -864,8 +1015,9 @@ /* Get next char, updating state; error code goes into tok->done */ static int tok_nextc(struct tok_state *tok) { + int rc; for (;;) { if (tok->cur != tok->inp) { return Py_CHARMASK(*tok->cur++); /* Fast path */ @@ -873,20 +1025,5 @@ if (tok->done != E_OK) return EOF; if (tok->fp == NULL) { - char *end = strchr(tok->inp, '\n'); - if (end != NULL) - end++; - else { - end = strchr(tok->inp, '\0'); - if (end == tok->inp) { - tok->done = E_EOF; - return EOF; - } - } - if (tok->start == NULL) - tok->buf = tok->cur; - tok->line_start = tok->cur; - tok->lineno++; - tok->inp = end; - return Py_CHARMASK(*tok->cur++); + rc = tok_underflow_string(tok); } @@ -892,80 +1029,5 @@ } - if (tok->prompt != NULL) { - char *newtok = PyOS_Readline(stdin, stdout, tok->prompt); - if (newtok != NULL) { - char *translated = translate_newlines(newtok, 0, tok); - PyMem_Free(newtok); - if (translated == NULL) - return EOF; - newtok = translated; - } - if (tok->encoding && newtok && *newtok) { - /* Recode to UTF-8 */ - Py_ssize_t buflen; - const char* buf; - PyObject *u = translate_into_utf8(newtok, tok->encoding); - PyMem_Free(newtok); - if (!u) { - tok->done = E_DECODE; - return EOF; - } - buflen = PyBytes_GET_SIZE(u); - buf = PyBytes_AS_STRING(u); - newtok = PyMem_Malloc(buflen+1); - if (newtok == NULL) { - Py_DECREF(u); - tok->done = E_NOMEM; - return EOF; - } - strcpy(newtok, buf); - Py_DECREF(u); - } - if (tok->fp_interactive && - tok_concatenate_interactive_new_line(tok, newtok) == -1) { - return EOF; - } - if (tok->nextprompt != NULL) - tok->prompt = tok->nextprompt; - if (newtok == NULL) - tok->done = E_INTR; - else if (*newtok == '\0') { - PyMem_Free(newtok); - tok->done = E_EOF; - } - else if (tok->start != NULL) { - size_t start = tok->start - tok->buf; - size_t oldlen = tok->cur - tok->buf; - size_t newlen = oldlen + strlen(newtok); - Py_ssize_t cur_multi_line_start = tok->multi_line_start - tok->buf; - char *buf = tok->buf; - buf = (char *)PyMem_Realloc(buf, newlen+1); - tok->lineno++; - if (buf == NULL) { - PyMem_Free(tok->buf); - tok->buf = NULL; - PyMem_Free(newtok); - tok->done = E_NOMEM; - return EOF; - } - tok->buf = buf; - tok->cur = tok->buf + oldlen; - tok->multi_line_start = tok->buf + cur_multi_line_start; - tok->line_start = tok->cur; - strcpy(tok->buf + oldlen, newtok); - PyMem_Free(newtok); - tok->inp = tok->buf + newlen; - tok->end = tok->inp + 1; - tok->start = tok->buf + start; - } - else { - tok->lineno++; - if (tok->buf != NULL) - PyMem_Free(tok->buf); - tok->buf = newtok; - tok->cur = tok->buf; - tok->line_start = tok->buf; - tok->inp = strchr(tok->buf, '\0'); - tok->end = tok->inp + 1; - } + else if (tok->prompt != NULL) { + rc = tok_underflow_interactive(tok); } else { @@ -970,89 +1032,4 @@ } else { - int done = 0; - Py_ssize_t cur = 0; - char *pt; - if (tok->start == NULL) { - if (tok->buf == NULL) { - tok->buf = (char *) - PyMem_Malloc(BUFSIZ); - if (tok->buf == NULL) { - tok->done = E_NOMEM; - return EOF; - } - tok->end = tok->buf + BUFSIZ; - } - if (decoding_fgets(tok->buf, (int)(tok->end - tok->buf), - tok) == NULL) { - if (!tok->decoding_erred && !(tok->done == E_NOMEM)) - tok->done = E_EOF; - done = 1; - } - else { - tok->done = E_OK; - tok->inp = strchr(tok->buf, '\0'); - done = tok->inp == tok->buf || tok->inp[-1] == '\n'; - } - } - else { - cur = tok->cur - tok->buf; - if (decoding_feof(tok)) { - tok->done = E_EOF; - done = 1; - } - else - tok->done = E_OK; - } - tok->lineno++; - /* Read until '\n' or EOF */ - while (!done) { - Py_ssize_t curstart = tok->start == NULL ? -1 : - tok->start - tok->buf; - Py_ssize_t cur_multi_line_start = tok->multi_line_start - tok->buf; - Py_ssize_t curvalid = tok->inp - tok->buf; - Py_ssize_t newsize = curvalid + BUFSIZ; - char *newbuf = tok->buf; - newbuf = (char *)PyMem_Realloc(newbuf, - newsize); - if (newbuf == NULL) { - tok->done = E_NOMEM; - tok->cur = tok->inp; - return EOF; - } - tok->buf = newbuf; - tok->cur = tok->buf + cur; - tok->multi_line_start = tok->buf + cur_multi_line_start; - tok->line_start = tok->cur; - tok->inp = tok->buf + curvalid; - tok->end = tok->buf + newsize; - tok->start = curstart < 0 ? NULL : - tok->buf + curstart; - if (decoding_fgets(tok->inp, - (int)(tok->end - tok->inp), - tok) == NULL) { - /* Break out early on decoding - errors, as tok->buf will be NULL - */ - if (tok->decoding_erred) - return EOF; - /* Last line does not end in \n, - fake one */ - if (tok->inp[-1] != '\n') - strcpy(tok->inp, "\n"); - } - tok->inp = strchr(tok->inp, '\0'); - done = tok->inp[-1] == '\n'; - } - if (tok->buf != NULL) { - tok->cur = tok->buf + cur; - tok->line_start = tok->cur; - /* replace "\r\n" with "\n" */ - /* For Mac leave the \r, giving a syntax error */ - pt = tok->inp - 2; - if (pt >= tok->buf && *pt == '\r') { - *pt++ = '\n'; - *pt = '\0'; - tok->inp = pt; - } - } + rc = tok_underflow_file(tok); } @@ -1058,7 +1035,10 @@ } - if (tok->done != E_OK) { - if (tok->prompt != NULL) - PySys_WriteStderr("\n"); + if (Py_DebugFlag) { + printf("line[%d] = ", tok->lineno); + print_escape(stdout, tok->cur, tok->inp - tok->cur); + printf(" tok->done = %d\n", tok->done); + } + if (!rc) { tok->cur = tok->inp; return EOF; } @@ -1062,4 +1042,5 @@ tok->cur = tok->inp; return EOF; } + tok->line_start = tok->cur; } @@ -1065,4 +1046,4 @@ } - /*NOTREACHED*/ + Py_UNREACHABLE(); } @@ -1067,6 +1048,5 @@ } - /* Back-up one character */ static void @@ -1076,8 +1056,8 @@ if (--tok->cur < tok->buf) { Py_FatalError("tokenizer beginning of buffer"); } - if (*tok->cur != c) { - *tok->cur = c; + if ((int)(unsigned char)*tok->cur != c) { + Py_FatalError("tok_backup: wrong character"); } } } @@ -1951,5 +1931,5 @@ fclose(fp); if (tok->encoding) { encoding = (char *)PyMem_Malloc(strlen(tok->encoding) + 1); - if (encoding) + if (encoding) { strcpy(encoding, tok->encoding); @@ -1955,4 +1935,5 @@ strcpy(encoding, tok->encoding); + } } PyTokenizer_Free(tok); return encoding; diff --git a/Parser/tokenizer.h b/Parser/tokenizer.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UGFyc2VyL3Rva2VuaXplci5o..8dd72af26abae4c1395bdd7572059de8fccc8d87_UGFyc2VyL3Rva2VuaXplci5o 100644 --- a/Parser/tokenizer.h +++ b/Parser/tokenizer.h @@ -15,8 +15,8 @@ enum decoding_state { STATE_INIT, - STATE_RAW, - STATE_NORMAL /* have a codec associated with input */ + STATE_SEEK_CODING, + STATE_NORMAL }; /* Tokenizer state */ @@ -54,7 +54,6 @@ /* Stuff for PEP 0263 */ enum decoding_state decoding_state; int decoding_erred; /* whether erred in decoding */ - int read_coding_spec; /* whether 'coding:...' has been read */ char *encoding; /* Source encoding. */ int cont_line; /* whether we are in a continuation line. */ const char* line_start; /* pointer to start of current line */ diff --git a/Python/Python-ast.c b/Python/Python-ast.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL1B5dGhvbi1hc3QuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL1B5dGhvbi1hc3QuYw== 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -1,6 +1,3 @@ // File automatically generated by Parser/asdl_c.py. - -#include <stddef.h> - #include "Python.h" @@ -6,6 +3,5 @@ #include "Python.h" - - +#include "pycore_ast.h" #include "pycore_ast_state.h" // struct ast_state #include "pycore_interp.h" // _PyInterpreterState.ast #include "pycore_pystate.h" // _PyInterpreterState_GET() @@ -9,6 +5,8 @@ #include "pycore_ast_state.h" // struct ast_state #include "pycore_interp.h" // _PyInterpreterState.ast #include "pycore_pystate.h" // _PyInterpreterState_GET() +#include "structmember.h" +#include <stddef.h> // Forward declaration static int init_types(struct ast_state *state); @@ -24,11 +22,6 @@ return state; } -// Include Python-ast.h after pycore_interp.h to avoid conflicts -// with the Yield macro redefined by <winbase.h> -#include "Python-ast.h" -#include "structmember.h" - void _PyAST_Fini(PyInterpreterState *interp) { struct ast_state *state = &interp->ast; @@ -682,6 +675,12 @@ "value", }; static PyObject* ast2obj_alias(struct ast_state *state, void*); +static const char * const alias_attributes[] = { + "lineno", + "col_offset", + "end_lineno", + "end_col_offset", +}; static const char * const alias_fields[]={ "name", "asname", @@ -961,7 +960,7 @@ if (obj == Py_None) obj = NULL; if (obj) { - if (PyArena_AddPyObject(arena, obj) < 0) { + if (_PyArena_AddPyObject(arena, obj) < 0) { *out = NULL; return -1; } @@ -973,7 +972,7 @@ static int obj2ast_constant(struct ast_state *Py_UNUSED(state), PyObject* obj, PyObject** out, PyArena* arena) { - if (PyArena_AddPyObject(arena, obj) < 0) { + if (_PyArena_AddPyObject(arena, obj) < 0) { *out = NULL; return -1; } @@ -1714,6 +1713,7 @@ alias_fields, 2, "alias(identifier name, identifier? asname)"); if (!state->alias_type) return 0; - if (!add_attributes(state, state->alias_type, NULL, 0)) return 0; + if (!add_attributes(state, state->alias_type, alias_attributes, 4)) return + 0; if (PyObject_SetAttr(state->alias_type, state->asname, Py_None) == -1) return 0; @@ -1718,5 +1718,10 @@ if (PyObject_SetAttr(state->alias_type, state->asname, Py_None) == -1) return 0; + if (PyObject_SetAttr(state->alias_type, state->end_lineno, Py_None) == -1) + return 0; + if (PyObject_SetAttr(state->alias_type, state->end_col_offset, Py_None) == + -1) + return 0; state->withitem_type = make_type(state, "withitem", state->AST_type, withitem_fields, 2, "withitem(expr context_expr, expr? optional_vars)"); @@ -1783,7 +1788,7 @@ type_ignore_ty* out, PyArena* arena); mod_ty -Module(asdl_stmt_seq * body, asdl_type_ignore_seq * type_ignores, PyArena - *arena) +_PyAST_Module(asdl_stmt_seq * body, asdl_type_ignore_seq * type_ignores, + PyArena *arena) { mod_ty p; @@ -1788,6 +1793,6 @@ { mod_ty p; - p = (mod_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (mod_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Module_kind; @@ -1797,6 +1802,6 @@ } mod_ty -Interactive(asdl_stmt_seq * body, PyArena *arena) +_PyAST_Interactive(asdl_stmt_seq * body, PyArena *arena) { mod_ty p; @@ -1801,6 +1806,6 @@ { mod_ty p; - p = (mod_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (mod_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Interactive_kind; @@ -1809,7 +1814,7 @@ } mod_ty -Expression(expr_ty body, PyArena *arena) +_PyAST_Expression(expr_ty body, PyArena *arena) { mod_ty p; if (!body) { @@ -1817,7 +1822,7 @@ "field 'body' is required for Expression"); return NULL; } - p = (mod_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (mod_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Expression_kind; @@ -1826,7 +1831,7 @@ } mod_ty -FunctionType(asdl_expr_seq * argtypes, expr_ty returns, PyArena *arena) +_PyAST_FunctionType(asdl_expr_seq * argtypes, expr_ty returns, PyArena *arena) { mod_ty p; if (!returns) { @@ -1834,7 +1839,7 @@ "field 'returns' is required for FunctionType"); return NULL; } - p = (mod_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (mod_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = FunctionType_kind; @@ -1844,10 +1849,10 @@ } stmt_ty -FunctionDef(identifier name, arguments_ty args, asdl_stmt_seq * body, - asdl_expr_seq * decorator_list, expr_ty returns, string - type_comment, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +_PyAST_FunctionDef(identifier name, arguments_ty args, asdl_stmt_seq * body, + asdl_expr_seq * decorator_list, expr_ty returns, string + type_comment, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena) { stmt_ty p; if (!name) { @@ -1860,7 +1865,7 @@ "field 'args' is required for FunctionDef"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = FunctionDef_kind; @@ -1878,10 +1883,10 @@ } stmt_ty -AsyncFunctionDef(identifier name, arguments_ty args, asdl_stmt_seq * body, - asdl_expr_seq * decorator_list, expr_ty returns, string - type_comment, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +_PyAST_AsyncFunctionDef(identifier name, arguments_ty args, asdl_stmt_seq * + body, asdl_expr_seq * decorator_list, expr_ty returns, + string type_comment, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; if (!name) { @@ -1894,7 +1899,7 @@ "field 'args' is required for AsyncFunctionDef"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = AsyncFunctionDef_kind; @@ -1912,9 +1917,10 @@ } stmt_ty -ClassDef(identifier name, asdl_expr_seq * bases, asdl_keyword_seq * keywords, - asdl_stmt_seq * body, asdl_expr_seq * decorator_list, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_ClassDef(identifier name, asdl_expr_seq * bases, asdl_keyword_seq * + keywords, asdl_stmt_seq * body, asdl_expr_seq * decorator_list, + int lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena) { stmt_ty p; if (!name) { @@ -1922,7 +1928,7 @@ "field 'name' is required for ClassDef"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = ClassDef_kind; @@ -1939,7 +1945,7 @@ } stmt_ty -Return(expr_ty value, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +_PyAST_Return(expr_ty value, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { stmt_ty p; @@ -1944,6 +1950,6 @@ { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Return_kind; @@ -1956,7 +1962,7 @@ } stmt_ty -Delete(asdl_expr_seq * targets, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +_PyAST_Delete(asdl_expr_seq * targets, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; @@ -1961,6 +1967,6 @@ { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Delete_kind; @@ -1973,8 +1979,9 @@ } stmt_ty -Assign(asdl_expr_seq * targets, expr_ty value, string type_comment, int lineno, - int col_offset, int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_Assign(asdl_expr_seq * targets, expr_ty value, string type_comment, int + lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena) { stmt_ty p; if (!value) { @@ -1982,7 +1989,7 @@ "field 'value' is required for Assign"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Assign_kind; @@ -1997,8 +2004,8 @@ } stmt_ty -AugAssign(expr_ty target, operator_ty op, expr_ty value, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_AugAssign(expr_ty target, operator_ty op, expr_ty value, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; if (!target) { @@ -2016,7 +2023,7 @@ "field 'value' is required for AugAssign"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = AugAssign_kind; @@ -2031,9 +2038,9 @@ } stmt_ty -AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int simple, int - lineno, int col_offset, int end_lineno, int end_col_offset, PyArena - *arena) +_PyAST_AnnAssign(expr_ty target, expr_ty annotation, expr_ty value, int simple, + int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { stmt_ty p; if (!target) { @@ -2046,7 +2053,7 @@ "field 'annotation' is required for AnnAssign"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = AnnAssign_kind; @@ -2062,9 +2069,9 @@ } stmt_ty -For(expr_ty target, expr_ty iter, asdl_stmt_seq * body, asdl_stmt_seq * orelse, - string type_comment, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +_PyAST_For(expr_ty target, expr_ty iter, asdl_stmt_seq * body, asdl_stmt_seq * + orelse, string type_comment, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; if (!target) { @@ -2077,7 +2084,7 @@ "field 'iter' is required for For"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = For_kind; @@ -2094,9 +2101,9 @@ } stmt_ty -AsyncFor(expr_ty target, expr_ty iter, asdl_stmt_seq * body, asdl_stmt_seq * - orelse, string type_comment, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +_PyAST_AsyncFor(expr_ty target, expr_ty iter, asdl_stmt_seq * body, + asdl_stmt_seq * orelse, string type_comment, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; if (!target) { @@ -2109,7 +2116,7 @@ "field 'iter' is required for AsyncFor"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = AsyncFor_kind; @@ -2126,8 +2133,9 @@ } stmt_ty -While(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, int lineno, - int col_offset, int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_While(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, int + lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena) { stmt_ty p; if (!test) { @@ -2135,7 +2143,7 @@ "field 'test' is required for While"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = While_kind; @@ -2150,8 +2158,9 @@ } stmt_ty -If(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_If(expr_ty test, asdl_stmt_seq * body, asdl_stmt_seq * orelse, int + lineno, int col_offset, int end_lineno, int end_col_offset, PyArena + *arena) { stmt_ty p; if (!test) { @@ -2159,7 +2168,7 @@ "field 'test' is required for If"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = If_kind; @@ -2174,7 +2183,8 @@ } stmt_ty -With(asdl_withitem_seq * items, asdl_stmt_seq * body, string type_comment, int - lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_With(asdl_withitem_seq * items, asdl_stmt_seq * body, string + type_comment, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { stmt_ty p; @@ -2179,6 +2189,6 @@ { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = With_kind; @@ -2193,8 +2203,8 @@ } stmt_ty -AsyncWith(asdl_withitem_seq * items, asdl_stmt_seq * body, string type_comment, - int lineno, int col_offset, int end_lineno, int end_col_offset, - PyArena *arena) +_PyAST_AsyncWith(asdl_withitem_seq * items, asdl_stmt_seq * body, string + type_comment, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { stmt_ty p; @@ -2199,6 +2209,6 @@ { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = AsyncWith_kind; @@ -2213,8 +2223,8 @@ } stmt_ty -Match(expr_ty subject, asdl_match_case_seq * cases, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_Match(expr_ty subject, asdl_match_case_seq * cases, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; if (!subject) { @@ -2222,7 +2232,7 @@ "field 'subject' is required for Match"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Match_kind; @@ -2236,7 +2246,7 @@ } stmt_ty -Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena) +_PyAST_Raise(expr_ty exc, expr_ty cause, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; @@ -2241,6 +2251,6 @@ { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Raise_kind; @@ -2254,8 +2264,8 @@ } stmt_ty -Try(asdl_stmt_seq * body, asdl_excepthandler_seq * handlers, asdl_stmt_seq * - orelse, asdl_stmt_seq * finalbody, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +_PyAST_Try(asdl_stmt_seq * body, asdl_excepthandler_seq * handlers, + asdl_stmt_seq * orelse, asdl_stmt_seq * finalbody, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; @@ -2260,6 +2270,6 @@ { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Try_kind; @@ -2275,8 +2285,8 @@ } stmt_ty -Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena) +_PyAST_Assert(expr_ty test, expr_ty msg, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; if (!test) { @@ -2284,7 +2294,7 @@ "field 'test' is required for Assert"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Assert_kind; @@ -2298,7 +2308,7 @@ } stmt_ty -Import(asdl_alias_seq * names, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +_PyAST_Import(asdl_alias_seq * names, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; @@ -2303,6 +2313,6 @@ { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Import_kind; @@ -2315,7 +2325,8 @@ } stmt_ty -ImportFrom(identifier module, asdl_alias_seq * names, int level, int lineno, - int col_offset, int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_ImportFrom(identifier module, asdl_alias_seq * names, int level, int + lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena) { stmt_ty p; @@ -2320,6 +2331,6 @@ { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = ImportFrom_kind; @@ -2334,7 +2345,7 @@ } stmt_ty -Global(asdl_identifier_seq * names, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena) +_PyAST_Global(asdl_identifier_seq * names, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; @@ -2339,6 +2350,6 @@ { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Global_kind; @@ -2351,7 +2362,7 @@ } stmt_ty -Nonlocal(asdl_identifier_seq * names, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +_PyAST_Nonlocal(asdl_identifier_seq * names, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { stmt_ty p; @@ -2356,6 +2367,6 @@ { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Nonlocal_kind; @@ -2368,8 +2379,8 @@ } stmt_ty -Expr(expr_ty value, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +_PyAST_Expr(expr_ty value, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { stmt_ty p; if (!value) { @@ -2377,7 +2388,7 @@ "field 'value' is required for Expr"); return NULL; } - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Expr_kind; @@ -2390,7 +2401,7 @@ } stmt_ty -Pass(int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena - *arena) +_PyAST_Pass(int lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena) { stmt_ty p; @@ -2395,6 +2406,6 @@ { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Pass_kind; @@ -2406,7 +2417,7 @@ } stmt_ty -Break(int lineno, int col_offset, int end_lineno, int end_col_offset, PyArena - *arena) +_PyAST_Break(int lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena) { stmt_ty p; @@ -2411,6 +2422,6 @@ { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Break_kind; @@ -2422,7 +2433,7 @@ } stmt_ty -Continue(int lineno, int col_offset, int end_lineno, int end_col_offset, - PyArena *arena) +_PyAST_Continue(int lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena) { stmt_ty p; @@ -2427,6 +2438,6 @@ { stmt_ty p; - p = (stmt_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (stmt_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Continue_kind; @@ -2438,8 +2449,8 @@ } expr_ty -BoolOp(boolop_ty op, asdl_expr_seq * values, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +_PyAST_BoolOp(boolop_ty op, asdl_expr_seq * values, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!op) { @@ -2447,7 +2458,7 @@ "field 'op' is required for BoolOp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = BoolOp_kind; @@ -2461,8 +2472,8 @@ } expr_ty -NamedExpr(expr_ty target, expr_ty value, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +_PyAST_NamedExpr(expr_ty target, expr_ty value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!target) { @@ -2475,7 +2486,7 @@ "field 'value' is required for NamedExpr"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = NamedExpr_kind; @@ -2489,8 +2500,8 @@ } expr_ty -BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!left) { @@ -2508,7 +2519,7 @@ "field 'right' is required for BinOp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = BinOp_kind; @@ -2523,8 +2534,8 @@ } expr_ty -UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +_PyAST_UnaryOp(unaryop_ty op, expr_ty operand, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!op) { @@ -2537,7 +2548,7 @@ "field 'operand' is required for UnaryOp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = UnaryOp_kind; @@ -2551,8 +2562,8 @@ } expr_ty -Lambda(arguments_ty args, expr_ty body, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +_PyAST_Lambda(arguments_ty args, expr_ty body, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!args) { @@ -2565,7 +2576,7 @@ "field 'body' is required for Lambda"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Lambda_kind; @@ -2579,8 +2590,8 @@ } expr_ty -IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!test) { @@ -2598,7 +2609,7 @@ "field 'orelse' is required for IfExp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = IfExp_kind; @@ -2613,7 +2624,7 @@ } expr_ty -Dict(asdl_expr_seq * keys, asdl_expr_seq * values, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_Dict(asdl_expr_seq * keys, asdl_expr_seq * values, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; @@ -2618,6 +2629,6 @@ { expr_ty p; - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Dict_kind; @@ -2631,7 +2642,7 @@ } expr_ty -Set(asdl_expr_seq * elts, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +_PyAST_Set(asdl_expr_seq * elts, int lineno, int col_offset, int end_lineno, + int end_col_offset, PyArena *arena) { expr_ty p; @@ -2636,6 +2647,6 @@ { expr_ty p; - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Set_kind; @@ -2648,8 +2659,9 @@ } expr_ty -ListComp(expr_ty elt, asdl_comprehension_seq * generators, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_ListComp(expr_ty elt, asdl_comprehension_seq * generators, int lineno, + int col_offset, int end_lineno, int end_col_offset, PyArena + *arena) { expr_ty p; if (!elt) { @@ -2657,7 +2669,7 @@ "field 'elt' is required for ListComp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = ListComp_kind; @@ -2671,8 +2683,9 @@ } expr_ty -SetComp(expr_ty elt, asdl_comprehension_seq * generators, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_SetComp(expr_ty elt, asdl_comprehension_seq * generators, int lineno, + int col_offset, int end_lineno, int end_col_offset, PyArena + *arena) { expr_ty p; if (!elt) { @@ -2680,7 +2693,7 @@ "field 'elt' is required for SetComp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = SetComp_kind; @@ -2694,9 +2707,9 @@ } expr_ty -DictComp(expr_ty key, expr_ty value, asdl_comprehension_seq * generators, int - lineno, int col_offset, int end_lineno, int end_col_offset, PyArena - *arena) +_PyAST_DictComp(expr_ty key, expr_ty value, asdl_comprehension_seq * + generators, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { expr_ty p; if (!key) { @@ -2709,7 +2722,7 @@ "field 'value' is required for DictComp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = DictComp_kind; @@ -2724,8 +2737,9 @@ } expr_ty -GeneratorExp(expr_ty elt, asdl_comprehension_seq * generators, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_GeneratorExp(expr_ty elt, asdl_comprehension_seq * generators, int + lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena) { expr_ty p; if (!elt) { @@ -2733,7 +2747,7 @@ "field 'elt' is required for GeneratorExp"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = GeneratorExp_kind; @@ -2747,8 +2761,8 @@ } expr_ty -Await(expr_ty value, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +_PyAST_Await(expr_ty value, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { expr_ty p; if (!value) { @@ -2756,7 +2770,7 @@ "field 'value' is required for Await"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Await_kind; @@ -2769,7 +2783,7 @@ } expr_ty -Yield(expr_ty value, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +_PyAST_Yield(expr_ty value, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { expr_ty p; @@ -2774,6 +2788,6 @@ { expr_ty p; - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Yield_kind; @@ -2786,8 +2800,8 @@ } expr_ty -YieldFrom(expr_ty value, int lineno, int col_offset, int end_lineno, int - end_col_offset, PyArena *arena) +_PyAST_YieldFrom(expr_ty value, int lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { expr_ty p; if (!value) { @@ -2795,7 +2809,7 @@ "field 'value' is required for YieldFrom"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = YieldFrom_kind; @@ -2808,9 +2822,9 @@ } expr_ty -Compare(expr_ty left, asdl_int_seq * ops, asdl_expr_seq * comparators, int - lineno, int col_offset, int end_lineno, int end_col_offset, PyArena - *arena) +_PyAST_Compare(expr_ty left, asdl_int_seq * ops, asdl_expr_seq * comparators, + int lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena) { expr_ty p; if (!left) { @@ -2818,7 +2832,7 @@ "field 'left' is required for Compare"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Compare_kind; @@ -2833,8 +2847,9 @@ } expr_ty -Call(expr_ty func, asdl_expr_seq * args, asdl_keyword_seq * keywords, int - lineno, int col_offset, int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_Call(expr_ty func, asdl_expr_seq * args, asdl_keyword_seq * keywords, + int lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena) { expr_ty p; if (!func) { @@ -2842,7 +2857,7 @@ "field 'func' is required for Call"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Call_kind; @@ -2857,9 +2872,9 @@ } expr_ty -FormattedValue(expr_ty value, int conversion, expr_ty format_spec, int lineno, - int col_offset, int end_lineno, int end_col_offset, PyArena - *arena) +_PyAST_FormattedValue(expr_ty value, int conversion, expr_ty format_spec, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { expr_ty p; if (!value) { @@ -2867,7 +2882,7 @@ "field 'value' is required for FormattedValue"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = FormattedValue_kind; @@ -2882,7 +2897,7 @@ } expr_ty -JoinedStr(asdl_expr_seq * values, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena) +_PyAST_JoinedStr(asdl_expr_seq * values, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; @@ -2887,6 +2902,6 @@ { expr_ty p; - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = JoinedStr_kind; @@ -2899,8 +2914,8 @@ } expr_ty -Constant(constant value, string kind, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +_PyAST_Constant(constant value, string kind, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!value) { @@ -2908,7 +2923,7 @@ "field 'value' is required for Constant"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Constant_kind; @@ -2922,8 +2937,9 @@ } expr_ty -Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int + lineno, int col_offset, int end_lineno, int end_col_offset, + PyArena *arena) { expr_ty p; if (!value) { @@ -2941,7 +2957,7 @@ "field 'ctx' is required for Attribute"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Attribute_kind; @@ -2956,8 +2972,9 @@ } expr_ty -Subscript(expr_ty value, expr_ty slice, expr_context_ty ctx, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_Subscript(expr_ty value, expr_ty slice, expr_context_ty ctx, int lineno, + int col_offset, int end_lineno, int end_col_offset, PyArena + *arena) { expr_ty p; if (!value) { @@ -2975,7 +2992,7 @@ "field 'ctx' is required for Subscript"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Subscript_kind; @@ -2990,8 +3007,8 @@ } expr_ty -Starred(expr_ty value, expr_context_ty ctx, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +_PyAST_Starred(expr_ty value, expr_context_ty ctx, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!value) { @@ -3004,7 +3021,7 @@ "field 'ctx' is required for Starred"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Starred_kind; @@ -3018,8 +3035,8 @@ } expr_ty -Name(identifier id, expr_context_ty ctx, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +_PyAST_Name(identifier id, expr_context_ty ctx, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!id) { @@ -3032,7 +3049,7 @@ "field 'ctx' is required for Name"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Name_kind; @@ -3046,8 +3063,8 @@ } expr_ty -List(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +_PyAST_List(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!ctx) { @@ -3055,7 +3072,7 @@ "field 'ctx' is required for List"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = List_kind; @@ -3069,8 +3086,8 @@ } expr_ty -Tuple(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_Tuple(asdl_expr_seq * elts, expr_context_ty ctx, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!ctx) { @@ -3078,7 +3095,7 @@ "field 'ctx' is required for Tuple"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Tuple_kind; @@ -3092,7 +3109,7 @@ } expr_ty -Slice(expr_ty lower, expr_ty upper, expr_ty step, int lineno, int col_offset, - int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_Slice(expr_ty lower, expr_ty upper, expr_ty step, int lineno, int + col_offset, int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; @@ -3097,6 +3114,6 @@ { expr_ty p; - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = Slice_kind; @@ -3111,8 +3128,8 @@ } expr_ty -MatchAs(expr_ty pattern, identifier name, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +_PyAST_MatchAs(expr_ty pattern, identifier name, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; if (!pattern) { @@ -3125,7 +3142,7 @@ "field 'name' is required for MatchAs"); return NULL; } - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = MatchAs_kind; @@ -3139,7 +3156,7 @@ } expr_ty -MatchOr(asdl_expr_seq * patterns, int lineno, int col_offset, int end_lineno, - int end_col_offset, PyArena *arena) +_PyAST_MatchOr(asdl_expr_seq * patterns, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { expr_ty p; @@ -3144,6 +3161,6 @@ { expr_ty p; - p = (expr_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = MatchOr_kind; @@ -3156,8 +3173,8 @@ } comprehension_ty -comprehension(expr_ty target, expr_ty iter, asdl_expr_seq * ifs, int is_async, - PyArena *arena) +_PyAST_comprehension(expr_ty target, expr_ty iter, asdl_expr_seq * ifs, int + is_async, PyArena *arena) { comprehension_ty p; if (!target) { @@ -3170,7 +3187,7 @@ "field 'iter' is required for comprehension"); return NULL; } - p = (comprehension_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (comprehension_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->target = target; @@ -3181,8 +3198,8 @@ } excepthandler_ty -ExceptHandler(expr_ty type, identifier name, asdl_stmt_seq * body, int lineno, - int col_offset, int end_lineno, int end_col_offset, PyArena - *arena) +_PyAST_ExceptHandler(expr_ty type, identifier name, asdl_stmt_seq * body, int + lineno, int col_offset, int end_lineno, int + end_col_offset, PyArena *arena) { excepthandler_ty p; @@ -3187,6 +3204,6 @@ { excepthandler_ty p; - p = (excepthandler_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (excepthandler_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = ExceptHandler_kind; @@ -3201,8 +3218,9 @@ } arguments_ty -arguments(asdl_arg_seq * posonlyargs, asdl_arg_seq * args, arg_ty vararg, - asdl_arg_seq * kwonlyargs, asdl_expr_seq * kw_defaults, arg_ty kwarg, - asdl_expr_seq * defaults, PyArena *arena) +_PyAST_arguments(asdl_arg_seq * posonlyargs, asdl_arg_seq * args, arg_ty + vararg, asdl_arg_seq * kwonlyargs, asdl_expr_seq * + kw_defaults, arg_ty kwarg, asdl_expr_seq * defaults, PyArena + *arena) { arguments_ty p; @@ -3207,6 +3225,6 @@ { arguments_ty p; - p = (arguments_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (arguments_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->posonlyargs = posonlyargs; @@ -3220,8 +3238,8 @@ } arg_ty -arg(identifier arg, expr_ty annotation, string type_comment, int lineno, int - col_offset, int end_lineno, int end_col_offset, PyArena *arena) +_PyAST_arg(identifier arg, expr_ty annotation, string type_comment, int lineno, + int col_offset, int end_lineno, int end_col_offset, PyArena *arena) { arg_ty p; if (!arg) { @@ -3229,7 +3247,7 @@ "field 'arg' is required for arg"); return NULL; } - p = (arg_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (arg_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->arg = arg; @@ -3243,8 +3261,8 @@ } keyword_ty -keyword(identifier arg, expr_ty value, int lineno, int col_offset, int - end_lineno, int end_col_offset, PyArena *arena) +_PyAST_keyword(identifier arg, expr_ty value, int lineno, int col_offset, int + end_lineno, int end_col_offset, PyArena *arena) { keyword_ty p; if (!value) { @@ -3252,7 +3270,7 @@ "field 'value' is required for keyword"); return NULL; } - p = (keyword_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (keyword_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->arg = arg; @@ -3265,7 +3283,8 @@ } alias_ty -alias(identifier name, identifier asname, PyArena *arena) +_PyAST_alias(identifier name, identifier asname, int lineno, int col_offset, + int end_lineno, int end_col_offset, PyArena *arena) { alias_ty p; if (!name) { @@ -3273,8 +3292,8 @@ "field 'name' is required for alias"); return NULL; } - p = (alias_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (alias_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->name = name; p->asname = asname; @@ -3277,8 +3296,12 @@ if (!p) return NULL; p->name = name; p->asname = asname; + p->lineno = lineno; + p->col_offset = col_offset; + p->end_lineno = end_lineno; + p->end_col_offset = end_col_offset; return p; } withitem_ty @@ -3281,8 +3304,8 @@ return p; } withitem_ty -withitem(expr_ty context_expr, expr_ty optional_vars, PyArena *arena) +_PyAST_withitem(expr_ty context_expr, expr_ty optional_vars, PyArena *arena) { withitem_ty p; if (!context_expr) { @@ -3290,7 +3313,7 @@ "field 'context_expr' is required for withitem"); return NULL; } - p = (withitem_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (withitem_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->context_expr = context_expr; @@ -3299,7 +3322,8 @@ } match_case_ty -match_case(expr_ty pattern, expr_ty guard, asdl_stmt_seq * body, PyArena *arena) +_PyAST_match_case(expr_ty pattern, expr_ty guard, asdl_stmt_seq * body, PyArena + *arena) { match_case_ty p; if (!pattern) { @@ -3307,7 +3331,7 @@ "field 'pattern' is required for match_case"); return NULL; } - p = (match_case_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (match_case_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->pattern = pattern; @@ -3317,7 +3341,7 @@ } type_ignore_ty -TypeIgnore(int lineno, string tag, PyArena *arena) +_PyAST_TypeIgnore(int lineno, string tag, PyArena *arena) { type_ignore_ty p; if (!tag) { @@ -3325,7 +3349,7 @@ "field 'tag' is required for TypeIgnore"); return NULL; } - p = (type_ignore_ty)PyArena_Malloc(arena, sizeof(*p)); + p = (type_ignore_ty)_PyArena_Malloc(arena, sizeof(*p)); if (!p) return NULL; p->kind = TypeIgnore_kind; @@ -4843,6 +4867,26 @@ if (PyObject_SetAttr(result, state->asname, value) == -1) goto failed; Py_DECREF(value); + value = ast2obj_int(state, o->lineno); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->lineno, value) < 0) + goto failed; + Py_DECREF(value); + value = ast2obj_int(state, o->col_offset); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->col_offset, value) < 0) + goto failed; + Py_DECREF(value); + value = ast2obj_int(state, o->end_lineno); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->end_lineno, value) < 0) + goto failed; + Py_DECREF(value); + value = ast2obj_int(state, o->end_col_offset); + if (!value) goto failed; + if (PyObject_SetAttr(result, state->end_col_offset, value) < 0) + goto failed; + Py_DECREF(value); return result; failed: Py_XDECREF(value); @@ -5034,7 +5078,7 @@ } Py_CLEAR(tmp); } - *out = Module(body, type_ignores, arena); + *out = _PyAST_Module(body, type_ignores, arena); if (*out == NULL) goto failed; return 0; } @@ -5079,7 +5123,7 @@ } Py_CLEAR(tmp); } - *out = Interactive(body, arena); + *out = _PyAST_Interactive(body, arena); if (*out == NULL) goto failed; return 0; } @@ -5104,7 +5148,7 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Expression(body, arena); + *out = _PyAST_Expression(body, arena); if (*out == NULL) goto failed; return 0; } @@ -5163,7 +5207,7 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = FunctionType(argtypes, returns, arena); + *out = _PyAST_FunctionType(argtypes, returns, arena); if (*out == NULL) goto failed; return 0; } @@ -5374,9 +5418,9 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = FunctionDef(name, args, body, decorator_list, returns, - type_comment, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_FunctionDef(name, args, body, decorator_list, returns, + type_comment, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -5511,9 +5555,10 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = AsyncFunctionDef(name, args, body, decorator_list, returns, - type_comment, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_AsyncFunctionDef(name, args, body, decorator_list, + returns, type_comment, lineno, + col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } @@ -5674,8 +5719,9 @@ } Py_CLEAR(tmp); } - *out = ClassDef(name, bases, keywords, body, decorator_list, lineno, - col_offset, end_lineno, end_col_offset, arena); + *out = _PyAST_ClassDef(name, bases, keywords, body, decorator_list, + lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } @@ -5700,8 +5746,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Return(value, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = _PyAST_Return(value, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -5746,8 +5792,8 @@ } Py_CLEAR(tmp); } - *out = Delete(targets, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = _PyAST_Delete(targets, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -5820,8 +5866,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Assign(targets, value, type_comment, lineno, col_offset, - end_lineno, end_col_offset, arena); + *out = _PyAST_Assign(targets, value, type_comment, lineno, col_offset, + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -5874,8 +5920,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = AugAssign(target, op, value, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_AugAssign(target, op, value, lineno, col_offset, + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -5942,8 +5988,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = AnnAssign(target, annotation, value, simple, lineno, col_offset, - end_lineno, end_col_offset, arena); + *out = _PyAST_AnnAssign(target, annotation, value, simple, lineno, + col_offset, end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -6064,8 +6110,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = For(target, iter, body, orelse, type_comment, lineno, - col_offset, end_lineno, end_col_offset, arena); + *out = _PyAST_For(target, iter, body, orelse, type_comment, lineno, + col_offset, end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -6186,8 +6232,9 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = AsyncFor(target, iter, body, orelse, type_comment, lineno, - col_offset, end_lineno, end_col_offset, arena); + *out = _PyAST_AsyncFor(target, iter, body, orelse, type_comment, + lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } @@ -6280,8 +6327,8 @@ } Py_CLEAR(tmp); } - *out = While(test, body, orelse, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_While(test, body, orelse, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -6374,8 +6421,8 @@ } Py_CLEAR(tmp); } - *out = If(test, body, orelse, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_If(test, body, orelse, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -6468,8 +6515,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = With(items, body, type_comment, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_With(items, body, type_comment, lineno, col_offset, + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -6562,8 +6609,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = AsyncWith(items, body, type_comment, lineno, col_offset, - end_lineno, end_col_offset, arena); + *out = _PyAST_AsyncWith(items, body, type_comment, lineno, col_offset, + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -6622,8 +6669,8 @@ } Py_CLEAR(tmp); } - *out = Match(subject, cases, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_Match(subject, cases, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -6662,8 +6709,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Raise(exc, cause, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_Raise(exc, cause, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -6810,8 +6857,8 @@ } Py_CLEAR(tmp); } - *out = Try(body, handlers, orelse, finalbody, lineno, col_offset, - end_lineno, end_col_offset, arena); + *out = _PyAST_Try(body, handlers, orelse, finalbody, lineno, + col_offset, end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -6850,8 +6897,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Assert(test, msg, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_Assert(test, msg, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -6896,8 +6943,8 @@ } Py_CLEAR(tmp); } - *out = Import(names, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = _PyAST_Import(names, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -6970,8 +7017,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = ImportFrom(module, names, level, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_ImportFrom(module, names, level, lineno, col_offset, + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7016,8 +7063,8 @@ } Py_CLEAR(tmp); } - *out = Global(names, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = _PyAST_Global(names, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7062,8 +7109,8 @@ } Py_CLEAR(tmp); } - *out = Nonlocal(names, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = _PyAST_Nonlocal(names, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7088,8 +7135,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Expr(value, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = _PyAST_Expr(value, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7100,7 +7147,8 @@ } if (isinstance) { - *out = Pass(lineno, col_offset, end_lineno, end_col_offset, arena); + *out = _PyAST_Pass(lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } @@ -7111,7 +7159,8 @@ } if (isinstance) { - *out = Break(lineno, col_offset, end_lineno, end_col_offset, arena); + *out = _PyAST_Break(lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } @@ -7122,7 +7171,8 @@ } if (isinstance) { - *out = Continue(lineno, col_offset, end_lineno, end_col_offset, arena); + *out = _PyAST_Continue(lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } @@ -7257,8 +7307,8 @@ } Py_CLEAR(tmp); } - *out = BoolOp(op, values, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_BoolOp(op, values, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7297,8 +7347,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = NamedExpr(target, value, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_NamedExpr(target, value, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7351,8 +7401,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = BinOp(left, op, right, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_BinOp(left, op, right, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7391,8 +7441,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = UnaryOp(op, operand, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_UnaryOp(op, operand, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7431,8 +7481,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Lambda(args, body, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_Lambda(args, body, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7485,8 +7535,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = IfExp(test, body, orelse, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_IfExp(test, body, orelse, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7565,8 +7615,8 @@ } Py_CLEAR(tmp); } - *out = Dict(keys, values, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_Dict(keys, values, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7611,7 +7661,8 @@ } Py_CLEAR(tmp); } - *out = Set(elts, lineno, col_offset, end_lineno, end_col_offset, arena); + *out = _PyAST_Set(elts, lineno, col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } @@ -7670,8 +7721,8 @@ } Py_CLEAR(tmp); } - *out = ListComp(elt, generators, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_ListComp(elt, generators, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7730,8 +7781,8 @@ } Py_CLEAR(tmp); } - *out = SetComp(elt, generators, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_SetComp(elt, generators, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7804,8 +7855,8 @@ } Py_CLEAR(tmp); } - *out = DictComp(key, value, generators, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_DictComp(key, value, generators, lineno, col_offset, + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7864,8 +7915,8 @@ } Py_CLEAR(tmp); } - *out = GeneratorExp(elt, generators, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_GeneratorExp(elt, generators, lineno, col_offset, + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7890,8 +7941,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Await(value, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = _PyAST_Await(value, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7916,8 +7967,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Yield(value, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = _PyAST_Yield(value, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -7942,8 +7993,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = YieldFrom(value, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = _PyAST_YieldFrom(value, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -8036,8 +8087,8 @@ } Py_CLEAR(tmp); } - *out = Compare(left, ops, comparators, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_Compare(left, ops, comparators, lineno, col_offset, + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -8130,8 +8181,8 @@ } Py_CLEAR(tmp); } - *out = Call(func, args, keywords, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_Call(func, args, keywords, lineno, col_offset, + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -8184,8 +8235,9 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = FormattedValue(value, conversion, format_spec, lineno, - col_offset, end_lineno, end_col_offset, arena); + *out = _PyAST_FormattedValue(value, conversion, format_spec, lineno, + col_offset, end_lineno, end_col_offset, + arena); if (*out == NULL) goto failed; return 0; } @@ -8230,8 +8282,8 @@ } Py_CLEAR(tmp); } - *out = JoinedStr(values, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_JoinedStr(values, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -8270,8 +8322,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Constant(value, kind, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_Constant(value, kind, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -8324,8 +8376,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Attribute(value, attr, ctx, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_Attribute(value, attr, ctx, lineno, col_offset, + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -8378,8 +8430,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Subscript(value, slice, ctx, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_Subscript(value, slice, ctx, lineno, col_offset, + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -8418,8 +8470,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Starred(value, ctx, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_Starred(value, ctx, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -8458,8 +8510,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Name(id, ctx, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = _PyAST_Name(id, ctx, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -8518,8 +8570,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = List(elts, ctx, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = _PyAST_List(elts, ctx, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -8578,8 +8630,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Tuple(elts, ctx, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = _PyAST_Tuple(elts, ctx, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -8632,8 +8684,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = Slice(lower, upper, step, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_Slice(lower, upper, step, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -8672,8 +8724,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = MatchAs(pattern, name, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_MatchAs(pattern, name, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -8718,8 +8770,8 @@ } Py_CLEAR(tmp); } - *out = MatchOr(patterns, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_MatchOr(patterns, lineno, col_offset, end_lineno, + end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -9123,7 +9175,7 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = comprehension(target, iter, ifs, is_async, arena); + *out = _PyAST_comprehension(target, iter, ifs, is_async, arena); return 0; failed: Py_XDECREF(tmp); @@ -9268,8 +9320,8 @@ } Py_CLEAR(tmp); } - *out = ExceptHandler(type, name, body, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_ExceptHandler(type, name, body, lineno, col_offset, + end_lineno, end_col_offset, arena); if (*out == NULL) goto failed; return 0; } @@ -9484,8 +9536,8 @@ } Py_CLEAR(tmp); } - *out = arguments(posonlyargs, args, vararg, kwonlyargs, kw_defaults, kwarg, - defaults, arena); + *out = _PyAST_arguments(posonlyargs, args, vararg, kwonlyargs, kw_defaults, + kwarg, defaults, arena); return 0; failed: Py_XDECREF(tmp); @@ -9595,8 +9647,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = arg(arg, annotation, type_comment, lineno, col_offset, end_lineno, - end_col_offset, arena); + *out = _PyAST_arg(arg, annotation, type_comment, lineno, col_offset, + end_lineno, end_col_offset, arena); return 0; failed: Py_XDECREF(tmp); @@ -9693,8 +9745,8 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = keyword(arg, value, lineno, col_offset, end_lineno, end_col_offset, - arena); + *out = _PyAST_keyword(arg, value, lineno, col_offset, end_lineno, + end_col_offset, arena); return 0; failed: Py_XDECREF(tmp); @@ -9708,6 +9760,10 @@ PyObject* tmp = NULL; identifier name; identifier asname; + int lineno; + int col_offset; + int end_lineno; + int end_col_offset; if (_PyObject_LookupAttr(obj, state->name, &tmp) < 0) { return 1; @@ -9735,7 +9791,60 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = alias(name, asname, arena); + if (_PyObject_LookupAttr(obj, state->lineno, &tmp) < 0) { + return 1; + } + if (tmp == NULL) { + PyErr_SetString(PyExc_TypeError, "required field \"lineno\" missing from alias"); + return 1; + } + else { + int res; + res = obj2ast_int(state, tmp, &lineno, arena); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->col_offset, &tmp) < 0) { + return 1; + } + if (tmp == NULL) { + PyErr_SetString(PyExc_TypeError, "required field \"col_offset\" missing from alias"); + return 1; + } + else { + int res; + res = obj2ast_int(state, tmp, &col_offset, arena); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->end_lineno, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + end_lineno = 0; + } + else { + int res; + res = obj2ast_int(state, tmp, &end_lineno, arena); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + if (_PyObject_LookupAttr(obj, state->end_col_offset, &tmp) < 0) { + return 1; + } + if (tmp == NULL || tmp == Py_None) { + Py_CLEAR(tmp); + end_col_offset = 0; + } + else { + int res; + res = obj2ast_int(state, tmp, &end_col_offset, arena); + if (res != 0) goto failed; + Py_CLEAR(tmp); + } + *out = _PyAST_alias(name, asname, lineno, col_offset, end_lineno, + end_col_offset, arena); return 0; failed: Py_XDECREF(tmp); @@ -9776,7 +9885,7 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = withitem(context_expr, optional_vars, arena); + *out = _PyAST_withitem(context_expr, optional_vars, arena); return 0; failed: Py_XDECREF(tmp); @@ -9851,7 +9960,7 @@ } Py_CLEAR(tmp); } - *out = match_case(pattern, guard, body, arena); + *out = _PyAST_match_case(pattern, guard, body, arena); return 0; failed: Py_XDECREF(tmp); @@ -9906,7 +10015,7 @@ if (res != 0) goto failed; Py_CLEAR(tmp); } - *out = TypeIgnore(lineno, tag, arena); + *out = _PyAST_TypeIgnore(lineno, tag, arena); if (*out == NULL) goto failed; return 0; } diff --git a/Python/asdl.c b/Python/asdl.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL2FzZGwuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL2FzZGwuYw== 100644 --- a/Python/asdl.c +++ b/Python/asdl.c @@ -1,5 +1,5 @@ #include "Python.h" -#include "asdl.h" +#include "pycore_asdl.h" GENERATE_ASDL_SEQ_CONSTRUCTOR(generic, void*); GENERATE_ASDL_SEQ_CONSTRUCTOR(identifier, PyObject*); diff --git a/Python/ast.c b/Python/ast.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL2FzdC5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL2FzdC5j 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3,8 +3,7 @@ * of the given abstract syntax tree (potentially constructed manually). */ #include "Python.h" -#include "Python-ast.h" -#include "ast.h" +#include "pycore_ast.h" // asdl_stmt_seq #include <assert.h> diff --git a/Python/ast_opt.c b/Python/ast_opt.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL2FzdF9vcHQuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL2FzdF9vcHQuYw== 100644 --- a/Python/ast_opt.c +++ b/Python/ast_opt.c @@ -1,6 +1,7 @@ /* AST Optimizer */ #include "Python.h" #include "pycore_ast.h" // _PyAST_GetDocString() +#include "pycore_compile.h" // _PyASTOptimizeState static int @@ -15,7 +16,7 @@ PyErr_Clear(); return 1; } - if (PyArena_AddPyObject(arena, val) < 0) { + if (_PyArena_AddPyObject(arena, val) < 0) { Py_DECREF(val); return 0; } @@ -450,8 +451,9 @@ return 0; } asdl_seq_SET(values, 0, st->v.Expr.value); - expr_ty expr = JoinedStr(values, st->lineno, st->col_offset, - st->end_lineno, st->end_col_offset, ctx_); + expr_ty expr = _PyAST_JoinedStr(values, st->lineno, st->col_offset, + st->end_lineno, st->end_col_offset, + ctx_); if (!expr) { return 0; } diff --git a/Python/ast_unparse.c b/Python/ast_unparse.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL2FzdF91bnBhcnNlLmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL2FzdF91bnBhcnNlLmM= 100644 --- a/Python/ast_unparse.c +++ b/Python/ast_unparse.c @@ -1,2 +1,4 @@ -#include <float.h> /* DBL_MAX_10_EXP */ +#include "Python.h" +#include "pycore_ast.h" // expr_ty +#include <float.h> // DBL_MAX_10_EXP #include <stdbool.h> @@ -2,6 +4,4 @@ #include <stdbool.h> -#include "Python.h" -#include "Python-ast.h" static PyObject *_str_open_br; static PyObject *_str_dbl_open_br; diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL2JsdGlubW9kdWxlLmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL2JsdGlubW9kdWxlLmM= 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -2,6 +2,4 @@ #include "Python.h" #include <ctype.h> -#include "ast.h" -#undef Yield /* undefine macro conflicting with <winbase.h> */ #include "pycore_ast.h" // _PyAST_Validate() @@ -7,4 +5,5 @@ #include "pycore_ast.h" // _PyAST_Validate() +#include "pycore_compile.h" // _PyAST_Compile() #include "pycore_object.h" // _Py_AddToAllObjects() #include "pycore_pyerrors.h" // _PyErr_NoMemory() #include "pycore_pystate.h" // _PyThreadState_GET() @@ -828,8 +827,8 @@ PyArena *arena; mod_ty mod; - arena = PyArena_New(); + arena = _PyArena_New(); if (arena == NULL) goto error; mod = PyAST_obj2mod(source, arena, compile_mode); if (mod == NULL) { @@ -832,8 +831,8 @@ if (arena == NULL) goto error; mod = PyAST_obj2mod(source, arena, compile_mode); if (mod == NULL) { - PyArena_Free(arena); + _PyArena_Free(arena); goto error; } if (!_PyAST_Validate(mod)) { @@ -837,6 +836,6 @@ goto error; } if (!_PyAST_Validate(mod)) { - PyArena_Free(arena); + _PyArena_Free(arena); goto error; } @@ -841,8 +840,8 @@ goto error; } - result = (PyObject*)PyAST_CompileObject(mod, filename, - &cf, optimize, arena); - PyArena_Free(arena); + result = (PyObject*)_PyAST_Compile(mod, filename, + &cf, optimize, arena); + _PyArena_Free(arena); } goto finally; } @@ -1264,8 +1263,48 @@ } lz->iters = iters; func = PyTuple_GET_ITEM(args, 0); - Py_INCREF(func); - lz->func = func; + lz->func = Py_NewRef(func); + + return (PyObject *)lz; +} + +static PyObject * +map_vectorcall(PyObject *type, PyObject * const*args, + size_t nargsf, PyObject *kwnames) +{ + PyTypeObject *tp = (PyTypeObject *)type; + if (tp == &PyMap_Type && !_PyArg_NoKwnames("map", kwnames)) { + return NULL; + } + + Py_ssize_t nargs = PyVectorcall_NARGS(nargsf); + if (nargs < 2) { + PyErr_SetString(PyExc_TypeError, + "map() must have at least two arguments."); + return NULL; + } + + PyObject *iters = PyTuple_New(nargs-1); + if (iters == NULL) { + return NULL; + } + + for (int i=1; i<nargs; i++) { + PyObject *it = PyObject_GetIter(args[i]); + if (it == NULL) { + Py_DECREF(iters); + return NULL; + } + PyTuple_SET_ITEM(iters, i-1, it); + } + + mapobject *lz = (mapobject *)tp->tp_alloc(tp, 0); + if (lz == NULL) { + Py_DECREF(iters); + return NULL; + } + lz->iters = iters; + lz->func = Py_NewRef(args[0]); return (PyObject *)lz; } @@ -1403,6 +1442,7 @@ PyType_GenericAlloc, /* tp_alloc */ map_new, /* tp_new */ PyObject_GC_Del, /* tp_free */ + .tp_vectorcall = (vectorcallfunc)map_vectorcall }; @@ -1571,6 +1611,62 @@ /*[clinic input] +aiter as builtin_aiter + + async_iterable: object + / + +Return an AsyncIterator for an AsyncIterable object. +[clinic start generated code]*/ + +static PyObject * +builtin_aiter(PyObject *module, PyObject *async_iterable) +/*[clinic end generated code: output=1bae108d86f7960e input=473993d0cacc7d23]*/ +{ + return PyObject_GetAiter(async_iterable); +} + +PyObject *PyAnextAwaitable_New(PyObject *, PyObject *); + +/*[clinic input] +anext as builtin_anext + + aiterator: object + default: object = NULL + / + +Return the next item from the async iterator. +[clinic start generated code]*/ + +static PyObject * +builtin_anext_impl(PyObject *module, PyObject *aiterator, + PyObject *default_value) +/*[clinic end generated code: output=f02c060c163a81fa input=699d11f4e38eca24]*/ +{ + PyTypeObject *t; + PyObject *awaitable; + + t = Py_TYPE(aiterator); + if (t->tp_as_async == NULL || t->tp_as_async->am_anext == NULL) { + PyErr_Format(PyExc_TypeError, + "'%.200s' object is not an async iterator", + t->tp_name); + return NULL; + } + + awaitable = (*t->tp_as_async->am_anext)(aiterator); + if (default_value == NULL) { + return awaitable; + } + + PyObject* new_awaitable = PyAnextAwaitable_New( + awaitable, default_value); + Py_DECREF(awaitable); + return new_awaitable; +} + + +/*[clinic input] len as builtin_len obj: object @@ -2858,8 +2954,9 @@ BUILTIN_ISINSTANCE_METHODDEF BUILTIN_ISSUBCLASS_METHODDEF {"iter", (PyCFunction)(void(*)(void))builtin_iter, METH_FASTCALL, iter_doc}, + BUILTIN_AITER_METHODDEF BUILTIN_LEN_METHODDEF BUILTIN_LOCALS_METHODDEF {"max", (PyCFunction)(void(*)(void))builtin_max, METH_VARARGS | METH_KEYWORDS, max_doc}, {"min", (PyCFunction)(void(*)(void))builtin_min, METH_VARARGS | METH_KEYWORDS, min_doc}, {"next", (PyCFunction)(void(*)(void))builtin_next, METH_FASTCALL, next_doc}, @@ -2861,8 +2958,9 @@ BUILTIN_LEN_METHODDEF BUILTIN_LOCALS_METHODDEF {"max", (PyCFunction)(void(*)(void))builtin_max, METH_VARARGS | METH_KEYWORDS, max_doc}, {"min", (PyCFunction)(void(*)(void))builtin_min, METH_VARARGS | METH_KEYWORDS, min_doc}, {"next", (PyCFunction)(void(*)(void))builtin_next, METH_FASTCALL, next_doc}, + BUILTIN_ANEXT_METHODDEF BUILTIN_OCT_METHODDEF BUILTIN_ORD_METHODDEF BUILTIN_POW_METHODDEF diff --git a/Python/ceval.c b/Python/ceval.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL2NldmFsLmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL2NldmFsLmM= 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1,4 +1,3 @@ - /* Execute compiled code */ /* XXX TO DO: @@ -38,6 +37,7 @@ PyCodeObject *code; // The code object for the bounds. May be NULL. int instr_prev; // Only valid if code != NULL. PyCodeAddressRange bounds; // Only valid if code != NULL. + CFrame cframe; } PyTraceInfo; @@ -1029,10 +1029,4 @@ int match_self = 0; match_args = PyObject_GetAttrString(type, "__match_args__"); if (match_args) { - if (PyList_CheckExact(match_args)) { - Py_SETREF(match_args, PyList_AsTuple(match_args)); - } - if (match_args == NULL) { - goto fail; - } if (!PyTuple_CheckExact(match_args)) { @@ -1038,6 +1032,5 @@ if (!PyTuple_CheckExact(match_args)) { - const char *e = "%s.__match_args__ must be a list or tuple " - "(got %s)"; + const char *e = "%s.__match_args__ must be a tuple (got %s)"; _PyErr_Format(tstate, PyExc_TypeError, e, ((PyTypeObject *)type)->tp_name, Py_TYPE(match_args)->tp_name); @@ -1117,8 +1110,6 @@ static int do_raise(PyThreadState *tstate, PyObject *exc, PyObject *cause); static int unpack_iterable(PyThreadState *, PyObject *, int, int, PyObject **); -#define _Py_TracingPossible(ceval) ((ceval)->tracing_possible) - PyObject * PyEval_EvalCode(PyObject *co, PyObject *globals, PyObject *locals) @@ -1231,40 +1222,6 @@ return 0; } -PyObject* _Py_HOT_FUNCTION -_PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) -{ - _Py_EnsureTstateNotNULL(tstate); - -#ifdef DXPAIRS - int lastopcode = 0; -#endif - PyObject **stack_pointer; /* Next free slot in value stack */ - const _Py_CODEUNIT *next_instr; - int opcode; /* Current opcode */ - int oparg; /* Current opcode argument, if any */ - PyObject **fastlocals, **freevars; - PyObject *retval = NULL; /* Return value */ - struct _ceval_state * const ceval2 = &tstate->interp->ceval; - _Py_atomic_int * const eval_breaker = &ceval2->eval_breaker; - PyCodeObject *co; - - /* when tracing we set things up so that - - not (instr_lb <= current_bytecode_offset < instr_ub) - - is true when the line being executed has changed. The - initial values are such as to make this false the first - time it is tested. */ - - const _Py_CODEUNIT *first_instr; - PyObject *names; - PyObject *consts; - _PyOpcache *co_opcache; - -#ifdef LLTRACE - _Py_IDENTIFIER(__ltrace__); -#endif /* Computed GOTOs, or the-optimization-commonly-but-improperly-known-as-"threaded code" @@ -1305,6 +1262,23 @@ -fno-crossjumping). */ +/* Use macros rather than inline functions, to make it as clear as possible + * to the C compiler that the tracing check is a simple test then branch. + * We want to be sure that the compiler knows this before it generates + * the CFG. + */ +#ifdef LLTRACE +#define OR_LLTRACE || lltrace +#else +#define OR_LLTRACE +#endif + +#ifdef WITH_DTRACE +#define OR_DTRACE_LINE || PyDTrace_LINE_ENABLED() +#else +#define OR_DTRACE_LINE +#endif + #ifdef DYNAMIC_EXECUTION_PROFILE #undef USE_COMPUTED_GOTOS #define USE_COMPUTED_GOTOS 0 @@ -1323,21 +1297,6 @@ #endif #if USE_COMPUTED_GOTOS -/* Import the static jump table */ -#include "opcode_targets.h" - -#define TARGET(op) \ - op: \ - TARGET_##op - -#ifdef LLTRACE -#define FAST_DISPATCH() \ - { \ - if (!lltrace && !_Py_TracingPossible(ceval2) && !PyDTrace_LINE_ENABLED()) { \ - f->f_lasti = INSTR_OFFSET(); \ - NEXTOPARG(); \ - goto *opcode_targets[opcode]; \ - } \ - goto fast_next_opcode; \ - } +#define TARGET(op) op: TARGET_##op +#define DISPATCH_GOTO() goto *opcode_targets[opcode] #else @@ -1343,14 +1302,7 @@ #else -#define FAST_DISPATCH() \ - { \ - if (!_Py_TracingPossible(ceval2) && !PyDTrace_LINE_ENABLED()) { \ - f->f_lasti = INSTR_OFFSET(); \ - NEXTOPARG(); \ - goto *opcode_targets[opcode]; \ - } \ - goto fast_next_opcode; \ - } +#define TARGET(op) op +#define DISPATCH_GOTO() goto dispatch_opcode #endif #define DISPATCH() \ { \ @@ -1353,7 +1305,7 @@ #endif #define DISPATCH() \ { \ - if (!_Py_atomic_load_relaxed(eval_breaker)) { \ - FAST_DISPATCH(); \ + if (trace_info.cframe.use_tracing OR_DTRACE_LINE OR_LLTRACE) { \ + goto tracing_dispatch; \ } \ @@ -1359,4 +1311,11 @@ } \ + f->f_lasti = INSTR_OFFSET(); \ + NEXTOPARG(); \ + DISPATCH_GOTO(); \ + } + +#define CHECK_EVAL_BREAKER() \ + if (_Py_atomic_load_relaxed(eval_breaker)) { \ continue; \ } @@ -1360,12 +1319,6 @@ continue; \ } -#else -#define TARGET(op) op -#define FAST_DISPATCH() goto fast_next_opcode -#define DISPATCH() continue -#endif - /* Tuple access macros */ @@ -1378,11 +1331,10 @@ /* Code access macros */ /* The integer overflow is checked by an assertion below. */ -#define INSTR_OFFSET() \ - (sizeof(_Py_CODEUNIT) * (int)(next_instr - first_instr)) +#define INSTR_OFFSET() ((int)(next_instr - first_instr)) #define NEXTOPARG() do { \ _Py_CODEUNIT word = *next_instr; \ opcode = _Py_OPCODE(word); \ oparg = _Py_OPARG(word); \ next_instr++; \ } while (0) @@ -1383,11 +1335,11 @@ #define NEXTOPARG() do { \ _Py_CODEUNIT word = *next_instr; \ opcode = _Py_OPCODE(word); \ oparg = _Py_OPARG(word); \ next_instr++; \ } while (0) -#define JUMPTO(x) (next_instr = first_instr + (x) / sizeof(_Py_CODEUNIT)) -#define JUMPBY(x) (next_instr += (x) / sizeof(_Py_CODEUNIT)) +#define JUMPTO(x) (next_instr = first_instr + (x)) +#define JUMPBY(x) (next_instr += (x)) /* OpCode prediction macros Some opcodes tend to come in pairs thus making it possible to @@ -1622,10 +1574,40 @@ #endif -/* Start of code */ + +PyObject* _Py_HOT_FUNCTION +_PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) +{ + _Py_EnsureTstateNotNULL(tstate); + +#if USE_COMPUTED_GOTOS +/* Import the static jump table */ +#include "opcode_targets.h" +#endif + +#ifdef DXPAIRS + int lastopcode = 0; +#endif + PyObject **stack_pointer; /* Next free slot in value stack */ + const _Py_CODEUNIT *next_instr; + int opcode; /* Current opcode */ + int oparg; /* Current opcode argument, if any */ + PyObject **fastlocals, **freevars; + PyObject *retval = NULL; /* Return value */ + _Py_atomic_int * const eval_breaker = &tstate->interp->ceval.eval_breaker; + PyCodeObject *co; + + const _Py_CODEUNIT *first_instr; + PyObject *names; + PyObject *consts; + _PyOpcache *co_opcache; + +#ifdef LLTRACE + _Py_IDENTIFIER(__ltrace__); +#endif if (_Py_EnterRecursiveCall(tstate, "")) { return NULL; } PyTraceInfo trace_info; @@ -1626,9 +1608,9 @@ if (_Py_EnterRecursiveCall(tstate, "")) { return NULL; } PyTraceInfo trace_info; - /* Mark trace_info as initialized */ + /* Mark trace_info as uninitialized */ trace_info.code = NULL; @@ -1633,6 +1615,15 @@ trace_info.code = NULL; + /* WARNING: Because the CFrame lives on the C stack, + * but can be accessed from a heap allocated object (tstate) + * strict stack discipline must be maintained. + */ + CFrame *prev_cframe = tstate->cframe; + trace_info.cframe.use_tracing = prev_cframe->use_tracing; + trace_info.cframe.previous = prev_cframe; + tstate->cframe = &trace_info.cframe; + /* push frame */ tstate->frame = f; co = f->f_code; @@ -1635,8 +1626,8 @@ /* push frame */ tstate->frame = f; co = f->f_code; - if (tstate->use_tracing) { + if (trace_info.cframe.use_tracing) { if (tstate->c_tracefunc != NULL) { /* tstate->c_tracefunc, if defined, is a function that will be called on *every* entry @@ -1700,11 +1691,7 @@ to the beginning of the combined pair.) */ assert(f->f_lasti >= -1); - next_instr = first_instr; - if (f->f_lasti >= 0) { - assert(f->f_lasti % sizeof(_Py_CODEUNIT) == 0); - next_instr += f->f_lasti / sizeof(_Py_CODEUNIT) + 1; - } + next_instr = first_instr + f->f_lasti + 1; stack_pointer = f->f_valuestack + f->f_stackdepth; /* Set f->f_stackdepth to -1. * Update when returning or calling trace function. @@ -1767,10 +1754,10 @@ if (_Py_atomic_load_relaxed(eval_breaker)) { opcode = _Py_OPCODE(*next_instr); - if (opcode == SETUP_FINALLY || - opcode == SETUP_WITH || - opcode == BEFORE_ASYNC_WITH || - opcode == YIELD_FROM) { + if (opcode != SETUP_FINALLY && + opcode != SETUP_WITH && + opcode != BEFORE_ASYNC_WITH && + opcode != YIELD_FROM) { /* Few cases where we skip running signal handlers and other pending calls: - If we're about to enter the 'with:'. It will prevent @@ -1787,13 +1774,11 @@ running the signal handler and raising KeyboardInterrupt (see bpo-30039). */ - goto fast_next_opcode; - } - - if (eval_frame_handle_pending(tstate) != 0) { - goto error; - } - } - - fast_next_opcode: + if (eval_frame_handle_pending(tstate) != 0) { + goto error; + } + } + } + + tracing_dispatch: f->f_lasti = INSTR_OFFSET(); @@ -1799,7 +1784,8 @@ f->f_lasti = INSTR_OFFSET(); + NEXTOPARG(); if (PyDTrace_LINE_ENABLED()) maybe_dtrace_line(f, &trace_info); /* line-by-line tracing support */ @@ -1800,10 +1786,10 @@ if (PyDTrace_LINE_ENABLED()) maybe_dtrace_line(f, &trace_info); /* line-by-line tracing support */ - if (_Py_TracingPossible(ceval2) && + if (trace_info.cframe.use_tracing && tstate->c_tracefunc != NULL && !tstate->tracing) { int err; /* see maybe_call_line_trace() @@ -1818,6 +1804,6 @@ JUMPTO(f->f_lasti); stack_pointer = f->f_valuestack+f->f_stackdepth; f->f_stackdepth = -1; - if (err) + if (err) { /* trace function raised an exception */ goto error; @@ -1822,18 +1808,8 @@ /* trace function raised an exception */ goto error; - } - - /* Extract opcode and argument */ - - NEXTOPARG(); - dispatch_opcode: -#ifdef DYNAMIC_EXECUTION_PROFILE -#ifdef DXPAIRS - dxpairs[lastopcode][opcode]++; - lastopcode = opcode; -#endif - dxp[opcode]++; -#endif + } + NEXTOPARG(); + } #ifdef LLTRACE /* Instruction tracing */ @@ -1850,7 +1826,16 @@ } #endif + dispatch_opcode: +#ifdef DYNAMIC_EXECUTION_PROFILE +#ifdef DXPAIRS + dxpairs[lastopcode][opcode]++; + lastopcode = opcode; +#endif + dxp[opcode]++; +#endif + switch (opcode) { /* BEWARE! It is essential that any operation that fails must goto error @@ -1853,7 +1838,7 @@ switch (opcode) { /* BEWARE! It is essential that any operation that fails must goto error - and that all operation that succeed call [FAST_]DISPATCH() ! */ + and that all operation that succeed call DISPATCH() ! */ case TARGET(NOP): { @@ -1858,6 +1843,6 @@ case TARGET(NOP): { - FAST_DISPATCH(); + DISPATCH(); } case TARGET(LOAD_FAST): { @@ -1870,7 +1855,7 @@ } Py_INCREF(value); PUSH(value); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(LOAD_CONST): { @@ -1878,10 +1863,10 @@ PyObject *value = GETITEM(consts, oparg); Py_INCREF(value); PUSH(value); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(STORE_FAST): { PREDICTED(STORE_FAST); PyObject *value = POP(); SETLOCAL(oparg, value); @@ -1882,12 +1867,12 @@ } case TARGET(STORE_FAST): { PREDICTED(STORE_FAST); PyObject *value = POP(); SETLOCAL(oparg, value); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(POP_TOP): { PyObject *value = POP(); Py_DECREF(value); @@ -1889,9 +1874,9 @@ } case TARGET(POP_TOP): { PyObject *value = POP(); Py_DECREF(value); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(ROT_TWO): { @@ -1899,7 +1884,7 @@ PyObject *second = SECOND(); SET_TOP(second); SET_SECOND(top); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(ROT_THREE): { @@ -1909,7 +1894,7 @@ SET_TOP(second); SET_SECOND(third); SET_THIRD(top); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(ROT_FOUR): { @@ -1921,10 +1906,10 @@ SET_SECOND(third); SET_THIRD(fourth); SET_FOURTH(top); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(DUP_TOP): { PyObject *top = TOP(); Py_INCREF(top); PUSH(top); @@ -1925,10 +1910,10 @@ } case TARGET(DUP_TOP): { PyObject *top = TOP(); Py_INCREF(top); PUSH(top); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(DUP_TOP_TWO): { @@ -1939,7 +1924,7 @@ STACK_GROW(2); SET_TOP(top); SET_SECOND(second); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(UNARY_POSITIVE): { @@ -2591,7 +2576,7 @@ gen_status = PyIter_Send(receiver, v, &retval); } else { _Py_IDENTIFIER(send); - if (v == Py_None && PyIter_Check(receiver)) { + if (Py_IsNone(v) && PyIter_Check(receiver)) { retval = Py_TYPE(receiver)->tp_iternext(receiver); } else { @@ -2628,8 +2613,8 @@ assert (gen_status == PYGEN_NEXT); /* receiver remains on stack, retval is value to be yielded */ /* and repeat... */ - assert(f->f_lasti >= (int)sizeof(_Py_CODEUNIT)); - f->f_lasti -= sizeof(_Py_CODEUNIT); + assert(f->f_lasti > 0); + f->f_lasti -= 1; f->f_state = FRAME_SUSPENDED; f->f_stackdepth = (int)(stack_pointer - f->f_valuestack); goto exiting; @@ -2652,6 +2637,30 @@ goto exiting; } + case TARGET(GEN_START): { + PyObject *none = POP(); + Py_DECREF(none); + if (!Py_IsNone(none)) { + if (oparg > 2) { + _PyErr_SetString(tstate, PyExc_SystemError, + "Illegal kind for GEN_START"); + } + else { + static const char *gen_kind[3] = { + "generator", + "coroutine", + "async generator" + }; + _PyErr_Format(tstate, PyExc_TypeError, + "can't send non-None value to a " + "just-started %s", + gen_kind[oparg]); + } + goto error; + } + DISPATCH(); + } + case TARGET(POP_EXCEPT): { PyObject *type, *value, *traceback; _PyErr_StackItem *exc_info; @@ -2704,7 +2713,7 @@ UNWIND_EXCEPT_HANDLER(b); Py_DECREF(POP()); JUMPBY(oparg); - FAST_DISPATCH(); + DISPATCH(); } else { PyObject *val = POP(); @@ -2718,7 +2727,7 @@ PyObject *value = PyExc_AssertionError; Py_INCREF(value); PUSH(value); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(LOAD_BUILD_CLASS): { @@ -3612,7 +3621,7 @@ case TARGET(IS_OP): { PyObject *right = POP(); PyObject *left = TOP(); - int res = (left == right)^oparg; + int res = Py_Is(left, right) ^ oparg; PyObject *b = res ? Py_True : Py_False; Py_INCREF(b); SET_TOP(b); @@ -3620,7 +3629,7 @@ Py_DECREF(right); PREDICT(POP_JUMP_IF_FALSE); PREDICT(POP_JUMP_IF_TRUE); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(CONTAINS_OP): { @@ -3637,7 +3646,7 @@ PUSH(b); PREDICT(POP_JUMP_IF_FALSE); PREDICT(POP_JUMP_IF_TRUE); - FAST_DISPATCH(); + DISPATCH(); } #define CANNOT_CATCH_MSG "catching classes that do not inherit from "\ @@ -3734,10 +3743,10 @@ case TARGET(JUMP_FORWARD): { JUMPBY(oparg); - FAST_DISPATCH(); + DISPATCH(); } case TARGET(POP_JUMP_IF_FALSE): { PREDICTED(POP_JUMP_IF_FALSE); PyObject *cond = POP(); int err; @@ -3738,8 +3747,8 @@ } case TARGET(POP_JUMP_IF_FALSE): { PREDICTED(POP_JUMP_IF_FALSE); PyObject *cond = POP(); int err; - if (cond == Py_True) { + if (Py_IsTrue(cond)) { Py_DECREF(cond); @@ -3745,6 +3754,6 @@ Py_DECREF(cond); - FAST_DISPATCH(); - } - if (cond == Py_False) { + DISPATCH(); + } + if (Py_IsFalse(cond)) { Py_DECREF(cond); JUMPTO(oparg); @@ -3749,6 +3758,6 @@ Py_DECREF(cond); JUMPTO(oparg); - FAST_DISPATCH(); + DISPATCH(); } err = PyObject_IsTrue(cond); Py_DECREF(cond); @@ -3765,5 +3774,5 @@ PREDICTED(POP_JUMP_IF_TRUE); PyObject *cond = POP(); int err; - if (cond == Py_False) { + if (Py_IsFalse(cond)) { Py_DECREF(cond); @@ -3769,6 +3778,6 @@ Py_DECREF(cond); - FAST_DISPATCH(); - } - if (cond == Py_True) { + DISPATCH(); + } + if (Py_IsTrue(cond)) { Py_DECREF(cond); JUMPTO(oparg); @@ -3773,6 +3782,6 @@ Py_DECREF(cond); JUMPTO(oparg); - FAST_DISPATCH(); + DISPATCH(); } err = PyObject_IsTrue(cond); Py_DECREF(cond); @@ -3789,6 +3798,6 @@ case TARGET(JUMP_IF_FALSE_OR_POP): { PyObject *cond = TOP(); int err; - if (cond == Py_True) { + if (Py_IsTrue(cond)) { STACK_SHRINK(1); Py_DECREF(cond); @@ -3793,6 +3802,6 @@ STACK_SHRINK(1); Py_DECREF(cond); - FAST_DISPATCH(); - } - if (cond == Py_False) { + DISPATCH(); + } + if (Py_IsFalse(cond)) { JUMPTO(oparg); @@ -3798,5 +3807,5 @@ JUMPTO(oparg); - FAST_DISPATCH(); + DISPATCH(); } err = PyObject_IsTrue(cond); if (err > 0) { @@ -3813,6 +3822,6 @@ case TARGET(JUMP_IF_TRUE_OR_POP): { PyObject *cond = TOP(); int err; - if (cond == Py_False) { + if (Py_IsFalse(cond)) { STACK_SHRINK(1); Py_DECREF(cond); @@ -3817,6 +3826,6 @@ STACK_SHRINK(1); Py_DECREF(cond); - FAST_DISPATCH(); - } - if (cond == Py_True) { + DISPATCH(); + } + if (Py_IsTrue(cond)) { JUMPTO(oparg); @@ -3822,5 +3831,5 @@ JUMPTO(oparg); - FAST_DISPATCH(); + DISPATCH(); } err = PyObject_IsTrue(cond); if (err > 0) { @@ -3838,14 +3847,5 @@ case TARGET(JUMP_ABSOLUTE): { PREDICTED(JUMP_ABSOLUTE); JUMPTO(oparg); -#if FAST_LOOPS - /* Enabling this path speeds-up all while and for-loops by bypassing - the per-loop checks for signals. By default, this should be turned-off - because it prevents detection of a control-break in tight loops like - "while 1: pass". Compile with this option turned-on when you need - the speed-up and do not need break checking inside tight loops (ones - that contain only instructions ending with FAST_DISPATCH). - */ - FAST_DISPATCH(); -#else + CHECK_EVAL_BREAKER(); DISPATCH(); @@ -3851,5 +3851,4 @@ DISPATCH(); -#endif } case TARGET(GET_LEN): { @@ -3973,7 +3972,7 @@ goto error; } PUSH(values_or_none); - if (values_or_none == Py_None) { + if (Py_IsNone(values_or_none)) { Py_INCREF(Py_False); PUSH(Py_False); DISPATCH(); @@ -4164,7 +4163,7 @@ exc = TOP(); val = SECOND(); tb = THIRD(); - assert(exc != Py_None); + assert(!Py_IsNone(exc)); assert(!PyLong_Check(exc)); exit_func = PEEK(7); PyObject *stack[4] = {NULL, exc, val, tb}; @@ -4260,6 +4259,7 @@ PUSH(res); if (res == NULL) goto error; + CHECK_EVAL_BREAKER(); DISPATCH(); } @@ -4273,6 +4273,7 @@ if (res == NULL) { goto error; } + CHECK_EVAL_BREAKER(); DISPATCH(); } @@ -4292,6 +4293,7 @@ if (res == NULL) { goto error; } + CHECK_EVAL_BREAKER(); DISPATCH(); } @@ -4338,6 +4340,7 @@ if (result == NULL) { goto error; } + CHECK_EVAL_BREAKER(); DISPATCH(); } @@ -4547,7 +4550,7 @@ PUSH(val); PUSH(exc); JUMPTO(handler); - if (_Py_TracingPossible(ceval2)) { + if (trace_info.cframe.use_tracing) { trace_info.instr_prev = INT_MAX; } /* Resume normal execution */ @@ -4571,7 +4574,7 @@ f->f_stackdepth = 0; f->f_state = FRAME_RAISED; exiting: - if (tstate->use_tracing) { + if (trace_info.cframe.use_tracing) { if (tstate->c_tracefunc) { if (call_trace_protected(tstate->c_tracefunc, tstate->c_traceobj, tstate, f, &trace_info, PyTrace_RETURN, retval)) { @@ -4588,6 +4591,10 @@ /* pop frame */ exit_eval_frame: + /* Restore previous cframe */ + tstate->cframe = trace_info.cframe.previous; + tstate->cframe->use_tracing = trace_info.cframe.use_tracing; + if (PyDTrace_FUNCTION_RETURN_ENABLED()) dtrace_function_return(f); _Py_LeaveRecursiveCall(tstate); @@ -5238,7 +5245,7 @@ type = exc_info->exc_type; value = exc_info->exc_value; tb = exc_info->exc_traceback; - if (type == Py_None || type == NULL) { + if (Py_IsNone(type) || type == NULL) { _PyErr_SetString(tstate, PyExc_RuntimeError, "No active exception to reraise"); return 0; @@ -5296,7 +5303,7 @@ else if (PyExceptionInstance_Check(cause)) { fixed_cause = cause; } - else if (cause == Py_None) { + else if (Py_IsNone(cause)) { Py_DECREF(cause); fixed_cause = NULL; } @@ -5422,7 +5429,6 @@ return 0; } - #ifdef LLTRACE static int prtrace(PyThreadState *tstate, PyObject *v, const char *str) @@ -5512,9 +5518,9 @@ if (tstate->tracing) return 0; tstate->tracing++; - tstate->use_tracing = 0; + tstate->cframe->use_tracing = 0; if (frame->f_lasti < 0) { frame->f_lineno = frame->f_code->co_firstlineno; } else { initialize_trace_info(trace_info, frame); @@ -5516,9 +5522,9 @@ if (frame->f_lasti < 0) { frame->f_lineno = frame->f_code->co_firstlineno; } else { initialize_trace_info(trace_info, frame); - frame->f_lineno = _PyCode_CheckLineNumber(frame->f_lasti, &trace_info->bounds); + frame->f_lineno = _PyCode_CheckLineNumber(frame->f_lasti*2, &trace_info->bounds); } result = func(obj, frame, what, arg); frame->f_lineno = 0; @@ -5522,7 +5528,7 @@ } result = func(obj, frame, what, arg); frame->f_lineno = 0; - tstate->use_tracing = ((tstate->c_tracefunc != NULL) + tstate->cframe->use_tracing = ((tstate->c_tracefunc != NULL) || (tstate->c_profilefunc != NULL)); tstate->tracing--; return result; @@ -5533,7 +5539,7 @@ { PyThreadState *tstate = _PyThreadState_GET(); int save_tracing = tstate->tracing; - int save_use_tracing = tstate->use_tracing; + int save_use_tracing = tstate->cframe->use_tracing; PyObject *result; tstate->tracing = 0; @@ -5537,7 +5543,7 @@ PyObject *result; tstate->tracing = 0; - tstate->use_tracing = ((tstate->c_tracefunc != NULL) + tstate->cframe->use_tracing = ((tstate->c_tracefunc != NULL) || (tstate->c_profilefunc != NULL)); result = PyObject_Call(func, args, NULL); tstate->tracing = save_tracing; @@ -5541,7 +5547,7 @@ || (tstate->c_profilefunc != NULL)); result = PyObject_Call(func, args, NULL); tstate->tracing = save_tracing; - tstate->use_tracing = save_use_tracing; + tstate->cframe->use_tracing = save_use_tracing; return result; } @@ -5559,7 +5565,7 @@ */ initialize_trace_info(trace_info, frame); int lastline = trace_info->bounds.ar_line; - int line = _PyCode_CheckLineNumber(frame->f_lasti, &trace_info->bounds); + int line = _PyCode_CheckLineNumber(frame->f_lasti*2, &trace_info->bounds); if (line != -1 && frame->f_trace_lines) { /* Trace backward edges or first instruction of a new line */ if (frame->f_lasti < trace_info->instr_prev || @@ -5563,7 +5569,7 @@ if (line != -1 && frame->f_trace_lines) { /* Trace backward edges or first instruction of a new line */ if (frame->f_lasti < trace_info->instr_prev || - (line != lastline && frame->f_lasti == trace_info->bounds.ar_start)) + (line != lastline && frame->f_lasti*2 == trace_info->bounds.ar_start)) { result = call_trace(func, obj, tstate, frame, trace_info, PyTrace_LINE, Py_None); } @@ -5595,7 +5601,7 @@ tstate->c_profilefunc = NULL; tstate->c_profileobj = NULL; /* Must make sure that tracing is not ignored if 'profileobj' is freed */ - tstate->use_tracing = tstate->c_tracefunc != NULL; + tstate->cframe->use_tracing = tstate->c_tracefunc != NULL; Py_XDECREF(profileobj); Py_XINCREF(arg); @@ -5603,7 +5609,7 @@ tstate->c_profilefunc = func; /* Flag that tracing or profiling is turned on */ - tstate->use_tracing = (func != NULL) || (tstate->c_tracefunc != NULL); + tstate->cframe->use_tracing = (func != NULL) || (tstate->c_tracefunc != NULL); return 0; } @@ -5631,5 +5637,4 @@ return -1; } - struct _ceval_state *ceval2 = &tstate->interp->ceval; PyObject *traceobj = tstate->c_traceobj; @@ -5635,6 +5640,5 @@ PyObject *traceobj = tstate->c_traceobj; - ceval2->tracing_possible += (func != NULL) - (tstate->c_tracefunc != NULL); tstate->c_tracefunc = NULL; tstate->c_traceobj = NULL; /* Must make sure that profiling is not ignored if 'traceobj' is freed */ @@ -5637,8 +5641,8 @@ tstate->c_tracefunc = NULL; tstate->c_traceobj = NULL; /* Must make sure that profiling is not ignored if 'traceobj' is freed */ - tstate->use_tracing = (tstate->c_profilefunc != NULL); + tstate->cframe->use_tracing = (tstate->c_profilefunc != NULL); Py_XDECREF(traceobj); Py_XINCREF(arg); @@ -5646,7 +5650,7 @@ tstate->c_tracefunc = func; /* Flag that tracing or profiling is turned on */ - tstate->use_tracing = ((func != NULL) + tstate->cframe->use_tracing = ((func != NULL) || (tstate->c_profilefunc != NULL)); return 0; @@ -5841,7 +5845,7 @@ } #define C_TRACE(x, call) \ -if (tstate->use_tracing && tstate->c_profilefunc) { \ +if (trace_info->cframe.use_tracing && tstate->c_profilefunc) { \ if (call_trace(tstate->c_profilefunc, tstate->c_profileobj, \ tstate, tstate->frame, trace_info, \ PyTrace_C_CALL, func)) { \ @@ -5922,7 +5926,7 @@ Py_ssize_t nargs = oparg - nkwargs; PyObject **stack = (*pp_stack) - nargs - nkwargs; - if (tstate->use_tracing) { + if (trace_info->cframe.use_tracing) { x = trace_call_function(tstate, trace_info, func, stack, nargs, kwnames); } else { @@ -5955,7 +5959,7 @@ } else if (Py_IS_TYPE(func, &PyMethodDescr_Type)) { Py_ssize_t nargs = PyTuple_GET_SIZE(callargs); - if (nargs > 0 && tstate->use_tracing) { + if (nargs > 0 && trace_info->cframe.use_tracing) { /* We need to create a temporary bound method as argument for profiling. @@ -5991,7 +5995,7 @@ _PyEval_SliceIndex(PyObject *v, Py_ssize_t *pi) { PyThreadState *tstate = _PyThreadState_GET(); - if (v != Py_None) { + if (!Py_IsNone(v)) { Py_ssize_t x; if (_PyIndex_Check(v)) { x = PyNumber_AsSsize_t(v, NULL); @@ -6482,7 +6486,7 @@ PyCodeObject *code = f->f_code; filename = PyUnicode_AsUTF8(code->co_filename); funcname = PyUnicode_AsUTF8(code->co_name); - lineno = PyCode_Addr2Line(code, f->f_lasti); + lineno = PyFrame_GetLineNumber(f); PyDTrace_FUNCTION_ENTRY(filename, funcname, lineno); } @@ -6497,7 +6501,7 @@ PyCodeObject *code = f->f_code; filename = PyUnicode_AsUTF8(code->co_filename); funcname = PyUnicode_AsUTF8(code->co_name); - lineno = PyCode_Addr2Line(code, f->f_lasti); + lineno = PyFrame_GetLineNumber(f); PyDTrace_FUNCTION_RETURN(filename, funcname, lineno); } @@ -6513,7 +6517,7 @@ instruction window, reset the window. */ initialize_trace_info(trace_info, frame); - int line = _PyCode_CheckLineNumber(frame->f_lasti, &trace_info->bounds); + int line = _PyCode_CheckLineNumber(frame->f_lasti*2, &trace_info->bounds); /* If the last instruction falls at the start of a line or if it represents a jump backwards, update the frame's line number and call the trace function. */ diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL2NsaW5pYy9ibHRpbm1vZHVsZS5jLmg=..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL2NsaW5pYy9ibHRpbm1vZHVsZS5jLmg= 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -530,6 +530,50 @@ #define BUILTIN_HEX_METHODDEF \ {"hex", (PyCFunction)builtin_hex, METH_O, builtin_hex__doc__}, +PyDoc_STRVAR(builtin_aiter__doc__, +"aiter($module, async_iterable, /)\n" +"--\n" +"\n" +"Return an AsyncIterator for an AsyncIterable object."); + +#define BUILTIN_AITER_METHODDEF \ + {"aiter", (PyCFunction)builtin_aiter, METH_O, builtin_aiter__doc__}, + +PyDoc_STRVAR(builtin_anext__doc__, +"anext($module, aiterator, default=<unrepresentable>, /)\n" +"--\n" +"\n" +"Return the next item from the async iterator."); + +#define BUILTIN_ANEXT_METHODDEF \ + {"anext", (PyCFunction)(void(*)(void))builtin_anext, METH_FASTCALL, builtin_anext__doc__}, + +static PyObject * +builtin_anext_impl(PyObject *module, PyObject *aiterator, + PyObject *default_value); + +static PyObject * +builtin_anext(PyObject *module, PyObject *const *args, Py_ssize_t nargs) +{ + PyObject *return_value = NULL; + PyObject *aiterator; + PyObject *default_value = NULL; + + if (!_PyArg_CheckPositional("anext", nargs, 1, 2)) { + goto exit; + } + aiterator = args[0]; + if (nargs < 2) { + goto skip_optional; + } + default_value = args[1]; +skip_optional: + return_value = builtin_anext_impl(module, aiterator, default_value); + +exit: + return return_value; +} + PyDoc_STRVAR(builtin_len__doc__, "len($module, obj, /)\n" "--\n" @@ -830,4 +874,4 @@ exit: return return_value; } -/*[clinic end generated code: output=e2fcf0201790367c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=da9ae459e9233259 input=a9049054013a1b77]*/ diff --git a/Python/compile.c b/Python/compile.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL2NvbXBpbGUuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL2NvbXBpbGUuYw== 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1,7 +1,7 @@ /* * This file compiles an abstract syntax tree (AST) into Python bytecode. * - * The primary entry point is PyAST_Compile(), which returns a + * The primary entry point is _PyAST_Compile(), which returns a * PyCodeObject. The compiler makes several passes to build the code * object: * 1. Checks for future statements. See future.c @@ -23,6 +23,7 @@ #include "Python.h" #include "pycore_ast.h" // _PyAST_GetDocString() +#include "pycore_compile.h" // _PyFuture_FromAST() #include "pycore_pymem.h" // _PyMem_IsPtrFreed() #include "pycore_long.h" // _PyLong_GetZero() #include "pycore_symtable.h" // PySTEntryObject @@ -115,7 +116,8 @@ */ enum fblocktype { WHILE_LOOP, FOR_LOOP, TRY_EXCEPT, FINALLY_TRY, FINALLY_END, - WITH, ASYNC_WITH, HANDLER_CLEANUP, POP_VALUE, EXCEPTION_HANDLER }; + WITH, ASYNC_WITH, HANDLER_CLEANUP, POP_VALUE, EXCEPTION_HANDLER, + ASYNC_COMPREHENSION_GENERATOR }; struct fblockinfo { enum fblocktype fb_type; @@ -350,8 +352,8 @@ } PyCodeObject * -PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, - int optimize, PyArena *arena) +_PyAST_Compile(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, + int optimize, PyArena *arena) { struct compiler c; PyCodeObject *co = NULL; @@ -373,7 +375,7 @@ Py_INCREF(filename); c.c_filename = filename; c.c_arena = arena; - c.c_future = PyFuture_FromASTObject(mod, filename); + c.c_future = _PyFuture_FromAST(mod, filename); if (c.c_future == NULL) goto finally; if (!flags) { @@ -409,21 +411,6 @@ return co; } -PyCodeObject * -PyAST_CompileEx(mod_ty mod, const char *filename_str, PyCompilerFlags *flags, - int optimize, PyArena *arena) -{ - PyObject *filename; - PyCodeObject *co; - filename = PyUnicode_DecodeFSDefault(filename_str); - if (filename == NULL) - return NULL; - co = PyAST_CompileObject(mod, filename, flags, optimize, arena); - Py_DECREF(filename); - return co; - -} - static void compiler_free(struct compiler *c) { @@ -1154,6 +1141,8 @@ return 1; case LIST_TO_TUPLE: return 0; + case GEN_START: + return -1; case LIST_EXTEND: case SET_UPDATE: case DICT_MERGE: @@ -1712,6 +1701,7 @@ switch (info->fb_type) { case WHILE_LOOP: case EXCEPTION_HANDLER: + case ASYNC_COMPREHENSION_GENERATOR: return 1; case FOR_LOOP: @@ -4585,6 +4575,11 @@ } compiler_use_next_block(c, start); + /* Runtime will push a block here, so we need to account for that */ + if (!compiler_push_fblock(c, ASYNC_COMPREHENSION_GENERATOR, start, + NULL, NULL)) { + return 0; + } ADDOP_JUMP(c, SETUP_FINALLY, except); ADDOP(c, GET_ANEXT); @@ -4639,6 +4634,8 @@ compiler_use_next_block(c, if_cleanup); ADDOP_JUMP(c, JUMP_ABSOLUTE, start); + compiler_pop_fblock(c, ASYNC_COMPREHENSION_GENERATOR, start); + compiler_use_next_block(c, except); ADDOP(c, END_ASYNC_FOR); @@ -6174,8 +6171,7 @@ entryblock = b; nblocks++; } - if (!entryblock) - return 0; + assert(entryblock!= NULL); stack = (basicblock **)PyObject_Malloc(sizeof(basicblock *) * nblocks); if (!stack) { PyErr_NoMemory(); @@ -6183,7 +6179,11 @@ } sp = stack; - stackdepth_push(&sp, entryblock, 0); + if (c->u->u_ste->ste_generator || c->u->u_ste->ste_coroutine) { + stackdepth_push(&sp, entryblock, 1); + } else { + stackdepth_push(&sp, entryblock, 0); + } while (sp != stack) { b = *--sp; int depth = b->b_startdepth; @@ -6412,7 +6412,6 @@ if (is_relative_jump(instr)) { instr->i_oparg -= bsize; } - instr->i_oparg *= sizeof(_Py_CODEUNIT); if (instrsize(instr->i_oparg) != isize) { extended_arg_recompile = 1; } @@ -6663,6 +6662,41 @@ static int ensure_exits_have_lineno(struct compiler *c); +static int +insert_generator_prefix(struct compiler *c, basicblock *entryblock) { + + int flags = compute_code_flags(c); + if (flags < 0) { + return -1; + } + int kind; + if (flags & (CO_GENERATOR | CO_COROUTINE | CO_ASYNC_GENERATOR)) { + if (flags & CO_COROUTINE) { + kind = 1; + } + else if (flags & CO_ASYNC_GENERATOR) { + kind = 2; + } + else { + kind = 0; + } + } + else { + return 0; + } + if (compiler_next_instr(entryblock) < 0) { + return -1; + } + for (int i = entryblock->b_iused-1; i > 0; i--) { + entryblock->b_instr[i] = entryblock->b_instr[i-1]; + } + entryblock->b_instr[0].i_opcode = GEN_START; + entryblock->b_instr[0].i_oparg = kind; + entryblock->b_instr[0].i_lineno = -1; + entryblock->b_instr[0].i_target = NULL; + return 0; +} + static PyCodeObject * assemble(struct compiler *c, int addNone) { @@ -6699,6 +6733,11 @@ nblocks++; entryblock = b; } + assert(entryblock != NULL); + + if (insert_generator_prefix(c, entryblock)) { + goto error; + } /* Set firstlineno if it wasn't explicitly set. */ if (!c->u->u_firstlineno) { @@ -6702,7 +6741,7 @@ /* Set firstlineno if it wasn't explicitly set. */ if (!c->u->u_firstlineno) { - if (entryblock && entryblock->b_instr && entryblock->b_instr->i_lineno) + if (entryblock->b_instr && entryblock->b_instr->i_lineno) c->u->u_firstlineno = entryblock->b_instr->i_lineno; else c->u->u_firstlineno = 1; @@ -6758,15 +6797,6 @@ return co; } -#undef PyAST_Compile -PyCodeObject * -PyAST_Compile(mod_ty mod, const char *filename, PyCompilerFlags *flags, - PyArena *arena) -{ - return PyAST_CompileEx(mod, filename, flags, -1, arena); -} - - /* Replace LOAD_CONST c1, LOAD_CONST c2 ... LOAD_CONST cn, BUILD_TUPLE n with LOAD_CONST (c1, c2, ... cn). The consts table must still be in list form so that the diff --git a/Python/dtoa.c b/Python/dtoa.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL2R0b2EuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL2R0b2EuYw== 100644 --- a/Python/dtoa.c +++ b/Python/dtoa.c @@ -119,16 +119,6 @@ #include "Python.h" #include "pycore_dtoa.h" -#include "pycore_interp.h" -#include "pycore_pystate.h" - -#define ULong _PyDtoa_ULong -#define Long _PyDtoa_Long -#define ULLong _PyDtoa_ULLong -#define Kmax _PyDtoa_Kmax - -typedef struct _PyDtoa_Bigint Bigint; - /* if PY_NO_SHORT_FLOAT_REPR is defined, then don't even try to compile the following code */ @@ -164,6 +154,11 @@ #error "doubles and ints have incompatible endianness" #endif + +typedef uint32_t ULong; +typedef int32_t Long; +typedef uint64_t ULLong; + #undef DEBUG #ifdef Py_DEBUG #define DEBUG @@ -302,6 +297,8 @@ #define FFFFFFFF 0xffffffffUL +#define Kmax 7 + /* struct Bigint is used to represent arbitrary-precision integers. These integers are stored in sign-magnitude format, with the magnitude stored as an array of base 2**32 digits. Bigints are always normalized: if x is a @@ -324,6 +321,14 @@ significant (x[0]) to most significant (x[wds-1]). */ +struct +Bigint { + struct Bigint *next; + int k, maxwds, sign, wds; + ULong x[1]; +}; + +typedef struct Bigint Bigint; #ifndef Py_USING_MEMORY_DEBUGGER @@ -346,13 +351,7 @@ Bfree to PyMem_Free. Investigate whether this has any significant performance on impact. */ - -/* Get Bigint freelist from interpreter */ -static Bigint ** -get_freelist(void) { - PyInterpreterState *interp = _PyInterpreterState_GET(); - return interp->dtoa_freelist; -} +static Bigint *freelist[Kmax+1]; /* Allocate space for a Bigint with up to 1<<k digits */ @@ -362,7 +361,7 @@ int x; Bigint *rv; unsigned int len; - Bigint **freelist = get_freelist(); + if (k <= Kmax && (rv = freelist[k])) freelist[k] = rv->next; else { @@ -394,7 +393,6 @@ if (v->k > Kmax) FREE((void*)v); else { - Bigint **freelist = get_freelist(); v->next = freelist[v->k]; freelist[v->k] = v; } diff --git a/Python/errors.c b/Python/errors.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL2Vycm9ycy5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL2Vycm9ycy5j 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -1192,7 +1192,7 @@ PyStatus -_PyErr_Init(void) +_PyErr_InitTypes(void) { if (UnraisableHookArgsType.tp_name == NULL) { if (PyStructSequence_InitType2(&UnraisableHookArgsType, diff --git a/Python/future.c b/Python/future.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL2Z1dHVyZS5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL2Z1dHVyZS5j 100644 --- a/Python/future.c +++ b/Python/future.c @@ -116,7 +116,7 @@ PyFutureFeatures * -PyFuture_FromASTObject(mod_ty mod, PyObject *filename) +_PyFuture_FromAST(mod_ty mod, PyObject *filename) { PyFutureFeatures *ff; @@ -134,18 +134,3 @@ } return ff; } - - -PyFutureFeatures * -PyFuture_FromAST(mod_ty mod, const char *filename_str) -{ - PyFutureFeatures *ff; - PyObject *filename; - - filename = PyUnicode_DecodeFSDefault(filename_str); - if (filename == NULL) - return NULL; - ff = PyFuture_FromASTObject(mod, filename); - Py_DECREF(filename); - return ff; -} diff --git a/Python/import.c b/Python/import.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL2ltcG9ydC5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL2ltcG9ydC5j 100644 --- a/Python/import.c +++ b/Python/import.c @@ -2,8 +2,6 @@ #include "Python.h" -#include "Python-ast.h" -#undef Yield /* undefine macro conflicting with <winbase.h> */ #include "pycore_import.h" // _PyImport_BootstrapImp() #include "pycore_initconfig.h" #include "pycore_pyerrors.h" @@ -1593,7 +1591,7 @@ } if (mod != NULL && mod != Py_None) { - if (import_ensure_initialized(tstate->interp, mod, name) < 0) { + if (import_ensure_initialized(tstate->interp, mod, abs_name) < 0) { goto error; } } @@ -1744,4 +1742,7 @@ PyObject * PyImport_Import(PyObject *module_name) { + _Py_IDENTIFIER(__import__); + _Py_IDENTIFIER(__builtins__); + PyThreadState *tstate = _PyThreadState_GET(); @@ -1747,10 +1748,7 @@ PyThreadState *tstate = _PyThreadState_GET(); - static PyObject *silly_list = NULL; - static PyObject *builtins_str = NULL; - static PyObject *import_str = NULL; PyObject *globals = NULL; PyObject *import = NULL; PyObject *builtins = NULL; PyObject *r = NULL; /* Initialize constant string objects */ @@ -1751,19 +1749,22 @@ PyObject *globals = NULL; PyObject *import = NULL; PyObject *builtins = NULL; PyObject *r = NULL; /* Initialize constant string objects */ - if (silly_list == NULL) { - import_str = PyUnicode_InternFromString("__import__"); - if (import_str == NULL) - return NULL; - builtins_str = PyUnicode_InternFromString("__builtins__"); - if (builtins_str == NULL) - return NULL; - silly_list = PyList_New(0); - if (silly_list == NULL) - return NULL; + PyObject *import_str = _PyUnicode_FromId(&PyId___import__); // borrowed ref + if (import_str == NULL) { + return NULL; + } + + PyObject *builtins_str = _PyUnicode_FromId(&PyId___builtins__); // borrowed ref + if (builtins_str == NULL) { + return NULL; + } + + PyObject *from_list = PyList_New(0); + if (from_list == NULL) { + goto err; } /* Get the builtins from current globals */ @@ -1778,8 +1779,9 @@ /* No globals -- use standard builtins, and fake globals */ builtins = PyImport_ImportModuleLevel("builtins", NULL, NULL, NULL, 0); - if (builtins == NULL) - return NULL; + if (builtins == NULL) { + goto err; + } globals = Py_BuildValue("{OO}", builtins_str, builtins); if (globals == NULL) goto err; @@ -1801,7 +1803,7 @@ Always use absolute import here. Calling for side-effect of import. */ r = PyObject_CallFunction(import, "OOOOi", module_name, globals, - globals, silly_list, 0, NULL); + globals, from_list, 0, NULL); if (r == NULL) goto err; Py_DECREF(r); @@ -1815,6 +1817,7 @@ Py_XDECREF(globals); Py_XDECREF(builtins); Py_XDECREF(import); + Py_XDECREF(from_list); return r; } diff --git a/Python/importlib_zipimport.h b/Python/importlib_zipimport.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL2ltcG9ydGxpYl96aXBpbXBvcnQuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL2ltcG9ydGxpYl96aXBpbXBvcnQuaA== 100644 --- a/Python/importlib_zipimport.h +++ b/Python/importlib_zipimport.h @@ -118,6 +118,6 @@ 97,109,101,32,111,102,32,116,104,101,10,32,32,32,32,122, 105,112,102,105,108,101,32,116,97,114,103,101,116,101,100,46, 10,32,32,32,32,99,2,0,0,0,0,0,0,0,0,0, - 0,0,8,0,0,0,9,0,0,0,67,0,0,0,115,40, - 1,0,0,116,0,124,1,116,1,131,2,115,28,100,1,100, + 0,0,8,0,0,0,9,0,0,0,67,0,0,0,115,34, + 1,0,0,116,0,124,1,116,1,131,2,115,14,100,1,100, 0,108,2,125,2,124,2,160,3,124,1,161,1,125,1,124, @@ -123,82 +123,135 @@ 0,108,2,125,2,124,2,160,3,124,1,161,1,125,1,124, - 1,115,44,116,4,100,2,124,1,100,3,141,2,130,1,116, - 5,114,60,124,1,160,6,116,5,116,7,161,2,125,1,103, - 0,125,3,9,0,122,14,116,8,160,9,124,1,161,1,125, - 4,87,0,110,70,4,0,116,10,116,11,102,2,144,1,121, - 38,1,0,1,0,1,0,116,8,160,12,124,1,161,1,92, - 2,125,5,125,6,124,5,124,1,107,2,114,134,116,4,100, - 5,124,1,100,3,141,2,130,1,124,5,125,1,124,3,160, - 13,124,6,161,1,1,0,89,0,110,28,124,4,106,14,100, - 6,64,0,100,7,107,3,114,178,116,4,100,5,124,1,100, - 3,141,2,130,1,113,182,113,66,122,12,116,15,124,1,25, - 0,125,7,87,0,110,32,4,0,116,16,144,1,121,36,1, - 0,1,0,1,0,116,17,124,1,131,1,125,7,124,7,116, - 15,124,1,60,0,89,0,124,7,124,0,95,18,124,1,124, - 0,95,19,116,8,106,20,124,3,100,0,100,0,100,8,133, - 3,25,0,142,0,124,0,95,21,124,0,106,21,144,1,114, - 32,124,0,4,0,106,21,116,7,55,0,2,0,95,21,100, - 0,83,0,100,0,83,0,119,0,119,0,41,9,78,114,0, - 0,0,0,122,21,97,114,99,104,105,118,101,32,112,97,116, - 104,32,105,115,32,101,109,112,116,121,169,1,218,4,112,97, - 116,104,84,122,14,110,111,116,32,97,32,90,105,112,32,102, - 105,108,101,105,0,240,0,0,105,0,128,0,0,233,255,255, - 255,255,41,22,218,10,105,115,105,110,115,116,97,110,99,101, - 218,3,115,116,114,218,2,111,115,90,8,102,115,100,101,99, - 111,100,101,114,3,0,0,0,218,12,97,108,116,95,112,97, - 116,104,95,115,101,112,218,7,114,101,112,108,97,99,101,218, - 8,112,97,116,104,95,115,101,112,218,19,95,98,111,111,116, - 115,116,114,97,112,95,101,120,116,101,114,110,97,108,90,10, - 95,112,97,116,104,95,115,116,97,116,218,7,79,83,69,114, - 114,111,114,218,10,86,97,108,117,101,69,114,114,111,114,90, - 11,95,112,97,116,104,95,115,112,108,105,116,218,6,97,112, - 112,101,110,100,90,7,115,116,95,109,111,100,101,218,20,95, - 122,105,112,95,100,105,114,101,99,116,111,114,121,95,99,97, - 99,104,101,218,8,75,101,121,69,114,114,111,114,218,15,95, - 114,101,97,100,95,100,105,114,101,99,116,111,114,121,218,6, - 95,102,105,108,101,115,218,7,97,114,99,104,105,118,101,218, - 10,95,112,97,116,104,95,106,111,105,110,218,6,112,114,101, - 102,105,120,41,8,218,4,115,101,108,102,114,13,0,0,0, - 114,17,0,0,0,114,31,0,0,0,90,2,115,116,90,7, - 100,105,114,110,97,109,101,90,8,98,97,115,101,110,97,109, - 101,218,5,102,105,108,101,115,114,9,0,0,0,114,9,0, - 0,0,114,10,0,0,0,218,8,95,95,105,110,105,116,95, - 95,64,0,0,0,115,70,0,0,0,10,1,8,1,10,1, - 4,1,12,1,4,1,12,1,4,2,2,1,2,1,14,1, - 18,1,14,3,8,1,12,1,4,1,14,1,14,3,12,2, - 2,1,2,240,2,18,12,1,14,1,8,1,10,1,6,1, - 6,1,22,2,8,1,18,1,4,255,2,249,2,239,255,128, - 122,20,122,105,112,105,109,112,111,114,116,101,114,46,95,95, - 105,110,105,116,95,95,78,99,3,0,0,0,0,0,0,0, - 0,0,0,0,5,0,0,0,4,0,0,0,67,0,0,0, - 115,78,0,0,0,116,0,124,0,124,1,131,2,125,3,124, - 3,100,1,117,1,114,26,124,0,103,0,102,2,83,0,116, - 1,124,0,124,1,131,2,125,4,116,2,124,0,124,4,131, - 2,114,70,100,1,124,0,106,3,155,0,116,4,155,0,124, - 4,155,0,157,3,103,1,102,2,83,0,100,1,103,0,102, - 2,83,0,41,2,97,47,2,0,0,102,105,110,100,95,108, - 111,97,100,101,114,40,102,117,108,108,110,97,109,101,44,32, - 112,97,116,104,61,78,111,110,101,41,32,45,62,32,115,101, - 108,102,44,32,115,116,114,32,111,114,32,78,111,110,101,46, - 10,10,32,32,32,32,32,32,32,32,83,101,97,114,99,104, - 32,102,111,114,32,97,32,109,111,100,117,108,101,32,115,112, - 101,99,105,102,105,101,100,32,98,121,32,39,102,117,108,108, - 110,97,109,101,39,46,32,39,102,117,108,108,110,97,109,101, - 39,32,109,117,115,116,32,98,101,32,116,104,101,10,32,32, - 32,32,32,32,32,32,102,117,108,108,121,32,113,117,97,108, - 105,102,105,101,100,32,40,100,111,116,116,101,100,41,32,109, - 111,100,117,108,101,32,110,97,109,101,46,32,73,116,32,114, - 101,116,117,114,110,115,32,116,104,101,32,122,105,112,105,109, - 112,111,114,116,101,114,10,32,32,32,32,32,32,32,32,105, - 110,115,116,97,110,99,101,32,105,116,115,101,108,102,32,105, - 102,32,116,104,101,32,109,111,100,117,108,101,32,119,97,115, - 32,102,111,117,110,100,44,32,97,32,115,116,114,105,110,103, - 32,99,111,110,116,97,105,110,105,110,103,32,116,104,101,10, - 32,32,32,32,32,32,32,32,102,117,108,108,32,112,97,116, - 104,32,110,97,109,101,32,105,102,32,105,116,39,115,32,112, - 111,115,115,105,98,108,121,32,97,32,112,111,114,116,105,111, - 110,32,111,102,32,97,32,110,97,109,101,115,112,97,99,101, - 32,112,97,99,107,97,103,101,44,10,32,32,32,32,32,32, - 32,32,111,114,32,78,111,110,101,32,111,116,104,101,114,119, - 105,115,101,46,32,84,104,101,32,111,112,116,105,111,110,97, + 1,115,22,116,4,100,2,124,1,100,3,141,2,130,1,116, + 5,114,30,124,1,160,6,116,5,116,7,161,2,125,1,103, + 0,125,3,9,0,122,7,116,8,160,9,124,1,161,1,125, + 4,87,0,110,34,4,0,116,10,116,11,102,2,121,144,1, + 0,1,0,1,0,116,8,160,12,124,1,161,1,92,2,125, + 5,125,6,124,5,124,1,107,2,114,66,116,4,100,5,124, + 1,100,3,141,2,130,1,124,5,125,1,124,3,160,13,124, + 6,161,1,1,0,89,0,110,14,124,4,106,14,100,6,64, + 0,100,7,107,3,114,88,116,4,100,5,124,1,100,3,141, + 2,130,1,113,90,113,33,122,6,116,15,124,1,25,0,125, + 7,87,0,110,15,4,0,116,16,121,143,1,0,1,0,1, + 0,116,17,124,1,131,1,125,7,124,7,116,15,124,1,60, + 0,89,0,124,7,124,0,95,18,124,1,124,0,95,19,116, + 8,106,20,124,3,100,0,100,0,100,8,133,3,25,0,142, + 0,124,0,95,21,124,0,106,21,114,141,124,0,4,0,106, + 21,116,7,55,0,2,0,95,21,100,0,83,0,100,0,83, + 0,119,0,119,0,41,9,78,114,0,0,0,0,122,21,97, + 114,99,104,105,118,101,32,112,97,116,104,32,105,115,32,101, + 109,112,116,121,169,1,218,4,112,97,116,104,84,122,14,110, + 111,116,32,97,32,90,105,112,32,102,105,108,101,105,0,240, + 0,0,105,0,128,0,0,233,255,255,255,255,41,22,218,10, + 105,115,105,110,115,116,97,110,99,101,218,3,115,116,114,218, + 2,111,115,90,8,102,115,100,101,99,111,100,101,114,3,0, + 0,0,218,12,97,108,116,95,112,97,116,104,95,115,101,112, + 218,7,114,101,112,108,97,99,101,218,8,112,97,116,104,95, + 115,101,112,218,19,95,98,111,111,116,115,116,114,97,112,95, + 101,120,116,101,114,110,97,108,90,10,95,112,97,116,104,95, + 115,116,97,116,218,7,79,83,69,114,114,111,114,218,10,86, + 97,108,117,101,69,114,114,111,114,90,11,95,112,97,116,104, + 95,115,112,108,105,116,218,6,97,112,112,101,110,100,90,7, + 115,116,95,109,111,100,101,218,20,95,122,105,112,95,100,105, + 114,101,99,116,111,114,121,95,99,97,99,104,101,218,8,75, + 101,121,69,114,114,111,114,218,15,95,114,101,97,100,95,100, + 105,114,101,99,116,111,114,121,218,6,95,102,105,108,101,115, + 218,7,97,114,99,104,105,118,101,218,10,95,112,97,116,104, + 95,106,111,105,110,218,6,112,114,101,102,105,120,41,8,218, + 4,115,101,108,102,114,13,0,0,0,114,17,0,0,0,114, + 31,0,0,0,90,2,115,116,90,7,100,105,114,110,97,109, + 101,90,8,98,97,115,101,110,97,109,101,218,5,102,105,108, + 101,115,114,9,0,0,0,114,9,0,0,0,114,10,0,0, + 0,218,8,95,95,105,110,105,116,95,95,64,0,0,0,115, + 70,0,0,0,10,1,8,1,10,1,4,1,12,1,4,1, + 12,1,4,2,2,1,2,1,14,1,16,1,14,3,8,1, + 12,1,4,1,14,1,14,3,12,2,2,1,2,240,2,18, + 12,1,12,1,8,1,10,1,6,1,6,1,22,2,6,1, + 18,1,4,255,2,249,2,239,255,128,122,20,122,105,112,105, + 109,112,111,114,116,101,114,46,95,95,105,110,105,116,95,95, + 78,99,3,0,0,0,0,0,0,0,0,0,0,0,5,0, + 0,0,4,0,0,0,67,0,0,0,115,90,0,0,0,116, + 0,160,1,100,1,116,2,161,2,1,0,116,3,124,0,124, + 1,131,2,125,3,124,3,100,2,117,1,114,19,124,0,103, + 0,102,2,83,0,116,4,124,0,124,1,131,2,125,4,116, + 5,124,0,124,4,131,2,114,41,100,2,124,0,106,6,155, + 0,116,7,155,0,124,4,155,0,157,3,103,1,102,2,83, + 0,100,2,103,0,102,2,83,0,41,3,97,47,2,0,0, + 102,105,110,100,95,108,111,97,100,101,114,40,102,117,108,108, + 110,97,109,101,44,32,112,97,116,104,61,78,111,110,101,41, + 32,45,62,32,115,101,108,102,44,32,115,116,114,32,111,114, + 32,78,111,110,101,46,10,10,32,32,32,32,32,32,32,32, + 83,101,97,114,99,104,32,102,111,114,32,97,32,109,111,100, + 117,108,101,32,115,112,101,99,105,102,105,101,100,32,98,121, + 32,39,102,117,108,108,110,97,109,101,39,46,32,39,102,117, + 108,108,110,97,109,101,39,32,109,117,115,116,32,98,101,32, + 116,104,101,10,32,32,32,32,32,32,32,32,102,117,108,108, + 121,32,113,117,97,108,105,102,105,101,100,32,40,100,111,116, + 116,101,100,41,32,109,111,100,117,108,101,32,110,97,109,101, + 46,32,73,116,32,114,101,116,117,114,110,115,32,116,104,101, + 32,122,105,112,105,109,112,111,114,116,101,114,10,32,32,32, + 32,32,32,32,32,105,110,115,116,97,110,99,101,32,105,116, + 115,101,108,102,32,105,102,32,116,104,101,32,109,111,100,117, + 108,101,32,119,97,115,32,102,111,117,110,100,44,32,97,32, + 115,116,114,105,110,103,32,99,111,110,116,97,105,110,105,110, + 103,32,116,104,101,10,32,32,32,32,32,32,32,32,102,117, + 108,108,32,112,97,116,104,32,110,97,109,101,32,105,102,32, + 105,116,39,115,32,112,111,115,115,105,98,108,121,32,97,32, + 112,111,114,116,105,111,110,32,111,102,32,97,32,110,97,109, + 101,115,112,97,99,101,32,112,97,99,107,97,103,101,44,10, + 32,32,32,32,32,32,32,32,111,114,32,78,111,110,101,32, + 111,116,104,101,114,119,105,115,101,46,32,84,104,101,32,111, + 112,116,105,111,110,97,108,32,39,112,97,116,104,39,32,97, + 114,103,117,109,101,110,116,32,105,115,32,105,103,110,111,114, + 101,100,32,45,45,32,105,116,39,115,10,32,32,32,32,32, + 32,32,32,116,104,101,114,101,32,102,111,114,32,99,111,109, + 112,97,116,105,98,105,108,105,116,121,32,119,105,116,104,32, + 116,104,101,32,105,109,112,111,114,116,101,114,32,112,114,111, + 116,111,99,111,108,46,10,10,32,32,32,32,32,32,32,32, + 68,101,112,114,101,99,97,116,101,100,32,115,105,110,99,101, + 32,80,121,116,104,111,110,32,51,46,49,48,46,32,85,115, + 101,32,102,105,110,100,95,115,112,101,99,40,41,32,105,110, + 115,116,101,97,100,46,10,32,32,32,32,32,32,32,32,122, + 102,122,105,112,105,109,112,111,114,116,101,114,46,102,105,110, + 100,95,108,111,97,100,101,114,40,41,32,105,115,32,100,101, + 112,114,101,99,97,116,101,100,32,97,110,100,32,115,108,97, + 116,101,100,32,102,111,114,32,114,101,109,111,118,97,108,32, + 105,110,32,80,121,116,104,111,110,32,51,46,49,50,59,32, + 117,115,101,32,102,105,110,100,95,115,112,101,99,40,41,32, + 105,110,115,116,101,97,100,78,41,8,218,9,95,119,97,114, + 110,105,110,103,115,218,4,119,97,114,110,218,18,68,101,112, + 114,101,99,97,116,105,111,110,87,97,114,110,105,110,103,218, + 16,95,103,101,116,95,109,111,100,117,108,101,95,105,110,102, + 111,218,16,95,103,101,116,95,109,111,100,117,108,101,95,112, + 97,116,104,218,7,95,105,115,95,100,105,114,114,29,0,0, + 0,114,20,0,0,0,41,5,114,32,0,0,0,218,8,102, + 117,108,108,110,97,109,101,114,13,0,0,0,218,2,109,105, + 218,7,109,111,100,112,97,116,104,114,9,0,0,0,114,9, + 0,0,0,114,10,0,0,0,218,11,102,105,110,100,95,108, + 111,97,100,101,114,110,0,0,0,115,22,0,0,0,6,12, + 2,2,4,254,10,3,8,1,8,2,10,7,10,1,24,4, + 8,2,255,128,122,23,122,105,112,105,109,112,111,114,116,101, + 114,46,102,105,110,100,95,108,111,97,100,101,114,99,3,0, + 0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0, + 0,0,67,0,0,0,115,28,0,0,0,116,0,160,1,100, + 1,116,2,161,2,1,0,124,0,160,3,124,1,124,2,161, + 2,100,2,25,0,83,0,41,4,97,203,1,0,0,102,105, + 110,100,95,109,111,100,117,108,101,40,102,117,108,108,110,97, + 109,101,44,32,112,97,116,104,61,78,111,110,101,41,32,45, + 62,32,115,101,108,102,32,111,114,32,78,111,110,101,46,10, + 10,32,32,32,32,32,32,32,32,83,101,97,114,99,104,32, + 102,111,114,32,97,32,109,111,100,117,108,101,32,115,112,101, + 99,105,102,105,101,100,32,98,121,32,39,102,117,108,108,110, + 97,109,101,39,46,32,39,102,117,108,108,110,97,109,101,39, + 32,109,117,115,116,32,98,101,32,116,104,101,10,32,32,32, + 32,32,32,32,32,102,117,108,108,121,32,113,117,97,108,105, + 102,105,101,100,32,40,100,111,116,116,101,100,41,32,109,111, + 100,117,108,101,32,110,97,109,101,46,32,73,116,32,114,101, + 116,117,114,110,115,32,116,104,101,32,122,105,112,105,109,112, + 111,114,116,101,114,10,32,32,32,32,32,32,32,32,105,110, + 115,116,97,110,99,101,32,105,116,115,101,108,102,32,105,102, + 32,116,104,101,32,109,111,100,117,108,101,32,119,97,115,32, + 102,111,117,110,100,44,32,111,114,32,78,111,110,101,32,105, + 102,32,105,116,32,119,97,115,110,39,116,46,10,32,32,32, + 32,32,32,32,32,84,104,101,32,111,112,116,105,111,110,97, 108,32,39,112,97,116,104,39,32,97,114,103,117,109,101,110, 116,32,105,115,32,105,103,110,111,114,101,100,32,45,45,32, @@ -203,10 +256,10 @@ 108,32,39,112,97,116,104,39,32,97,114,103,117,109,101,110, 116,32,105,115,32,105,103,110,111,114,101,100,32,45,45,32, - 105,116,39,115,10,32,32,32,32,32,32,32,32,116,104,101, - 114,101,32,102,111,114,32,99,111,109,112,97,116,105,98,105, - 108,105,116,121,32,119,105,116,104,32,116,104,101,32,105,109, + 105,116,39,115,32,116,104,101,114,101,32,102,111,114,32,99, + 111,109,112,97,116,105,98,105,108,105,116,121,10,32,32,32, + 32,32,32,32,32,119,105,116,104,32,116,104,101,32,105,109, 112,111,114,116,101,114,32,112,114,111,116,111,99,111,108,46, 10,10,32,32,32,32,32,32,32,32,68,101,112,114,101,99, 97,116,101,100,32,115,105,110,99,101,32,80,121,116,104,111, 110,32,51,46,49,48,46,32,85,115,101,32,102,105,110,100, 95,115,112,101,99,40,41,32,105,110,115,116,101,97,100,46, @@ -208,27 +261,208 @@ 112,111,114,116,101,114,32,112,114,111,116,111,99,111,108,46, 10,10,32,32,32,32,32,32,32,32,68,101,112,114,101,99, 97,116,101,100,32,115,105,110,99,101,32,80,121,116,104,111, 110,32,51,46,49,48,46,32,85,115,101,32,102,105,110,100, 95,115,112,101,99,40,41,32,105,110,115,116,101,97,100,46, - 10,32,32,32,32,32,32,32,32,78,41,5,218,16,95,103, - 101,116,95,109,111,100,117,108,101,95,105,110,102,111,218,16, - 95,103,101,116,95,109,111,100,117,108,101,95,112,97,116,104, - 218,7,95,105,115,95,100,105,114,114,29,0,0,0,114,20, - 0,0,0,41,5,114,32,0,0,0,218,8,102,117,108,108, - 110,97,109,101,114,13,0,0,0,218,2,109,105,218,7,109, - 111,100,112,97,116,104,114,9,0,0,0,114,9,0,0,0, - 114,10,0,0,0,218,11,102,105,110,100,95,108,111,97,100, - 101,114,110,0,0,0,115,16,0,0,0,10,12,8,1,8, - 2,10,7,10,1,24,4,8,2,255,128,122,23,122,105,112, - 105,109,112,111,114,116,101,114,46,102,105,110,100,95,108,111, - 97,100,101,114,99,3,0,0,0,0,0,0,0,0,0,0, - 0,3,0,0,0,4,0,0,0,67,0,0,0,115,16,0, - 0,0,124,0,160,0,124,1,124,2,161,2,100,1,25,0, - 83,0,41,3,97,203,1,0,0,102,105,110,100,95,109,111, - 100,117,108,101,40,102,117,108,108,110,97,109,101,44,32,112, - 97,116,104,61,78,111,110,101,41,32,45,62,32,115,101,108, - 102,32,111,114,32,78,111,110,101,46,10,10,32,32,32,32, - 32,32,32,32,83,101,97,114,99,104,32,102,111,114,32,97, + 10,32,32,32,32,32,32,32,32,122,102,122,105,112,105,109, + 112,111,114,116,101,114,46,102,105,110,100,95,109,111,100,117, + 108,101,40,41,32,105,115,32,100,101,112,114,101,99,97,116, + 101,100,32,97,110,100,32,115,108,97,116,101,100,32,102,111, + 114,32,114,101,109,111,118,97,108,32,105,110,32,80,121,116, + 104,111,110,32,51,46,49,50,59,32,117,115,101,32,102,105, + 110,100,95,115,112,101,99,40,41,32,105,110,115,116,101,97, + 100,114,0,0,0,0,78,41,4,114,35,0,0,0,114,36, + 0,0,0,114,37,0,0,0,114,44,0,0,0,41,3,114, + 32,0,0,0,114,41,0,0,0,114,13,0,0,0,114,9, + 0,0,0,114,9,0,0,0,114,10,0,0,0,218,11,102, + 105,110,100,95,109,111,100,117,108,101,147,0,0,0,115,10, + 0,0,0,6,11,2,2,4,254,16,3,255,128,122,23,122, + 105,112,105,109,112,111,114,116,101,114,46,102,105,110,100,95, + 109,111,100,117,108,101,99,3,0,0,0,0,0,0,0,0, + 0,0,0,7,0,0,0,5,0,0,0,67,0,0,0,115, + 108,0,0,0,116,0,124,0,124,1,131,2,125,3,124,3, + 100,1,117,1,114,17,116,1,106,2,124,1,124,0,124,3, + 100,2,141,3,83,0,116,3,124,0,124,1,131,2,125,4, + 116,4,124,0,124,4,131,2,114,52,124,0,106,5,155,0, + 116,6,155,0,124,4,155,0,157,3,125,5,116,1,106,7, + 124,1,100,1,100,3,100,4,141,3,125,6,124,6,106,8, + 160,9,124,5,161,1,1,0,124,6,83,0,100,1,83,0, + 41,5,122,107,67,114,101,97,116,101,32,97,32,77,111,100, + 117,108,101,83,112,101,99,32,102,111,114,32,116,104,101,32, + 115,112,101,99,105,102,105,101,100,32,109,111,100,117,108,101, + 46,10,10,32,32,32,32,32,32,32,32,82,101,116,117,114, + 110,115,32,78,111,110,101,32,105,102,32,116,104,101,32,109, + 111,100,117,108,101,32,99,97,110,110,111,116,32,98,101,32, + 102,111,117,110,100,46,10,32,32,32,32,32,32,32,32,78, + 41,1,218,10,105,115,95,112,97,99,107,97,103,101,84,41, + 3,218,4,110,97,109,101,90,6,108,111,97,100,101,114,114, + 46,0,0,0,41,10,114,38,0,0,0,218,10,95,98,111, + 111,116,115,116,114,97,112,90,16,115,112,101,99,95,102,114, + 111,109,95,108,111,97,100,101,114,114,39,0,0,0,114,40, + 0,0,0,114,29,0,0,0,114,20,0,0,0,90,10,77, + 111,100,117,108,101,83,112,101,99,90,26,115,117,98,109,111, + 100,117,108,101,95,115,101,97,114,99,104,95,108,111,99,97, + 116,105,111,110,115,114,24,0,0,0,41,7,114,32,0,0, + 0,114,41,0,0,0,90,6,116,97,114,103,101,116,90,11, + 109,111,100,117,108,101,95,105,110,102,111,114,43,0,0,0, + 114,13,0,0,0,90,4,115,112,101,99,114,9,0,0,0, + 114,9,0,0,0,114,10,0,0,0,218,9,102,105,110,100, + 95,115,112,101,99,163,0,0,0,115,26,0,0,0,10,5, + 8,1,16,1,10,7,10,1,18,4,8,1,2,1,6,255, + 12,2,4,1,4,2,255,128,122,21,122,105,112,105,109,112, + 111,114,116,101,114,46,102,105,110,100,95,115,112,101,99,99, + 2,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0, + 3,0,0,0,67,0,0,0,115,20,0,0,0,116,0,124, + 0,124,1,131,2,92,3,125,2,125,3,125,4,124,2,83, + 0,41,2,122,166,103,101,116,95,99,111,100,101,40,102,117, + 108,108,110,97,109,101,41,32,45,62,32,99,111,100,101,32, + 111,98,106,101,99,116,46,10,10,32,32,32,32,32,32,32, + 32,82,101,116,117,114,110,32,116,104,101,32,99,111,100,101, + 32,111,98,106,101,99,116,32,102,111,114,32,116,104,101,32, + 115,112,101,99,105,102,105,101,100,32,109,111,100,117,108,101, + 46,32,82,97,105,115,101,32,90,105,112,73,109,112,111,114, + 116,69,114,114,111,114,10,32,32,32,32,32,32,32,32,105, + 102,32,116,104,101,32,109,111,100,117,108,101,32,99,111,117, + 108,100,110,39,116,32,98,101,32,105,109,112,111,114,116,101, + 100,46,10,32,32,32,32,32,32,32,32,78,169,1,218,16, + 95,103,101,116,95,109,111,100,117,108,101,95,99,111,100,101, + 169,5,114,32,0,0,0,114,41,0,0,0,218,4,99,111, + 100,101,218,9,105,115,112,97,99,107,97,103,101,114,43,0, + 0,0,114,9,0,0,0,114,9,0,0,0,114,10,0,0, + 0,218,8,103,101,116,95,99,111,100,101,190,0,0,0,115, + 6,0,0,0,16,6,4,1,255,128,122,20,122,105,112,105, + 109,112,111,114,116,101,114,46,103,101,116,95,99,111,100,101, + 99,2,0,0,0,0,0,0,0,0,0,0,0,4,0,0, + 0,8,0,0,0,67,0,0,0,115,112,0,0,0,116,0, + 114,8,124,1,160,1,116,0,116,2,161,2,125,1,124,1, + 125,2,124,1,160,3,124,0,106,4,116,2,23,0,161,1, + 114,29,124,1,116,5,124,0,106,4,116,2,23,0,131,1, + 100,1,133,2,25,0,125,2,122,7,124,0,106,6,124,2, + 25,0,125,3,87,0,110,12,4,0,116,7,121,55,1,0, + 1,0,1,0,116,8,100,2,100,3,124,2,131,3,130,1, + 116,9,124,0,106,4,124,3,131,2,83,0,119,0,41,4, + 122,154,103,101,116,95,100,97,116,97,40,112,97,116,104,110, + 97,109,101,41,32,45,62,32,115,116,114,105,110,103,32,119, + 105,116,104,32,102,105,108,101,32,100,97,116,97,46,10,10, + 32,32,32,32,32,32,32,32,82,101,116,117,114,110,32,116, + 104,101,32,100,97,116,97,32,97,115,115,111,99,105,97,116, + 101,100,32,119,105,116,104,32,39,112,97,116,104,110,97,109, + 101,39,46,32,82,97,105,115,101,32,79,83,69,114,114,111, + 114,32,105,102,10,32,32,32,32,32,32,32,32,116,104,101, + 32,102,105,108,101,32,119,97,115,110,39,116,32,102,111,117, + 110,100,46,10,32,32,32,32,32,32,32,32,78,114,0,0, + 0,0,218,0,41,10,114,18,0,0,0,114,19,0,0,0, + 114,20,0,0,0,218,10,115,116,97,114,116,115,119,105,116, + 104,114,29,0,0,0,218,3,108,101,110,114,28,0,0,0, + 114,26,0,0,0,114,22,0,0,0,218,9,95,103,101,116, + 95,100,97,116,97,41,4,114,32,0,0,0,218,8,112,97, + 116,104,110,97,109,101,90,3,107,101,121,218,9,116,111,99, + 95,101,110,116,114,121,114,9,0,0,0,114,9,0,0,0, + 114,10,0,0,0,218,8,103,101,116,95,100,97,116,97,200, + 0,0,0,115,24,0,0,0,4,6,12,1,4,2,16,1, + 22,1,2,2,14,1,12,1,12,1,12,1,2,254,255,128, + 122,20,122,105,112,105,109,112,111,114,116,101,114,46,103,101, + 116,95,100,97,116,97,99,2,0,0,0,0,0,0,0,0, + 0,0,0,5,0,0,0,3,0,0,0,67,0,0,0,115, + 20,0,0,0,116,0,124,0,124,1,131,2,92,3,125,2, + 125,3,125,4,124,4,83,0,41,2,122,165,103,101,116,95, + 102,105,108,101,110,97,109,101,40,102,117,108,108,110,97,109, + 101,41,32,45,62,32,102,105,108,101,110,97,109,101,32,115, + 116,114,105,110,103,46,10,10,32,32,32,32,32,32,32,32, + 82,101,116,117,114,110,32,116,104,101,32,102,105,108,101,110, + 97,109,101,32,102,111,114,32,116,104,101,32,115,112,101,99, + 105,102,105,101,100,32,109,111,100,117,108,101,32,111,114,32, + 114,97,105,115,101,32,90,105,112,73,109,112,111,114,116,69, + 114,114,111,114,10,32,32,32,32,32,32,32,32,105,102,32, + 105,116,32,99,111,117,108,100,110,39,116,32,98,101,32,105, + 109,112,111,114,116,101,100,46,10,32,32,32,32,32,32,32, + 32,78,114,50,0,0,0,114,52,0,0,0,114,9,0,0, + 0,114,9,0,0,0,114,10,0,0,0,218,12,103,101,116, + 95,102,105,108,101,110,97,109,101,221,0,0,0,115,6,0, + 0,0,16,8,4,1,255,128,122,24,122,105,112,105,109,112, + 111,114,116,101,114,46,103,101,116,95,102,105,108,101,110,97, + 109,101,99,2,0,0,0,0,0,0,0,0,0,0,0,6, + 0,0,0,8,0,0,0,67,0,0,0,115,126,0,0,0, + 116,0,124,0,124,1,131,2,125,2,124,2,100,1,117,0, + 114,18,116,1,100,2,124,1,155,2,157,2,124,1,100,3, + 141,2,130,1,116,2,124,0,124,1,131,2,125,3,124,2, + 114,32,116,3,160,4,124,3,100,4,161,2,125,4,110,5, + 124,3,155,0,100,5,157,2,125,4,122,7,124,0,106,5, + 124,4,25,0,125,5,87,0,110,9,4,0,116,6,121,62, + 1,0,1,0,1,0,89,0,100,1,83,0,116,7,124,0, + 106,8,124,5,131,2,160,9,161,0,83,0,119,0,41,6, + 122,253,103,101,116,95,115,111,117,114,99,101,40,102,117,108, + 108,110,97,109,101,41,32,45,62,32,115,111,117,114,99,101, + 32,115,116,114,105,110,103,46,10,10,32,32,32,32,32,32, + 32,32,82,101,116,117,114,110,32,116,104,101,32,115,111,117, + 114,99,101,32,99,111,100,101,32,102,111,114,32,116,104,101, + 32,115,112,101,99,105,102,105,101,100,32,109,111,100,117,108, + 101,46,32,82,97,105,115,101,32,90,105,112,73,109,112,111, + 114,116,69,114,114,111,114,10,32,32,32,32,32,32,32,32, + 105,102,32,116,104,101,32,109,111,100,117,108,101,32,99,111, + 117,108,100,110,39,116,32,98,101,32,102,111,117,110,100,44, + 32,114,101,116,117,114,110,32,78,111,110,101,32,105,102,32, + 116,104,101,32,97,114,99,104,105,118,101,32,100,111,101,115, + 10,32,32,32,32,32,32,32,32,99,111,110,116,97,105,110, + 32,116,104,101,32,109,111,100,117,108,101,44,32,98,117,116, + 32,104,97,115,32,110,111,32,115,111,117,114,99,101,32,102, + 111,114,32,105,116,46,10,32,32,32,32,32,32,32,32,78, + 250,18,99,97,110,39,116,32,102,105,110,100,32,109,111,100, + 117,108,101,32,169,1,114,47,0,0,0,250,11,95,95,105, + 110,105,116,95,95,46,112,121,250,3,46,112,121,41,10,114, + 38,0,0,0,114,3,0,0,0,114,39,0,0,0,114,21, + 0,0,0,114,30,0,0,0,114,28,0,0,0,114,26,0, + 0,0,114,59,0,0,0,114,29,0,0,0,218,6,100,101, + 99,111,100,101,41,6,114,32,0,0,0,114,41,0,0,0, + 114,42,0,0,0,114,13,0,0,0,218,8,102,117,108,108, + 112,97,116,104,114,61,0,0,0,114,9,0,0,0,114,9, + 0,0,0,114,10,0,0,0,218,10,103,101,116,95,115,111, + 117,114,99,101,233,0,0,0,115,28,0,0,0,10,7,8, + 1,18,1,10,2,4,1,14,1,10,2,2,2,14,1,12, + 1,6,2,16,1,2,253,255,128,122,22,122,105,112,105,109, + 112,111,114,116,101,114,46,103,101,116,95,115,111,117,114,99, + 101,99,2,0,0,0,0,0,0,0,0,0,0,0,3,0, + 0,0,4,0,0,0,67,0,0,0,115,40,0,0,0,116, + 0,124,0,124,1,131,2,125,2,124,2,100,1,117,0,114, + 18,116,1,100,2,124,1,155,2,157,2,124,1,100,3,141, + 2,130,1,124,2,83,0,41,4,122,171,105,115,95,112,97, + 99,107,97,103,101,40,102,117,108,108,110,97,109,101,41,32, + 45,62,32,98,111,111,108,46,10,10,32,32,32,32,32,32, + 32,32,82,101,116,117,114,110,32,84,114,117,101,32,105,102, + 32,116,104,101,32,109,111,100,117,108,101,32,115,112,101,99, + 105,102,105,101,100,32,98,121,32,102,117,108,108,110,97,109, + 101,32,105,115,32,97,32,112,97,99,107,97,103,101,46,10, + 32,32,32,32,32,32,32,32,82,97,105,115,101,32,90,105, + 112,73,109,112,111,114,116,69,114,114,111,114,32,105,102,32, + 116,104,101,32,109,111,100,117,108,101,32,99,111,117,108,100, + 110,39,116,32,98,101,32,102,111,117,110,100,46,10,32,32, + 32,32,32,32,32,32,78,114,64,0,0,0,114,65,0,0, + 0,41,2,114,38,0,0,0,114,3,0,0,0,41,3,114, + 32,0,0,0,114,41,0,0,0,114,42,0,0,0,114,9, + 0,0,0,114,9,0,0,0,114,10,0,0,0,114,46,0, + 0,0,3,1,0,0,115,10,0,0,0,10,6,8,1,18, + 1,4,1,255,128,122,22,122,105,112,105,109,112,111,114,116, + 101,114,46,105,115,95,112,97,99,107,97,103,101,99,2,0, + 0,0,0,0,0,0,0,0,0,0,9,0,0,0,8,0, + 0,0,67,0,0,0,115,252,0,0,0,100,1,125,2,116, + 0,160,1,124,2,116,2,161,2,1,0,116,3,124,0,124, + 1,131,2,92,3,125,3,125,4,125,5,116,4,106,5,160, + 6,124,1,161,1,125,6,124,6,100,2,117,0,115,31,116, + 7,124,6,116,8,131,2,115,40,116,8,124,1,131,1,125, + 6,124,6,116,4,106,5,124,1,60,0,124,0,124,6,95, + 9,122,42,124,4,114,62,116,10,124,0,124,1,131,2,125, + 7,116,11,160,12,124,0,106,13,124,7,161,2,125,8,124, + 8,103,1,124,6,95,14,116,15,124,6,100,3,131,2,115, + 70,116,16,124,6,95,16,116,11,160,17,124,6,106,18,124, + 1,124,5,161,3,1,0,116,19,124,3,124,6,106,18,131, + 2,1,0,87,0,110,8,1,0,1,0,1,0,116,4,106, + 5,124,1,61,0,130,0,122,7,116,4,106,5,124,1,25, + 0,125,6,87,0,110,14,4,0,116,20,121,125,1,0,1, + 0,1,0,116,21,100,4,124,1,155,2,100,5,157,3,131, + 1,130,1,116,22,160,23,100,6,124,1,124,5,161,3,1, + 0,124,6,83,0,119,0,41,7,97,64,1,0,0,108,111, + 97,100,95,109,111,100,117,108,101,40,102,117,108,108,110,97, + 109,101,41,32,45,62,32,109,111,100,117,108,101,46,10,10, + 32,32,32,32,32,32,32,32,76,111,97,100,32,116,104,101, 32,109,111,100,117,108,101,32,115,112,101,99,105,102,105,101, 100,32,98,121,32,39,102,117,108,108,110,97,109,101,39,46, 32,39,102,117,108,108,110,97,109,101,39,32,109,117,115,116, @@ -236,228 +470,20 @@ 102,117,108,108,121,32,113,117,97,108,105,102,105,101,100,32, 40,100,111,116,116,101,100,41,32,109,111,100,117,108,101,32, 110,97,109,101,46,32,73,116,32,114,101,116,117,114,110,115, - 32,116,104,101,32,122,105,112,105,109,112,111,114,116,101,114, - 10,32,32,32,32,32,32,32,32,105,110,115,116,97,110,99, - 101,32,105,116,115,101,108,102,32,105,102,32,116,104,101,32, - 109,111,100,117,108,101,32,119,97,115,32,102,111,117,110,100, - 44,32,111,114,32,78,111,110,101,32,105,102,32,105,116,32, - 119,97,115,110,39,116,46,10,32,32,32,32,32,32,32,32, - 84,104,101,32,111,112,116,105,111,110,97,108,32,39,112,97, - 116,104,39,32,97,114,103,117,109,101,110,116,32,105,115,32, - 105,103,110,111,114,101,100,32,45,45,32,105,116,39,115,32, - 116,104,101,114,101,32,102,111,114,32,99,111,109,112,97,116, - 105,98,105,108,105,116,121,10,32,32,32,32,32,32,32,32, - 119,105,116,104,32,116,104,101,32,105,109,112,111,114,116,101, - 114,32,112,114,111,116,111,99,111,108,46,10,10,32,32,32, - 32,32,32,32,32,68,101,112,114,101,99,97,116,101,100,32, - 115,105,110,99,101,32,80,121,116,104,111,110,32,51,46,49, - 48,46,32,85,115,101,32,102,105,110,100,95,115,112,101,99, - 40,41,32,105,110,115,116,101,97,100,46,10,32,32,32,32, - 32,32,32,32,114,0,0,0,0,78,41,1,114,41,0,0, - 0,41,3,114,32,0,0,0,114,38,0,0,0,114,13,0, - 0,0,114,9,0,0,0,114,9,0,0,0,114,10,0,0, - 0,218,11,102,105,110,100,95,109,111,100,117,108,101,144,0, - 0,0,115,4,0,0,0,16,11,255,128,122,23,122,105,112, - 105,109,112,111,114,116,101,114,46,102,105,110,100,95,109,111, - 100,117,108,101,99,3,0,0,0,0,0,0,0,0,0,0, - 0,7,0,0,0,5,0,0,0,67,0,0,0,115,108,0, - 0,0,116,0,124,0,124,1,131,2,125,3,124,3,100,1, - 117,1,114,34,116,1,106,2,124,1,124,0,124,3,100,2, - 141,3,83,0,116,3,124,0,124,1,131,2,125,4,116,4, - 124,0,124,4,131,2,114,104,124,0,106,5,155,0,116,6, - 155,0,124,4,155,0,157,3,125,5,116,1,106,7,124,1, - 100,1,100,3,100,4,141,3,125,6,124,6,106,8,160,9, - 124,5,161,1,1,0,124,6,83,0,100,1,83,0,41,5, - 122,107,67,114,101,97,116,101,32,97,32,77,111,100,117,108, - 101,83,112,101,99,32,102,111,114,32,116,104,101,32,115,112, - 101,99,105,102,105,101,100,32,109,111,100,117,108,101,46,10, - 10,32,32,32,32,32,32,32,32,82,101,116,117,114,110,115, - 32,78,111,110,101,32,105,102,32,116,104,101,32,109,111,100, - 117,108,101,32,99,97,110,110,111,116,32,98,101,32,102,111, - 117,110,100,46,10,32,32,32,32,32,32,32,32,78,41,1, - 218,10,105,115,95,112,97,99,107,97,103,101,84,41,3,218, - 4,110,97,109,101,90,6,108,111,97,100,101,114,114,43,0, - 0,0,41,10,114,35,0,0,0,218,10,95,98,111,111,116, - 115,116,114,97,112,90,16,115,112,101,99,95,102,114,111,109, - 95,108,111,97,100,101,114,114,36,0,0,0,114,37,0,0, - 0,114,29,0,0,0,114,20,0,0,0,90,10,77,111,100, - 117,108,101,83,112,101,99,90,26,115,117,98,109,111,100,117, - 108,101,95,115,101,97,114,99,104,95,108,111,99,97,116,105, - 111,110,115,114,24,0,0,0,41,7,114,32,0,0,0,114, - 38,0,0,0,90,6,116,97,114,103,101,116,90,11,109,111, - 100,117,108,101,95,105,110,102,111,114,40,0,0,0,114,13, - 0,0,0,90,4,115,112,101,99,114,9,0,0,0,114,9, - 0,0,0,114,10,0,0,0,218,9,102,105,110,100,95,115, - 112,101,99,157,0,0,0,115,26,0,0,0,10,5,8,1, - 16,1,10,7,10,1,18,4,8,1,2,1,6,255,12,2, - 4,1,4,2,255,128,122,21,122,105,112,105,109,112,111,114, - 116,101,114,46,102,105,110,100,95,115,112,101,99,99,2,0, - 0,0,0,0,0,0,0,0,0,0,5,0,0,0,3,0, - 0,0,67,0,0,0,115,20,0,0,0,116,0,124,0,124, - 1,131,2,92,3,125,2,125,3,125,4,124,2,83,0,41, - 2,122,166,103,101,116,95,99,111,100,101,40,102,117,108,108, - 110,97,109,101,41,32,45,62,32,99,111,100,101,32,111,98, - 106,101,99,116,46,10,10,32,32,32,32,32,32,32,32,82, - 101,116,117,114,110,32,116,104,101,32,99,111,100,101,32,111, - 98,106,101,99,116,32,102,111,114,32,116,104,101,32,115,112, - 101,99,105,102,105,101,100,32,109,111,100,117,108,101,46,32, - 82,97,105,115,101,32,90,105,112,73,109,112,111,114,116,69, - 114,114,111,114,10,32,32,32,32,32,32,32,32,105,102,32, - 116,104,101,32,109,111,100,117,108,101,32,99,111,117,108,100, - 110,39,116,32,98,101,32,105,109,112,111,114,116,101,100,46, - 10,32,32,32,32,32,32,32,32,78,169,1,218,16,95,103, - 101,116,95,109,111,100,117,108,101,95,99,111,100,101,169,5, - 114,32,0,0,0,114,38,0,0,0,218,4,99,111,100,101, - 218,9,105,115,112,97,99,107,97,103,101,114,40,0,0,0, - 114,9,0,0,0,114,9,0,0,0,114,10,0,0,0,218, - 8,103,101,116,95,99,111,100,101,184,0,0,0,115,6,0, - 0,0,16,6,4,1,255,128,122,20,122,105,112,105,109,112, - 111,114,116,101,114,46,103,101,116,95,99,111,100,101,99,2, - 0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,8, - 0,0,0,67,0,0,0,115,112,0,0,0,116,0,114,16, - 124,1,160,1,116,0,116,2,161,2,125,1,124,1,125,2, - 124,1,160,3,124,0,106,4,116,2,23,0,161,1,114,58, - 124,1,116,5,124,0,106,4,116,2,23,0,131,1,100,1, - 133,2,25,0,125,2,122,14,124,0,106,6,124,2,25,0, - 125,3,87,0,110,24,4,0,116,7,121,110,1,0,1,0, - 1,0,116,8,100,2,100,3,124,2,131,3,130,1,116,9, - 124,0,106,4,124,3,131,2,83,0,119,0,41,4,122,154, - 103,101,116,95,100,97,116,97,40,112,97,116,104,110,97,109, - 101,41,32,45,62,32,115,116,114,105,110,103,32,119,105,116, - 104,32,102,105,108,101,32,100,97,116,97,46,10,10,32,32, - 32,32,32,32,32,32,82,101,116,117,114,110,32,116,104,101, - 32,100,97,116,97,32,97,115,115,111,99,105,97,116,101,100, - 32,119,105,116,104,32,39,112,97,116,104,110,97,109,101,39, - 46,32,82,97,105,115,101,32,79,83,69,114,114,111,114,32, - 105,102,10,32,32,32,32,32,32,32,32,116,104,101,32,102, - 105,108,101,32,119,97,115,110,39,116,32,102,111,117,110,100, - 46,10,32,32,32,32,32,32,32,32,78,114,0,0,0,0, - 218,0,41,10,114,18,0,0,0,114,19,0,0,0,114,20, - 0,0,0,218,10,115,116,97,114,116,115,119,105,116,104,114, - 29,0,0,0,218,3,108,101,110,114,28,0,0,0,114,26, - 0,0,0,114,22,0,0,0,218,9,95,103,101,116,95,100, - 97,116,97,41,4,114,32,0,0,0,218,8,112,97,116,104, - 110,97,109,101,90,3,107,101,121,218,9,116,111,99,95,101, - 110,116,114,121,114,9,0,0,0,114,9,0,0,0,114,10, - 0,0,0,218,8,103,101,116,95,100,97,116,97,194,0,0, - 0,115,24,0,0,0,4,6,12,1,4,2,16,1,22,1, - 2,2,14,1,12,1,12,1,12,1,2,254,255,128,122,20, - 122,105,112,105,109,112,111,114,116,101,114,46,103,101,116,95, - 100,97,116,97,99,2,0,0,0,0,0,0,0,0,0,0, - 0,5,0,0,0,3,0,0,0,67,0,0,0,115,20,0, - 0,0,116,0,124,0,124,1,131,2,92,3,125,2,125,3, - 125,4,124,4,83,0,41,2,122,165,103,101,116,95,102,105, - 108,101,110,97,109,101,40,102,117,108,108,110,97,109,101,41, - 32,45,62,32,102,105,108,101,110,97,109,101,32,115,116,114, - 105,110,103,46,10,10,32,32,32,32,32,32,32,32,82,101, - 116,117,114,110,32,116,104,101,32,102,105,108,101,110,97,109, - 101,32,102,111,114,32,116,104,101,32,115,112,101,99,105,102, - 105,101,100,32,109,111,100,117,108,101,32,111,114,32,114,97, - 105,115,101,32,90,105,112,73,109,112,111,114,116,69,114,114, - 111,114,10,32,32,32,32,32,32,32,32,105,102,32,105,116, - 32,99,111,117,108,100,110,39,116,32,98,101,32,105,109,112, - 111,114,116,101,100,46,10,32,32,32,32,32,32,32,32,78, - 114,47,0,0,0,114,49,0,0,0,114,9,0,0,0,114, - 9,0,0,0,114,10,0,0,0,218,12,103,101,116,95,102, - 105,108,101,110,97,109,101,215,0,0,0,115,6,0,0,0, - 16,8,4,1,255,128,122,24,122,105,112,105,109,112,111,114, - 116,101,114,46,103,101,116,95,102,105,108,101,110,97,109,101, - 99,2,0,0,0,0,0,0,0,0,0,0,0,6,0,0, - 0,8,0,0,0,67,0,0,0,115,126,0,0,0,116,0, - 124,0,124,1,131,2,125,2,124,2,100,1,117,0,114,36, - 116,1,100,2,124,1,155,2,157,2,124,1,100,3,141,2, - 130,1,116,2,124,0,124,1,131,2,125,3,124,2,114,64, - 116,3,160,4,124,3,100,4,161,2,125,4,110,10,124,3, - 155,0,100,5,157,2,125,4,122,14,124,0,106,5,124,4, - 25,0,125,5,87,0,110,18,4,0,116,6,121,124,1,0, - 1,0,1,0,89,0,100,1,83,0,116,7,124,0,106,8, - 124,5,131,2,160,9,161,0,83,0,119,0,41,6,122,253, - 103,101,116,95,115,111,117,114,99,101,40,102,117,108,108,110, - 97,109,101,41,32,45,62,32,115,111,117,114,99,101,32,115, - 116,114,105,110,103,46,10,10,32,32,32,32,32,32,32,32, - 82,101,116,117,114,110,32,116,104,101,32,115,111,117,114,99, - 101,32,99,111,100,101,32,102,111,114,32,116,104,101,32,115, - 112,101,99,105,102,105,101,100,32,109,111,100,117,108,101,46, - 32,82,97,105,115,101,32,90,105,112,73,109,112,111,114,116, - 69,114,114,111,114,10,32,32,32,32,32,32,32,32,105,102, - 32,116,104,101,32,109,111,100,117,108,101,32,99,111,117,108, - 100,110,39,116,32,98,101,32,102,111,117,110,100,44,32,114, - 101,116,117,114,110,32,78,111,110,101,32,105,102,32,116,104, - 101,32,97,114,99,104,105,118,101,32,100,111,101,115,10,32, - 32,32,32,32,32,32,32,99,111,110,116,97,105,110,32,116, - 104,101,32,109,111,100,117,108,101,44,32,98,117,116,32,104, - 97,115,32,110,111,32,115,111,117,114,99,101,32,102,111,114, - 32,105,116,46,10,32,32,32,32,32,32,32,32,78,250,18, - 99,97,110,39,116,32,102,105,110,100,32,109,111,100,117,108, - 101,32,169,1,114,44,0,0,0,250,11,95,95,105,110,105, - 116,95,95,46,112,121,250,3,46,112,121,41,10,114,35,0, - 0,0,114,3,0,0,0,114,36,0,0,0,114,21,0,0, - 0,114,30,0,0,0,114,28,0,0,0,114,26,0,0,0, - 114,56,0,0,0,114,29,0,0,0,218,6,100,101,99,111, - 100,101,41,6,114,32,0,0,0,114,38,0,0,0,114,39, - 0,0,0,114,13,0,0,0,218,8,102,117,108,108,112,97, - 116,104,114,58,0,0,0,114,9,0,0,0,114,9,0,0, - 0,114,10,0,0,0,218,10,103,101,116,95,115,111,117,114, - 99,101,227,0,0,0,115,28,0,0,0,10,7,8,1,18, - 1,10,2,4,1,14,1,10,2,2,2,14,1,12,1,6, - 2,16,1,2,253,255,128,122,22,122,105,112,105,109,112,111, - 114,116,101,114,46,103,101,116,95,115,111,117,114,99,101,99, - 2,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0, - 4,0,0,0,67,0,0,0,115,40,0,0,0,116,0,124, - 0,124,1,131,2,125,2,124,2,100,1,117,0,114,36,116, - 1,100,2,124,1,155,2,157,2,124,1,100,3,141,2,130, - 1,124,2,83,0,41,4,122,171,105,115,95,112,97,99,107, - 97,103,101,40,102,117,108,108,110,97,109,101,41,32,45,62, - 32,98,111,111,108,46,10,10,32,32,32,32,32,32,32,32, - 82,101,116,117,114,110,32,84,114,117,101,32,105,102,32,116, - 104,101,32,109,111,100,117,108,101,32,115,112,101,99,105,102, - 105,101,100,32,98,121,32,102,117,108,108,110,97,109,101,32, - 105,115,32,97,32,112,97,99,107,97,103,101,46,10,32,32, - 32,32,32,32,32,32,82,97,105,115,101,32,90,105,112,73, - 109,112,111,114,116,69,114,114,111,114,32,105,102,32,116,104, - 101,32,109,111,100,117,108,101,32,99,111,117,108,100,110,39, - 116,32,98,101,32,102,111,117,110,100,46,10,32,32,32,32, - 32,32,32,32,78,114,61,0,0,0,114,62,0,0,0,41, - 2,114,35,0,0,0,114,3,0,0,0,41,3,114,32,0, - 0,0,114,38,0,0,0,114,39,0,0,0,114,9,0,0, - 0,114,9,0,0,0,114,10,0,0,0,114,43,0,0,0, - 253,0,0,0,115,10,0,0,0,10,6,8,1,18,1,4, - 1,255,128,122,22,122,105,112,105,109,112,111,114,116,101,114, - 46,105,115,95,112,97,99,107,97,103,101,99,2,0,0,0, - 0,0,0,0,0,0,0,0,9,0,0,0,8,0,0,0, - 67,0,0,0,115,252,0,0,0,100,1,125,2,116,0,160, - 1,124,2,116,2,161,2,1,0,116,3,124,0,124,1,131, - 2,92,3,125,3,125,4,125,5,116,4,106,5,160,6,124, - 1,161,1,125,6,124,6,100,2,117,0,115,62,116,7,124, - 6,116,8,131,2,115,80,116,8,124,1,131,1,125,6,124, - 6,116,4,106,5,124,1,60,0,124,0,124,6,95,9,122, - 84,124,4,114,124,116,10,124,0,124,1,131,2,125,7,116, - 11,160,12,124,0,106,13,124,7,161,2,125,8,124,8,103, - 1,124,6,95,14,116,15,124,6,100,3,131,2,115,140,116, - 16,124,6,95,16,116,11,160,17,124,6,106,18,124,1,124, - 5,161,3,1,0,116,19,124,3,124,6,106,18,131,2,1, - 0,87,0,110,16,1,0,1,0,1,0,116,4,106,5,124, - 1,61,0,130,0,122,14,116,4,106,5,124,1,25,0,125, - 6,87,0,110,28,4,0,116,20,121,250,1,0,1,0,1, - 0,116,21,100,4,124,1,155,2,100,5,157,3,131,1,130, - 1,116,22,160,23,100,6,124,1,124,5,161,3,1,0,124, - 6,83,0,119,0,41,7,97,64,1,0,0,108,111,97,100, - 95,109,111,100,117,108,101,40,102,117,108,108,110,97,109,101, - 41,32,45,62,32,109,111,100,117,108,101,46,10,10,32,32, - 32,32,32,32,32,32,76,111,97,100,32,116,104,101,32,109, - 111,100,117,108,101,32,115,112,101,99,105,102,105,101,100,32, - 98,121,32,39,102,117,108,108,110,97,109,101,39,46,32,39, - 102,117,108,108,110,97,109,101,39,32,109,117,115,116,32,98, - 101,32,116,104,101,10,32,32,32,32,32,32,32,32,102,117, - 108,108,121,32,113,117,97,108,105,102,105,101,100,32,40,100, - 111,116,116,101,100,41,32,109,111,100,117,108,101,32,110,97, - 109,101,46,32,73,116,32,114,101,116,117,114,110,115,32,116, - 104,101,32,105,109,112,111,114,116,101,100,10,32,32,32,32, - 32,32,32,32,109,111,100,117,108,101,44,32,111,114,32,114, - 97,105,115,101,115,32,90,105,112,73,109,112,111,114,116,69, - 114,114,111,114,32,105,102,32,105,116,32,99,111,117,108,100, - 32,110,111,116,32,98,101,32,105,109,112,111,114,116,101,100, - 46,10,10,32,32,32,32,32,32,32,32,68,101,112,114,101, - 99,97,116,101,100,32,115,105,110,99,101,32,80,121,116,104, - 111,110,32,51,46,49,48,46,32,85,115,101,32,101,120,101, + 32,116,104,101,32,105,109,112,111,114,116,101,100,10,32,32, + 32,32,32,32,32,32,109,111,100,117,108,101,44,32,111,114, + 32,114,97,105,115,101,115,32,90,105,112,73,109,112,111,114, + 116,69,114,114,111,114,32,105,102,32,105,116,32,99,111,117, + 108,100,32,110,111,116,32,98,101,32,105,109,112,111,114,116, + 101,100,46,10,10,32,32,32,32,32,32,32,32,68,101,112, + 114,101,99,97,116,101,100,32,115,105,110,99,101,32,80,121, + 116,104,111,110,32,51,46,49,48,46,32,85,115,101,32,101, + 120,101,99,95,109,111,100,117,108,101,40,41,32,105,110,115, + 116,101,97,100,46,10,32,32,32,32,32,32,32,32,122,114, + 122,105,112,105,109,112,111,114,116,46,122,105,112,105,109,112, + 111,114,116,101,114,46,108,111,97,100,95,109,111,100,117,108, + 101,40,41,32,105,115,32,100,101,112,114,101,99,97,116,101, + 100,32,97,110,100,32,115,108,97,116,101,100,32,102,111,114, + 32,114,101,109,111,118,97,108,32,105,110,32,80,121,116,104, + 111,110,32,51,46,49,50,59,32,117,115,101,32,101,120,101, 99,95,109,111,100,117,108,101,40,41,32,105,110,115,116,101, @@ -463,154 +489,196 @@ 99,95,109,111,100,117,108,101,40,41,32,105,110,115,116,101, - 97,100,46,10,32,32,32,32,32,32,32,32,122,114,122,105, - 112,105,109,112,111,114,116,46,122,105,112,105,109,112,111,114, - 116,101,114,46,108,111,97,100,95,109,111,100,117,108,101,40, - 41,32,105,115,32,100,101,112,114,101,99,97,116,101,100,32, - 97,110,100,32,115,108,97,116,101,100,32,102,111,114,32,114, - 101,109,111,118,97,108,32,105,110,32,80,121,116,104,111,110, - 32,51,46,49,50,59,32,117,115,101,32,101,120,101,99,95, - 109,111,100,117,108,101,40,41,32,105,110,115,116,101,97,100, - 78,218,12,95,95,98,117,105,108,116,105,110,115,95,95,122, - 14,76,111,97,100,101,100,32,109,111,100,117,108,101,32,122, - 25,32,110,111,116,32,102,111,117,110,100,32,105,110,32,115, - 121,115,46,109,111,100,117,108,101,115,122,30,105,109,112,111, - 114,116,32,123,125,32,35,32,108,111,97,100,101,100,32,102, - 114,111,109,32,90,105,112,32,123,125,41,24,218,9,95,119, - 97,114,110,105,110,103,115,90,4,119,97,114,110,218,18,68, - 101,112,114,101,99,97,116,105,111,110,87,97,114,110,105,110, - 103,114,48,0,0,0,218,3,115,121,115,218,7,109,111,100, - 117,108,101,115,218,3,103,101,116,114,15,0,0,0,218,12, - 95,109,111,100,117,108,101,95,116,121,112,101,218,10,95,95, - 108,111,97,100,101,114,95,95,114,36,0,0,0,114,21,0, - 0,0,114,30,0,0,0,114,29,0,0,0,90,8,95,95, - 112,97,116,104,95,95,218,7,104,97,115,97,116,116,114,114, - 68,0,0,0,90,14,95,102,105,120,95,117,112,95,109,111, - 100,117,108,101,218,8,95,95,100,105,99,116,95,95,218,4, - 101,120,101,99,114,26,0,0,0,218,11,73,109,112,111,114, - 116,69,114,114,111,114,114,45,0,0,0,218,16,95,118,101, - 114,98,111,115,101,95,109,101,115,115,97,103,101,41,9,114, - 32,0,0,0,114,38,0,0,0,218,3,109,115,103,114,50, - 0,0,0,114,51,0,0,0,114,40,0,0,0,90,3,109, - 111,100,114,13,0,0,0,114,66,0,0,0,114,9,0,0, - 0,114,9,0,0,0,114,10,0,0,0,218,11,108,111,97, - 100,95,109,111,100,117,108,101,10,1,0,0,115,56,0,0, - 0,4,9,12,2,16,1,12,1,18,1,8,1,10,1,6, - 1,2,2,4,1,10,3,14,1,8,1,10,2,6,1,16, - 1,16,1,6,1,8,1,2,1,2,2,14,1,12,1,16, - 1,14,1,4,1,2,253,255,128,122,23,122,105,112,105,109, - 112,111,114,116,101,114,46,108,111,97,100,95,109,111,100,117, - 108,101,99,2,0,0,0,0,0,0,0,0,0,0,0,3, - 0,0,0,8,0,0,0,67,0,0,0,115,64,0,0,0, - 122,20,124,0,160,0,124,1,161,1,115,18,87,0,100,1, - 83,0,87,0,110,18,4,0,116,1,121,62,1,0,1,0, - 1,0,89,0,100,1,83,0,100,2,100,3,108,2,109,3, - 125,2,1,0,124,2,124,0,124,1,131,2,83,0,119,0, - 41,4,122,204,82,101,116,117,114,110,32,116,104,101,32,82, - 101,115,111,117,114,99,101,82,101,97,100,101,114,32,102,111, - 114,32,97,32,112,97,99,107,97,103,101,32,105,110,32,97, - 32,122,105,112,32,102,105,108,101,46,10,10,32,32,32,32, - 32,32,32,32,73,102,32,39,102,117,108,108,110,97,109,101, - 39,32,105,115,32,97,32,112,97,99,107,97,103,101,32,119, - 105,116,104,105,110,32,116,104,101,32,122,105,112,32,102,105, - 108,101,44,32,114,101,116,117,114,110,32,116,104,101,10,32, - 32,32,32,32,32,32,32,39,82,101,115,111,117,114,99,101, - 82,101,97,100,101,114,39,32,111,98,106,101,99,116,32,102, - 111,114,32,116,104,101,32,112,97,99,107,97,103,101,46,32, - 32,79,116,104,101,114,119,105,115,101,32,114,101,116,117,114, - 110,32,78,111,110,101,46,10,32,32,32,32,32,32,32,32, - 78,114,0,0,0,0,41,1,218,9,90,105,112,82,101,97, - 100,101,114,41,4,114,43,0,0,0,114,3,0,0,0,90, - 17,105,109,112,111,114,116,108,105,98,46,114,101,97,100,101, - 114,115,114,83,0,0,0,41,3,114,32,0,0,0,114,38, - 0,0,0,114,83,0,0,0,114,9,0,0,0,114,9,0, - 0,0,114,10,0,0,0,218,19,103,101,116,95,114,101,115, - 111,117,114,99,101,95,114,101,97,100,101,114,53,1,0,0, - 115,20,0,0,0,2,6,10,1,6,1,4,255,12,2,6, - 1,12,1,10,1,2,253,255,128,122,31,122,105,112,105,109, - 112,111,114,116,101,114,46,103,101,116,95,114,101,115,111,117, - 114,99,101,95,114,101,97,100,101,114,99,1,0,0,0,0, - 0,0,0,0,0,0,0,1,0,0,0,8,0,0,0,67, - 0,0,0,115,72,0,0,0,122,30,116,0,124,0,106,1, - 131,1,124,0,95,2,124,0,106,2,116,3,124,0,106,1, - 60,0,87,0,100,1,83,0,4,0,116,4,121,70,1,0, - 1,0,1,0,116,3,160,5,124,0,106,1,100,1,161,2, - 1,0,100,1,124,0,95,2,89,0,100,1,83,0,119,0, - 41,2,122,41,82,101,108,111,97,100,32,116,104,101,32,102, - 105,108,101,32,100,97,116,97,32,111,102,32,116,104,101,32, - 97,114,99,104,105,118,101,32,112,97,116,104,46,78,41,6, - 114,27,0,0,0,114,29,0,0,0,114,28,0,0,0,114, - 25,0,0,0,114,3,0,0,0,218,3,112,111,112,169,1, - 114,32,0,0,0,114,9,0,0,0,114,9,0,0,0,114, - 10,0,0,0,218,17,105,110,118,97,108,105,100,97,116,101, - 95,99,97,99,104,101,115,68,1,0,0,115,16,0,0,0, - 2,2,12,1,18,1,12,1,14,1,12,1,2,254,255,128, - 122,29,122,105,112,105,109,112,111,114,116,101,114,46,105,110, - 118,97,108,105,100,97,116,101,95,99,97,99,104,101,115,99, - 1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0, - 5,0,0,0,67,0,0,0,115,24,0,0,0,100,1,124, - 0,106,0,155,0,116,1,155,0,124,0,106,2,155,0,100, - 2,157,5,83,0,41,3,78,122,21,60,122,105,112,105,109, - 112,111,114,116,101,114,32,111,98,106,101,99,116,32,34,122, - 2,34,62,41,3,114,29,0,0,0,114,20,0,0,0,114, - 31,0,0,0,114,86,0,0,0,114,9,0,0,0,114,9, - 0,0,0,114,10,0,0,0,218,8,95,95,114,101,112,114, - 95,95,78,1,0,0,115,4,0,0,0,24,1,255,128,122, - 20,122,105,112,105,109,112,111,114,116,101,114,46,95,95,114, - 101,112,114,95,95,41,1,78,41,1,78,41,1,78,41,17, - 114,6,0,0,0,114,7,0,0,0,114,8,0,0,0,218, - 7,95,95,100,111,99,95,95,114,34,0,0,0,114,41,0, - 0,0,114,42,0,0,0,114,46,0,0,0,114,52,0,0, - 0,114,59,0,0,0,114,60,0,0,0,114,67,0,0,0, - 114,43,0,0,0,114,82,0,0,0,114,84,0,0,0,114, - 87,0,0,0,114,88,0,0,0,114,9,0,0,0,114,9, - 0,0,0,114,9,0,0,0,114,10,0,0,0,114,4,0, - 0,0,46,0,0,0,115,32,0,0,0,8,0,4,1,8, - 17,10,46,10,34,10,13,8,27,8,10,8,21,8,12,8, - 26,8,13,8,43,8,15,12,10,255,128,122,12,95,95,105, - 110,105,116,95,95,46,112,121,99,84,114,63,0,0,0,70, - 41,3,122,4,46,112,121,99,84,70,41,3,114,64,0,0, - 0,70,70,99,2,0,0,0,0,0,0,0,0,0,0,0, - 2,0,0,0,4,0,0,0,67,0,0,0,115,20,0,0, - 0,124,0,106,0,124,1,160,1,100,1,161,1,100,2,25, - 0,23,0,83,0,41,3,78,218,1,46,233,2,0,0,0, - 41,2,114,31,0,0,0,218,10,114,112,97,114,116,105,116, - 105,111,110,41,2,114,32,0,0,0,114,38,0,0,0,114, - 9,0,0,0,114,9,0,0,0,114,10,0,0,0,114,36, - 0,0,0,96,1,0,0,115,4,0,0,0,20,1,255,128, - 114,36,0,0,0,99,2,0,0,0,0,0,0,0,0,0, - 0,0,3,0,0,0,2,0,0,0,67,0,0,0,115,18, - 0,0,0,124,1,116,0,23,0,125,2,124,2,124,0,106, - 1,118,0,83,0,169,1,78,41,2,114,20,0,0,0,114, - 28,0,0,0,41,3,114,32,0,0,0,114,13,0,0,0, - 90,7,100,105,114,112,97,116,104,114,9,0,0,0,114,9, - 0,0,0,114,10,0,0,0,114,37,0,0,0,100,1,0, - 0,115,6,0,0,0,8,4,10,2,255,128,114,37,0,0, - 0,99,2,0,0,0,0,0,0,0,0,0,0,0,7,0, - 0,0,4,0,0,0,67,0,0,0,115,56,0,0,0,116, - 0,124,0,124,1,131,2,125,2,116,1,68,0,93,36,92, - 3,125,3,125,4,125,5,124,2,124,3,23,0,125,6,124, - 6,124,0,106,2,118,0,114,50,124,5,2,0,1,0,83, - 0,113,14,100,0,83,0,114,93,0,0,0,41,3,114,36, - 0,0,0,218,16,95,122,105,112,95,115,101,97,114,99,104, - 111,114,100,101,114,114,28,0,0,0,41,7,114,32,0,0, - 0,114,38,0,0,0,114,13,0,0,0,218,6,115,117,102, - 102,105,120,218,10,105,115,98,121,116,101,99,111,100,101,114, - 51,0,0,0,114,66,0,0,0,114,9,0,0,0,114,9, - 0,0,0,114,10,0,0,0,114,35,0,0,0,109,1,0, - 0,115,16,0,0,0,10,1,14,1,8,1,10,1,8,1, - 2,255,4,2,255,128,114,35,0,0,0,99,1,0,0,0, - 0,0,0,0,0,0,0,0,26,0,0,0,9,0,0,0, - 67,0,0,0,115,236,4,0,0,122,14,116,0,160,1,124, - 0,161,1,125,1,87,0,110,32,4,0,116,2,144,4,121, - 234,1,0,1,0,1,0,116,3,100,1,124,0,155,2,157, - 2,124,0,100,2,141,2,130,1,124,1,144,4,143,130,1, - 0,122,36,124,1,160,4,116,5,11,0,100,3,161,2,1, - 0,124,1,160,6,161,0,125,2,124,1,160,7,116,5,161, - 1,125,3,87,0,110,32,4,0,116,2,144,4,121,232,1, - 0,1,0,1,0,116,3,100,4,124,0,155,2,157,2,124, - 0,100,2,141,2,130,1,116,8,124,3,131,1,116,5,107, - 3,114,156,116,3,100,4,124,0,155,2,157,2,124,0,100, - 2,141,2,130,1,124,3,100,0,100,5,133,2,25,0,116, - 9,107,3,144,1,114,152,122,24,124,1,160,4,100,6,100, - 3,161,2,1,0,124,1,160,6,161,0,125,4,87,0,110, - 32,4,0,116,2,144,4,121,230,1,0,1,0,1,0,116, + 97,100,78,218,12,95,95,98,117,105,108,116,105,110,115,95, + 95,122,14,76,111,97,100,101,100,32,109,111,100,117,108,101, + 32,122,25,32,110,111,116,32,102,111,117,110,100,32,105,110, + 32,115,121,115,46,109,111,100,117,108,101,115,122,30,105,109, + 112,111,114,116,32,123,125,32,35,32,108,111,97,100,101,100, + 32,102,114,111,109,32,90,105,112,32,123,125,41,24,114,35, + 0,0,0,114,36,0,0,0,114,37,0,0,0,114,51,0, + 0,0,218,3,115,121,115,218,7,109,111,100,117,108,101,115, + 218,3,103,101,116,114,15,0,0,0,218,12,95,109,111,100, + 117,108,101,95,116,121,112,101,218,10,95,95,108,111,97,100, + 101,114,95,95,114,39,0,0,0,114,21,0,0,0,114,30, + 0,0,0,114,29,0,0,0,90,8,95,95,112,97,116,104, + 95,95,218,7,104,97,115,97,116,116,114,114,71,0,0,0, + 90,14,95,102,105,120,95,117,112,95,109,111,100,117,108,101, + 218,8,95,95,100,105,99,116,95,95,218,4,101,120,101,99, + 114,26,0,0,0,218,11,73,109,112,111,114,116,69,114,114, + 111,114,114,48,0,0,0,218,16,95,118,101,114,98,111,115, + 101,95,109,101,115,115,97,103,101,41,9,114,32,0,0,0, + 114,41,0,0,0,218,3,109,115,103,114,53,0,0,0,114, + 54,0,0,0,114,43,0,0,0,90,3,109,111,100,114,13, + 0,0,0,114,69,0,0,0,114,9,0,0,0,114,9,0, + 0,0,114,10,0,0,0,218,11,108,111,97,100,95,109,111, + 100,117,108,101,16,1,0,0,115,56,0,0,0,4,9,12, + 2,16,1,12,1,18,1,8,1,10,1,6,1,2,2,4, + 1,10,3,14,1,8,1,10,2,6,1,16,1,16,1,6, + 1,8,1,2,1,2,2,14,1,12,1,16,1,14,1,4, + 1,2,253,255,128,122,23,122,105,112,105,109,112,111,114,116, + 101,114,46,108,111,97,100,95,109,111,100,117,108,101,99,2, + 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,8, + 0,0,0,67,0,0,0,115,64,0,0,0,122,10,124,0, + 160,0,124,1,161,1,115,9,87,0,100,1,83,0,87,0, + 110,9,4,0,116,1,121,31,1,0,1,0,1,0,89,0, + 100,1,83,0,100,2,100,3,108,2,109,3,125,2,1,0, + 124,2,124,0,124,1,131,2,83,0,119,0,41,4,122,204, + 82,101,116,117,114,110,32,116,104,101,32,82,101,115,111,117, + 114,99,101,82,101,97,100,101,114,32,102,111,114,32,97,32, + 112,97,99,107,97,103,101,32,105,110,32,97,32,122,105,112, + 32,102,105,108,101,46,10,10,32,32,32,32,32,32,32,32, + 73,102,32,39,102,117,108,108,110,97,109,101,39,32,105,115, + 32,97,32,112,97,99,107,97,103,101,32,119,105,116,104,105, + 110,32,116,104,101,32,122,105,112,32,102,105,108,101,44,32, + 114,101,116,117,114,110,32,116,104,101,10,32,32,32,32,32, + 32,32,32,39,82,101,115,111,117,114,99,101,82,101,97,100, + 101,114,39,32,111,98,106,101,99,116,32,102,111,114,32,116, + 104,101,32,112,97,99,107,97,103,101,46,32,32,79,116,104, + 101,114,119,105,115,101,32,114,101,116,117,114,110,32,78,111, + 110,101,46,10,32,32,32,32,32,32,32,32,78,114,0,0, + 0,0,41,1,218,9,90,105,112,82,101,97,100,101,114,41, + 4,114,46,0,0,0,114,3,0,0,0,90,17,105,109,112, + 111,114,116,108,105,98,46,114,101,97,100,101,114,115,114,84, + 0,0,0,41,3,114,32,0,0,0,114,41,0,0,0,114, + 84,0,0,0,114,9,0,0,0,114,9,0,0,0,114,10, + 0,0,0,218,19,103,101,116,95,114,101,115,111,117,114,99, + 101,95,114,101,97,100,101,114,59,1,0,0,115,20,0,0, + 0,2,6,10,1,6,1,4,255,12,2,6,1,12,1,10, + 1,2,253,255,128,122,31,122,105,112,105,109,112,111,114,116, + 101,114,46,103,101,116,95,114,101,115,111,117,114,99,101,95, + 114,101,97,100,101,114,99,1,0,0,0,0,0,0,0,0, + 0,0,0,1,0,0,0,8,0,0,0,67,0,0,0,115, + 72,0,0,0,122,15,116,0,124,0,106,1,131,1,124,0, + 95,2,124,0,106,2,116,3,124,0,106,1,60,0,87,0, + 100,1,83,0,4,0,116,4,121,35,1,0,1,0,1,0, + 116,3,160,5,124,0,106,1,100,1,161,2,1,0,100,1, + 124,0,95,2,89,0,100,1,83,0,119,0,41,2,122,41, + 82,101,108,111,97,100,32,116,104,101,32,102,105,108,101,32, + 100,97,116,97,32,111,102,32,116,104,101,32,97,114,99,104, + 105,118,101,32,112,97,116,104,46,78,41,6,114,27,0,0, + 0,114,29,0,0,0,114,28,0,0,0,114,25,0,0,0, + 114,3,0,0,0,218,3,112,111,112,169,1,114,32,0,0, + 0,114,9,0,0,0,114,9,0,0,0,114,10,0,0,0, + 218,17,105,110,118,97,108,105,100,97,116,101,95,99,97,99, + 104,101,115,74,1,0,0,115,16,0,0,0,2,2,12,1, + 18,1,12,1,14,1,12,1,2,254,255,128,122,29,122,105, + 112,105,109,112,111,114,116,101,114,46,105,110,118,97,108,105, + 100,97,116,101,95,99,97,99,104,101,115,99,1,0,0,0, + 0,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0, + 67,0,0,0,115,24,0,0,0,100,1,124,0,106,0,155, + 0,116,1,155,0,124,0,106,2,155,0,100,2,157,5,83, + 0,41,3,78,122,21,60,122,105,112,105,109,112,111,114,116, + 101,114,32,111,98,106,101,99,116,32,34,122,2,34,62,41, + 3,114,29,0,0,0,114,20,0,0,0,114,31,0,0,0, + 114,87,0,0,0,114,9,0,0,0,114,9,0,0,0,114, + 10,0,0,0,218,8,95,95,114,101,112,114,95,95,84,1, + 0,0,115,4,0,0,0,24,1,255,128,122,20,122,105,112, + 105,109,112,111,114,116,101,114,46,95,95,114,101,112,114,95, + 95,41,1,78,41,1,78,41,1,78,41,17,114,6,0,0, + 0,114,7,0,0,0,114,8,0,0,0,218,7,95,95,100, + 111,99,95,95,114,34,0,0,0,114,44,0,0,0,114,45, + 0,0,0,114,49,0,0,0,114,55,0,0,0,114,62,0, + 0,0,114,63,0,0,0,114,70,0,0,0,114,46,0,0, + 0,114,83,0,0,0,114,85,0,0,0,114,88,0,0,0, + 114,89,0,0,0,114,9,0,0,0,114,9,0,0,0,114, + 9,0,0,0,114,10,0,0,0,114,4,0,0,0,46,0, + 0,0,115,32,0,0,0,8,0,4,1,8,17,10,46,10, + 37,10,16,8,27,8,10,8,21,8,12,8,26,8,13,8, + 43,8,15,12,10,255,128,122,12,95,95,105,110,105,116,95, + 95,46,112,121,99,84,114,66,0,0,0,70,41,3,122,4, + 46,112,121,99,84,70,41,3,114,67,0,0,0,70,70,99, + 2,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0, + 4,0,0,0,67,0,0,0,115,20,0,0,0,124,0,106, + 0,124,1,160,1,100,1,161,1,100,2,25,0,23,0,83, + 0,41,3,78,218,1,46,233,2,0,0,0,41,2,114,31, + 0,0,0,218,10,114,112,97,114,116,105,116,105,111,110,41, + 2,114,32,0,0,0,114,41,0,0,0,114,9,0,0,0, + 114,9,0,0,0,114,10,0,0,0,114,39,0,0,0,102, + 1,0,0,115,4,0,0,0,20,1,255,128,114,39,0,0, + 0,99,2,0,0,0,0,0,0,0,0,0,0,0,3,0, + 0,0,2,0,0,0,67,0,0,0,115,18,0,0,0,124, + 1,116,0,23,0,125,2,124,2,124,0,106,1,118,0,83, + 0,169,1,78,41,2,114,20,0,0,0,114,28,0,0,0, + 41,3,114,32,0,0,0,114,13,0,0,0,90,7,100,105, + 114,112,97,116,104,114,9,0,0,0,114,9,0,0,0,114, + 10,0,0,0,114,40,0,0,0,106,1,0,0,115,6,0, + 0,0,8,4,10,2,255,128,114,40,0,0,0,99,2,0, + 0,0,0,0,0,0,0,0,0,0,7,0,0,0,4,0, + 0,0,67,0,0,0,115,56,0,0,0,116,0,124,0,124, + 1,131,2,125,2,116,1,68,0,93,18,92,3,125,3,125, + 4,125,5,124,2,124,3,23,0,125,6,124,6,124,0,106, + 2,118,0,114,25,124,5,2,0,1,0,83,0,113,7,100, + 0,83,0,114,94,0,0,0,41,3,114,39,0,0,0,218, + 16,95,122,105,112,95,115,101,97,114,99,104,111,114,100,101, + 114,114,28,0,0,0,41,7,114,32,0,0,0,114,41,0, + 0,0,114,13,0,0,0,218,6,115,117,102,102,105,120,218, + 10,105,115,98,121,116,101,99,111,100,101,114,54,0,0,0, + 114,69,0,0,0,114,9,0,0,0,114,9,0,0,0,114, + 10,0,0,0,114,38,0,0,0,115,1,0,0,115,16,0, + 0,0,10,1,14,1,8,1,10,1,8,1,2,255,4,2, + 255,128,114,38,0,0,0,99,1,0,0,0,0,0,0,0, + 0,0,0,0,26,0,0,0,9,0,0,0,67,0,0,0, + 115,226,4,0,0,122,7,116,0,160,1,124,0,161,1,125, + 1,87,0,110,16,4,0,116,2,144,2,121,112,1,0,1, + 0,1,0,116,3,100,1,124,0,155,2,157,2,124,0,100, + 2,141,2,130,1,124,1,144,2,143,60,1,0,122,18,124, + 1,160,4,116,5,11,0,100,3,161,2,1,0,124,1,160, + 6,161,0,125,2,124,1,160,7,116,5,161,1,125,3,87, + 0,110,16,4,0,116,2,144,2,121,111,1,0,1,0,1, + 0,116,3,100,4,124,0,155,2,157,2,124,0,100,2,141, + 2,130,1,116,8,124,3,131,1,116,5,107,3,114,78,116, + 3,100,4,124,0,155,2,157,2,124,0,100,2,141,2,130, + 1,124,3,100,0,100,5,133,2,25,0,116,9,107,3,114, + 201,122,12,124,1,160,4,100,6,100,3,161,2,1,0,124, + 1,160,6,161,0,125,4,87,0,110,16,4,0,116,2,144, + 2,121,110,1,0,1,0,1,0,116,3,100,4,124,0,155, + 2,157,2,124,0,100,2,141,2,130,1,116,10,124,4,116, + 11,24,0,116,5,24,0,100,6,131,2,125,5,122,11,124, + 1,160,4,124,5,161,1,1,0,124,1,160,7,161,0,125, + 6,87,0,110,16,4,0,116,2,144,2,121,109,1,0,1, + 0,1,0,116,3,100,4,124,0,155,2,157,2,124,0,100, + 2,141,2,130,1,124,6,160,12,116,9,161,1,125,7,124, + 7,100,6,107,0,114,170,116,3,100,7,124,0,155,2,157, + 2,124,0,100,2,141,2,130,1,124,6,124,7,124,7,116, + 5,23,0,133,2,25,0,125,3,116,8,124,3,131,1,116, + 5,107,3,114,193,116,3,100,8,124,0,155,2,157,2,124, + 0,100,2,141,2,130,1,124,4,116,8,124,6,131,1,24, + 0,124,7,23,0,125,2,116,13,124,3,100,9,100,10,133, + 2,25,0,131,1,125,8,116,13,124,3,100,10,100,11,133, + 2,25,0,131,1,125,9,124,2,124,8,107,0,114,230,116, + 3,100,12,124,0,155,2,157,2,124,0,100,2,141,2,130, + 1,124,2,124,9,107,0,114,243,116,3,100,13,124,0,155, + 2,157,2,124,0,100,2,141,2,130,1,124,2,124,8,56, + 0,125,2,124,2,124,9,24,0,125,10,124,10,100,6,107, + 0,144,1,114,9,116,3,100,14,124,0,155,2,157,2,124, + 0,100,2,141,2,130,1,105,0,125,11,100,6,125,12,122, + 7,124,1,160,4,124,2,161,1,1,0,87,0,110,16,4, + 0,116,2,144,2,121,108,1,0,1,0,1,0,116,3,100, + 4,124,0,155,2,157,2,124,0,100,2,141,2,130,1,9, + 0,124,1,160,7,100,16,161,1,125,3,116,8,124,3,131, + 1,100,5,107,0,144,1,114,54,116,14,100,17,131,1,130, + 1,124,3,100,0,100,5,133,2,25,0,100,18,107,3,144, + 1,114,65,144,2,113,80,116,8,124,3,131,1,100,16,107, + 3,144,1,114,76,116,14,100,17,131,1,130,1,116,15,124, + 3,100,19,100,20,133,2,25,0,131,1,125,13,116,15,124, + 3,100,20,100,9,133,2,25,0,131,1,125,14,116,15,124, + 3,100,9,100,21,133,2,25,0,131,1,125,15,116,15,124, + 3,100,21,100,10,133,2,25,0,131,1,125,16,116,13,124, + 3,100,10,100,11,133,2,25,0,131,1,125,17,116,13,124, + 3,100,11,100,22,133,2,25,0,131,1,125,18,116,13,124, + 3,100,22,100,23,133,2,25,0,131,1,125,4,116,15,124, + 3,100,23,100,24,133,2,25,0,131,1,125,19,116,15,124, + 3,100,24,100,25,133,2,25,0,131,1,125,20,116,15,124, + 3,100,25,100,26,133,2,25,0,131,1,125,21,116,13,124, + 3,100,27,100,16,133,2,25,0,131,1,125,22,124,19,124, + 20,23,0,124,21,23,0,125,8,124,22,124,9,107,4,144, + 1,114,184,116,3,100,28,124,0,155,2,157,2,124,0,100, + 2,141,2,130,1,124,22,124,10,55,0,125,22,122,7,124, + 1,160,7,124,19,161,1,125,23,87,0,110,16,4,0,116, + 2,144,2,121,107,1,0,1,0,1,0,116,3,100,4,124, + 0,155,2,157,2,124,0,100,2,141,2,130,1,116,8,124, + 23,131,1,124,19,107,3,144,1,114,228,116,3,100,4,124, + 0,155,2,157,2,124,0,100,2,141,2,130,1,122,25,116, + 8,124,1,160,7,124,8,124,19,24,0,161,1,131,1,124, + 8,124,19,24,0,107,3,144,1,114,252,116,3,100,4,124, + 0,155,2,157,2,124,0,100,2,141,2,130,1,87,0,110, + 16,4,0,116,2,144,2,121,106,1,0,1,0,1,0,116, 3,100,4,124,0,155,2,157,2,124,0,100,2,141,2,130, @@ -616,197 +684,155 @@ 3,100,4,124,0,155,2,157,2,124,0,100,2,141,2,130, - 1,116,10,124,4,116,11,24,0,116,5,24,0,100,6,131, - 2,125,5,122,22,124,1,160,4,124,5,161,1,1,0,124, - 1,160,7,161,0,125,6,87,0,110,32,4,0,116,2,144, - 4,121,228,1,0,1,0,1,0,116,3,100,4,124,0,155, - 2,157,2,124,0,100,2,141,2,130,1,124,6,160,12,116, - 9,161,1,125,7,124,7,100,6,107,0,144,1,114,88,116, - 3,100,7,124,0,155,2,157,2,124,0,100,2,141,2,130, - 1,124,6,124,7,124,7,116,5,23,0,133,2,25,0,125, - 3,116,8,124,3,131,1,116,5,107,3,144,1,114,136,116, - 3,100,8,124,0,155,2,157,2,124,0,100,2,141,2,130, - 1,124,4,116,8,124,6,131,1,24,0,124,7,23,0,125, - 2,116,13,124,3,100,9,100,10,133,2,25,0,131,1,125, - 8,116,13,124,3,100,10,100,11,133,2,25,0,131,1,125, - 9,124,2,124,8,107,0,144,1,114,212,116,3,100,12,124, - 0,155,2,157,2,124,0,100,2,141,2,130,1,124,2,124, - 9,107,0,144,1,114,240,116,3,100,13,124,0,155,2,157, - 2,124,0,100,2,141,2,130,1,124,2,124,8,56,0,125, - 2,124,2,124,9,24,0,125,10,124,10,100,6,107,0,144, - 2,114,28,116,3,100,14,124,0,155,2,157,2,124,0,100, - 2,141,2,130,1,105,0,125,11,100,6,125,12,122,14,124, - 1,160,4,124,2,161,1,1,0,87,0,110,32,4,0,116, - 2,144,4,121,226,1,0,1,0,1,0,116,3,100,4,124, - 0,155,2,157,2,124,0,100,2,141,2,130,1,9,0,124, - 1,160,7,100,16,161,1,125,3,116,8,124,3,131,1,100, - 5,107,0,144,2,114,118,116,14,100,17,131,1,130,1,124, - 3,100,0,100,5,133,2,25,0,100,18,107,3,144,2,114, - 140,144,4,113,170,116,8,124,3,131,1,100,16,107,3,144, - 2,114,162,116,14,100,17,131,1,130,1,116,15,124,3,100, - 19,100,20,133,2,25,0,131,1,125,13,116,15,124,3,100, - 20,100,9,133,2,25,0,131,1,125,14,116,15,124,3,100, - 9,100,21,133,2,25,0,131,1,125,15,116,15,124,3,100, - 21,100,10,133,2,25,0,131,1,125,16,116,13,124,3,100, - 10,100,11,133,2,25,0,131,1,125,17,116,13,124,3,100, - 11,100,22,133,2,25,0,131,1,125,18,116,13,124,3,100, - 22,100,23,133,2,25,0,131,1,125,4,116,15,124,3,100, - 23,100,24,133,2,25,0,131,1,125,19,116,15,124,3,100, - 24,100,25,133,2,25,0,131,1,125,20,116,15,124,3,100, - 25,100,26,133,2,25,0,131,1,125,21,116,13,124,3,100, - 27,100,16,133,2,25,0,131,1,125,22,124,19,124,20,23, - 0,124,21,23,0,125,8,124,22,124,9,107,4,144,3,114, - 122,116,3,100,28,124,0,155,2,157,2,124,0,100,2,141, - 2,130,1,124,22,124,10,55,0,125,22,122,14,124,1,160, - 7,124,19,161,1,125,23,87,0,110,32,4,0,116,2,144, - 4,121,224,1,0,1,0,1,0,116,3,100,4,124,0,155, - 2,157,2,124,0,100,2,141,2,130,1,116,8,124,23,131, - 1,124,19,107,3,144,3,114,210,116,3,100,4,124,0,155, - 2,157,2,124,0,100,2,141,2,130,1,122,50,116,8,124, - 1,160,7,124,8,124,19,24,0,161,1,131,1,124,8,124, - 19,24,0,107,3,144,4,114,2,116,3,100,4,124,0,155, - 2,157,2,124,0,100,2,141,2,130,1,87,0,110,32,4, - 0,116,2,144,4,121,222,1,0,1,0,1,0,116,3,100, - 4,124,0,155,2,157,2,124,0,100,2,141,2,130,1,124, - 13,100,29,64,0,144,4,114,58,124,23,160,16,161,0,125, - 23,110,48,122,14,124,23,160,16,100,30,161,1,125,23,87, - 0,110,32,4,0,116,17,144,4,121,220,1,0,1,0,1, - 0,124,23,160,16,100,31,161,1,160,18,116,19,161,1,125, - 23,89,0,124,23,160,20,100,32,116,21,161,2,125,23,116, - 22,160,23,124,0,124,23,161,2,125,24,124,24,124,14,124, - 18,124,4,124,22,124,15,124,16,124,17,102,8,125,25,124, - 25,124,11,124,23,60,0,124,12,100,33,55,0,125,12,144, - 2,113,86,87,0,100,0,4,0,4,0,131,3,1,0,110, - 18,49,0,144,4,115,192,119,1,1,0,1,0,1,0,89, - 0,1,0,116,24,160,25,100,34,124,12,124,0,161,3,1, - 0,124,11,83,0,119,0,119,0,119,0,119,0,119,0,119, - 0,119,0,119,0,41,35,78,122,21,99,97,110,39,116,32, - 111,112,101,110,32,90,105,112,32,102,105,108,101,58,32,114, - 12,0,0,0,114,91,0,0,0,250,21,99,97,110,39,116, - 32,114,101,97,100,32,90,105,112,32,102,105,108,101,58,32, - 233,4,0,0,0,114,0,0,0,0,122,16,110,111,116,32, - 97,32,90,105,112,32,102,105,108,101,58,32,122,18,99,111, - 114,114,117,112,116,32,90,105,112,32,102,105,108,101,58,32, - 233,12,0,0,0,233,16,0,0,0,233,20,0,0,0,122, - 28,98,97,100,32,99,101,110,116,114,97,108,32,100,105,114, - 101,99,116,111,114,121,32,115,105,122,101,58,32,122,30,98, - 97,100,32,99,101,110,116,114,97,108,32,100,105,114,101,99, - 116,111,114,121,32,111,102,102,115,101,116,58,32,122,38,98, - 97,100,32,99,101,110,116,114,97,108,32,100,105,114,101,99, - 116,111,114,121,32,115,105,122,101,32,111,114,32,111,102,102, - 115,101,116,58,32,84,233,46,0,0,0,250,27,69,79,70, - 32,114,101,97,100,32,119,104,101,114,101,32,110,111,116,32, - 101,120,112,101,99,116,101,100,115,4,0,0,0,80,75,1, - 2,233,8,0,0,0,233,10,0,0,0,233,14,0,0,0, - 233,24,0,0,0,233,28,0,0,0,233,30,0,0,0,233, - 32,0,0,0,233,34,0,0,0,233,42,0,0,0,122,25, - 98,97,100,32,108,111,99,97,108,32,104,101,97,100,101,114, - 32,111,102,102,115,101,116,58,32,105,0,8,0,0,218,5, - 97,115,99,105,105,90,6,108,97,116,105,110,49,250,1,47, - 114,5,0,0,0,122,33,122,105,112,105,109,112,111,114,116, - 58,32,102,111,117,110,100,32,123,125,32,110,97,109,101,115, - 32,105,110,32,123,33,114,125,41,26,218,3,95,105,111,218, - 9,111,112,101,110,95,99,111,100,101,114,22,0,0,0,114, - 3,0,0,0,218,4,115,101,101,107,218,20,69,78,68,95, - 67,69,78,84,82,65,76,95,68,73,82,95,83,73,90,69, - 90,4,116,101,108,108,218,4,114,101,97,100,114,55,0,0, - 0,218,18,83,84,82,73,78,71,95,69,78,68,95,65,82, - 67,72,73,86,69,218,3,109,97,120,218,15,77,65,88,95, - 67,79,77,77,69,78,84,95,76,69,78,218,5,114,102,105, - 110,100,114,2,0,0,0,218,8,69,79,70,69,114,114,111, - 114,114,1,0,0,0,114,65,0,0,0,218,18,85,110,105, - 99,111,100,101,68,101,99,111,100,101,69,114,114,111,114,218, - 9,116,114,97,110,115,108,97,116,101,218,11,99,112,52,51, - 55,95,116,97,98,108,101,114,19,0,0,0,114,20,0,0, - 0,114,21,0,0,0,114,30,0,0,0,114,45,0,0,0, - 114,80,0,0,0,41,26,114,29,0,0,0,218,2,102,112, - 90,15,104,101,97,100,101,114,95,112,111,115,105,116,105,111, - 110,218,6,98,117,102,102,101,114,218,9,102,105,108,101,95, - 115,105,122,101,90,17,109,97,120,95,99,111,109,109,101,110, - 116,95,115,116,97,114,116,218,4,100,97,116,97,90,3,112, - 111,115,218,11,104,101,97,100,101,114,95,115,105,122,101,90, - 13,104,101,97,100,101,114,95,111,102,102,115,101,116,90,10, - 97,114,99,95,111,102,102,115,101,116,114,33,0,0,0,218, - 5,99,111,117,110,116,218,5,102,108,97,103,115,218,8,99, - 111,109,112,114,101,115,115,218,4,116,105,109,101,218,4,100, - 97,116,101,218,3,99,114,99,218,9,100,97,116,97,95,115, - 105,122,101,218,9,110,97,109,101,95,115,105,122,101,218,10, - 101,120,116,114,97,95,115,105,122,101,90,12,99,111,109,109, - 101,110,116,95,115,105,122,101,218,11,102,105,108,101,95,111, - 102,102,115,101,116,114,44,0,0,0,114,13,0,0,0,218, - 1,116,114,9,0,0,0,114,9,0,0,0,114,10,0,0, - 0,114,27,0,0,0,140,1,0,0,115,240,0,0,0,2, - 1,14,1,14,1,18,1,8,2,2,1,14,1,8,1,14, - 1,14,1,18,1,12,1,18,1,18,1,2,3,12,1,12, - 1,14,1,10,1,2,1,6,255,8,2,2,1,2,255,2, - 1,4,255,2,2,10,1,12,1,14,1,10,1,2,1,6, - 255,10,2,10,1,10,1,2,1,6,255,16,2,14,1,10, - 1,2,1,6,255,16,2,16,2,16,1,10,1,18,1,10, - 1,18,1,8,1,8,1,10,1,18,1,4,2,4,2,2, - 1,14,1,14,1,18,1,2,1,10,1,14,1,8,1,18, - 2,4,1,14,1,8,1,16,1,16,1,16,1,16,1,16, - 1,16,1,16,1,16,1,16,1,16,1,16,1,12,1,10, - 1,18,1,8,1,2,2,14,1,14,1,18,1,14,1,18, - 1,2,4,28,1,18,1,4,255,14,2,18,1,10,2,10, - 2,2,3,14,1,14,1,18,1,12,2,12,1,20,1,8, - 1,8,1,4,202,14,6,18,128,14,49,4,1,2,247,2, - 246,2,246,2,227,2,227,2,248,2,246,2,248,255,128,114, - 27,0,0,0,117,190,1,0,0,0,1,2,3,4,5,6, - 7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22, - 23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38, - 39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54, - 55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70, - 71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86, - 87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102, - 103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118, - 119,120,121,122,123,124,125,126,127,195,135,195,188,195,169,195, - 162,195,164,195,160,195,165,195,167,195,170,195,171,195,168,195, - 175,195,174,195,172,195,132,195,133,195,137,195,166,195,134,195, - 180,195,182,195,178,195,187,195,185,195,191,195,150,195,156,194, - 162,194,163,194,165,226,130,167,198,146,195,161,195,173,195,179, - 195,186,195,177,195,145,194,170,194,186,194,191,226,140,144,194, - 172,194,189,194,188,194,161,194,171,194,187,226,150,145,226,150, - 146,226,150,147,226,148,130,226,148,164,226,149,161,226,149,162, - 226,149,150,226,149,149,226,149,163,226,149,145,226,149,151,226, - 149,157,226,149,156,226,149,155,226,148,144,226,148,148,226,148, - 180,226,148,172,226,148,156,226,148,128,226,148,188,226,149,158, - 226,149,159,226,149,154,226,149,148,226,149,169,226,149,166,226, - 149,160,226,149,144,226,149,172,226,149,167,226,149,168,226,149, - 164,226,149,165,226,149,153,226,149,152,226,149,146,226,149,147, - 226,149,171,226,149,170,226,148,152,226,148,140,226,150,136,226, - 150,132,226,150,140,226,150,144,226,150,128,206,177,195,159,206, - 147,207,128,206,163,207,131,194,181,207,132,206,166,206,152,206, - 169,206,180,226,136,158,207,134,206,181,226,136,169,226,137,161, - 194,177,226,137,165,226,137,164,226,140,160,226,140,161,195,183, - 226,137,136,194,176,226,136,153,194,183,226,136,154,226,129,191, - 194,178,226,150,160,194,160,99,0,0,0,0,0,0,0,0, - 0,0,0,0,1,0,0,0,8,0,0,0,67,0,0,0, - 115,106,0,0,0,116,0,114,22,116,1,160,2,100,1,161, - 1,1,0,116,3,100,2,131,1,130,1,100,3,97,0,122, - 56,122,16,100,4,100,5,108,4,109,5,125,0,1,0,87, - 0,110,30,4,0,116,6,121,104,1,0,1,0,1,0,116, - 1,160,2,100,1,161,1,1,0,116,3,100,2,131,1,130, - 1,87,0,100,6,97,0,110,6,100,6,97,0,119,0,116, - 1,160,2,100,7,161,1,1,0,124,0,83,0,119,0,41, - 8,78,122,27,122,105,112,105,109,112,111,114,116,58,32,122, - 108,105,98,32,85,78,65,86,65,73,76,65,66,76,69,250, - 41,99,97,110,39,116,32,100,101,99,111,109,112,114,101,115, - 115,32,100,97,116,97,59,32,122,108,105,98,32,110,111,116, - 32,97,118,97,105,108,97,98,108,101,84,114,0,0,0,0, - 169,1,218,10,100,101,99,111,109,112,114,101,115,115,70,122, - 25,122,105,112,105,109,112,111,114,116,58,32,122,108,105,98, - 32,97,118,97,105,108,97,98,108,101,41,7,218,15,95,105, - 109,112,111,114,116,105,110,103,95,122,108,105,98,114,45,0, - 0,0,114,80,0,0,0,114,3,0,0,0,90,4,122,108, - 105,98,114,146,0,0,0,218,9,69,120,99,101,112,116,105, - 111,110,114,145,0,0,0,114,9,0,0,0,114,9,0,0, - 0,114,10,0,0,0,218,20,95,103,101,116,95,100,101,99, - 111,109,112,114,101,115,115,95,102,117,110,99,42,2,0,0, - 115,30,0,0,0,4,2,10,3,8,1,4,2,4,1,16, - 1,12,1,10,1,8,1,2,253,12,5,10,2,4,1,2, - 249,255,128,114,149,0,0,0,99,2,0,0,0,0,0,0, - 0,0,0,0,0,17,0,0,0,9,0,0,0,67,0,0, - 0,115,134,1,0,0,124,1,92,8,125,2,125,3,125,4, - 125,5,125,6,125,7,125,8,125,9,124,4,100,1,107,0, - 114,36,116,0,100,2,131,1,130,1,116,1,160,2,124,0, - 161,1,144,1,143,4,125,10,122,14,124,10,160,3,124,6, - 161,1,1,0,87,0,110,32,4,0,116,4,144,1,121,132, + 1,124,13,100,29,64,0,144,2,114,24,124,23,160,16,161, + 0,125,23,110,24,122,7,124,23,160,16,100,30,161,1,125, + 23,87,0,110,16,4,0,116,17,144,2,121,105,1,0,1, + 0,1,0,124,23,160,16,100,31,161,1,160,18,116,19,161, + 1,125,23,89,0,124,23,160,20,100,32,116,21,161,2,125, + 23,116,22,160,23,124,0,124,23,161,2,125,24,124,24,124, + 14,124,18,124,4,124,22,124,15,124,16,124,17,102,8,125, + 25,124,25,124,11,124,23,60,0,124,12,100,33,55,0,125, + 12,144,1,113,38,87,0,100,0,4,0,4,0,131,3,1, + 0,110,9,49,0,144,2,115,91,119,1,1,0,1,0,1, + 0,89,0,1,0,116,24,160,25,100,34,124,12,124,0,161, + 3,1,0,124,11,83,0,119,0,119,0,119,0,119,0,119, + 0,119,0,119,0,119,0,41,35,78,122,21,99,97,110,39, + 116,32,111,112,101,110,32,90,105,112,32,102,105,108,101,58, + 32,114,12,0,0,0,114,92,0,0,0,250,21,99,97,110, + 39,116,32,114,101,97,100,32,90,105,112,32,102,105,108,101, + 58,32,233,4,0,0,0,114,0,0,0,0,122,16,110,111, + 116,32,97,32,90,105,112,32,102,105,108,101,58,32,122,18, + 99,111,114,114,117,112,116,32,90,105,112,32,102,105,108,101, + 58,32,233,12,0,0,0,233,16,0,0,0,233,20,0,0, + 0,122,28,98,97,100,32,99,101,110,116,114,97,108,32,100, + 105,114,101,99,116,111,114,121,32,115,105,122,101,58,32,122, + 30,98,97,100,32,99,101,110,116,114,97,108,32,100,105,114, + 101,99,116,111,114,121,32,111,102,102,115,101,116,58,32,122, + 38,98,97,100,32,99,101,110,116,114,97,108,32,100,105,114, + 101,99,116,111,114,121,32,115,105,122,101,32,111,114,32,111, + 102,102,115,101,116,58,32,84,233,46,0,0,0,250,27,69, + 79,70,32,114,101,97,100,32,119,104,101,114,101,32,110,111, + 116,32,101,120,112,101,99,116,101,100,115,4,0,0,0,80, + 75,1,2,233,8,0,0,0,233,10,0,0,0,233,14,0, + 0,0,233,24,0,0,0,233,28,0,0,0,233,30,0,0, + 0,233,32,0,0,0,233,34,0,0,0,233,42,0,0,0, + 122,25,98,97,100,32,108,111,99,97,108,32,104,101,97,100, + 101,114,32,111,102,102,115,101,116,58,32,105,0,8,0,0, + 218,5,97,115,99,105,105,90,6,108,97,116,105,110,49,250, + 1,47,114,5,0,0,0,122,33,122,105,112,105,109,112,111, + 114,116,58,32,102,111,117,110,100,32,123,125,32,110,97,109, + 101,115,32,105,110,32,123,33,114,125,41,26,218,3,95,105, + 111,218,9,111,112,101,110,95,99,111,100,101,114,22,0,0, + 0,114,3,0,0,0,218,4,115,101,101,107,218,20,69,78, + 68,95,67,69,78,84,82,65,76,95,68,73,82,95,83,73, + 90,69,90,4,116,101,108,108,218,4,114,101,97,100,114,58, + 0,0,0,218,18,83,84,82,73,78,71,95,69,78,68,95, + 65,82,67,72,73,86,69,218,3,109,97,120,218,15,77,65, + 88,95,67,79,77,77,69,78,84,95,76,69,78,218,5,114, + 102,105,110,100,114,2,0,0,0,218,8,69,79,70,69,114, + 114,111,114,114,1,0,0,0,114,68,0,0,0,218,18,85, + 110,105,99,111,100,101,68,101,99,111,100,101,69,114,114,111, + 114,218,9,116,114,97,110,115,108,97,116,101,218,11,99,112, + 52,51,55,95,116,97,98,108,101,114,19,0,0,0,114,20, + 0,0,0,114,21,0,0,0,114,30,0,0,0,114,48,0, + 0,0,114,81,0,0,0,41,26,114,29,0,0,0,218,2, + 102,112,90,15,104,101,97,100,101,114,95,112,111,115,105,116, + 105,111,110,218,6,98,117,102,102,101,114,218,9,102,105,108, + 101,95,115,105,122,101,90,17,109,97,120,95,99,111,109,109, + 101,110,116,95,115,116,97,114,116,218,4,100,97,116,97,90, + 3,112,111,115,218,11,104,101,97,100,101,114,95,115,105,122, + 101,90,13,104,101,97,100,101,114,95,111,102,102,115,101,116, + 90,10,97,114,99,95,111,102,102,115,101,116,114,33,0,0, + 0,218,5,99,111,117,110,116,218,5,102,108,97,103,115,218, + 8,99,111,109,112,114,101,115,115,218,4,116,105,109,101,218, + 4,100,97,116,101,218,3,99,114,99,218,9,100,97,116,97, + 95,115,105,122,101,218,9,110,97,109,101,95,115,105,122,101, + 218,10,101,120,116,114,97,95,115,105,122,101,90,12,99,111, + 109,109,101,110,116,95,115,105,122,101,218,11,102,105,108,101, + 95,111,102,102,115,101,116,114,47,0,0,0,114,13,0,0, + 0,218,1,116,114,9,0,0,0,114,9,0,0,0,114,10, + 0,0,0,114,27,0,0,0,146,1,0,0,115,240,0,0, + 0,2,1,14,1,14,1,18,1,8,2,2,1,14,1,8, + 1,14,1,14,1,18,1,12,1,18,1,16,1,2,3,12, + 1,12,1,14,1,10,1,2,1,6,255,8,2,2,1,2, + 255,2,1,4,255,2,2,10,1,12,1,14,1,10,1,2, + 1,6,255,10,2,8,1,10,1,2,1,6,255,16,2,12, + 1,10,1,2,1,6,255,16,2,16,2,16,1,8,1,18, + 1,8,1,18,1,8,1,8,1,10,1,18,1,4,2,4, + 2,2,1,14,1,14,1,18,1,2,1,10,1,14,1,8, + 1,18,2,4,1,14,1,8,1,16,1,16,1,16,1,16, + 1,16,1,16,1,16,1,16,1,16,1,16,1,16,1,12, + 1,10,1,18,1,8,1,2,2,14,1,14,1,18,1,14, + 1,18,1,2,4,28,1,18,1,4,255,14,2,18,1,10, + 2,10,2,2,3,14,1,14,1,18,1,12,2,12,1,20, + 1,8,1,8,1,4,202,14,6,18,128,14,49,4,1,2, + 247,2,246,2,246,2,227,2,227,2,248,2,246,2,248,255, + 128,114,27,0,0,0,117,190,1,0,0,0,1,2,3,4, + 5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20, + 21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36, + 37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52, + 53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68, + 69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84, + 85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100, + 101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116, + 117,118,119,120,121,122,123,124,125,126,127,195,135,195,188,195, + 169,195,162,195,164,195,160,195,165,195,167,195,170,195,171,195, + 168,195,175,195,174,195,172,195,132,195,133,195,137,195,166,195, + 134,195,180,195,182,195,178,195,187,195,185,195,191,195,150,195, + 156,194,162,194,163,194,165,226,130,167,198,146,195,161,195,173, + 195,179,195,186,195,177,195,145,194,170,194,186,194,191,226,140, + 144,194,172,194,189,194,188,194,161,194,171,194,187,226,150,145, + 226,150,146,226,150,147,226,148,130,226,148,164,226,149,161,226, + 149,162,226,149,150,226,149,149,226,149,163,226,149,145,226,149, + 151,226,149,157,226,149,156,226,149,155,226,148,144,226,148,148, + 226,148,180,226,148,172,226,148,156,226,148,128,226,148,188,226, + 149,158,226,149,159,226,149,154,226,149,148,226,149,169,226,149, + 166,226,149,160,226,149,144,226,149,172,226,149,167,226,149,168, + 226,149,164,226,149,165,226,149,153,226,149,152,226,149,146,226, + 149,147,226,149,171,226,149,170,226,148,152,226,148,140,226,150, + 136,226,150,132,226,150,140,226,150,144,226,150,128,206,177,195, + 159,206,147,207,128,206,163,207,131,194,181,207,132,206,166,206, + 152,206,169,206,180,226,136,158,207,134,206,181,226,136,169,226, + 137,161,194,177,226,137,165,226,137,164,226,140,160,226,140,161, + 195,183,226,137,136,194,176,226,136,153,194,183,226,136,154,226, + 129,191,194,178,226,150,160,194,160,99,0,0,0,0,0,0, + 0,0,0,0,0,0,1,0,0,0,8,0,0,0,67,0, + 0,0,115,106,0,0,0,116,0,114,11,116,1,160,2,100, + 1,161,1,1,0,116,3,100,2,131,1,130,1,100,3,97, + 0,122,28,122,8,100,4,100,5,108,4,109,5,125,0,1, + 0,87,0,110,15,4,0,116,6,121,52,1,0,1,0,1, + 0,116,1,160,2,100,1,161,1,1,0,116,3,100,2,131, + 1,130,1,87,0,100,6,97,0,110,3,100,6,97,0,119, + 0,116,1,160,2,100,7,161,1,1,0,124,0,83,0,119, + 0,41,8,78,122,27,122,105,112,105,109,112,111,114,116,58, + 32,122,108,105,98,32,85,78,65,86,65,73,76,65,66,76, + 69,250,41,99,97,110,39,116,32,100,101,99,111,109,112,114, + 101,115,115,32,100,97,116,97,59,32,122,108,105,98,32,110, + 111,116,32,97,118,97,105,108,97,98,108,101,84,114,0,0, + 0,0,169,1,218,10,100,101,99,111,109,112,114,101,115,115, + 70,122,25,122,105,112,105,109,112,111,114,116,58,32,122,108, + 105,98,32,97,118,97,105,108,97,98,108,101,41,7,218,15, + 95,105,109,112,111,114,116,105,110,103,95,122,108,105,98,114, + 48,0,0,0,114,81,0,0,0,114,3,0,0,0,90,4, + 122,108,105,98,114,147,0,0,0,218,9,69,120,99,101,112, + 116,105,111,110,114,146,0,0,0,114,9,0,0,0,114,9, + 0,0,0,114,10,0,0,0,218,20,95,103,101,116,95,100, + 101,99,111,109,112,114,101,115,115,95,102,117,110,99,48,2, + 0,0,115,30,0,0,0,4,2,10,3,8,1,4,2,4, + 1,16,1,12,1,10,1,8,1,2,253,12,5,10,2,4, + 1,2,249,255,128,114,150,0,0,0,99,2,0,0,0,0, + 0,0,0,0,0,0,0,17,0,0,0,9,0,0,0,67, + 0,0,0,115,120,1,0,0,124,1,92,8,125,2,125,3, + 125,4,125,5,125,6,125,7,125,8,125,9,124,4,100,1, + 107,0,114,18,116,0,100,2,131,1,130,1,116,1,160,2, + 124,0,161,1,143,127,125,10,122,7,124,10,160,3,124,6, + 161,1,1,0,87,0,110,15,4,0,116,4,121,187,1,0, + 1,0,1,0,116,0,100,3,124,0,155,2,157,2,124,0, + 100,4,141,2,130,1,124,10,160,5,100,5,161,1,125,11, + 116,6,124,11,131,1,100,5,107,3,114,62,116,7,100,6, + 131,1,130,1,124,11,100,0,100,7,133,2,25,0,100,8, + 107,3,114,79,116,0,100,9,124,0,155,2,157,2,124,0, + 100,4,141,2,130,1,116,8,124,11,100,10,100,11,133,2, + 25,0,131,1,125,12,116,8,124,11,100,11,100,5,133,2, + 25,0,131,1,125,13,100,5,124,12,23,0,124,13,23,0, + 125,14,124,6,124,14,55,0,125,6,122,7,124,10,160,3, + 124,6,161,1,1,0,87,0,110,15,4,0,116,4,121,186, 1,0,1,0,1,0,116,0,100,3,124,0,155,2,157,2, @@ -812,188 +838,177 @@ 1,0,1,0,1,0,116,0,100,3,124,0,155,2,157,2, - 124,0,100,4,141,2,130,1,124,10,160,5,100,5,161,1, - 125,11,116,6,124,11,131,1,100,5,107,3,114,128,116,7, - 100,6,131,1,130,1,124,11,100,0,100,7,133,2,25,0, - 100,8,107,3,114,162,116,0,100,9,124,0,155,2,157,2, - 124,0,100,4,141,2,130,1,116,8,124,11,100,10,100,11, - 133,2,25,0,131,1,125,12,116,8,124,11,100,11,100,5, - 133,2,25,0,131,1,125,13,100,5,124,12,23,0,124,13, - 23,0,125,14,124,6,124,14,55,0,125,6,122,14,124,10, - 160,3,124,6,161,1,1,0,87,0,110,32,4,0,116,4, - 144,1,121,130,1,0,1,0,1,0,116,0,100,3,124,0, - 155,2,157,2,124,0,100,4,141,2,130,1,124,10,160,5, - 124,4,161,1,125,15,116,6,124,15,131,1,124,4,107,3, - 144,1,114,38,116,4,100,12,131,1,130,1,87,0,100,0, - 4,0,4,0,131,3,1,0,110,18,49,0,144,1,115,60, - 119,1,1,0,1,0,1,0,89,0,1,0,124,3,100,1, - 107,2,144,1,114,84,124,15,83,0,122,10,116,9,131,0, - 125,16,87,0,110,22,4,0,116,10,144,1,121,128,1,0, - 1,0,1,0,116,0,100,13,131,1,130,1,124,16,124,15, - 100,14,131,2,83,0,119,0,119,0,119,0,41,15,78,114, - 0,0,0,0,122,18,110,101,103,97,116,105,118,101,32,100, - 97,116,97,32,115,105,122,101,114,97,0,0,0,114,12,0, - 0,0,114,109,0,0,0,114,103,0,0,0,114,98,0,0, - 0,115,4,0,0,0,80,75,3,4,122,23,98,97,100,32, - 108,111,99,97,108,32,102,105,108,101,32,104,101,97,100,101, - 114,58,32,233,26,0,0,0,114,108,0,0,0,122,26,122, - 105,112,105,109,112,111,114,116,58,32,99,97,110,39,116,32, - 114,101,97,100,32,100,97,116,97,114,144,0,0,0,105,241, - 255,255,255,41,11,114,3,0,0,0,114,115,0,0,0,114, - 116,0,0,0,114,117,0,0,0,114,22,0,0,0,114,119, - 0,0,0,114,55,0,0,0,114,124,0,0,0,114,1,0, - 0,0,114,149,0,0,0,114,148,0,0,0,41,17,114,29, - 0,0,0,114,58,0,0,0,90,8,100,97,116,97,112,97, - 116,104,114,135,0,0,0,114,139,0,0,0,114,130,0,0, - 0,114,142,0,0,0,114,136,0,0,0,114,137,0,0,0, - 114,138,0,0,0,114,128,0,0,0,114,129,0,0,0,114, - 140,0,0,0,114,141,0,0,0,114,132,0,0,0,90,8, - 114,97,119,95,100,97,116,97,114,146,0,0,0,114,9,0, - 0,0,114,9,0,0,0,114,10,0,0,0,114,56,0,0, - 0,63,2,0,0,115,74,0,0,0,20,1,8,1,8,1, - 14,2,2,2,14,1,14,1,18,1,10,1,12,1,8,1, - 16,2,18,2,16,2,16,1,12,1,8,1,2,1,14,1, - 14,1,18,1,10,1,14,1,8,1,14,255,18,128,10,3, - 4,2,2,3,10,1,14,1,8,1,10,1,2,254,2,243, - 2,240,255,128,114,56,0,0,0,99,2,0,0,0,0,0, - 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, - 0,0,115,16,0,0,0,116,0,124,0,124,1,24,0,131, - 1,100,1,107,1,83,0,41,2,78,114,5,0,0,0,41, - 1,218,3,97,98,115,41,2,90,2,116,49,90,2,116,50, - 114,9,0,0,0,114,9,0,0,0,114,10,0,0,0,218, - 9,95,101,113,95,109,116,105,109,101,109,2,0,0,115,4, - 0,0,0,16,2,255,128,114,152,0,0,0,99,5,0,0, - 0,0,0,0,0,0,0,0,0,14,0,0,0,6,0,0, - 0,67,0,0,0,115,254,0,0,0,124,3,124,2,100,1, - 156,2,125,5,116,0,160,1,124,4,124,3,124,5,161,3, - 125,6,124,6,100,2,64,0,100,3,107,3,125,7,124,7, - 114,126,124,6,100,4,64,0,100,3,107,3,125,8,116,2, - 106,3,100,5,107,3,114,124,124,8,115,76,116,2,106,3, - 100,6,107,2,114,124,116,4,124,0,124,2,131,2,125,9, - 124,9,100,0,117,1,114,124,116,2,160,5,116,0,106,6, - 124,9,161,2,125,10,116,0,160,7,124,4,124,10,124,3, - 124,5,161,4,1,0,110,80,116,8,124,0,124,2,131,2, - 92,2,125,11,125,12,124,11,114,206,116,9,116,10,124,4, - 100,7,100,8,133,2,25,0,131,1,124,11,131,2,114,186, - 116,10,124,4,100,8,100,9,133,2,25,0,131,1,124,12, - 107,3,114,206,116,11,160,12,100,10,124,3,155,2,157,2, - 161,1,1,0,100,0,83,0,116,13,160,14,124,4,100,9, - 100,0,133,2,25,0,161,1,125,13,116,15,124,13,116,16, - 131,2,115,250,116,17,100,11,124,1,155,2,100,12,157,3, - 131,1,130,1,124,13,83,0,41,13,78,41,2,114,44,0, - 0,0,114,13,0,0,0,114,5,0,0,0,114,0,0,0, - 0,114,91,0,0,0,90,5,110,101,118,101,114,90,6,97, - 108,119,97,121,115,114,104,0,0,0,114,99,0,0,0,114, - 100,0,0,0,122,22,98,121,116,101,99,111,100,101,32,105, - 115,32,115,116,97,108,101,32,102,111,114,32,122,16,99,111, - 109,112,105,108,101,100,32,109,111,100,117,108,101,32,122,21, - 32,105,115,32,110,111,116,32,97,32,99,111,100,101,32,111, - 98,106,101,99,116,41,18,114,21,0,0,0,90,13,95,99, - 108,97,115,115,105,102,121,95,112,121,99,218,4,95,105,109, - 112,90,21,99,104,101,99,107,95,104,97,115,104,95,98,97, - 115,101,100,95,112,121,99,115,218,15,95,103,101,116,95,112, - 121,99,95,115,111,117,114,99,101,218,11,115,111,117,114,99, - 101,95,104,97,115,104,90,17,95,82,65,87,95,77,65,71, - 73,67,95,78,85,77,66,69,82,90,18,95,118,97,108,105, - 100,97,116,101,95,104,97,115,104,95,112,121,99,218,29,95, - 103,101,116,95,109,116,105,109,101,95,97,110,100,95,115,105, - 122,101,95,111,102,95,115,111,117,114,99,101,114,152,0,0, - 0,114,2,0,0,0,114,45,0,0,0,114,80,0,0,0, - 218,7,109,97,114,115,104,97,108,90,5,108,111,97,100,115, - 114,15,0,0,0,218,10,95,99,111,100,101,95,116,121,112, - 101,218,9,84,121,112,101,69,114,114,111,114,41,14,114,32, - 0,0,0,114,57,0,0,0,114,66,0,0,0,114,38,0, - 0,0,114,131,0,0,0,90,11,101,120,99,95,100,101,116, - 97,105,108,115,114,134,0,0,0,90,10,104,97,115,104,95, - 98,97,115,101,100,90,12,99,104,101,99,107,95,115,111,117, - 114,99,101,90,12,115,111,117,114,99,101,95,98,121,116,101, - 115,114,155,0,0,0,90,12,115,111,117,114,99,101,95,109, - 116,105,109,101,90,11,115,111,117,114,99,101,95,115,105,122, - 101,114,50,0,0,0,114,9,0,0,0,114,9,0,0,0, - 114,10,0,0,0,218,15,95,117,110,109,97,114,115,104,97, - 108,95,99,111,100,101,117,2,0,0,115,74,0,0,0,2, - 2,2,1,6,254,14,5,12,2,4,1,12,1,10,1,2, - 1,2,255,8,1,2,255,10,2,8,1,4,1,4,1,2, - 1,4,254,4,5,8,1,4,255,2,128,8,4,6,255,4, - 3,22,3,18,1,2,255,4,2,8,1,4,255,4,2,18, - 2,10,1,16,1,4,1,255,128,114,160,0,0,0,99,1, - 0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4, - 0,0,0,67,0,0,0,115,28,0,0,0,124,0,160,0, - 100,1,100,2,161,2,125,0,124,0,160,0,100,3,100,2, - 161,2,125,0,124,0,83,0,41,4,78,115,2,0,0,0, - 13,10,243,1,0,0,0,10,243,1,0,0,0,13,41,1, - 114,19,0,0,0,41,1,218,6,115,111,117,114,99,101,114, - 9,0,0,0,114,9,0,0,0,114,10,0,0,0,218,23, - 95,110,111,114,109,97,108,105,122,101,95,108,105,110,101,95, - 101,110,100,105,110,103,115,162,2,0,0,115,8,0,0,0, - 12,1,12,1,4,1,255,128,114,164,0,0,0,99,2,0, - 0,0,0,0,0,0,0,0,0,0,2,0,0,0,6,0, - 0,0,67,0,0,0,115,24,0,0,0,116,0,124,1,131, - 1,125,1,116,1,124,1,124,0,100,1,100,2,100,3,141, - 4,83,0,41,4,78,114,78,0,0,0,84,41,1,90,12, - 100,111,110,116,95,105,110,104,101,114,105,116,41,2,114,164, - 0,0,0,218,7,99,111,109,112,105,108,101,41,2,114,57, - 0,0,0,114,163,0,0,0,114,9,0,0,0,114,9,0, - 0,0,114,10,0,0,0,218,15,95,99,111,109,112,105,108, - 101,95,115,111,117,114,99,101,169,2,0,0,115,6,0,0, - 0,8,1,16,1,255,128,114,166,0,0,0,99,2,0,0, - 0,0,0,0,0,0,0,0,0,2,0,0,0,11,0,0, - 0,67,0,0,0,115,68,0,0,0,116,0,160,1,124,0, - 100,1,63,0,100,2,23,0,124,0,100,3,63,0,100,4, - 64,0,124,0,100,5,64,0,124,1,100,6,63,0,124,1, - 100,3,63,0,100,7,64,0,124,1,100,5,64,0,100,8, - 20,0,100,9,100,9,100,9,102,9,161,1,83,0,41,10, - 78,233,9,0,0,0,105,188,7,0,0,233,5,0,0,0, - 233,15,0,0,0,233,31,0,0,0,233,11,0,0,0,233, - 63,0,0,0,114,91,0,0,0,114,14,0,0,0,41,2, - 114,136,0,0,0,90,6,109,107,116,105,109,101,41,2,218, - 1,100,114,143,0,0,0,114,9,0,0,0,114,9,0,0, - 0,114,10,0,0,0,218,14,95,112,97,114,115,101,95,100, - 111,115,116,105,109,101,175,2,0,0,115,20,0,0,0,4, - 1,10,1,10,1,6,1,6,1,10,1,10,1,6,1,6, - 249,255,128,114,174,0,0,0,99,2,0,0,0,0,0,0, - 0,0,0,0,0,6,0,0,0,10,0,0,0,67,0,0, - 0,115,110,0,0,0,122,82,124,1,100,1,100,0,133,2, - 25,0,100,2,118,0,115,22,74,0,130,1,124,1,100,0, - 100,1,133,2,25,0,125,1,124,0,106,0,124,1,25,0, - 125,2,124,2,100,3,25,0,125,3,124,2,100,4,25,0, - 125,4,124,2,100,5,25,0,125,5,116,1,124,4,124,3, - 131,2,124,5,102,2,87,0,83,0,4,0,116,2,116,3, - 116,4,102,3,121,108,1,0,1,0,1,0,89,0,100,6, - 83,0,119,0,41,7,78,114,14,0,0,0,169,2,218,1, - 99,218,1,111,114,168,0,0,0,233,6,0,0,0,233,3, - 0,0,0,41,2,114,0,0,0,0,114,0,0,0,0,41, - 5,114,28,0,0,0,114,174,0,0,0,114,26,0,0,0, - 218,10,73,110,100,101,120,69,114,114,111,114,114,159,0,0, - 0,41,6,114,32,0,0,0,114,13,0,0,0,114,58,0, - 0,0,114,136,0,0,0,114,137,0,0,0,90,17,117,110, - 99,111,109,112,114,101,115,115,101,100,95,115,105,122,101,114, - 9,0,0,0,114,9,0,0,0,114,10,0,0,0,114,156, - 0,0,0,188,2,0,0,115,24,0,0,0,2,1,20,2, - 12,1,10,1,8,3,8,1,8,1,16,1,18,1,6,1, - 2,255,255,128,114,156,0,0,0,99,2,0,0,0,0,0, - 0,0,0,0,0,0,3,0,0,0,8,0,0,0,67,0, - 0,0,115,80,0,0,0,124,1,100,1,100,0,133,2,25, - 0,100,2,118,0,115,20,74,0,130,1,124,1,100,0,100, - 1,133,2,25,0,125,1,122,14,124,0,106,0,124,1,25, - 0,125,2,87,0,110,18,4,0,116,1,121,78,1,0,1, - 0,1,0,89,0,100,0,83,0,116,2,124,0,106,3,124, - 2,131,2,83,0,119,0,41,3,78,114,14,0,0,0,114, - 175,0,0,0,41,4,114,28,0,0,0,114,26,0,0,0, - 114,56,0,0,0,114,29,0,0,0,41,3,114,32,0,0, - 0,114,13,0,0,0,114,58,0,0,0,114,9,0,0,0, - 114,9,0,0,0,114,10,0,0,0,114,154,0,0,0,207, - 2,0,0,115,18,0,0,0,20,2,12,1,2,2,14,1, - 12,1,6,1,12,2,2,253,255,128,114,154,0,0,0,99, - 2,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0, - 11,0,0,0,67,0,0,0,115,18,1,0,0,116,0,124, - 0,124,1,131,2,125,2,100,0,125,3,116,1,68,0,93, - 204,92,3,125,4,125,5,125,6,124,2,124,4,23,0,125, - 7,116,2,106,3,100,1,124,0,106,4,116,5,124,7,100, - 2,100,3,141,5,1,0,122,14,124,0,106,6,124,7,25, - 0,125,8,87,0,110,18,4,0,116,7,144,1,121,16,1, - 0,1,0,1,0,89,0,113,18,124,8,100,4,25,0,125, - 9,116,8,124,0,106,4,124,8,131,2,125,10,100,0,125, - 11,124,5,114,182,122,20,116,9,124,0,124,9,124,7,124, - 1,124,10,131,5,125,11,87,0,110,50,4,0,116,10,144, - 1,121,14,1,0,125,12,1,0,122,16,124,12,125,3,87, - 0,89,0,100,0,125,12,126,12,110,18,100,0,125,12,126, + 124,0,100,4,141,2,130,1,124,10,160,5,124,4,161,1, + 125,15,116,6,124,15,131,1,124,4,107,3,114,143,116,4, + 100,12,131,1,130,1,87,0,100,0,4,0,4,0,131,3, + 1,0,110,8,49,0,115,153,119,1,1,0,1,0,1,0, + 89,0,1,0,124,3,100,1,107,2,114,164,124,15,83,0, + 122,5,116,9,131,0,125,16,87,0,110,10,4,0,116,10, + 121,185,1,0,1,0,1,0,116,0,100,13,131,1,130,1, + 124,16,124,15,100,14,131,2,83,0,119,0,119,0,119,0, + 41,15,78,114,0,0,0,0,122,18,110,101,103,97,116,105, + 118,101,32,100,97,116,97,32,115,105,122,101,114,98,0,0, + 0,114,12,0,0,0,114,110,0,0,0,114,104,0,0,0, + 114,99,0,0,0,115,4,0,0,0,80,75,3,4,122,23, + 98,97,100,32,108,111,99,97,108,32,102,105,108,101,32,104, + 101,97,100,101,114,58,32,233,26,0,0,0,114,109,0,0, + 0,122,26,122,105,112,105,109,112,111,114,116,58,32,99,97, + 110,39,116,32,114,101,97,100,32,100,97,116,97,114,145,0, + 0,0,105,241,255,255,255,41,11,114,3,0,0,0,114,116, + 0,0,0,114,117,0,0,0,114,118,0,0,0,114,22,0, + 0,0,114,120,0,0,0,114,58,0,0,0,114,125,0,0, + 0,114,1,0,0,0,114,150,0,0,0,114,149,0,0,0, + 41,17,114,29,0,0,0,114,61,0,0,0,90,8,100,97, + 116,97,112,97,116,104,114,136,0,0,0,114,140,0,0,0, + 114,131,0,0,0,114,143,0,0,0,114,137,0,0,0,114, + 138,0,0,0,114,139,0,0,0,114,129,0,0,0,114,130, + 0,0,0,114,141,0,0,0,114,142,0,0,0,114,133,0, + 0,0,90,8,114,97,119,95,100,97,116,97,114,147,0,0, + 0,114,9,0,0,0,114,9,0,0,0,114,10,0,0,0, + 114,59,0,0,0,69,2,0,0,115,74,0,0,0,20,1, + 8,1,8,1,12,2,2,2,14,1,12,1,18,1,10,1, + 12,1,8,1,16,2,18,2,16,2,16,1,12,1,8,1, + 2,1,14,1,12,1,18,1,10,1,12,1,8,1,14,255, + 16,128,8,3,4,2,2,3,10,1,12,1,8,1,10,1, + 2,254,2,243,2,240,255,128,114,59,0,0,0,99,2,0, + 0,0,0,0,0,0,0,0,0,0,2,0,0,0,3,0, + 0,0,67,0,0,0,115,16,0,0,0,116,0,124,0,124, + 1,24,0,131,1,100,1,107,1,83,0,41,2,78,114,5, + 0,0,0,41,1,218,3,97,98,115,41,2,90,2,116,49, + 90,2,116,50,114,9,0,0,0,114,9,0,0,0,114,10, + 0,0,0,218,9,95,101,113,95,109,116,105,109,101,115,2, + 0,0,115,4,0,0,0,16,2,255,128,114,153,0,0,0, + 99,5,0,0,0,0,0,0,0,0,0,0,0,14,0,0, + 0,6,0,0,0,67,0,0,0,115,254,0,0,0,124,3, + 124,2,100,1,156,2,125,5,116,0,160,1,124,4,124,3, + 124,5,161,3,125,6,124,6,100,2,64,0,100,3,107,3, + 125,7,124,7,114,63,124,6,100,4,64,0,100,3,107,3, + 125,8,116,2,106,3,100,5,107,3,114,62,124,8,115,38, + 116,2,106,3,100,6,107,2,114,62,116,4,124,0,124,2, + 131,2,125,9,124,9,100,0,117,1,114,62,116,2,160,5, + 116,0,106,6,124,9,161,2,125,10,116,0,160,7,124,4, + 124,10,124,3,124,5,161,4,1,0,110,40,116,8,124,0, + 124,2,131,2,92,2,125,11,125,12,124,11,114,103,116,9, + 116,10,124,4,100,7,100,8,133,2,25,0,131,1,124,11, + 131,2,114,93,116,10,124,4,100,8,100,9,133,2,25,0, + 131,1,124,12,107,3,114,103,116,11,160,12,100,10,124,3, + 155,2,157,2,161,1,1,0,100,0,83,0,116,13,160,14, + 124,4,100,9,100,0,133,2,25,0,161,1,125,13,116,15, + 124,13,116,16,131,2,115,125,116,17,100,11,124,1,155,2, + 100,12,157,3,131,1,130,1,124,13,83,0,41,13,78,41, + 2,114,47,0,0,0,114,13,0,0,0,114,5,0,0,0, + 114,0,0,0,0,114,92,0,0,0,90,5,110,101,118,101, + 114,90,6,97,108,119,97,121,115,114,105,0,0,0,114,100, + 0,0,0,114,101,0,0,0,122,22,98,121,116,101,99,111, + 100,101,32,105,115,32,115,116,97,108,101,32,102,111,114,32, + 122,16,99,111,109,112,105,108,101,100,32,109,111,100,117,108, + 101,32,122,21,32,105,115,32,110,111,116,32,97,32,99,111, + 100,101,32,111,98,106,101,99,116,41,18,114,21,0,0,0, + 90,13,95,99,108,97,115,115,105,102,121,95,112,121,99,218, + 4,95,105,109,112,90,21,99,104,101,99,107,95,104,97,115, + 104,95,98,97,115,101,100,95,112,121,99,115,218,15,95,103, + 101,116,95,112,121,99,95,115,111,117,114,99,101,218,11,115, + 111,117,114,99,101,95,104,97,115,104,90,17,95,82,65,87, + 95,77,65,71,73,67,95,78,85,77,66,69,82,90,18,95, + 118,97,108,105,100,97,116,101,95,104,97,115,104,95,112,121, + 99,218,29,95,103,101,116,95,109,116,105,109,101,95,97,110, + 100,95,115,105,122,101,95,111,102,95,115,111,117,114,99,101, + 114,153,0,0,0,114,2,0,0,0,114,48,0,0,0,114, + 81,0,0,0,218,7,109,97,114,115,104,97,108,90,5,108, + 111,97,100,115,114,15,0,0,0,218,10,95,99,111,100,101, + 95,116,121,112,101,218,9,84,121,112,101,69,114,114,111,114, + 41,14,114,32,0,0,0,114,60,0,0,0,114,69,0,0, + 0,114,41,0,0,0,114,132,0,0,0,90,11,101,120,99, + 95,100,101,116,97,105,108,115,114,135,0,0,0,90,10,104, + 97,115,104,95,98,97,115,101,100,90,12,99,104,101,99,107, + 95,115,111,117,114,99,101,90,12,115,111,117,114,99,101,95, + 98,121,116,101,115,114,156,0,0,0,90,12,115,111,117,114, + 99,101,95,109,116,105,109,101,90,11,115,111,117,114,99,101, + 95,115,105,122,101,114,53,0,0,0,114,9,0,0,0,114, + 9,0,0,0,114,10,0,0,0,218,15,95,117,110,109,97, + 114,115,104,97,108,95,99,111,100,101,123,2,0,0,115,74, + 0,0,0,2,2,2,1,6,254,14,5,12,2,4,1,12, + 1,10,1,2,1,2,255,8,1,2,255,10,2,8,1,4, + 1,4,1,2,1,4,254,4,5,8,1,4,255,2,128,8, + 4,6,255,4,3,22,3,18,1,2,255,4,2,8,1,4, + 255,4,2,18,2,10,1,16,1,4,1,255,128,114,161,0, + 0,0,99,1,0,0,0,0,0,0,0,0,0,0,0,1, + 0,0,0,4,0,0,0,67,0,0,0,115,28,0,0,0, + 124,0,160,0,100,1,100,2,161,2,125,0,124,0,160,0, + 100,3,100,2,161,2,125,0,124,0,83,0,41,4,78,115, + 2,0,0,0,13,10,243,1,0,0,0,10,243,1,0,0, + 0,13,41,1,114,19,0,0,0,41,1,218,6,115,111,117, + 114,99,101,114,9,0,0,0,114,9,0,0,0,114,10,0, + 0,0,218,23,95,110,111,114,109,97,108,105,122,101,95,108, + 105,110,101,95,101,110,100,105,110,103,115,168,2,0,0,115, + 8,0,0,0,12,1,12,1,4,1,255,128,114,165,0,0, + 0,99,2,0,0,0,0,0,0,0,0,0,0,0,2,0, + 0,0,6,0,0,0,67,0,0,0,115,24,0,0,0,116, + 0,124,1,131,1,125,1,116,1,124,1,124,0,100,1,100, + 2,100,3,141,4,83,0,41,4,78,114,79,0,0,0,84, + 41,1,90,12,100,111,110,116,95,105,110,104,101,114,105,116, + 41,2,114,165,0,0,0,218,7,99,111,109,112,105,108,101, + 41,2,114,60,0,0,0,114,164,0,0,0,114,9,0,0, + 0,114,9,0,0,0,114,10,0,0,0,218,15,95,99,111, + 109,112,105,108,101,95,115,111,117,114,99,101,175,2,0,0, + 115,6,0,0,0,8,1,16,1,255,128,114,167,0,0,0, + 99,2,0,0,0,0,0,0,0,0,0,0,0,2,0,0, + 0,11,0,0,0,67,0,0,0,115,68,0,0,0,116,0, + 160,1,124,0,100,1,63,0,100,2,23,0,124,0,100,3, + 63,0,100,4,64,0,124,0,100,5,64,0,124,1,100,6, + 63,0,124,1,100,3,63,0,100,7,64,0,124,1,100,5, + 64,0,100,8,20,0,100,9,100,9,100,9,102,9,161,1, + 83,0,41,10,78,233,9,0,0,0,105,188,7,0,0,233, + 5,0,0,0,233,15,0,0,0,233,31,0,0,0,233,11, + 0,0,0,233,63,0,0,0,114,92,0,0,0,114,14,0, + 0,0,41,2,114,137,0,0,0,90,6,109,107,116,105,109, + 101,41,2,218,1,100,114,144,0,0,0,114,9,0,0,0, + 114,9,0,0,0,114,10,0,0,0,218,14,95,112,97,114, + 115,101,95,100,111,115,116,105,109,101,181,2,0,0,115,20, + 0,0,0,4,1,10,1,10,1,6,1,6,1,10,1,10, + 1,6,1,6,249,255,128,114,175,0,0,0,99,2,0,0, + 0,0,0,0,0,0,0,0,0,6,0,0,0,10,0,0, + 0,67,0,0,0,115,110,0,0,0,122,41,124,1,100,1, + 100,0,133,2,25,0,100,2,118,0,115,11,74,0,130,1, + 124,1,100,0,100,1,133,2,25,0,125,1,124,0,106,0, + 124,1,25,0,125,2,124,2,100,3,25,0,125,3,124,2, + 100,4,25,0,125,4,124,2,100,5,25,0,125,5,116,1, + 124,4,124,3,131,2,124,5,102,2,87,0,83,0,4,0, + 116,2,116,3,116,4,102,3,121,54,1,0,1,0,1,0, + 89,0,100,6,83,0,119,0,41,7,78,114,14,0,0,0, + 169,2,218,1,99,218,1,111,114,169,0,0,0,233,6,0, + 0,0,233,3,0,0,0,41,2,114,0,0,0,0,114,0, + 0,0,0,41,5,114,28,0,0,0,114,175,0,0,0,114, + 26,0,0,0,218,10,73,110,100,101,120,69,114,114,111,114, + 114,160,0,0,0,41,6,114,32,0,0,0,114,13,0,0, + 0,114,61,0,0,0,114,137,0,0,0,114,138,0,0,0, + 90,17,117,110,99,111,109,112,114,101,115,115,101,100,95,115, + 105,122,101,114,9,0,0,0,114,9,0,0,0,114,10,0, + 0,0,114,157,0,0,0,194,2,0,0,115,24,0,0,0, + 2,1,20,2,12,1,10,1,8,3,8,1,8,1,16,1, + 18,1,6,1,2,255,255,128,114,157,0,0,0,99,2,0, + 0,0,0,0,0,0,0,0,0,0,3,0,0,0,8,0, + 0,0,67,0,0,0,115,80,0,0,0,124,1,100,1,100, + 0,133,2,25,0,100,2,118,0,115,10,74,0,130,1,124, + 1,100,0,100,1,133,2,25,0,125,1,122,7,124,0,106, + 0,124,1,25,0,125,2,87,0,110,9,4,0,116,1,121, + 39,1,0,1,0,1,0,89,0,100,0,83,0,116,2,124, + 0,106,3,124,2,131,2,83,0,119,0,41,3,78,114,14, + 0,0,0,114,176,0,0,0,41,4,114,28,0,0,0,114, + 26,0,0,0,114,59,0,0,0,114,29,0,0,0,41,3, + 114,32,0,0,0,114,13,0,0,0,114,61,0,0,0,114, + 9,0,0,0,114,9,0,0,0,114,10,0,0,0,114,155, + 0,0,0,213,2,0,0,115,18,0,0,0,20,2,12,1, + 2,2,14,1,12,1,6,1,12,2,2,253,255,128,114,155, + 0,0,0,99,2,0,0,0,0,0,0,0,0,0,0,0, + 14,0,0,0,11,0,0,0,67,0,0,0,115,14,1,0, + 0,116,0,124,0,124,1,131,2,125,2,100,0,125,3,116, + 1,68,0,93,100,92,3,125,4,125,5,125,6,124,2,124, + 4,23,0,125,7,116,2,106,3,100,1,124,0,106,4,116, + 5,124,7,100,2,100,3,141,5,1,0,122,7,124,0,106, + 6,124,7,25,0,125,8,87,0,110,8,4,0,116,7,121, + 134,1,0,1,0,1,0,89,0,113,9,124,8,100,4,25, + 0,125,9,116,8,124,0,106,4,124,8,131,2,125,10,100, + 0,125,11,124,5,114,89,122,10,116,9,124,0,124,9,124, + 7,124,1,124,10,131,5,125,11,87,0,110,24,4,0,116, + 10,121,133,1,0,125,12,1,0,122,8,124,12,125,3,87, + 0,89,0,100,0,125,12,126,12,110,9,100,0,125,12,126, 12,119,1,116,11,124,9,124,10,131,2,125,11,124,11,100, @@ -999,3 +1014,3 @@ 12,119,1,116,11,124,9,124,10,131,2,125,11,124,11,100, - 0,117,0,114,202,113,18,124,8,100,4,25,0,125,9,124, + 0,117,0,114,99,113,9,124,8,100,4,25,0,125,9,124, 11,124,6,124,9,102,3,2,0,1,0,83,0,124,3,114, @@ -1001,5 +1016,5 @@ 11,124,6,124,9,102,3,2,0,1,0,83,0,124,3,114, - 252,100,5,124,3,155,0,157,2,125,13,116,12,124,13,124, + 124,100,5,124,3,155,0,157,2,125,13,116,12,124,13,124, 1,100,6,141,2,124,3,130,2,116,12,100,7,124,1,155, 2,157,2,124,1,100,6,141,2,130,1,119,0,119,0,41, 8,78,122,13,116,114,121,105,110,103,32,123,125,123,125,123, @@ -1003,5 +1018,5 @@ 1,100,6,141,2,124,3,130,2,116,12,100,7,124,1,155, 2,157,2,124,1,100,6,141,2,130,1,119,0,119,0,41, 8,78,122,13,116,114,121,105,110,103,32,123,125,123,125,123, - 125,114,91,0,0,0,41,1,90,9,118,101,114,98,111,115, + 125,114,92,0,0,0,41,1,90,9,118,101,114,98,111,115, 105,116,121,114,0,0,0,0,122,20,109,111,100,117,108,101, @@ -1007,5 +1022,5 @@ 105,116,121,114,0,0,0,0,122,20,109,111,100,117,108,101, - 32,108,111,97,100,32,102,97,105,108,101,100,58,32,114,62, - 0,0,0,114,61,0,0,0,41,13,114,36,0,0,0,114, - 94,0,0,0,114,45,0,0,0,114,80,0,0,0,114,29, + 32,108,111,97,100,32,102,97,105,108,101,100,58,32,114,65, + 0,0,0,114,64,0,0,0,41,13,114,39,0,0,0,114, + 95,0,0,0,114,48,0,0,0,114,81,0,0,0,114,29, 0,0,0,114,20,0,0,0,114,28,0,0,0,114,26,0, @@ -1011,13 +1026,13 @@ 0,0,0,114,20,0,0,0,114,28,0,0,0,114,26,0, - 0,0,114,56,0,0,0,114,160,0,0,0,114,79,0,0, - 0,114,166,0,0,0,114,3,0,0,0,41,14,114,32,0, - 0,0,114,38,0,0,0,114,13,0,0,0,90,12,105,109, - 112,111,114,116,95,101,114,114,111,114,114,95,0,0,0,114, - 96,0,0,0,114,51,0,0,0,114,66,0,0,0,114,58, - 0,0,0,114,40,0,0,0,114,131,0,0,0,114,50,0, - 0,0,90,3,101,120,99,114,81,0,0,0,114,9,0,0, - 0,114,9,0,0,0,114,10,0,0,0,114,48,0,0,0, - 222,2,0,0,115,60,0,0,0,10,1,4,1,14,1,8, - 1,22,1,2,1,14,1,14,1,4,1,8,2,12,1,4, - 1,4,1,2,1,20,1,16,1,16,1,8,128,10,2,8, + 0,0,114,59,0,0,0,114,161,0,0,0,114,80,0,0, + 0,114,167,0,0,0,114,3,0,0,0,41,14,114,32,0, + 0,0,114,41,0,0,0,114,13,0,0,0,90,12,105,109, + 112,111,114,116,95,101,114,114,111,114,114,96,0,0,0,114, + 97,0,0,0,114,54,0,0,0,114,69,0,0,0,114,61, + 0,0,0,114,43,0,0,0,114,132,0,0,0,114,53,0, + 0,0,90,3,101,120,99,114,82,0,0,0,114,9,0,0, + 0,114,9,0,0,0,114,10,0,0,0,114,51,0,0,0, + 228,2,0,0,115,60,0,0,0,10,1,4,1,14,1,8, + 1,22,1,2,1,14,1,12,1,4,1,8,2,12,1,4, + 1,4,1,2,1,20,1,14,1,16,1,8,128,10,2,8, 1,2,3,8,1,14,1,4,2,10,1,14,1,18,2,2, @@ -1023,6 +1038,6 @@ 1,2,3,8,1,14,1,4,2,10,1,14,1,18,2,2, - 241,2,247,255,128,114,48,0,0,0,41,46,114,89,0,0, + 241,2,247,255,128,114,51,0,0,0,41,46,114,90,0,0, 0,90,26,95,102,114,111,122,101,110,95,105,109,112,111,114, 116,108,105,98,95,101,120,116,101,114,110,97,108,114,21,0, 0,0,114,1,0,0,0,114,2,0,0,0,90,17,95,102, 114,111,122,101,110,95,105,109,112,111,114,116,108,105,98,114, @@ -1025,8 +1040,8 @@ 0,90,26,95,102,114,111,122,101,110,95,105,109,112,111,114, 116,108,105,98,95,101,120,116,101,114,110,97,108,114,21,0, 0,0,114,1,0,0,0,114,2,0,0,0,90,17,95,102, 114,111,122,101,110,95,105,109,112,111,114,116,108,105,98,114, - 45,0,0,0,114,153,0,0,0,114,115,0,0,0,114,157, - 0,0,0,114,71,0,0,0,114,136,0,0,0,114,69,0, + 48,0,0,0,114,154,0,0,0,114,116,0,0,0,114,158, + 0,0,0,114,72,0,0,0,114,137,0,0,0,114,35,0, 0,0,90,7,95,95,97,108,108,95,95,114,20,0,0,0, 90,15,112,97,116,104,95,115,101,112,97,114,97,116,111,114, @@ -1031,6 +1046,6 @@ 0,0,90,7,95,95,97,108,108,95,95,114,20,0,0,0, 90,15,112,97,116,104,95,115,101,112,97,114,97,116,111,114, - 115,114,18,0,0,0,114,79,0,0,0,114,3,0,0,0, - 114,25,0,0,0,218,4,116,121,112,101,114,74,0,0,0, - 114,118,0,0,0,114,120,0,0,0,114,122,0,0,0,90, + 115,114,18,0,0,0,114,80,0,0,0,114,3,0,0,0, + 114,25,0,0,0,218,4,116,121,112,101,114,75,0,0,0, + 114,119,0,0,0,114,121,0,0,0,114,123,0,0,0,90, 13,95,76,111,97,100,101,114,66,97,115,105,99,115,114,4, @@ -1036,12 +1051,12 @@ 13,95,76,111,97,100,101,114,66,97,115,105,99,115,114,4, - 0,0,0,114,94,0,0,0,114,36,0,0,0,114,37,0, - 0,0,114,35,0,0,0,114,27,0,0,0,114,127,0,0, - 0,114,147,0,0,0,114,149,0,0,0,114,56,0,0,0, - 114,152,0,0,0,114,160,0,0,0,218,8,95,95,99,111, - 100,101,95,95,114,158,0,0,0,114,164,0,0,0,114,166, - 0,0,0,114,174,0,0,0,114,156,0,0,0,114,154,0, - 0,0,114,48,0,0,0,114,9,0,0,0,114,9,0,0, + 0,0,0,114,95,0,0,0,114,39,0,0,0,114,40,0, + 0,0,114,38,0,0,0,114,27,0,0,0,114,128,0,0, + 0,114,148,0,0,0,114,150,0,0,0,114,59,0,0,0, + 114,153,0,0,0,114,161,0,0,0,218,8,95,95,99,111, + 100,101,95,95,114,159,0,0,0,114,165,0,0,0,114,167, + 0,0,0,114,175,0,0,0,114,157,0,0,0,114,155,0, + 0,0,114,51,0,0,0,114,9,0,0,0,114,9,0,0, 0,114,9,0,0,0,114,10,0,0,0,218,8,60,109,111, 100,117,108,101,62,1,0,0,0,115,92,0,0,0,4,0, 8,16,16,1,8,1,8,1,8,1,8,1,8,1,8,1, 8,1,8,2,6,3,14,1,16,3,4,4,8,2,4,2, @@ -1044,8 +1059,8 @@ 0,114,9,0,0,0,114,10,0,0,0,218,8,60,109,111, 100,117,108,101,62,1,0,0,0,115,92,0,0,0,4,0, 8,16,16,1,8,1,8,1,8,1,8,1,8,1,8,1, 8,1,8,2,6,3,14,1,16,3,4,4,8,2,4,2, - 4,1,4,1,18,2,0,127,0,127,12,44,12,1,2,1, + 4,1,4,1,18,2,0,127,0,127,12,50,12,1,2,1, 2,1,4,252,8,9,8,4,8,9,8,31,2,126,2,254, 4,29,8,5,8,21,8,46,8,8,10,40,8,5,8,7, 8,6,8,13,8,19,12,15,255,128, diff --git a/Python/initconfig.c b/Python/initconfig.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL2luaXRjb25maWcuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL2luaXRjb25maWcuYw== 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -94,6 +94,7 @@ otherwise activate automatically)\n\ -X pycache_prefix=PATH: enable writing .pyc files to a parallel tree rooted at the\n\ given directory instead of to the code tree\n\ + -X warn_default_encoding: enable opt-in EncodingWarning for 'encoding=None'\n\ \n\ --check-hash-based-pycs always|default|never:\n\ control how Python invalidates hash-based .pyc files\n\ @@ -129,7 +130,8 @@ "PYTHONBREAKPOINT: if this variable is set to 0, it disables the default\n" " debugger. It can be set to the callable of your debugger of choice.\n" "PYTHONDEVMODE: enable the development mode.\n" -"PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files.\n"; +"PYTHONPYCACHEPREFIX: root directory for bytecode cache (pyc) files.\n" +"PYTHONWARNDEFAULTENCODING: enable opt-in EncodingWarning for 'encoding=None'.\n"; #if defined(MS_WINDOWS) # define PYTHONHOMEHELP "<prefix>\\python{major}{minor}" @@ -600,6 +602,7 @@ assert(config->malloc_stats >= 0); assert(config->site_import >= 0); assert(config->bytes_warning >= 0); + assert(config->warn_default_encoding >= 0); assert(config->inspect >= 0); assert(config->interactive >= 0); assert(config->optimization_level >= 0); @@ -698,6 +701,7 @@ config->parse_argv = 0; config->site_import = -1; config->bytes_warning = -1; + config->warn_default_encoding = 0; config->inspect = -1; config->interactive = -1; config->optimization_level = -1; @@ -906,6 +910,7 @@ COPY_ATTR(site_import); COPY_ATTR(bytes_warning); + COPY_ATTR(warn_default_encoding); COPY_ATTR(inspect); COPY_ATTR(interactive); COPY_ATTR(optimization_level); @@ -1007,6 +1012,7 @@ SET_ITEM_WSTR(platlibdir); SET_ITEM_INT(site_import); SET_ITEM_INT(bytes_warning); + SET_ITEM_INT(warn_default_encoding); SET_ITEM_INT(inspect); SET_ITEM_INT(interactive); SET_ITEM_INT(optimization_level); @@ -1271,6 +1277,7 @@ GET_WSTRLIST(warnoptions); GET_UINT(site_import); GET_UINT(bytes_warning); + GET_UINT(warn_default_encoding); GET_UINT(inspect); GET_UINT(interactive); GET_UINT(optimization_level); diff --git a/Python/opcode_targets.h b/Python/opcode_targets.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL29wY29kZV90YXJnZXRzLmg=..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL29wY29kZV90YXJnZXRzLmg= 100644 --- a/Python/opcode_targets.h +++ b/Python/opcode_targets.h @@ -128,7 +128,7 @@ &&TARGET_DELETE_FAST, &&_unknown_opcode, &&_unknown_opcode, - &&_unknown_opcode, + &&TARGET_GEN_START, &&TARGET_RAISE_VARARGS, &&TARGET_CALL_FUNCTION, &&TARGET_MAKE_FUNCTION, diff --git a/Python/preconfig.c b/Python/preconfig.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL3ByZWNvbmZpZy5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL3ByZWNvbmZpZy5j 100644 --- a/Python/preconfig.c +++ b/Python/preconfig.c @@ -169,6 +169,7 @@ COPY_ATTR(isolated); COPY_ATTR(use_environment); COPY_ATTR(dev_mode); + COPY_ATTR(warn_default_encoding); return _PyStatus_OK(); #undef COPY_ATTR @@ -257,6 +258,13 @@ cmdline->dev_mode = 0; } + // warn_default_encoding + if (_Py_get_xoption(&cmdline->xoptions, L"warn_default_encoding") + || _Py_GetEnv(cmdline->use_environment, "PYTHONWARNDEFAULTENCODING")) + { + cmdline->warn_default_encoding = 1; + } + assert(cmdline->use_environment >= 0); assert(cmdline->isolated >= 0); assert(cmdline->dev_mode >= 0); @@ -260,6 +268,7 @@ assert(cmdline->use_environment >= 0); assert(cmdline->isolated >= 0); assert(cmdline->dev_mode >= 0); + assert(cmdline->warn_default_encoding >= 0); return _PyStatus_OK(); } diff --git a/Python/pyarena.c b/Python/pyarena.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL3B5YXJlbmEuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL3B5YXJlbmEuYw== 100644 --- a/Python/pyarena.c +++ b/Python/pyarena.c @@ -1,4 +1,5 @@ #include "Python.h" +#include "pycore_pyarena.h" // PyArena /* A simple arena block structure. @@ -125,7 +126,7 @@ } PyArena * -PyArena_New() +_PyArena_New(void) { PyArena* arena = (PyArena *)PyMem_Malloc(sizeof(PyArena)); if (!arena) @@ -154,7 +155,7 @@ } void -PyArena_Free(PyArena *arena) +_PyArena_Free(PyArena *arena) { assert(arena); #if defined(Py_DEBUG) @@ -177,7 +178,7 @@ } void * -PyArena_Malloc(PyArena *arena, size_t size) +_PyArena_Malloc(PyArena *arena, size_t size) { void *p = block_alloc(arena->a_cur, size); if (!p) @@ -200,7 +201,7 @@ } int -PyArena_AddPyObject(PyArena *arena, PyObject *obj) +_PyArena_AddPyObject(PyArena *arena, PyObject *obj) { int r = PyList_Append(arena->a_objects, obj); if (r >= 0) { diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL3B5bGlmZWN5Y2xlLmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL3B5bGlmZWN5Y2xlLmM= 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -2,9 +2,6 @@ #include "Python.h" -#include "Python-ast.h" -#undef Yield /* undefine macro conflicting with <winbase.h> */ - #include "pycore_ceval.h" // _PyEval_FiniGIL() #include "pycore_context.h" // _PyContext_Init() #include "pycore_fileutils.h" // _Py_ResetForceASCII() @@ -631,6 +628,6 @@ static PyStatus -pycore_init_types(PyInterpreterState *interp) +pycore_init_singletons(PyInterpreterState *interp) { PyStatus status; @@ -635,9 +632,16 @@ { PyStatus status; - int is_main_interp = _Py_IsMainInterpreter(interp); - - status = _PyGC_Init(interp); + + if (_PyLong_Init(interp) < 0) { + return _PyStatus_ERR("can't init longs"); + } + + if (_Py_IsMainInterpreter(interp)) { + _PyFloat_Init(); + } + + status = _PyBytes_Init(interp); if (_PyStatus_EXCEPTION(status)) { return status; } @@ -640,28 +644,9 @@ if (_PyStatus_EXCEPTION(status)) { return status; } - // Create the empty tuple singleton. It must be created before the first - // PyType_Ready() call since PyType_Ready() creates tuples, for tp_bases - // for example. - status = _PyTuple_Init(interp); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - - if (is_main_interp) { - status = _PyTypes_Init(); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - } - - if (!_PyLong_Init(interp)) { - return _PyStatus_ERR("can't init longs"); - } - status = _PyUnicode_Init(interp); if (_PyStatus_EXCEPTION(status)) { return status; } @@ -663,10 +648,10 @@ status = _PyUnicode_Init(interp); if (_PyStatus_EXCEPTION(status)) { return status; } - status = _PyBytes_Init(interp); + status = _PyTuple_Init(interp); if (_PyStatus_EXCEPTION(status)) { return status; } @@ -669,9 +654,45 @@ if (_PyStatus_EXCEPTION(status)) { return status; } + return _PyStatus_OK(); +} + + +static PyStatus +pycore_init_types(PyInterpreterState *interp) +{ + PyStatus status; + int is_main_interp = _Py_IsMainInterpreter(interp); + + if (is_main_interp) { + if (_PyStructSequence_Init() < 0) { + return _PyStatus_ERR("can't initialize structseq"); + } + + status = _PyTypes_Init(); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + if (_PyLong_InitTypes() < 0) { + return _PyStatus_ERR("can't init int type"); + } + + status = _PyUnicode_InitTypes(); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + } + + if (is_main_interp) { + if (_PyFloat_InitTypes() < 0) { + return _PyStatus_ERR("can't init float"); + } + } + status = _PyExc_Init(interp); if (_PyStatus_EXCEPTION(status)) { return status; } @@ -673,19 +694,9 @@ status = _PyExc_Init(interp); if (_PyStatus_EXCEPTION(status)) { return status; } - if (is_main_interp) { - if (!_PyFloat_Init()) { - return _PyStatus_ERR("can't init float"); - } - - if (_PyStructSequence_Init() < 0) { - return _PyStatus_ERR("can't initialize structseq"); - } - } - - status = _PyErr_Init(); + status = _PyErr_InitTypes(); if (_PyStatus_EXCEPTION(status)) { return status; } @@ -696,17 +707,8 @@ } } - if (_PyWarnings_InitState(interp) < 0) { - return _PyStatus_ERR("can't initialize warnings"); - } - - status = _PyAtExit_Init(interp); - if (_PyStatus_EXCEPTION(status)) { - return status; - } - return _PyStatus_OK(); } static PyStatus @@ -708,7 +710,7 @@ return _PyStatus_OK(); } static PyStatus -pycore_init_builtins(PyInterpreterState *interp) +pycore_init_builtins(PyThreadState *tstate) { @@ -714,4 +716,6 @@ { + PyInterpreterState *interp = tstate->interp; + PyObject *bimod = _PyBuiltin_Init(interp); if (bimod == NULL) { goto error; @@ -747,6 +751,7 @@ } interp->import_func = Py_NewRef(import_func); + assert(!_PyErr_Occurred(tstate)); return _PyStatus_OK(); error: @@ -758,6 +763,7 @@ static PyStatus pycore_interp_init(PyThreadState *tstate) { + PyInterpreterState *interp = tstate->interp; PyStatus status; PyObject *sysmod = NULL; @@ -761,8 +767,22 @@ PyStatus status; PyObject *sysmod = NULL; - status = pycore_init_types(tstate->interp); + // Create singletons before the first PyType_Ready() call, since + // PyType_Ready() uses singletons like the Unicode empty string (tp_doc) + // and the empty tuple singletons (tp_bases). + status = pycore_init_singletons(interp); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + // The GC must be initialized before the first GC collection. + status = _PyGC_Init(interp); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + + status = pycore_init_types(interp); if (_PyStatus_EXCEPTION(status)) { goto done; } @@ -765,9 +785,18 @@ if (_PyStatus_EXCEPTION(status)) { goto done; } + if (_PyWarnings_InitState(interp) < 0) { + return _PyStatus_ERR("can't initialize warnings"); + } + + status = _PyAtExit_Init(interp); + if (_PyStatus_EXCEPTION(status)) { + return status; + } + status = _PySys_Create(tstate, &sysmod); if (_PyStatus_EXCEPTION(status)) { goto done; } @@ -769,12 +798,10 @@ status = _PySys_Create(tstate, &sysmod); if (_PyStatus_EXCEPTION(status)) { goto done; } - assert(!_PyErr_Occurred(tstate)); - - status = pycore_init_builtins(tstate->interp); + status = pycore_init_builtins(tstate); if (_PyStatus_EXCEPTION(status)) { goto done; } @@ -777,10 +804,8 @@ if (_PyStatus_EXCEPTION(status)) { goto done; } - assert(!_PyErr_Occurred(tstate)); - - const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); + const PyConfig *config = _PyInterpreterState_GetConfig(interp); if (config->_install_importlib) { /* This call sets up builtin and frozen import support */ if (init_importlib(tstate, sysmod) < 0) { @@ -2216,7 +2241,7 @@ return NULL; } -/* Set builtins.open to io.OpenWrapper */ +/* Set builtins.open to io.open */ static PyStatus init_set_builtins_open(void) { @@ -2232,7 +2257,7 @@ goto error; } - if (!(wrapper = PyObject_GetAttrString(iomod, "OpenWrapper"))) { + if (!(wrapper = PyObject_GetAttrString(iomod, "open"))) { goto error; } @@ -2254,7 +2279,7 @@ } -/* Initialize sys.stdin, stdout, stderr and builtins.open */ +/* Create sys.stdin, sys.stdout and sys.stderr */ static PyStatus init_sys_streams(PyThreadState *tstate) { @@ -2526,12 +2551,14 @@ // memory cannot be allocated on the heap in a signal handler. // Iterate on the dict instead. PyObject *stdlib_module_names = NULL; - pos = 0; - while (PyDict_Next(interp->sysdict, &pos, &key, &value)) { - if (PyUnicode_Check(key) - && PyUnicode_CompareWithASCIIString(key, "stdlib_module_names") == 0) { - stdlib_module_names = value; - break; + if (interp->sysdict != NULL) { + pos = 0; + while (PyDict_Next(interp->sysdict, &pos, &key, &value)) { + if (PyUnicode_Check(key) + && PyUnicode_CompareWithASCIIString(key, "stdlib_module_names") == 0) { + stdlib_module_names = value; + break; + } } } // If we failed to get sys.stdlib_module_names or it's not a frozenset, diff --git a/Python/pystate.c b/Python/pystate.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL3B5c3RhdGUuYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL3B5c3RhdGUuYw== 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -630,7 +630,8 @@ tstate->recursion_headroom = 0; tstate->stackcheck_counter = 0; tstate->tracing = 0; - tstate->use_tracing = 0; + tstate->root_cframe.use_tracing = 0; + tstate->cframe = &tstate->root_cframe; tstate->gilstate_counter = 0; tstate->async_exc = NULL; tstate->thread_id = PyThread_get_thread_ident(); diff --git a/Python/pythonrun.c b/Python/pythonrun.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL3B5dGhvbnJ1bi5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL3B5dGhvbnJ1bi5j 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -10,8 +10,7 @@ #include "Python.h" -#include "Python-ast.h" -#undef Yield /* undefine macro conflicting with <winbase.h> */ - +#include "pycore_ast.h" // PyAST_mod2obj +#include "pycore_compile.h" // _PyAST_Compile() #include "pycore_interp.h" // PyInterpreterState.importlib #include "pycore_object.h" // _PyDebug_PrintTotalRefs() @@ -16,6 +15,7 @@ #include "pycore_interp.h" // PyInterpreterState.importlib #include "pycore_object.h" // _PyDebug_PrintTotalRefs() -#include "pycore_pyerrors.h" // _PyErr_Fetch +#include "pycore_parser.h" // _PyParser_ASTFromString() +#include "pycore_pyerrors.h" // _PyErr_Fetch, _Py_Offer_Suggestions #include "pycore_pylifecycle.h" // _Py_UnhandledKeyboardInterrupt #include "pycore_pystate.h" // _PyInterpreterState_GET() #include "pycore_sysmodule.h" // _PySys_Audit() @@ -251,7 +251,7 @@ } } } - arena = PyArena_New(); + arena = _PyArena_New(); if (arena == NULL) { Py_XDECREF(v); Py_XDECREF(w); @@ -259,10 +259,10 @@ return -1; } - mod = PyParser_ASTFromFileObject(fp, filename, enc, Py_single_input, - ps1, ps2, flags, &errcode, arena); + mod = _PyParser_ASTFromFile(fp, filename, enc, Py_single_input, + ps1, ps2, flags, &errcode, arena); Py_XDECREF(v); Py_XDECREF(w); Py_XDECREF(oenc); if (mod == NULL) { @@ -264,9 +264,9 @@ Py_XDECREF(v); Py_XDECREF(w); Py_XDECREF(oenc); if (mod == NULL) { - PyArena_Free(arena); + _PyArena_Free(arena); if (errcode == E_EOF) { PyErr_Clear(); return E_EOF; @@ -275,8 +275,8 @@ } m = PyImport_AddModuleObject(mod_name); if (m == NULL) { - PyArena_Free(arena); + _PyArena_Free(arena); return -1; } d = PyModule_GetDict(m); v = run_mod(mod, filename, d, d, flags, arena); @@ -279,8 +279,8 @@ return -1; } d = PyModule_GetDict(m); v = run_mod(mod, filename, d, d, flags, arena); - PyArena_Free(arena); + _PyArena_Free(arena); if (v == NULL) { return -1; } @@ -959,6 +959,16 @@ if (err < 0) { PyErr_Clear(); } + PyObject* suggestions = _Py_Offer_Suggestions(value); + if (suggestions) { + // Add a trailer ". Did you mean: (...)?" + err = PyFile_WriteString(". Did you mean: ", f); + if (err == 0) { + err = PyFile_WriteObject(suggestions, f, Py_PRINT_RAW); + err += PyFile_WriteString("?", f); + } + Py_DECREF(suggestions); + } err += PyFile_WriteString("\n", f); Py_XDECREF(tb); Py_DECREF(value); @@ -1086,5 +1096,5 @@ if (file == Py_None) { return; } - + Py_INCREF(file); _PyErr_Display(file, exception, value, tb); @@ -1090,4 +1100,5 @@ _PyErr_Display(file, exception, value, tb); + Py_DECREF(file); } PyObject * @@ -1103,7 +1114,7 @@ if (filename == NULL) return NULL; - arena = PyArena_New(); + arena = _PyArena_New(); if (arena == NULL) return NULL; @@ -1107,7 +1118,7 @@ if (arena == NULL) return NULL; - mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + mod = _PyParser_ASTFromString(str, filename, start, flags, arena); if (mod != NULL) ret = run_mod(mod, filename, globals, locals, flags, arena); @@ -1111,7 +1122,7 @@ if (mod != NULL) ret = run_mod(mod, filename, globals, locals, flags, arena); - PyArena_Free(arena); + _PyArena_Free(arena); return ret; } @@ -1120,9 +1131,9 @@ pyrun_file(FILE *fp, PyObject *filename, int start, PyObject *globals, PyObject *locals, int closeit, PyCompilerFlags *flags) { - PyArena *arena = PyArena_New(); + PyArena *arena = _PyArena_New(); if (arena == NULL) { return NULL; } mod_ty mod; @@ -1124,10 +1135,10 @@ if (arena == NULL) { return NULL; } mod_ty mod; - mod = PyParser_ASTFromFileObject(fp, filename, NULL, start, NULL, NULL, - flags, NULL, arena); + mod = _PyParser_ASTFromFile(fp, filename, NULL, start, NULL, NULL, + flags, NULL, arena); if (closeit) { fclose(fp); @@ -1140,7 +1151,7 @@ else { ret = NULL; } - PyArena_Free(arena); + _PyArena_Free(arena); return ret; } @@ -1230,7 +1241,7 @@ PyCompilerFlags *flags, PyArena *arena) { PyThreadState *tstate = _PyThreadState_GET(); - PyCodeObject *co = PyAST_CompileObject(mod, filename, flags, -1, arena); + PyCodeObject *co = _PyAST_Compile(mod, filename, flags, -1, arena); if (co == NULL) return NULL; @@ -1293,7 +1304,7 @@ { PyCodeObject *co; mod_ty mod; - PyArena *arena = PyArena_New(); + PyArena *arena = _PyArena_New(); if (arena == NULL) return NULL; @@ -1297,5 +1308,5 @@ if (arena == NULL) return NULL; - mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + mod = _PyParser_ASTFromString(str, filename, start, flags, arena); if (mod == NULL) { @@ -1301,6 +1312,6 @@ if (mod == NULL) { - PyArena_Free(arena); + _PyArena_Free(arena); return NULL; } if (flags && (flags->cf_flags & PyCF_ONLY_AST)) { PyObject *result = PyAST_mod2obj(mod); @@ -1303,7 +1314,7 @@ return NULL; } if (flags && (flags->cf_flags & PyCF_ONLY_AST)) { PyObject *result = PyAST_mod2obj(mod); - PyArena_Free(arena); + _PyArena_Free(arena); return result; } @@ -1308,7 +1319,7 @@ return result; } - co = PyAST_CompileObject(mod, filename, flags, optimize, arena); - PyArena_Free(arena); + co = _PyAST_Compile(mod, filename, flags, optimize, arena); + _PyArena_Free(arena); return (PyObject *)co; } diff --git a/Python/stdlib_module_names.h b/Python/stdlib_module_names.h index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL3N0ZGxpYl9tb2R1bGVfbmFtZXMuaA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL3N0ZGxpYl9tb2R1bGVfbmFtZXMuaA== 100644 --- a/Python/stdlib_module_names.h +++ b/Python/stdlib_module_names.h @@ -52,6 +52,7 @@ "_opcode", "_operator", "_osx_support", +"_overlapped", "_pickle", "_posixshmem", "_posixsubprocess", diff --git a/Python/suggestions.c b/Python/suggestions.c new file mode 100644 index 0000000000000000000000000000000000000000..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL3N1Z2dlc3Rpb25zLmM= --- /dev/null +++ b/Python/suggestions.c @@ -0,0 +1,146 @@ +#include "Python.h" + +#include "pycore_pyerrors.h" + +#define MAX_DISTANCE 3 +#define MAX_CANDIDATE_ITEMS 100 +#define MAX_STRING_SIZE 20 + +/* Calculate the Levenshtein distance between string1 and string2 */ +static size_t +levenshtein_distance(const char *a, const char *b) { + if (a == NULL || b == NULL) { + return 0; + } + + const size_t a_size = strlen(a); + const size_t b_size = strlen(b); + + if (a_size > MAX_STRING_SIZE || b_size > MAX_STRING_SIZE) { + return 0; + } + + // Both strings are the same (by identity) + if (a == b) { + return 0; + } + + // The first string is empty + if (a_size == 0) { + return b_size; + } + + // The second string is empty + if (b_size == 0) { + return a_size; + } + + size_t *buffer = PyMem_Calloc(a_size, sizeof(size_t)); + if (buffer == NULL) { + return 0; + } + + // Initialize the buffer row + size_t index = 0; + while (index < a_size) { + buffer[index] = index + 1; + index++; + } + + size_t b_index = 0; + size_t result = 0; + while (b_index < b_size) { + char code = b[b_index]; + size_t distance = result = b_index++; + index = SIZE_MAX; + while (++index < a_size) { + size_t b_distance = code == a[index] ? distance : distance + 1; + distance = buffer[index]; + if (distance > result) { + if (b_distance > result) { + result = result + 1; + } else { + result = b_distance; + } + } else { + if (b_distance > distance) { + result = distance + 1; + } else { + result = b_distance; + } + } + buffer[index] = result; + } + } + PyMem_Free(buffer); + return result; +} + +static inline PyObject * +calculate_suggestions(PyObject *dir, + PyObject *name) { + assert(!PyErr_Occurred()); + assert(PyList_CheckExact(dir)); + + Py_ssize_t dir_size = PyList_GET_SIZE(dir); + if (dir_size >= MAX_CANDIDATE_ITEMS) { + return NULL; + } + + Py_ssize_t suggestion_distance = PyUnicode_GetLength(name); + PyObject *suggestion = NULL; + for (int i = 0; i < dir_size; ++i) { + PyObject *item = PyList_GET_ITEM(dir, i); + const char *name_str = PyUnicode_AsUTF8(name); + if (name_str == NULL) { + PyErr_Clear(); + continue; + } + Py_ssize_t current_distance = levenshtein_distance(PyUnicode_AsUTF8(name), PyUnicode_AsUTF8(item)); + if (current_distance == 0 || current_distance > MAX_DISTANCE) { + continue; + } + if (!suggestion || current_distance < suggestion_distance) { + suggestion = item; + suggestion_distance = current_distance; + } + } + if (!suggestion) { + return NULL; + } + Py_INCREF(suggestion); + return suggestion; +} + +static PyObject * +offer_suggestions_for_attribute_error(PyAttributeErrorObject *exc) { + PyObject *name = exc->name; // borrowed reference + PyObject *obj = exc->obj; // borrowed reference + + // Abort if we don't have an attribute name or we have an invalid one + if (name == NULL || obj == NULL || !PyUnicode_CheckExact(name)) { + return NULL; + } + + PyObject *dir = PyObject_Dir(obj); + if (dir == NULL) { + return NULL; + } + + PyObject *suggestions = calculate_suggestions(dir, name); + Py_DECREF(dir); + return suggestions; +} + +// Offer suggestions for a given exception. Returns a python string object containing the +// suggestions. This function does not raise exceptions and returns NULL if no suggestion was found. +PyObject *_Py_Offer_Suggestions(PyObject *exception) { + PyObject *result = NULL; + assert(!PyErr_Occurred()); // Check that we are not going to clean any existing exception + if (PyErr_GivenExceptionMatches(exception, PyExc_AttributeError)) { + result = offer_suggestions_for_attribute_error((PyAttributeErrorObject *) exception); + } + assert(!PyErr_Occurred()); + return result; +} + diff --git a/Python/symtable.c b/Python/symtable.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL3N5bXRhYmxlLmM=..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL3N5bXRhYmxlLmM= 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -1,3 +1,6 @@ #include "Python.h" +#include "pycore_ast.h" // identifier, stmt_ty +#include "pycore_compile.h" // _Py_Mangle() +#include "pycore_parser.h" // _PyParser_ASTFromString() #include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_symtable.h" // PySTEntryObject @@ -2,6 +5,5 @@ #include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_symtable.h" // PySTEntryObject -#undef Yield /* undefine macro conflicting with <winbase.h> */ #include "structmember.h" // PyMemberDef /* error strings used for warnings */ @@ -1969,7 +1971,7 @@ mod_ty mod; PyArena *arena; - arena = PyArena_New(); + arena = _PyArena_New(); if (arena == NULL) return NULL; @@ -1973,5 +1975,5 @@ if (arena == NULL) return NULL; - mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); + mod = _PyParser_ASTFromString(str, filename, start, flags, arena); if (mod == NULL) { @@ -1977,5 +1979,5 @@ if (mod == NULL) { - PyArena_Free(arena); + _PyArena_Free(arena); return NULL; } st = _PySymtable_Build(mod, filename, 0); @@ -1979,6 +1981,6 @@ return NULL; } st = _PySymtable_Build(mod, filename, 0); - PyArena_Free(arena); + _PyArena_Free(arena); return st; } diff --git a/Python/sysmodule.c b/Python/sysmodule.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL3N5c21vZHVsZS5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL3N5c21vZHVsZS5j 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -252,7 +252,7 @@ /* Disallow tracing in hooks unless explicitly enabled */ ts->tracing++; - ts->use_tracing = 0; + ts->cframe->use_tracing = 0; while ((hook = PyIter_Next(hooks)) != NULL) { _Py_IDENTIFIER(__cantrace__); PyObject *o; @@ -265,10 +265,10 @@ break; } if (canTrace) { - ts->use_tracing = (ts->c_tracefunc || ts->c_profilefunc); + ts->cframe->use_tracing = (ts->c_tracefunc || ts->c_profilefunc); ts->tracing--; } PyObject* args[2] = {eventName, eventArgs}; o = _PyObject_FastCallTstate(ts, hook, args, 2); if (canTrace) { ts->tracing++; @@ -269,10 +269,10 @@ ts->tracing--; } PyObject* args[2] = {eventName, eventArgs}; o = _PyObject_FastCallTstate(ts, hook, args, 2); if (canTrace) { ts->tracing++; - ts->use_tracing = 0; + ts->cframe->use_tracing = 0; } if (!o) { break; @@ -280,7 +280,7 @@ Py_DECREF(o); Py_CLEAR(hook); } - ts->use_tracing = (ts->c_tracefunc || ts->c_profilefunc); + ts->cframe->use_tracing = (ts->c_tracefunc || ts->c_profilefunc); ts->tracing--; if (_PyErr_Occurred(ts)) { goto exit; @@ -2514,6 +2514,7 @@ {"isolated", "-I"}, {"dev_mode", "-X dev"}, {"utf8_mode", "-X utf8"}, + {"warn_default_encoding", "-X warn_default_encoding"}, {0} }; @@ -2521,7 +2522,7 @@ "sys.flags", /* name */ flags__doc__, /* doc */ flags_fields, /* fields */ - 15 + 16 }; static int @@ -2560,6 +2561,7 @@ SetFlag(config->isolated); SetFlagObj(PyBool_FromLong(config->dev_mode)); SetFlag(preconfig->utf8_mode); + SetFlag(config->warn_default_encoding); #undef SetFlagObj #undef SetFlag return 0; diff --git a/Python/traceback.c b/Python/traceback.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UHl0aG9uL3RyYWNlYmFjay5j..8dd72af26abae4c1395bdd7572059de8fccc8d87_UHl0aG9uL3RyYWNlYmFjay5j 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -233,7 +233,7 @@ assert(tb_next == NULL || PyTraceBack_Check(tb_next)); assert(frame != NULL); - return tb_create_raw((PyTracebackObject *)tb_next, frame, frame->f_lasti, + return tb_create_raw((PyTracebackObject *)tb_next, frame, frame->f_lasti*2, PyFrame_GetLineNumber(frame)); } @@ -763,8 +763,7 @@ PUTS(fd, "???"); } - /* PyFrame_GetLineNumber() was introduced in Python 2.7.0 and 3.2.0 */ - int lineno = PyCode_Addr2Line(code, frame->f_lasti); + int lineno = PyFrame_GetLineNumber(frame); PUTS(fd, ", line "); if (lineno >= 0) { _Py_DumpDecimal(fd, (size_t)lineno); diff --git a/README.rst b/README.rst index d44ad9a90312e58b44562e9ca531de7ed4ce5736_UkVBRE1FLnJzdA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_UkVBRE1FLnJzdA== 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -This is Python version 3.10.0 alpha 6 +This is Python version 3.10.0 alpha 7 ===================================== .. image:: https://travis-ci.com/python/cpython.svg?branch=master @@ -17,9 +17,9 @@ :alt: CPython code coverage on Codecov :target: https://codecov.io/gh/python/cpython -.. image:: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg - :alt: Python Zulip chat - :target: https://python.zulipchat.com +.. image:: https://img.shields.io/badge/discourse-join_chat-brightgreen.svg + :alt: Python Discourse chat + :target: https://discuss.python.org/ Copyright (c) 2001-2021 Python Software Foundation. All rights reserved. diff --git a/Tools/ccbench/ccbench.py b/Tools/ccbench/ccbench.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_VG9vbHMvY2NiZW5jaC9jY2JlbmNoLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_VG9vbHMvY2NiZW5jaC9jY2JlbmNoLnB5 100644 --- a/Tools/ccbench/ccbench.py +++ b/Tools/ccbench/ccbench.py @@ -221,7 +221,7 @@ for i in range(nthreads): threads.append(threading.Thread(target=run)) for t in threads: - t.setDaemon(True) + t.daemon = True t.start() # We don't want measurements to include thread startup overhead, # so we arrange for timing to start after all threads are ready. @@ -328,7 +328,7 @@ for i in range(nthreads): threads.append(threading.Thread(target=run)) for t in threads: - t.setDaemon(True) + t.daemon = True t.start() # Wait for threads to be ready with ready_cond: @@ -460,7 +460,7 @@ for i in range(nthreads): threads.append(threading.Thread(target=run)) for t in threads: - t.setDaemon(True) + t.daemon = True t.start() # Wait for threads to be ready with ready_cond: diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_VG9vbHMvY2xpbmljL2NsaW5pYy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_VG9vbHMvY2xpbmljL2NsaW5pYy5weQ== 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -2159,7 +2159,6 @@ __mod__ __mul__ __neg__ -__new__ __next__ __or__ __pos__ @@ -4227,6 +4226,9 @@ module, cls = self.clinic._module_and_class(fields) fields = full_name.split('.') + if fields[-1] in unsupported_special_methods: + fail(f"{fields[-1]} is a special method and cannot be converted to Argument Clinic! (Yet.)") + if fields[-1] == '__new__': if (self.kind != CLASS_METHOD) or (not cls): fail("__new__ must be a class method!") @@ -4237,8 +4239,6 @@ self.kind = METHOD_INIT if not return_converter: return_converter = init_return_converter() - elif fields[-1] in unsupported_special_methods: - fail(fields[-1] + " is a special method and cannot be converted to Argument Clinic! (Yet.)") if not return_converter: return_converter = CReturnConverter() diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_VG9vbHMvZ2RiL2xpYnB5dGhvbi5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_VG9vbHMvZ2RiL2xpYnB5dGhvbi5weQ== 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -947,7 +947,7 @@ return self.f_lineno try: - return self.co.addr2line(self.f_lasti) + return self.co.addr2line(self.f_lasti*2) except Exception: # bpo-34989: addr2line() is a complex function, it can fail in many # ways. For example, it fails with a TypeError on "FakeRepr" if diff --git a/Tools/msi/purge.py b/Tools/msi/purge.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_VG9vbHMvbXNpL3B1cmdlLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_VG9vbHMvbXNpL3B1cmdlLnB5 100644 --- a/Tools/msi/purge.py +++ b/Tools/msi/purge.py @@ -65,4 +65,6 @@ "python-{}-webinstall.exe".format(m.group(0)), "python-{}-amd64.exe".format(m.group(0)), "python-{}-amd64-webinstall.exe".format(m.group(0)), + "python-{}-embed-amd64.zip".format(m.group(0)), + "python-{}-embed-win32.zip".format(m.group(0)), ] + ["win32{}/{}".format(REL, f) for f in FILES] + ["amd64{}/{}".format(REL, f) for f in FILES] @@ -68,4 +70,5 @@ ] + ["win32{}/{}".format(REL, f) for f in FILES] + ["amd64{}/{}".format(REL, f) for f in FILES] +PATHS = PATHS + [p + ".asc" for p in PATHS] print('Purged:') for n in PATHS: diff --git a/Tools/peg_generator/peg_extension/peg_extension.c b/Tools/peg_generator/peg_extension/peg_extension.c index d44ad9a90312e58b44562e9ca531de7ed4ce5736_VG9vbHMvcGVnX2dlbmVyYXRvci9wZWdfZXh0ZW5zaW9uL3BlZ19leHRlbnNpb24uYw==..8dd72af26abae4c1395bdd7572059de8fccc8d87_VG9vbHMvcGVnX2dlbmVyYXRvci9wZWdfZXh0ZW5zaW9uL3BlZ19leHRlbnNpb24uYw== 100644 --- a/Tools/peg_generator/peg_extension/peg_extension.c +++ b/Tools/peg_generator/peg_extension/peg_extension.c @@ -1,4 +1,6 @@ #include "pegen.h" +#include "pycore_compile.h" // _PyAST_Compile() + PyObject * _build_return_object(mod_ty module, int mode, PyObject *filename_ob, PyArena *arena) @@ -6,7 +8,7 @@ PyObject *result = NULL; if (mode == 2) { - result = (PyObject *)PyAST_CompileObject(module, filename_ob, NULL, -1, arena); + result = (PyObject *)_PyAST_Compile(module, filename_ob, NULL, -1, arena); } else if (mode == 1) { result = PyAST_mod2obj(module); } else { @@ -30,7 +32,7 @@ return PyErr_Format(PyExc_ValueError, "Bad mode, must be 0 <= mode <= 2"); } - PyArena *arena = PyArena_New(); + PyArena *arena = _PyArena_New(); if (arena == NULL) { return NULL; } @@ -42,4 +44,10 @@ goto error; } + FILE *fp = fopen(filename, "rb"); + if (fp == NULL) { + PyErr_SetFromErrnoWithFilename(PyExc_OSError, filename); + goto error; + } + PyCompilerFlags flags = _PyCompilerFlags_INIT; @@ -45,5 +53,8 @@ PyCompilerFlags flags = _PyCompilerFlags_INIT; - mod_ty res = _PyPegen_run_parser_from_file(filename, Py_file_input, filename_ob, &flags, arena); + mod_ty res = _PyPegen_run_parser_from_file_pointer( + fp, Py_file_input, filename_ob, + NULL, NULL, NULL, &flags, NULL, arena); + fclose(fp); if (res == NULL) { goto error; } @@ -52,7 +63,7 @@ error: Py_XDECREF(filename_ob); - PyArena_Free(arena); + _PyArena_Free(arena); return result; } @@ -69,7 +80,7 @@ return PyErr_Format(PyExc_ValueError, "Bad mode, must be 0 <= mode <= 2"); } - PyArena *arena = PyArena_New(); + PyArena *arena = _PyArena_New(); if (arena == NULL) { return NULL; } @@ -91,10 +102,10 @@ error: Py_XDECREF(filename_ob); - PyArena_Free(arena); + _PyArena_Free(arena); return result; } static PyObject * clear_memo_stats(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored)) { @@ -95,7 +106,8 @@ return result; } static PyObject * clear_memo_stats(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored)) { +#if defined(PY_DEBUG) _PyPegen_clear_memo_statistics(); @@ -101,7 +113,8 @@ _PyPegen_clear_memo_statistics(); +#endif Py_RETURN_NONE; } static PyObject * get_memo_stats(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored)) { @@ -102,7 +115,8 @@ Py_RETURN_NONE; } static PyObject * get_memo_stats(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored)) { +#if defined(PY_DEBUG) return _PyPegen_get_memo_statistics(); @@ -108,7 +122,10 @@ return _PyPegen_get_memo_statistics(); +#else + Py_RETURN_NONE; +#endif } // TODO: Write to Python's sys.stdout instead of C's stdout. static PyObject * dump_memo_stats(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored)) { @@ -109,9 +126,10 @@ } // TODO: Write to Python's sys.stdout instead of C's stdout. static PyObject * dump_memo_stats(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored)) { +#if defined(PY_DEBUG) PyObject *list = _PyPegen_get_memo_statistics(); if (list == NULL) { return NULL; @@ -128,6 +146,7 @@ } } Py_DECREF(list); +#endif Py_RETURN_NONE; } diff --git a/Tools/scripts/generate_stdlib_module_names.py b/Tools/scripts/generate_stdlib_module_names.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_VG9vbHMvc2NyaXB0cy9nZW5lcmF0ZV9zdGRsaWJfbW9kdWxlX25hbWVzLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_VG9vbHMvc2NyaXB0cy9nZW5lcmF0ZV9zdGRsaWJfbW9kdWxlX25hbWVzLnB5 100644 --- a/Tools/scripts/generate_stdlib_module_names.py +++ b/Tools/scripts/generate_stdlib_module_names.py @@ -42,6 +42,7 @@ # Windows extension modules WINDOWS_MODULES = ( '_msi', + '_overlapped', '_testconsole', '_winapi', 'msvcrt', diff --git a/Tools/scripts/pdeps.py b/Tools/scripts/pdeps.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_VG9vbHMvc2NyaXB0cy9wZGVwcy5weQ==..8dd72af26abae4c1395bdd7572059de8fccc8d87_VG9vbHMvc2NyaXB0cy9wZGVwcy5weQ== 100755 --- a/Tools/scripts/pdeps.py +++ b/Tools/scripts/pdeps.py @@ -64,7 +64,7 @@ # Collect data from one file # def process(filename, table): - with open(filename) as fp: + with open(filename, encoding='utf-8') as fp: mod = os.path.basename(filename) if mod[-3:] == '.py': mod = mod[:-3] diff --git a/Tools/scripts/stable_abi.py b/Tools/scripts/stable_abi.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_VG9vbHMvc2NyaXB0cy9zdGFibGVfYWJpLnB5..8dd72af26abae4c1395bdd7572059de8fccc8d87_VG9vbHMvc2NyaXB0cy9zdGFibGVfYWJpLnB5 100755 --- a/Tools/scripts/stable_abi.py +++ b/Tools/scripts/stable_abi.py @@ -91,11 +91,6 @@ def generate_limited_api_symbols(args): - if hasattr(sys, "gettotalrefcount"): - print( - "Stable ABI symbols cannot be generated from a debug build", file=sys.stderr - ) - sys.exit(1) library = sysconfig.get_config_var("LIBRARY") ldlibrary = sysconfig.get_config_var("LDLIBRARY") if ldlibrary != library: @@ -112,7 +107,6 @@ stable_data, stable_exported_data, stable_functions = get_limited_api_definitions( headers ) - macros = get_limited_api_macros(headers) stable_symbols = { symbol @@ -116,7 +110,7 @@ stable_symbols = { symbol - for symbol in (stable_functions | stable_exported_data | stable_data | macros) + for symbol in (stable_functions | stable_exported_data | stable_data) if symbol.startswith("Py") and symbol in available_symbols } with open(args.output_file, "w") as output_file: @@ -128,36 +122,6 @@ output_file.write(f"{symbol}\n") -def get_limited_api_macros(headers): - """Run the preprocesor over all the header files in "Include" setting - "-DPy_LIMITED_API" to the correct value for the running version of the interpreter - and extracting all macro definitions (via adding -dM to the compiler arguments). - """ - - preprocesor_output_with_macros = subprocess.check_output( - sysconfig.get_config_var("CC").split() - + [ - # Prevent the expansion of the exported macros so we can capture them later - "-DSIZEOF_WCHAR_T=4", # The actual value is not important - f"-DPy_LIMITED_API={sys.version_info.major << 24 | sys.version_info.minor << 16}", - "-I.", - "-I./Include", - "-dM", - "-E", - ] - + [str(file) for file in headers], - text=True, - stderr=subprocess.DEVNULL, - ) - - return { - target - for _, target in re.findall( - r"#define (\w+)\s*(?:\(.*?\))?\s+(\w+)", preprocesor_output_with_macros - ) - } - - def get_limited_api_definitions(headers): """Run the preprocesor over all the header files in "Include" setting "-DPy_LIMITED_API" to the correct value for the running version of the interpreter. diff --git a/Tools/ssl/make_ssl_data.py b/Tools/ssl/make_ssl_data.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_VG9vbHMvc3NsL21ha2Vfc3NsX2RhdGEucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_VG9vbHMvc3NsL21ha2Vfc3NsX2RhdGEucHk= 100755 --- a/Tools/ssl/make_ssl_data.py +++ b/Tools/ssl/make_ssl_data.py @@ -6,7 +6,7 @@ It takes two arguments: - the path to the OpenSSL source tree (e.g. git checkout) -- the path to the C file to be generated - (probably Modules/_ssl_data.h) +- the path to the header file to be generated Modules/_ssl_data_{version}.h +- error codes are version specific """ @@ -11,3 +11,4 @@ """ +import argparse import datetime @@ -13,5 +14,5 @@ import datetime -import glob +import operator import os import re import sys @@ -15,6 +16,55 @@ import os import re import sys -import _ssl + + +parser = argparse.ArgumentParser( + description="Generate ssl_data.h from OpenSSL sources" +) +parser.add_argument("srcdir", help="OpenSSL source directory") +parser.add_argument( + "output", nargs="?", type=argparse.FileType("w"), default=sys.stdout +) + + +def _file_search(fname, pat): + with open(fname, encoding="utf-8") as f: + for line in f: + match = pat.search(line) + if match is not None: + yield match + + +def parse_err_h(args): + """Parse err codes, e.g. ERR_LIB_X509: 11""" + pat = re.compile(r"#\s*define\W+ERR_LIB_(\w+)\s+(\d+)") + lib2errnum = {} + for match in _file_search(args.err_h, pat): + libname, num = match.groups() + lib2errnum[libname] = int(num) + + return lib2errnum + + +def parse_openssl_error_text(args): + """Parse error reasons, X509_R_AKID_MISMATCH""" + # ignore backslash line continuation for now + pat = re.compile(r"^((\w+?)_R_(\w+)):(\d+):") + for match in _file_search(args.errtxt, pat): + reason, libname, errname, num = match.groups() + if "_F_" in reason: + # ignore function codes + continue + num = int(num) + yield reason, libname, errname, num + + +def parse_extra_reasons(args): + """Parse extra reasons from openssl.ec""" + pat = re.compile(r"^R\s+((\w+)_R_(\w+))\s+(\d+)") + for match in _file_search(args.errcodes, pat): + reason, libname, errname, num = match.groups() + num = int(num) + yield reason, libname, errname, num @@ -19,17 +69,65 @@ -def parse_error_codes(h_file, prefix, libcode): - pat = re.compile(r"#\s*define\W+(%s([\w]+))\W+(\d+)\b" % re.escape(prefix)) - codes = [] - with open(h_file, "r", encoding="latin1") as f: - for line in f: - match = pat.search(line) - if match: - code, name, num = match.groups() - num = int(num) - # e.g. ("SSL_R_BAD_DATA", ("ERR_LIB_SSL", "BAD_DATA", 390)) - codes.append((code, (libcode, name, num))) - assert codes, f"no codes found in {h_file}" - return codes +def gen_library_codes(args): + """Generate table short libname to numeric code""" + yield "static struct py_ssl_library_code library_codes[] = {" + for libname in sorted(args.lib2errnum): + yield f"#ifdef ERR_LIB_{libname}" + yield f' {{"{libname}", ERR_LIB_{libname}}},' + yield "#endif" + yield " { NULL }" + yield "};" + yield "" + + +def gen_error_codes(args): + """Generate error code table for error reasons""" + yield "static struct py_ssl_error_code error_codes[] = {" + for reason, libname, errname, num in args.reasons: + yield f" #ifdef {reason}" + yield f' {{"{errname}", ERR_LIB_{libname}, {reason}}},' + yield " #else" + yield f' {{"{errname}", {args.lib2errnum[libname]}, {num}}},' + yield " #endif" + + yield " { NULL }" + yield "};" + yield "" + + +def main(): + args = parser.parse_args() + + args.err_h = os.path.join(args.srcdir, "include", "openssl", "err.h") + if not os.path.isfile(args.err_h): + # Fall back to infile for OpenSSL 3.0.0 + args.err_h += ".in" + args.errcodes = os.path.join(args.srcdir, "crypto", "err", "openssl.ec") + args.errtxt = os.path.join(args.srcdir, "crypto", "err", "openssl.txt") + + if not os.path.isfile(args.errtxt): + parser.error(f"File {args.errtxt} not found in srcdir\n.") + + # {X509: 11, ...} + args.lib2errnum = parse_err_h(args) + + # [('X509_R_AKID_MISMATCH', 'X509', 'AKID_MISMATCH', 110), ...] + reasons = [] + reasons.extend(parse_openssl_error_text(args)) + reasons.extend(parse_extra_reasons(args)) + # sort by libname, numeric error code + args.reasons = sorted(reasons, key=operator.itemgetter(0, 3)) + + lines = [ + "/* File generated by Tools/ssl/make_ssl_data.py */" + f"/* Generated on {datetime.datetime.utcnow().isoformat()} */" + ] + lines.extend(gen_library_codes(args)) + lines.append("") + lines.extend(gen_error_codes(args)) + + for line in lines: + args.output.write(line + "\n") + if __name__ == "__main__": @@ -34,67 +132,3 @@ if __name__ == "__main__": - openssl_inc = sys.argv[1] - outfile = sys.argv[2] - use_stdout = outfile == '-' - f = sys.stdout if use_stdout else open(outfile, "w") - # mnemonic -> (library code, error prefix, header file) - error_libraries = {} - for error_header in glob.glob(os.path.join(glob.escape(openssl_inc), 'include/openssl/*err.h')): - base = os.path.basename(error_header) - if base in ('buffererr.h', 'objectserr.h', 'storeerr.h'): - # Deprecated in 3.0. - continue - mnemonic = base[:-5].upper() - if mnemonic == "": - # err.h - lib_codes = { - code: num - for (code, (_, _, num)) in parse_error_codes(error_header, 'ERR_LIB_', None) - } - else: - error_libraries[mnemonic] = (f'ERR_LIB_{mnemonic}', f'{mnemonic}_R_', error_header) - - # Read codes from libraries - new_codes = [] - for libcode, prefix, h_file in sorted(error_libraries.values()): - new_codes += parse_error_codes(h_file, prefix, libcode) - new_code_nums = set((libcode, num) - for (code, (libcode, name, num)) in new_codes) - - # Merge with existing codes (in case some old codes disappeared). - codes = {} - for errname, (libnum, errnum) in _ssl.err_names_to_codes.items(): - lib = error_libraries[_ssl.lib_codes_to_names[libnum]] - libcode = lib[0] # e.g. ERR_LIB_PEM - errcode = lib[1] + errname # e.g. SSL_R_BAD_SSL_SESSION_ID_LENGTH - # Only keep it if the numeric codes weren't reused - if (libcode, errnum) not in new_code_nums: - codes[errcode] = libcode, errname, errnum - codes.update(dict(new_codes)) - - def w(l): - f.write(l + "\n") - w("/* File generated by Tools/ssl/make_ssl_data.py */") - w("/* Generated on %s */" % datetime.datetime.now().isoformat()) - w("") - - w("static struct py_ssl_library_code library_codes[] = {") - for mnemo, (libcode, _, _) in sorted(error_libraries.items()): - w(f'#ifdef {libcode}') - w(' {"%s", %s},' % (mnemo, libcode)) - w('#endif') - w(' { NULL }') - w('};') - w("") - - w("static struct py_ssl_error_code error_codes[] = {") - for errcode, (libcode, name, num) in sorted(codes.items()): - w(' #ifdef %s' % (errcode)) - w(' {"%s", %s, %s},' % (name, libcode, errcode)) - w(' #else') - w(' {"%s", %s, %d},' % (name, lib_codes[libcode], num)) - w(' #endif') - w(' { NULL }') - w('};') - if not use_stdout: - f.close() + main() diff --git a/Tools/ssl/multissltests.py b/Tools/ssl/multissltests.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_VG9vbHMvc3NsL211bHRpc3NsdGVzdHMucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_VG9vbHMvc3NsL211bHRpc3NsdGVzdHMucHk= 100755 --- a/Tools/ssl/multissltests.py +++ b/Tools/ssl/multissltests.py @@ -48,8 +48,8 @@ ] OPENSSL_RECENT_VERSIONS = [ - "1.1.1j", - # "3.0.0-alpha12" + "1.1.1k", + # "3.0.0-alpha14" ] LIBRESSL_OLD_VERSIONS = [ diff --git a/aclocal.m4 b/aclocal.m4 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_YWNsb2NhbC5tNA==..8dd72af26abae4c1395bdd7572059de8fccc8d87_YWNsb2NhbC5tNA== 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -12,6 +12,90 @@ # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +# =============================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_c_float_words_bigendian.html +# =============================================================================== +# +# SYNOPSIS +# +# AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) +# +# DESCRIPTION +# +# Checks the ordering of words within a multi-word float. This check is +# necessary because on some systems (e.g. certain ARM systems), the float +# word ordering can be different from the byte ordering. In a multi-word +# float context, "big-endian" implies that the word containing the sign +# bit is found in the memory location with the lowest address. This +# implementation was inspired by the AC_C_BIGENDIAN macro in autoconf. +# +# The endianness is detected by first compiling C code that contains a +# special double float value, then grepping the resulting object file for +# certain strings of ASCII values. The double is specially crafted to have +# a binary representation that corresponds with a simple string. In this +# implementation, the string "noonsees" was selected because the +# individual word values ("noon" and "sees") are palindromes, thus making +# this test byte-order agnostic. If grep finds the string "noonsees" in +# the object file, the target platform stores float words in big-endian +# order. If grep finds "seesnoon", float words are in little-endian order. +# If neither value is found, the user is instructed to specify the +# ordering. +# +# LICENSE +# +# Copyright (c) 2008 Daniel Amelang <dan@amelang.net> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 11 + +AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN], + [AC_CACHE_CHECK(whether float word ordering is bigendian, + ax_cv_c_float_words_bigendian, [ + +ax_cv_c_float_words_bigendian=unknown +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + +double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0; + +]])], [ + +if grep noonsees conftest.$ac_objext >/dev/null ; then + ax_cv_c_float_words_bigendian=yes +fi +if grep seesnoon conftest.$ac_objext >/dev/null ; then + if test "$ax_cv_c_float_words_bigendian" = unknown; then + ax_cv_c_float_words_bigendian=no + else + ax_cv_c_float_words_bigendian=unknown + fi +fi + +])]) + +case $ax_cv_c_float_words_bigendian in + yes) + m4_default([$1], + [AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1, + [Define to 1 if your system stores words within floats + with the most significant word first])]) ;; + no) + $2 ;; + *) + m4_default([$3], + [AC_MSG_ERROR([ + +Unknown float word ordering. You need to manually preset +ax_cv_c_float_words_bigendian=no (or yes) according to your system. + + ])]) ;; +esac + +])# AX_C_FLOAT_WORDS_BIGENDIAN + # =========================================================================== # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== @@ -66,6 +150,131 @@ AS_VAR_POPDEF([CACHEVAR])dnl ])dnl AX_CHECK_COMPILE_FLAGS +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]]) +# +# DESCRIPTION +# +# Look for OpenSSL in a number of default spots, or in a user-selected +# spot (via --with-openssl). Sets +# +# OPENSSL_INCLUDES to the include directives required +# OPENSSL_LIBS to the -l directives required +# OPENSSL_LDFLAGS to the -L or -R flags required +# +# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately +# +# This macro sets OPENSSL_INCLUDES such that source files should use the +# openssl/ directory in include directives: +# +# #include <openssl/hmac.h> +# +# LICENSE +# +# Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/> +# Copyright (c) 2009,2010 Dustin J. Mitchell <dustin@zmanda.com> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 10 + +AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL]) +AC_DEFUN([AX_CHECK_OPENSSL], [ + found=false + AC_ARG_WITH([openssl], + [AS_HELP_STRING([--with-openssl=DIR], + [root of the OpenSSL directory])], + [ + case "$withval" in + "" | y | ye | yes | n | no) + AC_MSG_ERROR([Invalid --with-openssl value]) + ;; + *) ssldirs="$withval" + ;; + esac + ], [ + # if pkg-config is installed and openssl has installed a .pc file, + # then use that information and don't search ssldirs + AC_CHECK_TOOL([PKG_CONFIG], [pkg-config]) + if test x"$PKG_CONFIG" != x""; then + OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` + if test $? = 0; then + OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` + OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` + found=true + fi + fi + + # no such luck; use some default ssldirs + if ! $found; then + ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" + fi + ] + ) + + + # note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in + # an 'openssl' subdirectory + + if ! $found; then + OPENSSL_INCLUDES= + for ssldir in $ssldirs; do + AC_MSG_CHECKING([for openssl/ssl.h in $ssldir]) + if test -f "$ssldir/include/openssl/ssl.h"; then + OPENSSL_INCLUDES="-I$ssldir/include" + OPENSSL_LDFLAGS="-L$ssldir/lib" + OPENSSL_LIBS="-lssl -lcrypto" + found=true + AC_MSG_RESULT([yes]) + break + else + AC_MSG_RESULT([no]) + fi + done + + # if the file wasn't found, well, go ahead and try the link anyway -- maybe + # it will just work! + fi + + # try the preprocessor and linker with our new flags, + # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS + + AC_MSG_CHECKING([whether compiling and linking against OpenSSL works]) + echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ + "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD + + save_LIBS="$LIBS" + save_LDFLAGS="$LDFLAGS" + save_CPPFLAGS="$CPPFLAGS" + LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" + LIBS="$OPENSSL_LIBS $LIBS" + CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([#include <openssl/ssl.h>], [SSL_new(NULL)])], + [ + AC_MSG_RESULT([yes]) + $1 + ], [ + AC_MSG_RESULT([no]) + $2 + ]) + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + + AC_SUBST([OPENSSL_INCLUDES]) + AC_SUBST([OPENSSL_LIBS]) + AC_SUBST([OPENSSL_LDFLAGS]) +]) + # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 11 (pkg-config-0.29.1) @@ -410,5 +619,3 @@ [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) ])dnl PKG_HAVE_DEFINE_WITH_MODULES -m4_include([m4/ax_c_float_words_bigendian.m4]) -m4_include([m4/ax_check_openssl.m4]) diff --git a/configure b/configure index d44ad9a90312e58b44562e9ca531de7ed4ce5736_Y29uZmlndXJl..8dd72af26abae4c1395bdd7572059de8fccc8d87_Y29uZmlndXJl 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for python 3.10. +# Generated by GNU Autoconf 2.71 for python 3.10. # # Report bugs to <https://bugs.python.org/>. # # @@ -4,8 +4,9 @@ # # Report bugs to <https://bugs.python.org/>. # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -16,10 +17,12 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -20,10 +23,10 @@ emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -33,6 +36,14 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl @@ -36,39 +47,31 @@ as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi +if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. @@ -73,6 +76,6 @@ # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -81,13 +84,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -96,8 +92,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -109,7 +109,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi @@ -113,26 +113,6 @@ exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -154,9 +134,9 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then @@ -159,11 +139,13 @@ fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST @@ -164,10 +146,10 @@ emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -187,9 +169,10 @@ as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 @@ -193,9 +176,11 @@ exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" @@ -196,8 +181,9 @@ test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes @@ -203,4 +189,4 @@ as_have_required=yes -else +else $as_nop as_have_required=no fi @@ -205,10 +191,11 @@ as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS @@ -210,11 +197,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. @@ -216,7 +207,7 @@ as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && @@ -222,3 +213,4 @@ if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes @@ -224,5 +216,6 @@ CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -230,6 +223,12 @@ esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$SHELL as_have_required=yes @@ -235,9 +234,10 @@ CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : +fi +fi + + + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -255,7 +255,7 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -259,10 +259,11 @@ exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else @@ -268,5 +269,5 @@ else - $as_echo "$0: Please tell bug-autoconf@gnu.org and + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: https://bugs.python.org/ about your system, including $0: any error possibly output before this message. Then $0: install a modern shell, or manually run the script @@ -294,6 +295,7 @@ } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -311,6 +313,14 @@ as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -325,7 +335,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -334,7 +344,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -373,8 +383,9 @@ # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' @@ -377,8 +388,8 @@ eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -390,8 +401,9 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' @@ -394,11 +406,11 @@ eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith @@ -399,9 +411,17 @@ as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -413,9 +433,9 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -442,7 +462,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -486,7 +506,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -500,6 +520,10 @@ exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -513,6 +537,13 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -588,12 +619,9 @@ ac_unique_file="Include/object.h" # Factoring default headers for most tests. ac_includes_default="\ -#include <stdio.h> -#ifdef HAVE_SYS_TYPES_H -# include <sys/types.h> -#endif -#ifdef HAVE_SYS_STAT_H -# include <sys/stat.h> -#endif -#ifdef STDC_HEADERS +#include <stddef.h> +#ifdef HAVE_STDIO_H +# include <stdio.h> +#endif +#ifdef HAVE_STDLIB_H # include <stdlib.h> @@ -599,8 +627,3 @@ # include <stdlib.h> -# include <stddef.h> -#else -# ifdef HAVE_STDLIB_H -# include <stdlib.h> -# endif #endif #ifdef HAVE_STRING_H @@ -605,7 +628,4 @@ #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include <memory.h> -# endif # include <string.h> #endif @@ -610,11 +630,8 @@ # include <string.h> #endif -#ifdef HAVE_STRINGS_H -# include <strings.h> -#endif #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_STDINT_H # include <stdint.h> #endif @@ -615,10 +632,19 @@ #ifdef HAVE_INTTYPES_H # include <inttypes.h> #endif #ifdef HAVE_STDINT_H # include <stdint.h> #endif +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif #ifdef HAVE_UNISTD_H # include <unistd.h> #endif" @@ -621,7 +647,8 @@ #ifdef HAVE_UNISTD_H # include <unistd.h> #endif" +ac_header_c_list= ac_subst_vars='LTLIBOBJS TEST_MODULES LIBRARY_DEPS @@ -675,6 +702,7 @@ SHLIB_SUFFIX LIBTOOL_CRUFT OTHER_LIBTOOL_OPT +EGREP UNIVERSAL_ARCH_FLAGS LDFLAGS_NODIST CFLAGS_NODIST @@ -718,7 +746,6 @@ LDLIBRARY LIBRARY BUILDEXEEXT -EGREP NO_AS_NEEDED MULTIARCH_CPPFLAGS PLATFORM_TRIPLET @@ -792,6 +819,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -915,6 +943,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -944,8 +973,6 @@ *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -986,5 +1013,5 @@ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt @@ -990,5 +1017,5 @@ ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1012,5 +1039,5 @@ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt @@ -1016,5 +1043,5 @@ ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1167,6 +1194,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1216,5 +1252,5 @@ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt @@ -1220,5 +1256,5 @@ ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1232,5 +1268,5 @@ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt @@ -1236,5 +1272,5 @@ ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1278,5 +1314,5 @@ *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && @@ -1282,5 +1318,5 @@ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1296,7 +1332,7 @@ case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1304,7 +1340,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1360,7 +1396,7 @@ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1457,6 +1493,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1594,7 +1631,7 @@ --with-ensurepip[=install|upgrade|no] "install" or "upgrade" using bundled pip (default is upgrade) - --with-openssl=DIR override root of the OpenSSL directory to DIR + --with-openssl=DIR root of the OpenSSL directory --with-openssl-rpath=[DIR|auto|no] Set runtime library directory (rpath) for OpenSSL libraries, no (default): don't set rpath, auto: @@ -1653,5 +1690,5 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. @@ -1657,5 +1694,5 @@ # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1683,7 +1720,8 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1691,7 +1729,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1701,9 +1739,9 @@ if $ac_init_version; then cat <<\_ACEOF python configure 3.10 -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. +generated by GNU Autoconf 2.71 + +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1720,10 +1758,10 @@ ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" @@ -1724,10 +1762,10 @@ if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1735,7 +1773,7 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -1739,5 +1777,6 @@ test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 @@ -1743,6 +1782,6 @@ ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1764,7 +1803,7 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1772,7 +1811,7 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -1776,5 +1815,6 @@ test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - }; then : + } +then : ac_retval=0 @@ -1780,6 +1820,6 @@ ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1795,10 +1835,10 @@ ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" @@ -1799,10 +1839,10 @@ if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1810,10 +1850,10 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext @@ -1814,8 +1854,9 @@ test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 @@ -1821,6 +1862,6 @@ ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1835,5 +1876,5 @@ } # ac_fn_c_try_link -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- @@ -1839,7 +1880,6 @@ # ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack @@ -1844,20 +1884,13 @@ { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF @@ -1860,62 +1893,13 @@ /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## --------------------------------------- ## -## Report this to https://bugs.python.org/ ## -## --------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 @@ -1920,7 +1904,6 @@ fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -1925,6 +1908,6 @@ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_header_mongrel +} # ac_fn_c_check_header_compile # ac_fn_c_try_run LINENO # ---------------------- @@ -1928,8 +1911,8 @@ # ac_fn_c_try_run LINENO # ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack @@ -1939,6 +1922,6 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? @@ -1943,9 +1926,9 @@ (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" @@ -1946,9 +1929,9 @@ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? @@ -1953,5 +1936,6 @@ (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : ac_retval=0 @@ -1957,7 +1941,7 @@ ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status @@ -1968,37 +1952,6 @@ } # ac_fn_c_try_run -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache @@ -2006,13 +1959,14 @@ ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int @@ -2014,9 +1968,9 @@ eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof ($2)) return 0; @@ -2024,8 +1978,9 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int @@ -2028,8 +1983,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof (($2))) return 0; @@ -2037,8 +1992,9 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop eval "$3=yes" fi @@ -2043,7 +1999,7 @@ eval "$3=yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 @@ -2048,7 +2004,7 @@ fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type @@ -2067,7 +2023,7 @@ /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0; @@ -2077,10 +2033,11 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int @@ -2081,10 +2038,10 @@ ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -2094,5 +2051,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=$ac_mid; break @@ -2098,5 +2056,5 @@ ac_hi=$ac_mid; break -else +else $as_nop as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= @@ -2104,10 +2062,10 @@ fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int @@ -2110,8 +2068,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0; @@ -2121,10 +2079,11 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int @@ -2125,10 +2084,10 @@ ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0; @@ -2138,5 +2097,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_lo=$ac_mid; break @@ -2142,5 +2102,5 @@ ac_lo=$ac_mid; break -else +else $as_nop as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= @@ -2148,8 +2108,8 @@ fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else $as_nop ac_lo= ac_hi= fi @@ -2154,8 +2114,8 @@ ac_lo= ac_hi= fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val @@ -2163,7 +2123,7 @@ /* end confdefs.h. */ $4 int -main () +main (void) { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0; @@ -2173,5 +2133,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_hi=$ac_mid @@ -2177,4 +2138,4 @@ ac_hi=$ac_mid -else +else $as_nop as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi @@ -2179,6 +2140,6 @@ as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; @@ -2188,8 +2149,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } #include <stdio.h> #include <stdlib.h> int @@ -2193,7 +2154,7 @@ #include <stdio.h> #include <stdlib.h> int -main () +main (void) { FILE *f = fopen ("conftest.val", "w"); @@ -2221,5 +2182,6 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : echo >>conftest.val; read $3 <conftest.val; ac_retval=0 @@ -2225,5 +2187,5 @@ echo >>conftest.val; read $3 <conftest.val; ac_retval=0 -else +else $as_nop ac_retval=1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -2242,11 +2204,12 @@ ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case <limits.h> declares $2. @@ -2254,16 +2217,9 @@ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - + which can conflict with char $2 (); below. */ + +#include <limits.h> #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -2281,10 +2237,10 @@ #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF @@ -2285,8 +2241,9 @@ { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" @@ -2292,4 +2249,4 @@ eval "$3=yes" -else +else $as_nop eval "$3=no" fi @@ -2294,6 +2251,6 @@ eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 @@ -2297,9 +2254,9 @@ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -2302,7 +2259,7 @@ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- +# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR +# ------------------------------------------------------------------ # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR @@ -2308,6 +2265,6 @@ # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () +# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. +ac_fn_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` @@ -2311,4 +2268,10 @@ { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +printf %s "checking whether $as_decl_name is declared... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` @@ -2314,10 +2277,7 @@ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + eval ac_save_FLAGS=\$$6 + as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int @@ -2320,8 +2280,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { #ifndef $as_decl_name #ifdef __cplusplus @@ -2335,5 +2295,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" @@ -2339,4 +2300,4 @@ eval "$3=yes" -else +else $as_nop eval "$3=no" fi @@ -2341,5 +2302,7 @@ eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + eval $6=\$ac_save_FLAGS + fi eval ac_res=\$$3 @@ -2344,6 +2307,6 @@ fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -2348,6 +2311,6 @@ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_decl +} # ac_fn_check_decl # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- @@ -2356,12 +2319,13 @@ ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -$as_echo_n "checking for $2.$3... " >&6; } -if eval \${$4+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +printf %s "checking for $2.$3... " >&6; } +if eval test \${$4+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int @@ -2364,8 +2328,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int -main () +main (void) { static $2 ac_aggr; if (ac_aggr.$3) @@ -2374,5 +2338,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$4=yes" @@ -2378,6 +2343,6 @@ eval "$4=yes" -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int @@ -2380,8 +2345,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int -main () +main (void) { static $2 ac_aggr; if (sizeof ac_aggr.$3) @@ -2390,5 +2355,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$4=yes" @@ -2394,4 +2360,4 @@ eval "$4=yes" -else +else $as_nop eval "$4=no" fi @@ -2396,7 +2362,7 @@ eval "$4=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$4 @@ -2401,7 +2367,7 @@ fi eval ac_res=\$$4 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member @@ -2405,8 +2371,28 @@ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by python $as_me 3.10, which was @@ -2408,11 +2394,11 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by python $as_me 3.10, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ +generated by GNU Autoconf 2.71. Invocation command line was + + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -2445,8 +2431,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -2481,7 +2471,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2516,7 +2506,9 @@ # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo @@ -2519,8 +2511,8 @@ # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2531,8 +2523,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2556,7 +2548,7 @@ ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2564,5 +2556,5 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac @@ -2568,6 +2560,6 @@ esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then @@ -2570,8 +2562,8 @@ done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2579,5 +2571,5 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac @@ -2583,7 +2575,7 @@ esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then @@ -2585,9 +2577,9 @@ done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2595,8 +2587,8 @@ echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2610,7 +2602,7 @@ # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. @@ -2614,30 +2606,18 @@ # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. @@ -2640,7 +2620,5 @@ # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then @@ -2646,8 +2624,3 @@ if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then @@ -2653,15 +2626,19 @@ elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" +else + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +fi + +for ac_site_file in $ac_site_files +do + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ @@ -2666,7 +2643,7 @@ sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2676,11 +2653,11 @@ # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else @@ -2681,11 +2658,11 @@ case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -2689,6 +2666,424 @@ >$cache_file fi +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include <stddef.h> +#include <stdarg.h> +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include <stdbool.h> +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" +as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H" +as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H" + +# Auxiliary files required by this configure script. +ac_aux_files="install-sh config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false @@ -2699,7 +3094,7 @@ eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) @@ -2704,7 +3099,7 @@ ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -2713,7 +3108,7 @@ ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else @@ -2718,6 +3113,6 @@ ac_cache_corrupted=: else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi @@ -2722,11 +3117,11 @@ eval $ac_var=\$ac_old_val fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in @@ -2728,9 +3123,9 @@ fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -2740,11 +3135,12 @@ fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2765,7 +3161,7 @@ # If we're building out-of-tree, we need to make sure the following # resources get picked up before their $srcdir counterparts. # Objects/ -> typeslots.inc - # Include/ -> Python-ast.h + # Include/ -> Python.h # Python/ -> importlib.h # (A side effect of this is that these resources will automatically be # regenerated when building out-of-tree, regardless of whether or not @@ -2784,11 +3180,12 @@ then # Extract the first word of "git", so it can be a program name with args. set dummy git; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_HAS_GIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_HAS_GIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$HAS_GIT"; then ac_cv_prog_HAS_GIT="$HAS_GIT" # Let the user override the test. else @@ -2796,5 +3193,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -2800,3 +3201,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_HAS_GIT="found" @@ -2802,5 +3203,5 @@ ac_cv_prog_HAS_GIT="found" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2812,11 +3213,11 @@ fi HAS_GIT=$ac_cv_prog_HAS_GIT if test -n "$HAS_GIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_GIT" >&5 -$as_echo "$HAS_GIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HAS_GIT" >&5 +printf "%s\n" "$HAS_GIT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2838,43 +3239,18 @@ ac_config_headers="$ac_config_headers pyconfig.h" -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && @@ -2879,5 +3255,5 @@ ac_build_alias=$build_alias test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 @@ -2882,11 +3258,11 @@ test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -2905,11 +3281,12 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else @@ -2913,13 +3290,13 @@ if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -2948,11 +3325,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PYTHON_FOR_REGEN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PYTHON_FOR_REGEN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$PYTHON_FOR_REGEN"; then ac_cv_prog_PYTHON_FOR_REGEN="$PYTHON_FOR_REGEN" # Let the user override the test. else @@ -2960,5 +3338,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -2964,3 +3346,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_PYTHON_FOR_REGEN="$ac_prog" @@ -2966,5 +3348,5 @@ ac_cv_prog_PYTHON_FOR_REGEN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2975,11 +3357,11 @@ fi PYTHON_FOR_REGEN=$ac_cv_prog_PYTHON_FOR_REGEN if test -n "$PYTHON_FOR_REGEN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_FOR_REGEN" >&5 -$as_echo "$PYTHON_FOR_REGEN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PYTHON_FOR_REGEN" >&5 +printf "%s\n" "$PYTHON_FOR_REGEN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2990,8 +3372,8 @@ if test "$cross_compiling" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5 -$as_echo_n "checking for python interpreter for cross build... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5 +printf %s "checking for python interpreter for cross build... " >&6; } if test -z "$PYTHON_FOR_BUILD"; then for interp in python$PACKAGE_VERSION python3 python; do which $interp >/dev/null 2>&1 || continue @@ -3003,8 +3385,8 @@ if test x$interp = x; then as_fn_error $? "python$PACKAGE_VERSION interpreter not found" "$LINENO" 5 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $interp" >&5 -$as_echo "$interp" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $interp" >&5 +printf "%s\n" "$interp" >&6; } PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH) '$interp fi elif test "$cross_compiling" = maybe; then @@ -3038,10 +3420,10 @@ # The later defininition of _XOPEN_SOURCE disables certain features # on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone). -$as_echo "#define _GNU_SOURCE 1" >>confdefs.h +printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables # certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable # them. @@ -3042,13 +3424,13 @@ # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables # certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable # them. -$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h +printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables # certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable # them. @@ -3049,13 +3431,13 @@ # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables # certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable # them. -$as_echo "#define __BSD_VISIBLE 1" >>confdefs.h +printf "%s\n" "#define __BSD_VISIBLE 1" >>confdefs.h # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables # certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable # them. @@ -3056,10 +3438,10 @@ # The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables # certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable # them. -$as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h +printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h @@ -3069,6 +3451,6 @@ CONFIG_ARGS="$ac_configure_args" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-universalsdk" >&5 -$as_echo_n "checking for --enable-universalsdk... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --enable-universalsdk" >&5 +printf %s "checking for --enable-universalsdk... " >&6; } # Check whether --enable-universalsdk was given. @@ -3074,5 +3456,6 @@ # Check whether --enable-universalsdk was given. -if test "${enable_universalsdk+set}" = set; then : +if test ${enable_universalsdk+y} +then : enableval=$enable_universalsdk; case $enableval in yes) @@ -3104,7 +3487,7 @@ esac -else +else $as_nop UNIVERSALSDK= enable_universalsdk= @@ -3113,11 +3496,11 @@ if test -n "${UNIVERSALSDK}" then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${UNIVERSALSDK}" >&5 -$as_echo "${UNIVERSALSDK}" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${UNIVERSALSDK}" >&5 +printf "%s\n" "${UNIVERSALSDK}" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3139,7 +3522,7 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-universal-archs" >&5 -$as_echo_n "checking for --with-universal-archs... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-universal-archs" >&5 +printf %s "checking for --with-universal-archs... " >&6; } # Check whether --with-universal-archs was given. @@ -3144,6 +3527,7 @@ # Check whether --with-universal-archs was given. -if test "${with_universal_archs+set}" = set; then : +if test ${with_universal_archs+y} +then : withval=$with_universal_archs; UNIVERSAL_ARCHS="$withval" @@ -3151,12 +3535,12 @@ if test -n "${UNIVERSALSDK}" then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${UNIVERSAL_ARCHS}" >&5 -$as_echo "${UNIVERSAL_ARCHS}" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${UNIVERSAL_ARCHS}" >&5 +printf "%s\n" "${UNIVERSAL_ARCHS}" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Check whether --with-framework-name was given. @@ -3159,10 +3543,11 @@ fi # Check whether --with-framework-name was given. -if test "${with_framework_name+set}" = set; then : +if test ${with_framework_name+y} +then : withval=$with_framework_name; PYTHONFRAMEWORK=${withval} PYTHONFRAMEWORKDIR=${withval}.framework PYTHONFRAMEWORKIDENTIFIER=org.python.`echo $withval | tr 'A-Z' 'a-z'` @@ -3164,9 +3549,9 @@ withval=$with_framework_name; PYTHONFRAMEWORK=${withval} PYTHONFRAMEWORKDIR=${withval}.framework PYTHONFRAMEWORKIDENTIFIER=org.python.`echo $withval | tr 'A-Z' 'a-z'` -else +else $as_nop PYTHONFRAMEWORK=Python PYTHONFRAMEWORKDIR=Python.framework @@ -3175,7 +3560,8 @@ fi # Check whether --enable-framework was given. -if test "${enable_framework+set}" = set; then : +if test ${enable_framework+y} +then : enableval=$enable_framework; case $enableval in yes) @@ -3264,7 +3650,7 @@ esac -else +else $as_nop PYTHONFRAMEWORK= PYTHONFRAMEWORKDIR=no-framework @@ -3299,9 +3685,7 @@ -cat >>confdefs.h <<_ACEOF -#define _PYTHONFRAMEWORK "${PYTHONFRAMEWORK}" -_ACEOF +printf "%s\n" "#define _PYTHONFRAMEWORK \"${PYTHONFRAMEWORK}\"" >>confdefs.h ##AC_ARG_WITH(dyld, @@ -3310,8 +3694,8 @@ ## # Set name for machine-dependent library files -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking MACHDEP" >&5 -$as_echo_n "checking MACHDEP... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking MACHDEP" >&5 +printf %s "checking MACHDEP... " >&6; } if test -z "$MACHDEP" then # avoid using uname for cross builds @@ -3361,8 +3745,8 @@ '') MACHDEP="unknown";; esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$MACHDEP\"" >&5 -$as_echo "\"$MACHDEP\"" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$MACHDEP\"" >&5 +printf "%s\n" "\"$MACHDEP\"" >&6; } if test "$cross_compiling" = yes; then @@ -3411,7 +3795,7 @@ # also defined. This can be overridden by defining _BSD_SOURCE # As this has a different meaning on Linux, only define it on OpenBSD -$as_echo "#define _BSD_SOURCE 1" >>confdefs.h +printf "%s\n" "#define _BSD_SOURCE 1" >>confdefs.h ;; OpenBSD/*) @@ -3419,7 +3803,7 @@ # also defined. This can be overridden by defining _BSD_SOURCE # As this has a different meaning on Linux, only define it on OpenBSD -$as_echo "#define _BSD_SOURCE 1" >>confdefs.h +printf "%s\n" "#define _BSD_SOURCE 1" >>confdefs.h ;; # Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of @@ -3477,7 +3861,7 @@ then # X/Open 7, incorporating POSIX.1-2008 -$as_echo "#define _XOPEN_SOURCE 700" >>confdefs.h +printf "%s\n" "#define _XOPEN_SOURCE 700" >>confdefs.h # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires @@ -3485,11 +3869,11 @@ # several APIs are not declared. Since this is also needed in some # cases for HP-UX, we define it globally. -$as_echo "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h - - - -$as_echo "#define _POSIX_C_SOURCE 200809L" >>confdefs.h +printf "%s\n" "#define _XOPEN_SOURCE_EXTENDED 1" >>confdefs.h + + + +printf "%s\n" "#define _POSIX_C_SOURCE 200809L" >>confdefs.h fi @@ -3504,7 +3888,7 @@ if test $define_stdc_a1 = yes then -$as_echo "#define _INCLUDE__STDC_A1_SOURCE 1" >>confdefs.h +printf "%s\n" "#define _INCLUDE__STDC_A1_SOURCE 1" >>confdefs.h fi @@ -3568,8 +3952,8 @@ then if test -n "`"$found_gcc" --version | grep llvm-gcc`" then - { $as_echo "$as_me:${as_lineno-$LINENO}: Detected llvm-gcc, falling back to clang" >&5 -$as_echo "$as_me: Detected llvm-gcc, falling back to clang" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Detected llvm-gcc, falling back to clang" >&5 +printf "%s\n" "$as_me: Detected llvm-gcc, falling back to clang" >&6;} CC="$found_clang" CXX="$found_clang++" fi @@ -3577,8 +3961,8 @@ elif test -z "$found_gcc" -a -n "$found_clang" then - { $as_echo "$as_me:${as_lineno-$LINENO}: No GCC found, use CLANG" >&5 -$as_echo "$as_me: No GCC found, use CLANG" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No GCC found, use CLANG" >&5 +printf "%s\n" "$as_me: No GCC found, use CLANG" >&6;} CC="$found_clang" CXX="$found_clang++" @@ -3587,8 +3971,8 @@ found_clang=`/usr/bin/xcrun -find clang 2>/dev/null` if test -n "${found_clang}" then - { $as_echo "$as_me:${as_lineno-$LINENO}: Using clang from Xcode.app" >&5 -$as_echo "$as_me: Using clang from Xcode.app" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Using clang from Xcode.app" >&5 +printf "%s\n" "$as_me: Using clang from Xcode.app" >&6;} CC="${found_clang}" CXX="`/usr/bin/xcrun -find clang++`" @@ -3597,6 +3981,15 @@ fi fi fi + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3605,11 +3998,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3617,5 +4011,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -3621,3 +4019,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" @@ -3623,5 +4021,5 @@ ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3632,11 +4030,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3645,11 +4043,12 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3657,5 +4056,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -3661,3 +4064,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" @@ -3663,5 +4066,5 @@ ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3672,11 +4075,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -3684,8 +4087,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3698,11 +4101,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3710,5 +4114,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -3714,3 +4122,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" @@ -3716,5 +4124,5 @@ ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3725,11 +4133,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3738,11 +4146,12 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3751,5 +4160,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -3755,7 +4168,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" @@ -3758,8 +4171,8 @@ ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3775,10 +4188,10 @@ # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3779,14 +4192,14 @@ fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3797,11 +4210,12 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3809,5 +4223,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -3813,3 +4231,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" @@ -3815,5 +4233,5 @@ ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3824,11 +4242,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3841,11 +4259,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3853,5 +4272,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -3857,3 +4280,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" @@ -3859,5 +4282,5 @@ ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3868,11 +4291,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3884,8 +4307,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3893,11 +4316,115 @@ fi fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. @@ -3900,7 +4427,7 @@ as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 @@ -3905,9 +4432,9 @@ set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" @@ -3908,10 +4435,10 @@ { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -3921,7 +4448,7 @@ cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -3929,7 +4456,7 @@ /* end confdefs.h. */ int -main () +main (void) { ; @@ -3941,9 +4468,9 @@ # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -3964,6 +4491,6 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? @@ -3968,7 +4495,8 @@ (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -3985,7 +4513,7 @@ # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -4001,6 +4529,6 @@ done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi @@ -4005,8 +4533,9 @@ ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -4011,6 +4540,6 @@ sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } @@ -4015,14 +4544,14 @@ as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save @@ -4025,12 +4554,12 @@ ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" @@ -4031,9 +4560,9 @@ if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? @@ -4038,7 +4567,8 @@ (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -4052,10 +4582,10 @@ * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext @@ -4058,9 +4588,9 @@ as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -4069,7 +4599,7 @@ /* end confdefs.h. */ #include <stdio.h> int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -4081,8 +4611,8 @@ ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -4090,6 +4620,6 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? @@ -4094,6 +4624,6 @@ (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -4101,6 +4631,6 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? @@ -4105,9 +4635,9 @@ (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else @@ -4108,14 +4638,14 @@ test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi @@ -4117,10 +4647,10 @@ If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save @@ -4124,16 +4654,17 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) { ; @@ -4147,6 +4678,6 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? @@ -4151,7 +4682,8 @@ (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -4160,7 +4692,7 @@ break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -4165,9 +4697,9 @@ sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -4169,9 +4701,9 @@ as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT @@ -4176,15 +4708,16 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) { #ifndef __GNUC__ choke me @@ -4194,5 +4727,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes @@ -4198,4 +4732,4 @@ ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi @@ -4200,6 +4734,6 @@ ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi @@ -4203,10 +4737,12 @@ ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi @@ -4208,7 +4744,7 @@ if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS @@ -4214,9 +4750,10 @@ ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -4225,12 +4762,13 @@ /* end confdefs.h. */ int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes @@ -4236,7 +4774,7 @@ ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4238,21 +4776,22 @@ CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4253,16 +4792,17 @@ ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi @@ -4267,9 +4807,9 @@ ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi @@ -4274,8 +4814,8 @@ ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -4290,12 +4830,108 @@ CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4298,58 +4934,9 @@ ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" @@ -4354,5 +4941,6 @@ do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi @@ -4357,7 +4945,7 @@ ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC @@ -4360,24 +4948,26 @@ test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -4391,10 +4981,10 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then @@ -4396,16 +4986,17 @@ # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. @@ -4406,12 +4997,10 @@ do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4414,11 +5003,7 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif +#include <limits.h> Syntax error _ACEOF @@ -4423,8 +5008,9 @@ Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop # Broken: fails on valid input. continue fi @@ -4436,6 +5022,7 @@ /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue @@ -4440,6 +5027,6 @@ # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -4449,7 +5036,8 @@ done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : break fi @@ -4461,10 +5049,10 @@ else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. @@ -4466,11 +5054,9 @@ ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4473,11 +5059,7 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif +#include <limits.h> Syntax error _ACEOF @@ -4482,8 +5064,9 @@ Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else +if ac_fn_c_try_cpp "$LINENO" +then : + +else $as_nop # Broken: fails on valid input. continue fi @@ -4495,6 +5078,7 @@ /* end confdefs.h. */ #include <ac_nonexistent.h> _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue @@ -4499,6 +5083,6 @@ # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -4508,11 +5092,12 @@ done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +if $ac_preproc_ok +then : + +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -4523,11 +5108,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST @@ -4535,6 +5121,11 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do for ac_exec_ext in '' $ac_executable_extensions; do @@ -4540,5 +5131,5 @@ for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP @@ -4547,9 +5138,9 @@ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" @@ -4551,9 +5142,9 @@ while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4581,8 +5172,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" @@ -4586,11 +5177,12 @@ GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" @@ -4604,6 +5196,11 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do for ac_exec_ext in '' $ac_executable_extensions; do @@ -4609,5 +5206,5 @@ for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED @@ -4616,9 +5213,9 @@ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" @@ -4620,9 +5217,9 @@ while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" + printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4650,11 +5247,11 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed @@ -4655,10 +5252,10 @@ SED="$ac_cv_path_SED" rm -f conftest.sed -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-cxx-main=<compiler>" >&5 -$as_echo_n "checking for --with-cxx-main=<compiler>... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-cxx-main=<compiler>" >&5 +printf %s "checking for --with-cxx-main=<compiler>... " >&6; } # Check whether --with-cxx_main was given. @@ -4663,6 +5260,7 @@ # Check whether --with-cxx_main was given. -if test "${with_cxx_main+set}" = set; then : +if test ${with_cxx_main+y} +then : withval=$with_cxx_main; case $withval in @@ -4677,10 +5275,10 @@ CXX=$withval fi;; esac -else +else $as_nop with_cxx_main=no MAINCC='$(CC)' fi @@ -4681,11 +5279,11 @@ with_cxx_main=no MAINCC='$(CC)' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_cxx_main" >&5 -$as_echo "$with_cxx_main" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_cxx_main" >&5 +printf "%s\n" "$with_cxx_main" >&6; } preset_cxx="$CXX" if test -z "$CXX" @@ -4694,11 +5292,12 @@ gcc) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}g++", so it can be a program name with args. set dummy ${ac_tool_prefix}g++; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CXX in [\\/]* | ?:[\\/]*) ac_cv_path_CXX="$CXX" # Let the user override the test with a path. @@ -4708,5 +5307,9 @@ for as_dir in notfound do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -4712,7 +5315,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CXX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4724,11 +5327,11 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4737,11 +5340,12 @@ ac_pt_CXX=$CXX # Extract the first word of "g++", so it can be a program name with args. set dummy g++; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_CXX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CXX="$ac_pt_CXX" # Let the user override the test with a path. @@ -4751,5 +5355,9 @@ for as_dir in notfound do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -4755,7 +5363,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_CXX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4767,11 +5375,11 @@ fi ac_pt_CXX=$ac_cv_path_ac_pt_CXX if test -n "$ac_pt_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 -$as_echo "$ac_pt_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 +printf "%s\n" "$ac_pt_CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_CXX" = x; then @@ -4779,8 +5387,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_pt_CXX @@ -4792,11 +5400,12 @@ cc) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}c++", so it can be a program name with args. set dummy ${ac_tool_prefix}c++; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CXX in [\\/]* | ?:[\\/]*) ac_cv_path_CXX="$CXX" # Let the user override the test with a path. @@ -4806,5 +5415,9 @@ for as_dir in notfound do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -4810,7 +5423,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CXX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4822,11 +5435,11 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4835,11 +5448,12 @@ ac_pt_CXX=$CXX # Extract the first word of "c++", so it can be a program name with args. set dummy c++; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_CXX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CXX="$ac_pt_CXX" # Let the user override the test with a path. @@ -4849,5 +5463,9 @@ for as_dir in notfound do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -4853,7 +5471,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_CXX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4865,11 +5483,11 @@ fi ac_pt_CXX=$ac_cv_path_ac_pt_CXX if test -n "$ac_pt_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 -$as_echo "$ac_pt_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 +printf "%s\n" "$ac_pt_CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_CXX" = x; then @@ -4877,8 +5495,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_pt_CXX @@ -4890,11 +5508,12 @@ clang|*/clang) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang++", so it can be a program name with args. set dummy ${ac_tool_prefix}clang++; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CXX in [\\/]* | ?:[\\/]*) ac_cv_path_CXX="$CXX" # Let the user override the test with a path. @@ -4904,5 +5523,9 @@ for as_dir in notfound do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -4908,7 +5531,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CXX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4920,11 +5543,11 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4933,11 +5556,12 @@ ac_pt_CXX=$CXX # Extract the first word of "clang++", so it can be a program name with args. set dummy clang++; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_CXX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CXX="$ac_pt_CXX" # Let the user override the test with a path. @@ -4947,5 +5571,9 @@ for as_dir in notfound do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -4951,7 +5579,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_CXX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4963,11 +5591,11 @@ fi ac_pt_CXX=$ac_cv_path_ac_pt_CXX if test -n "$ac_pt_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 -$as_echo "$ac_pt_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 +printf "%s\n" "$ac_pt_CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_CXX" = x; then @@ -4975,8 +5603,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_pt_CXX @@ -4988,11 +5616,12 @@ icc|*/icc) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}icpc", so it can be a program name with args. set dummy ${ac_tool_prefix}icpc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $CXX in [\\/]* | ?:[\\/]*) ac_cv_path_CXX="$CXX" # Let the user override the test with a path. @@ -5002,5 +5631,9 @@ for as_dir in notfound do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -5006,7 +5639,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_CXX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5018,11 +5651,11 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5031,11 +5664,12 @@ ac_pt_CXX=$CXX # Extract the first word of "icpc", so it can be a program name with args. set dummy icpc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_CXX in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_CXX="$ac_pt_CXX" # Let the user override the test with a path. @@ -5045,5 +5679,9 @@ for as_dir in notfound do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -5049,7 +5687,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_CXX="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5061,11 +5699,11 @@ fi ac_pt_CXX=$ac_cv_path_ac_pt_CXX if test -n "$ac_pt_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 -$as_echo "$ac_pt_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_CXX" >&5 +printf "%s\n" "$ac_pt_CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_CXX" = x; then @@ -5073,8 +5711,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_pt_CXX @@ -5096,11 +5734,12 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -5108,5 +5747,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -5112,3 +5755,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" @@ -5114,5 +5757,5 @@ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5123,11 +5766,11 @@ fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5140,11 +5783,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else @@ -5152,5 +5796,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -5156,3 +5804,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" @@ -5158,5 +5806,5 @@ ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5167,11 +5815,11 @@ fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5183,8 +5831,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -5198,8 +5846,8 @@ fi if test "$preset_cxx" != "$CXX" then - { $as_echo "$as_me:${as_lineno-$LINENO}: + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. " >&5 @@ -5202,8 +5850,8 @@ By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. " >&5 -$as_echo "$as_me: +printf "%s\n" "$as_me: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. @@ -5214,8 +5862,8 @@ MULTIARCH=$($CC --print-multiarch 2>/dev/null) -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5 -$as_echo_n "checking for the platform triplet based on compiler characteristics... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the platform triplet based on compiler characteristics" >&5 +printf %s "checking for the platform triplet based on compiler characteristics... " >&6; } cat >> conftest.c <<EOF #undef bfin #undef cris @@ -5364,11 +6012,11 @@ if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then PLATFORM_TRIPLET=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PLATFORM_TRIPLET" >&5 -$as_echo "$PLATFORM_TRIPLET" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PLATFORM_TRIPLET" >&5 +printf "%s\n" "$PLATFORM_TRIPLET" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } fi rm -f conftest.c conftest.out @@ -5385,8 +6033,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wl,--no-as-needed" >&5 -$as_echo_n "checking for -Wl,--no-as-needed... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wl,--no-as-needed" >&5 +printf %s "checking for -Wl,--no-as-needed... " >&6; } save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--no-as-needed" @@ -5394,12 +6042,13 @@ /* end confdefs.h. */ int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : NO_AS_NEEDED="-Wl,--no-as-needed" @@ -5405,5 +6054,5 @@ NO_AS_NEEDED="-Wl,--no-as-needed" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop NO_AS_NEEDED="" @@ -5409,11 +6058,11 @@ NO_AS_NEEDED="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext \ + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" # checks for UNIX variants that set C preprocessor variables @@ -5414,236 +6063,53 @@ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" # checks for UNIX variants that set C preprocessor variables - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ctype.h> -#include <stdlib.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" -if test "x$ac_cv_header_minix_config_h" = xyes; then : - MINIX=yes -else - MINIX= -fi - - - if test "$MINIX" = yes; then - -$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h - - -$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h - - -$as_echo "#define _MINIX 1" >>confdefs.h - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 -$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if ${ac_cv_safe_to_define___extensions__+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test ${ac_cv_safe_to_define___extensions__+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int @@ -5644,15 +6110,16 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_safe_to_define___extensions__=yes @@ -5658,4 +6125,4 @@ ac_cv_safe_to_define___extensions__=yes -else +else $as_nop ac_cv_safe_to_define___extensions__=no fi @@ -5660,24 +6127,118 @@ ac_cv_safe_to_define___extensions__=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 -$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h - - $as_echo "#define _ALL_SOURCE 1" >>confdefs.h - - $as_echo "#define _GNU_SOURCE 1" >>confdefs.h - - $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h - - $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Android API level" >&5 -$as_echo_n "checking for the Android API level... " >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if test ${ac_cv_should_define__xopen_source+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_should_define__xopen_source=no + if test $ac_cv_header_wchar_h = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <wchar.h> + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _XOPEN_SOURCE 500 + #include <wchar.h> + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_should_define__xopen_source=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } + + printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h + + printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + + printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h + + if test $ac_cv_header_minix_config_h = yes +then : + MINIX=yes + printf "%s\n" "#define _MINIX 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h + +else $as_nop + MINIX= +fi + if test $ac_cv_safe_to_define___extensions__ = yes +then : + printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h + +fi + if test $ac_cv_should_define__xopen_source = yes +then : + printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the Android API level" >&5 +printf %s "checking for the Android API level... " >&6; } cat >> conftest.c <<EOF #ifdef __ANDROID__ android_api = __ANDROID_API__ @@ -5690,10 +6251,10 @@ if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then ANDROID_API_LEVEL=`sed -n -e '/__ANDROID_API__/d' -e 's/^android_api = //p' conftest.out` _arm_arch=`sed -n -e '/__ARM_ARCH/d' -e 's/^arm_arch = //p' conftest.out` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ANDROID_API_LEVEL" >&5 -$as_echo "$ANDROID_API_LEVEL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ANDROID_API_LEVEL" >&5 +printf "%s\n" "$ANDROID_API_LEVEL" >&6; } if test -z "$ANDROID_API_LEVEL"; then echo 'Fatal: you must define __ANDROID_API__' exit 1 fi @@ -5695,19 +6256,17 @@ if test -z "$ANDROID_API_LEVEL"; then echo 'Fatal: you must define __ANDROID_API__' exit 1 fi -cat >>confdefs.h <<_ACEOF -#define ANDROID_API_LEVEL $ANDROID_API_LEVEL -_ACEOF - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Android arm ABI" >&5 -$as_echo_n "checking for the Android arm ABI... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_arm_arch" >&5 -$as_echo "$_arm_arch" >&6; } +printf "%s\n" "#define ANDROID_API_LEVEL $ANDROID_API_LEVEL" >>confdefs.h + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the Android arm ABI" >&5 +printf %s "checking for the Android arm ABI... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $_arm_arch" >&5 +printf "%s\n" "$_arm_arch" >&6; } if test "$_arm_arch" = 7; then BASECFLAGS="${BASECFLAGS} -mfloat-abi=softfp -mfpu=vfpv3-d16" LDFLAGS="${LDFLAGS} -march=armv7-a -Wl,--fix-cortex-a8" fi else @@ -5709,10 +6268,10 @@ if test "$_arm_arch" = 7; then BASECFLAGS="${BASECFLAGS} -mfloat-abi=softfp -mfpu=vfpv3-d16" LDFLAGS="${LDFLAGS} -march=armv7-a -Wl,--fix-cortex-a8" fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not Android" >&5 -$as_echo "not Android" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not Android" >&5 +printf "%s\n" "not Android" >&6; } fi rm -f conftest.c conftest.out @@ -5725,7 +6284,7 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-suffix" >&5 -$as_echo_n "checking for --with-suffix... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-suffix" >&5 +printf %s "checking for --with-suffix... " >&6; } # Check whether --with-suffix was given. @@ -5730,6 +6289,7 @@ # Check whether --with-suffix was given. -if test "${with_suffix+set}" = set; then : +if test ${with_suffix+y} +then : withval=$with_suffix; case $withval in no) EXEEXT=;; @@ -5738,9 +6298,9 @@ esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXEEXT" >&5 -$as_echo "$EXEEXT" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $EXEEXT" >&5 +printf "%s\n" "$EXEEXT" >&6; } # Test whether we're running on a non-case-sensitive system, in which # case we give a warning if no ext is given @@ -5743,12 +6303,12 @@ # Test whether we're running on a non-case-sensitive system, in which # case we give a warning if no ext is given -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for case-insensitive build directory" >&5 -$as_echo_n "checking for case-insensitive build directory... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for case-insensitive build directory" >&5 +printf %s "checking for case-insensitive build directory... " >&6; } if test ! -d CaseSensitiveTestDir; then mkdir CaseSensitiveTestDir fi if test -d casesensitivetestdir then @@ -5749,10 +6309,10 @@ if test ! -d CaseSensitiveTestDir; then mkdir CaseSensitiveTestDir fi if test -d casesensitivetestdir then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } BUILDEXEEXT=.exe else @@ -5757,7 +6317,7 @@ BUILDEXEEXT=.exe else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } BUILDEXEEXT=$EXEEXT fi rmdir CaseSensitiveTestDir @@ -5770,9 +6330,9 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBRARY" >&5 -$as_echo_n "checking LIBRARY... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking LIBRARY" >&5 +printf %s "checking LIBRARY... " >&6; } if test -z "$LIBRARY" then LIBRARY='libpython$(VERSION)$(ABIFLAGS).a' fi @@ -5775,9 +6335,9 @@ if test -z "$LIBRARY" then LIBRARY='libpython$(VERSION)$(ABIFLAGS).a' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5 -$as_echo "$LIBRARY" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBRARY" >&5 +printf "%s\n" "$LIBRARY" >&6; } # LDLIBRARY is the name of the library to link against (as opposed to the # name of the library into which to insert object files). BLDLIBRARY is also @@ -5816,8 +6376,8 @@ # compiled with CXX, LINKCC is CXX instead. Always using CXX is undesirable: # python might then depend on the C++ runtime -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LINKCC" >&5 -$as_echo_n "checking LINKCC... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking LINKCC" >&5 +printf %s "checking LINKCC... " >&6; } if test -z "$LINKCC" then LINKCC='$(PURIFY) $(MAINCC)' @@ -5828,8 +6388,8 @@ LINKCC=qcc;; esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINKCC" >&5 -$as_echo "$LINKCC" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LINKCC" >&5 +printf "%s\n" "$LINKCC" >&6; } # EXPORTSYMS holds the list of exported symbols for AIX. # EXPORTSFROM holds the module name exporting symbols on AIX. @@ -5837,11 +6397,11 @@ EXPORTSFROM= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking EXPORTSYMS" >&5 -$as_echo_n "checking EXPORTSYMS... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking EXPORTSYMS" >&5 +printf %s "checking EXPORTSYMS... " >&6; } case $ac_sys_system in AIX*) EXPORTSYMS="Modules/python.exp" EXPORTSFROM=. # the main executable ;; esac @@ -5842,11 +6402,11 @@ case $ac_sys_system in AIX*) EXPORTSYMS="Modules/python.exp" EXPORTSFROM=. # the main executable ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXPORTSYMS" >&5 -$as_echo "$EXPORTSYMS" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $EXPORTSYMS" >&5 +printf "%s\n" "$EXPORTSYMS" >&6; } # GNULD is set to "yes" if the GNU linker is used. If this goes wrong # make sure we default having it set to "no": this is used by @@ -5854,8 +6414,8 @@ # to linker command lines, and failing to detect GNU ld simply results # in the same bahaviour as before. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } ac_prog=ld if test "$GCC" = yes; then ac_prog=`$CC -print-prog-name=ld` @@ -5866,9 +6426,9 @@ *) GNULD=no;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNULD" >&5 -$as_echo "$GNULD" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-shared" >&5 -$as_echo_n "checking for --enable-shared... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GNULD" >&5 +printf "%s\n" "$GNULD" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --enable-shared" >&5 +printf %s "checking for --enable-shared... " >&6; } # Check whether --enable-shared was given. @@ -5874,5 +6434,6 @@ # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : +if test ${enable_shared+y} +then : enableval=$enable_shared; fi @@ -5886,9 +6447,9 @@ enable_shared="no";; esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-profiling" >&5 -$as_echo_n "checking for --enable-profiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf "%s\n" "$enable_shared" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --enable-profiling" >&5 +printf %s "checking for --enable-profiling... " >&6; } # Check whether --enable-profiling was given. @@ -5894,5 +6455,6 @@ # Check whether --enable-profiling was given. -if test "${enable_profiling+set}" = set; then : +if test ${enable_profiling+y} +then : enableval=$enable_profiling; fi @@ -5903,8 +6465,9 @@ /* end confdefs.h. */ int main() { return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -else +if ac_fn_c_try_link "$LINENO" +then : + +else $as_nop enable_profiling=no fi @@ -5909,8 +6472,8 @@ enable_profiling=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CC="$ac_save_cc" else enable_profiling=no fi @@ -5912,13 +6475,13 @@ conftest$ac_exeext conftest.$ac_ext CC="$ac_save_cc" else enable_profiling=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_profiling" >&5 -$as_echo "$enable_profiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_profiling" >&5 +printf "%s\n" "$enable_profiling" >&6; } if test "x$enable_profiling" = xyes; then BASECFLAGS="-pg $BASECFLAGS" LDFLAGS="-pg $LDFLAGS" fi @@ -5919,11 +6482,11 @@ if test "x$enable_profiling" = xyes; then BASECFLAGS="-pg $BASECFLAGS" LDFLAGS="-pg $LDFLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LDLIBRARY" >&5 -$as_echo_n "checking LDLIBRARY... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking LDLIBRARY" >&5 +printf %s "checking LDLIBRARY... " >&6; } # MacOSX framework builds need more magic. LDLIBRARY is the dynamic # library that we build, but we do not want to link against it (we @@ -5944,7 +6507,7 @@ if test $enable_shared = "yes"; then PY_ENABLE_SHARED=1 -$as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h +printf "%s\n" "#define Py_ENABLE_SHARED 1" >>confdefs.h case $ac_sys_system in CYGWIN*) @@ -6008,8 +6571,8 @@ RUNSHARED= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDLIBRARY" >&5 -$as_echo "$LDLIBRARY" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LDLIBRARY" >&5 +printf "%s\n" "$LDLIBRARY" >&6; } if test -n "$ac_tool_prefix"; then @@ -6017,11 +6580,12 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -6029,5 +6593,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -6033,3 +6601,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" @@ -6035,5 +6603,5 @@ ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6044,11 +6612,11 @@ fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6061,11 +6629,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -6073,5 +6642,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -6077,3 +6650,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" @@ -6079,5 +6652,5 @@ ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6088,11 +6661,11 @@ fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6104,8 +6677,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -6125,11 +6698,12 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_READELF+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_READELF+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$READELF"; then ac_cv_prog_READELF="$READELF" # Let the user override the test. else @@ -6137,5 +6711,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -6141,3 +6719,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_READELF="$ac_tool_prefix$ac_prog" @@ -6143,5 +6721,5 @@ ac_cv_prog_READELF="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6152,11 +6730,11 @@ fi READELF=$ac_cv_prog_READELF if test -n "$READELF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 -$as_echo "$READELF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 +printf "%s\n" "$READELF" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6169,11 +6747,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_READELF+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_READELF+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_READELF"; then ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test. else @@ -6181,5 +6760,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -6185,3 +6768,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_READELF="$ac_prog" @@ -6187,5 +6770,5 @@ ac_cv_prog_ac_ct_READELF="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6196,11 +6779,11 @@ fi ac_ct_READELF=$ac_cv_prog_ac_ct_READELF if test -n "$ac_ct_READELF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5 -$as_echo "$ac_ct_READELF" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5 +printf "%s\n" "$ac_ct_READELF" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6212,8 +6795,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac READELF=$ac_ct_READELF @@ -6238,7 +6821,8 @@ INSTALL="${srcdir}/install-sh -c" fi esac -# Find a good install program. We prefer a C program (faster), + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -6252,6 +6836,6 @@ # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then @@ -6257,8 +6841,9 @@ if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -6261,11 +6846,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -6275,5 +6864,5 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && @@ -6279,5 +6868,5 @@ if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && @@ -6281,7 +6870,7 @@ # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -6289,8 +6878,8 @@ echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then @@ -6293,8 +6882,8 @@ test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -6310,7 +6899,7 @@ rm -rf conftest.one conftest.two conftest.dir fi - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -6320,8 +6909,8 @@ INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -6331,6 +6920,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then @@ -6336,8 +6926,9 @@ if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS @@ -6340,7 +6931,11 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do @@ -6345,7 +6940,7 @@ for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) @@ -6351,5 +6946,5 @@ 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done @@ -6360,7 +6955,7 @@ fi test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then + if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a @@ -6370,8 +6965,8 @@ MKDIR_P="$ac_install_sh -d" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } # Not every filesystem supports hard links @@ -6388,7 +6983,7 @@ ABIFLAGS="" # Check for --with-pydebug -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pydebug" >&5 -$as_echo_n "checking for --with-pydebug... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-pydebug" >&5 +printf %s "checking for --with-pydebug... " >&6; } # Check whether --with-pydebug was given. @@ -6393,7 +6988,8 @@ # Check whether --with-pydebug was given. -if test "${with_pydebug+set}" = set; then : +if test ${with_pydebug+y} +then : withval=$with_pydebug; if test "$withval" != no then @@ -6396,10 +6992,10 @@ withval=$with_pydebug; if test "$withval" != no then -$as_echo "#define Py_DEBUG 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; +printf "%s\n" "#define Py_DEBUG 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; }; Py_DEBUG='true' ABIFLAGS="${ABIFLAGS}d" @@ -6404,13 +7000,13 @@ Py_DEBUG='true' ABIFLAGS="${ABIFLAGS}d" -else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; }; Py_DEBUG='false' -fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; Py_DEBUG='false' +fi +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Check for --with-trace-refs # --with-trace-refs @@ -6412,9 +7008,9 @@ fi # Check for --with-trace-refs # --with-trace-refs -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-trace-refs" >&5 -$as_echo_n "checking for --with-trace-refs... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-trace-refs" >&5 +printf %s "checking for --with-trace-refs... " >&6; } # Check whether --with-trace-refs was given. @@ -6419,4 +7015,5 @@ # Check whether --with-trace-refs was given. -if test "${with_trace_refs+set}" = set; then : +if test ${with_trace_refs+y} +then : withval=$with_trace_refs; @@ -6422,5 +7019,5 @@ withval=$with_trace_refs; -else +else $as_nop with_trace_refs=no fi @@ -6424,9 +7021,9 @@ with_trace_refs=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_trace_refs" >&5 -$as_echo "$with_trace_refs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_trace_refs" >&5 +printf "%s\n" "$with_trace_refs" >&6; } if test "$with_trace_refs" = "yes" then @@ -6429,11 +7026,11 @@ if test "$with_trace_refs" = "yes" then -$as_echo "#define Py_TRACE_REFS 1" >>confdefs.h +printf "%s\n" "#define Py_TRACE_REFS 1" >>confdefs.h fi # Check for --with-assertions. # This allows enabling assertions without Py_DEBUG. assertions='false' @@ -6434,10 +7031,10 @@ fi # Check for --with-assertions. # This allows enabling assertions without Py_DEBUG. assertions='false' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-assertions" >&5 -$as_echo_n "checking for --with-assertions... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-assertions" >&5 +printf %s "checking for --with-assertions... " >&6; } # Check whether --with-assertions was given. @@ -6442,6 +7039,7 @@ # Check whether --with-assertions was given. -if test "${with_assertions+set}" = set; then : +if test ${with_assertions+y} +then : withval=$with_assertions; if test "$withval" != no then @@ -6450,7 +7048,7 @@ fi if test "$assertions" = 'true'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } elif test "$Py_DEBUG" = 'true'; then assertions='true' @@ -6455,13 +7053,13 @@ elif test "$Py_DEBUG" = 'true'; then assertions='true' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: implied by --with-pydebug" >&5 -$as_echo "implied by --with-pydebug" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: implied by --with-pydebug" >&5 +printf "%s\n" "implied by --with-pydebug" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Enable optimization flags Py_OPT='false' @@ -6462,9 +7060,9 @@ fi # Enable optimization flags Py_OPT='false' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-optimizations" >&5 -$as_echo_n "checking for --enable-optimizations... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --enable-optimizations" >&5 +printf %s "checking for --enable-optimizations... " >&6; } # Check whether --enable-optimizations was given. @@ -6470,6 +7068,7 @@ # Check whether --enable-optimizations was given. -if test "${enable_optimizations+set}" = set; then : +if test ${enable_optimizations+y} +then : enableval=$enable_optimizations; if test "$enableval" != no then Py_OPT='true' @@ -6472,8 +7071,8 @@ enableval=$enable_optimizations; if test "$enableval" != no then Py_OPT='true' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; }; else Py_OPT='false' @@ -6478,11 +7077,11 @@ else Py_OPT='false' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; }; -fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; +fi +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "$Py_OPT" = 'true' ; then @@ -6495,11 +7094,12 @@ DEF_MAKE_RULE="build_all" case $CC in *gcc*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fno-semantic-interposition" >&5 -$as_echo_n "checking whether C compiler accepts -fno-semantic-interposition... " >&6; } -if ${ax_cv_check_cflags___fno_semantic_interposition+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fno-semantic-interposition" >&5 +printf %s "checking whether C compiler accepts -fno-semantic-interposition... " >&6; } +if test ${ax_cv_check_cflags___fno_semantic_interposition+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fno-semantic-interposition" @@ -6507,12 +7107,13 @@ /* end confdefs.h. */ int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : ax_cv_check_cflags___fno_semantic_interposition=yes @@ -6518,4 +7119,4 @@ ax_cv_check_cflags___fno_semantic_interposition=yes -else +else $as_nop ax_cv_check_cflags___fno_semantic_interposition=no fi @@ -6520,5 +7121,5 @@ ax_cv_check_cflags___fno_semantic_interposition=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi @@ -6523,9 +7124,10 @@ CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_semantic_interposition" >&5 -$as_echo "$ax_cv_check_cflags___fno_semantic_interposition" >&6; } -if test "x$ax_cv_check_cflags___fno_semantic_interposition" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_semantic_interposition" >&5 +printf "%s\n" "$ax_cv_check_cflags___fno_semantic_interposition" >&6; } +if test "x$ax_cv_check_cflags___fno_semantic_interposition" = xyes +then : CFLAGS_NODIST="$CFLAGS_NODIST -fno-semantic-interposition" LDFLAGS_NODIST="$LDFLAGS_NODIST -fno-semantic-interposition" @@ -6528,8 +7130,8 @@ CFLAGS_NODIST="$CFLAGS_NODIST -fno-semantic-interposition" LDFLAGS_NODIST="$LDFLAGS_NODIST -fno-semantic-interposition" -else +else $as_nop : fi @@ -6544,9 +7146,9 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking PROFILE_TASK" >&5 -$as_echo_n "checking PROFILE_TASK... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking PROFILE_TASK" >&5 +printf %s "checking PROFILE_TASK... " >&6; } if test -z "$PROFILE_TASK" then PROFILE_TASK='-m test --pgo --timeout=$(TESTTIMEOUT)' fi @@ -6549,9 +7151,9 @@ if test -z "$PROFILE_TASK" then PROFILE_TASK='-m test --pgo --timeout=$(TESTTIMEOUT)' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROFILE_TASK" >&5 -$as_echo "$PROFILE_TASK" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PROFILE_TASK" >&5 +printf "%s\n" "$PROFILE_TASK" >&6; } # Make llvm-relatec checks work on systems where llvm tools are not installed with their # normal names in the default $PATH (ie: Ubuntu). They exist under the @@ -6574,7 +7176,7 @@ fi # Enable LTO flags -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-lto" >&5 -$as_echo_n "checking for --with-lto... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-lto" >&5 +printf %s "checking for --with-lto... " >&6; } # Check whether --with-lto was given. @@ -6579,7 +7181,8 @@ # Check whether --with-lto was given. -if test "${with_lto+set}" = set; then : +if test ${with_lto+y} +then : withval=$with_lto; if test "$withval" != no then Py_LTO='true' @@ -6582,8 +7185,8 @@ withval=$with_lto; if test "$withval" != no then Py_LTO='true' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; }; else Py_LTO='false' @@ -6588,11 +7191,11 @@ else Py_LTO='false' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; }; -fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; +fi +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "$Py_LTO" = 'true' ; then @@ -6602,11 +7205,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}llvm-ar", so it can be a program name with args. set dummy ${ac_tool_prefix}llvm-ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LLVM_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_LLVM_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $LLVM_AR in [\\/]* | ?:[\\/]*) ac_cv_path_LLVM_AR="$LLVM_AR" # Let the user override the test with a path. @@ -6616,5 +7220,9 @@ for as_dir in ${llvm_path} do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -6620,7 +7228,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LLVM_AR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_LLVM_AR="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6632,11 +7240,11 @@ fi LLVM_AR=$ac_cv_path_LLVM_AR if test -n "$LLVM_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_AR" >&5 -$as_echo "$LLVM_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LLVM_AR" >&5 +printf "%s\n" "$LLVM_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6645,11 +7253,12 @@ ac_pt_LLVM_AR=$LLVM_AR # Extract the first word of "llvm-ar", so it can be a program name with args. set dummy llvm-ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_LLVM_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_LLVM_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_LLVM_AR in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_LLVM_AR="$ac_pt_LLVM_AR" # Let the user override the test with a path. @@ -6659,5 +7268,9 @@ for as_dir in ${llvm_path} do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -6663,7 +7276,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_LLVM_AR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_LLVM_AR="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6675,11 +7288,11 @@ fi ac_pt_LLVM_AR=$ac_cv_path_ac_pt_LLVM_AR if test -n "$ac_pt_LLVM_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_LLVM_AR" >&5 -$as_echo "$ac_pt_LLVM_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_LLVM_AR" >&5 +printf "%s\n" "$ac_pt_LLVM_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_LLVM_AR" = x; then @@ -6687,8 +7300,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LLVM_AR=$ac_pt_LLVM_AR @@ -6711,8 +7324,8 @@ then LLVM_AR='/usr/bin/xcrun llvm-ar' LLVM_AR_FOUND=found - { $as_echo "$as_me:${as_lineno-$LINENO}: llvm-ar found via xcrun: ${LLVM_AR}" >&5 -$as_echo "$as_me: llvm-ar found via xcrun: ${LLVM_AR}" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: llvm-ar found via xcrun: ${LLVM_AR}" >&5 +printf "%s\n" "$as_me: llvm-ar found via xcrun: ${LLVM_AR}" >&6;} fi fi if test $LLVM_AR_FOUND = not-found @@ -6766,11 +7379,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}llvm-profdata", so it can be a program name with args. set dummy ${ac_tool_prefix}llvm-profdata; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LLVM_PROFDATA+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_LLVM_PROFDATA+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $LLVM_PROFDATA in [\\/]* | ?:[\\/]*) ac_cv_path_LLVM_PROFDATA="$LLVM_PROFDATA" # Let the user override the test with a path. @@ -6780,5 +7394,9 @@ for as_dir in ${llvm_path} do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -6784,7 +7402,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LLVM_PROFDATA="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_LLVM_PROFDATA="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6796,11 +7414,11 @@ fi LLVM_PROFDATA=$ac_cv_path_LLVM_PROFDATA if test -n "$LLVM_PROFDATA"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_PROFDATA" >&5 -$as_echo "$LLVM_PROFDATA" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LLVM_PROFDATA" >&5 +printf "%s\n" "$LLVM_PROFDATA" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6809,11 +7427,12 @@ ac_pt_LLVM_PROFDATA=$LLVM_PROFDATA # Extract the first word of "llvm-profdata", so it can be a program name with args. set dummy llvm-profdata; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_LLVM_PROFDATA+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_LLVM_PROFDATA+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_LLVM_PROFDATA in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_LLVM_PROFDATA="$ac_pt_LLVM_PROFDATA" # Let the user override the test with a path. @@ -6823,5 +7442,9 @@ for as_dir in ${llvm_path} do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -6827,7 +7450,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_LLVM_PROFDATA="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_LLVM_PROFDATA="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6839,11 +7462,11 @@ fi ac_pt_LLVM_PROFDATA=$ac_cv_path_ac_pt_LLVM_PROFDATA if test -n "$ac_pt_LLVM_PROFDATA"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_LLVM_PROFDATA" >&5 -$as_echo "$ac_pt_LLVM_PROFDATA" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_LLVM_PROFDATA" >&5 +printf "%s\n" "$ac_pt_LLVM_PROFDATA" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_LLVM_PROFDATA" = x; then @@ -6851,8 +7474,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LLVM_PROFDATA=$ac_pt_LLVM_PROFDATA @@ -6877,8 +7500,8 @@ # https://apple.stackexchange.com/questions/197053/ LLVM_PROFDATA='/usr/bin/xcrun llvm-profdata' LLVM_PROF_FOUND=found - { $as_echo "$as_me:${as_lineno-$LINENO}: llvm-profdata found via xcrun: ${LLVM_PROFDATA}" >&5 -$as_echo "$as_me: llvm-profdata found via xcrun: ${LLVM_PROFDATA}" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: llvm-profdata found via xcrun: ${LLVM_PROFDATA}" >&5 +printf "%s\n" "$as_me: llvm-profdata found via xcrun: ${LLVM_PROFDATA}" >&6;} fi fi LLVM_PROF_ERR=no @@ -7022,7 +7645,7 @@ yes) CFLAGS_NODIST="$CFLAGS_NODIST -std=c99" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wextra" >&5 -$as_echo_n "checking for -Wextra... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -Wextra" >&5 +printf %s "checking for -Wextra... " >&6; } ac_save_cc="$CC" CC="$CC -Wextra -Werror" @@ -7027,22 +7650,24 @@ ac_save_cc="$CC" CC="$CC -Wextra -Werror" - if ${ac_cv_extra_warnings+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + if test ${ac_cv_extra_warnings+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_extra_warnings=yes @@ -7046,8 +7671,8 @@ ac_cv_extra_warnings=yes -else +else $as_nop ac_cv_extra_warnings=no fi @@ -7050,8 +7675,8 @@ ac_cv_extra_warnings=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi CC="$ac_save_cc" @@ -7055,8 +7680,8 @@ fi CC="$ac_save_cc" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_extra_warnings" >&5 -$as_echo "$ac_cv_extra_warnings" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_extra_warnings" >&5 +printf "%s\n" "$ac_cv_extra_warnings" >&6; } if test $ac_cv_extra_warnings = yes then @@ -7067,8 +7692,8 @@ # GCC produce warnings for legal Python code. Enable # -fno-strict-aliasing on versions of GCC that support but produce # warnings. See Issue3326 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts and needs -fno-strict-aliasing" >&5 -$as_echo_n "checking whether $CC accepts and needs -fno-strict-aliasing... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts and needs -fno-strict-aliasing" >&5 +printf %s "checking whether $CC accepts and needs -fno-strict-aliasing... " >&6; } ac_save_cc="$CC" CC="$CC -fno-strict-aliasing" save_CFLAGS="$CFLAGS" @@ -7072,23 +7697,25 @@ ac_save_cc="$CC" CC="$CC -fno-strict-aliasing" save_CFLAGS="$CFLAGS" - if ${ac_cv_no_strict_aliasing+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + if test ${ac_cv_no_strict_aliasing+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : CC="$ac_save_cc -fstrict-aliasing" CFLAGS="$CFLAGS -Werror -Wstrict-aliasing" @@ -7097,7 +7724,7 @@ void f(int **x) {} int -main () +main (void) { double *x; f((int **) &x); ; @@ -7105,7 +7732,8 @@ } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_no_strict_aliasing=no @@ -7109,8 +7737,8 @@ ac_cv_no_strict_aliasing=no -else +else $as_nop ac_cv_no_strict_aliasing=yes fi @@ -7113,11 +7741,11 @@ ac_cv_no_strict_aliasing=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -else +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +else $as_nop ac_cv_no_strict_aliasing=no fi @@ -7120,9 +7748,9 @@ ac_cv_no_strict_aliasing=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$save_CFLAGS" CC="$ac_save_cc" @@ -7125,9 +7753,9 @@ fi CFLAGS="$save_CFLAGS" CC="$ac_save_cc" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_no_strict_aliasing" >&5 -$as_echo "$ac_cv_no_strict_aliasing" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_no_strict_aliasing" >&5 +printf "%s\n" "$ac_cv_no_strict_aliasing" >&6; } if test $ac_cv_no_strict_aliasing = yes then BASECFLAGS="$BASECFLAGS -fno-strict-aliasing" @@ -7140,8 +7768,8 @@ ac_cv_disable_unused_result_warning=no ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn off $CC unused result warning" >&5 -$as_echo_n "checking if we can turn off $CC unused result warning... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can turn off $CC unused result warning" >&5 +printf %s "checking if we can turn off $CC unused result warning... " >&6; } ac_save_cc="$CC" CC="$CC -Wunused-result -Werror" save_CFLAGS="$CFLAGS" @@ -7145,23 +7773,25 @@ ac_save_cc="$CC" CC="$CC -Wunused-result -Werror" save_CFLAGS="$CFLAGS" - if ${ac_cv_disable_unused_result_warning+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + if test ${ac_cv_disable_unused_result_warning+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_disable_unused_result_warning=yes @@ -7165,8 +7795,8 @@ ac_cv_disable_unused_result_warning=yes -else +else $as_nop ac_cv_disable_unused_result_warning=no fi @@ -7169,9 +7799,9 @@ ac_cv_disable_unused_result_warning=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$save_CFLAGS" CC="$ac_save_cc" @@ -7174,9 +7804,9 @@ fi CFLAGS="$save_CFLAGS" CC="$ac_save_cc" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_unused_result_warning" >&5 -$as_echo "$ac_cv_disable_unused_result_warning" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_unused_result_warning" >&5 +printf "%s\n" "$ac_cv_disable_unused_result_warning" >&6; } ;; esac @@ -7186,7 +7816,7 @@ CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-result" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn off $CC unused parameter warning" >&5 -$as_echo_n "checking if we can turn off $CC unused parameter warning... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can turn off $CC unused parameter warning" >&5 +printf %s "checking if we can turn off $CC unused parameter warning... " >&6; } ac_save_cc="$CC" CC="$CC -Wunused-parameter -Werror" @@ -7191,22 +7821,24 @@ ac_save_cc="$CC" CC="$CC -Wunused-parameter -Werror" - if ${ac_cv_disable_unused_parameter_warning+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + if test ${ac_cv_disable_unused_parameter_warning+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_disable_unused_parameter_warning=yes @@ -7210,8 +7842,8 @@ ac_cv_disable_unused_parameter_warning=yes -else +else $as_nop ac_cv_disable_unused_parameter_warning=no fi @@ -7214,8 +7846,8 @@ ac_cv_disable_unused_parameter_warning=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi CC="$ac_save_cc" @@ -7219,11 +7851,11 @@ fi CC="$ac_save_cc" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_unused_parameter_warning" >&5 -$as_echo "$ac_cv_disable_unused_parameter_warning" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_unused_parameter_warning" >&5 +printf "%s\n" "$ac_cv_disable_unused_parameter_warning" >&6; } if test $ac_cv_disable_unused_parameter_warning = yes then CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-parameter" fi @@ -7224,10 +7856,10 @@ if test $ac_cv_disable_unused_parameter_warning = yes then CFLAGS_NODIST="$CFLAGS_NODIST -Wno-unused-parameter" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn off $CC missing field initializers warning" >&5 -$as_echo_n "checking if we can turn off $CC missing field initializers warning... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can turn off $CC missing field initializers warning" >&5 +printf %s "checking if we can turn off $CC missing field initializers warning... " >&6; } ac_save_cc="$CC" CC="$CC -Wmissing-field-initializers -Werror" @@ -7232,22 +7864,24 @@ ac_save_cc="$CC" CC="$CC -Wmissing-field-initializers -Werror" - if ${ac_cv_disable_missing_field_initializers+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + if test ${ac_cv_disable_missing_field_initializers+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_disable_missing_field_initializers=yes @@ -7251,8 +7885,8 @@ ac_cv_disable_missing_field_initializers=yes -else +else $as_nop ac_cv_disable_missing_field_initializers=no fi @@ -7255,8 +7889,8 @@ ac_cv_disable_missing_field_initializers=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi CC="$ac_save_cc" @@ -7260,11 +7894,11 @@ fi CC="$ac_save_cc" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_missing_field_initializers" >&5 -$as_echo "$ac_cv_disable_missing_field_initializers" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_disable_missing_field_initializers" >&5 +printf "%s\n" "$ac_cv_disable_missing_field_initializers" >&6; } if test $ac_cv_disable_missing_field_initializers = yes then CFLAGS_NODIST="$CFLAGS_NODIST -Wno-missing-field-initializers" fi @@ -7265,11 +7899,11 @@ if test $ac_cv_disable_missing_field_initializers = yes then CFLAGS_NODIST="$CFLAGS_NODIST -Wno-missing-field-initializers" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn on $CC mixed sign comparison warning" >&5 -$as_echo_n "checking if we can turn on $CC mixed sign comparison warning... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can turn on $CC mixed sign comparison warning" >&5 +printf %s "checking if we can turn on $CC mixed sign comparison warning... " >&6; } ac_save_cc="$CC" CC="$CC -Wsign-compare" save_CFLAGS="$CFLAGS" @@ -7273,23 +7907,25 @@ ac_save_cc="$CC" CC="$CC -Wsign-compare" save_CFLAGS="$CFLAGS" - if ${ac_cv_enable_sign_compare_warning+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + if test ${ac_cv_enable_sign_compare_warning+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_enable_sign_compare_warning=yes @@ -7293,8 +7929,8 @@ ac_cv_enable_sign_compare_warning=yes -else +else $as_nop ac_cv_enable_sign_compare_warning=no fi @@ -7297,9 +7933,9 @@ ac_cv_enable_sign_compare_warning=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$save_CFLAGS" CC="$ac_save_cc" @@ -7302,12 +7938,12 @@ fi CFLAGS="$save_CFLAGS" CC="$ac_save_cc" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_sign_compare_warning" >&5 -$as_echo "$ac_cv_enable_sign_compare_warning" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_sign_compare_warning" >&5 +printf "%s\n" "$ac_cv_enable_sign_compare_warning" >&6; } if test $ac_cv_enable_sign_compare_warning = yes then BASECFLAGS="$BASECFLAGS -Wsign-compare" fi @@ -7308,11 +7944,11 @@ if test $ac_cv_enable_sign_compare_warning = yes then BASECFLAGS="$BASECFLAGS -Wsign-compare" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn on $CC unreachable code warning" >&5 -$as_echo_n "checking if we can turn on $CC unreachable code warning... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can turn on $CC unreachable code warning" >&5 +printf %s "checking if we can turn on $CC unreachable code warning... " >&6; } ac_save_cc="$CC" CC="$CC -Wunreachable-code" save_CFLAGS="$CFLAGS" @@ -7316,23 +7952,25 @@ ac_save_cc="$CC" CC="$CC -Wunreachable-code" save_CFLAGS="$CFLAGS" - if ${ac_cv_enable_unreachable_code_warning+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + if test ${ac_cv_enable_unreachable_code_warning+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_enable_unreachable_code_warning=yes @@ -7336,8 +7974,8 @@ ac_cv_enable_unreachable_code_warning=yes -else +else $as_nop ac_cv_enable_unreachable_code_warning=no fi @@ -7340,8 +7978,8 @@ ac_cv_enable_unreachable_code_warning=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$save_CFLAGS" @@ -7362,10 +8000,10 @@ else ac_cv_enable_unreachable_code_warning=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_unreachable_code_warning" >&5 -$as_echo "$ac_cv_enable_unreachable_code_warning" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can turn on $CC strict-prototypes warning" >&5 -$as_echo_n "checking if we can turn on $CC strict-prototypes warning... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_unreachable_code_warning" >&5 +printf "%s\n" "$ac_cv_enable_unreachable_code_warning" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can turn on $CC strict-prototypes warning" >&5 +printf %s "checking if we can turn on $CC strict-prototypes warning... " >&6; } ac_save_cc="$CC" CC="$CC -Werror -Wstrict-prototypes" @@ -7370,22 +8008,24 @@ ac_save_cc="$CC" CC="$CC -Werror -Wstrict-prototypes" - if ${ac_cv_enable_enable_strict_prototypes_warning+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + if test ${ac_cv_enable_enable_strict_prototypes_warning+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_enable_strict_prototypes_warning=yes @@ -7389,8 +8029,8 @@ ac_cv_enable_strict_prototypes_warning=yes -else +else $as_nop ac_cv_enable_strict_prototypes_warning=no fi @@ -7393,8 +8033,8 @@ ac_cv_enable_strict_prototypes_warning=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi CC="$ac_save_cc" @@ -7398,11 +8038,11 @@ fi CC="$ac_save_cc" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_strict_prototypes_warning" >&5 -$as_echo "$ac_cv_enable_strict_prototypes_warning" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_strict_prototypes_warning" >&5 +printf "%s\n" "$ac_cv_enable_strict_prototypes_warning" >&6; } if test $ac_cv_enable_strict_prototypes_warning = yes then CFLAGS_NODIST="$CFLAGS_NODIST -Wstrict-prototypes" fi @@ -7403,10 +8043,10 @@ if test $ac_cv_enable_strict_prototypes_warning = yes then CFLAGS_NODIST="$CFLAGS_NODIST -Wstrict-prototypes" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can make implicit function declaration an error in $CC" >&5 -$as_echo_n "checking if we can make implicit function declaration an error in $CC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can make implicit function declaration an error in $CC" >&5 +printf %s "checking if we can make implicit function declaration an error in $CC... " >&6; } ac_save_cc="$CC" CC="$CC -Werror=implicit-function-declaration" @@ -7411,22 +8051,24 @@ ac_save_cc="$CC" CC="$CC -Werror=implicit-function-declaration" - if ${ac_cv_enable_implicit_function_declaration_error+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + if test ${ac_cv_enable_implicit_function_declaration_error+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_enable_implicit_function_declaration_error=yes @@ -7430,8 +8072,8 @@ ac_cv_enable_implicit_function_declaration_error=yes -else +else $as_nop ac_cv_enable_implicit_function_declaration_error=no fi @@ -7434,8 +8076,8 @@ ac_cv_enable_implicit_function_declaration_error=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi CC="$ac_save_cc" @@ -7439,11 +8081,11 @@ fi CC="$ac_save_cc" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_implicit_function_declaration_error" >&5 -$as_echo "$ac_cv_enable_implicit_function_declaration_error" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_implicit_function_declaration_error" >&5 +printf "%s\n" "$ac_cv_enable_implicit_function_declaration_error" >&6; } if test $ac_cv_enable_implicit_function_declaration_error = yes then CFLAGS_NODIST="$CFLAGS_NODIST -Werror=implicit-function-declaration" fi @@ -7444,10 +8086,10 @@ if test $ac_cv_enable_implicit_function_declaration_error = yes then CFLAGS_NODIST="$CFLAGS_NODIST -Werror=implicit-function-declaration" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use visibility in $CC" >&5 -$as_echo_n "checking if we can use visibility in $CC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can use visibility in $CC" >&5 +printf %s "checking if we can use visibility in $CC... " >&6; } ac_save_cc="$CC" CC="$CC -fvisibility=hidden" @@ -7452,22 +8094,24 @@ ac_save_cc="$CC" CC="$CC -fvisibility=hidden" - if ${ac_cv_enable_visibility+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - -int -main () -{ - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + if test ${ac_cv_enable_visibility+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_enable_visibility=yes @@ -7471,8 +8115,8 @@ ac_cv_enable_visibility=yes -else +else $as_nop ac_cv_enable_visibility=no fi @@ -7475,8 +8119,8 @@ ac_cv_enable_visibility=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi CC="$ac_save_cc" @@ -7480,8 +8124,8 @@ fi CC="$ac_save_cc" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_visibility" >&5 -$as_echo "$ac_cv_enable_visibility" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_enable_visibility" >&5 +printf "%s\n" "$ac_cv_enable_visibility" >&6; } if test $ac_cv_enable_visibility = yes then @@ -7507,8 +8151,8 @@ # used to be here, but non-Apple gcc doesn't accept them. if test "${CC}" = gcc then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which compiler should be used" >&5 -$as_echo_n "checking which compiler should be used... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which compiler should be used" >&5 +printf %s "checking which compiler should be used... " >&6; } case "${UNIVERSALSDK}" in */MacOSX10.4u.sdk) # Build using 10.4 SDK, force usage of gcc when the @@ -7518,8 +8162,8 @@ CPP=cpp-4.0 ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } fi if test "${enable_universalsdk}" @@ -7594,8 +8238,8 @@ # below to pick either 10.3, 10.4, or 10.5 as the target. # 4. If we are running on OS X 10.2 or earlier, good luck! - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which MACOSX_DEPLOYMENT_TARGET to use" >&5 -$as_echo_n "checking which MACOSX_DEPLOYMENT_TARGET to use... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which MACOSX_DEPLOYMENT_TARGET to use" >&5 +printf %s "checking which MACOSX_DEPLOYMENT_TARGET to use... " >&6; } cur_target_major=`sw_vers -productVersion | \ sed 's/\([0-9]*\)\.\([0-9]*\).*/\1/'` cur_target_minor=`sw_vers -productVersion | \ @@ -7632,12 +8276,12 @@ MACOSX_DEPLOYMENT_TARGET="$CONFIGURE_MACOSX_DEPLOYMENT_TARGET" export MACOSX_DEPLOYMENT_TARGET EXPORT_MACOSX_DEPLOYMENT_TARGET='' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACOSX_DEPLOYMENT_TARGET" >&5 -$as_echo "$MACOSX_DEPLOYMENT_TARGET" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if specified universal architectures work" >&5 -$as_echo_n "checking if specified universal architectures work... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MACOSX_DEPLOYMENT_TARGET" >&5 +printf "%s\n" "$MACOSX_DEPLOYMENT_TARGET" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if specified universal architectures work" >&5 +printf %s "checking if specified universal architectures work... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdio.h> int @@ -7640,11 +8284,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdio.h> int -main () +main (void) { printf("%d", 42); ; return 0; } _ACEOF @@ -7645,15 +8289,16 @@ { printf("%d", 42); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } as_fn_error $? "check config.log and use the '--with-universal-archs' option" "$LINENO" 5 fi @@ -7657,7 +8302,7 @@ as_fn_error $? "check config.log and use the '--with-universal-archs' option" "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # end of Darwin* tests @@ -7703,10 +8348,12 @@ # complain if unaccepted options are passed (e.g. gcc on Mac OS X). # So we have to see first whether pthreads are available without # options before we can check whether -Kpthread improves anything. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads are available without options" >&5 -$as_echo_n "checking whether pthreads are available without options... " >&6; } -if ${ac_cv_pthread_is_default+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads are available without options" >&5 +printf %s "checking whether pthreads are available without options... " >&6; } +if test ${ac_cv_pthread_is_default+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_pthread_is_default=no @@ -7712,5 +8359,5 @@ ac_cv_pthread_is_default=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7728,9 +8375,10 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_pthread_is_default=yes ac_cv_kthread=no ac_cv_pthread=no @@ -7732,9 +8380,9 @@ ac_cv_pthread_is_default=yes ac_cv_kthread=no ac_cv_pthread=no -else +else $as_nop ac_cv_pthread_is_default=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -7744,8 +8392,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread_is_default" >&5 -$as_echo "$ac_cv_pthread_is_default" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread_is_default" >&5 +printf "%s\n" "$ac_cv_pthread_is_default" >&6; } if test $ac_cv_pthread_is_default = yes @@ -7757,10 +8405,11 @@ # Some compilers won't report that they do not support -Kpthread, # so we need to run a program to see whether it really made the # function available. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Kpthread" >&5 -$as_echo_n "checking whether $CC accepts -Kpthread... " >&6; } -if ${ac_cv_kpthread+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Kpthread" >&5 +printf %s "checking whether $CC accepts -Kpthread... " >&6; } +if test ${ac_cv_kpthread+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_cc="$CC" CC="$CC -Kpthread" @@ -7765,4 +8414,5 @@ ac_save_cc="$CC" CC="$CC -Kpthread" -if test "$cross_compiling" = yes; then : +if test "$cross_compiling" = yes +then : ac_cv_kpthread=no @@ -7768,5 +8418,5 @@ ac_cv_kpthread=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7784,5 +8434,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_kpthread=yes @@ -7788,5 +8439,5 @@ ac_cv_kpthread=yes -else +else $as_nop ac_cv_kpthread=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -7796,8 +8447,8 @@ CC="$ac_save_cc" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_kpthread" >&5 -$as_echo "$ac_cv_kpthread" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_kpthread" >&5 +printf "%s\n" "$ac_cv_kpthread" >&6; } fi if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no @@ -7807,10 +8458,11 @@ # Some compilers won't report that they do not support -Kthread, # so we need to run a program to see whether it really made the # function available. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Kthread" >&5 -$as_echo_n "checking whether $CC accepts -Kthread... " >&6; } -if ${ac_cv_kthread+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Kthread" >&5 +printf %s "checking whether $CC accepts -Kthread... " >&6; } +if test ${ac_cv_kthread+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_cc="$CC" CC="$CC -Kthread" @@ -7815,4 +8467,5 @@ ac_save_cc="$CC" CC="$CC -Kthread" -if test "$cross_compiling" = yes; then : +if test "$cross_compiling" = yes +then : ac_cv_kthread=no @@ -7818,5 +8471,5 @@ ac_cv_kthread=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7834,5 +8487,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_kthread=yes @@ -7838,5 +8492,5 @@ ac_cv_kthread=yes -else +else $as_nop ac_cv_kthread=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -7846,8 +8500,8 @@ CC="$ac_save_cc" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_kthread" >&5 -$as_echo "$ac_cv_kthread" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_kthread" >&5 +printf "%s\n" "$ac_cv_kthread" >&6; } fi if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no @@ -7857,10 +8511,11 @@ # Some compilers won't report that they do not support -pthread, # so we need to run a program to see whether it really made the # function available. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -pthread" >&5 -$as_echo_n "checking whether $CC accepts -pthread... " >&6; } -if ${ac_cv_pthread+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -pthread" >&5 +printf %s "checking whether $CC accepts -pthread... " >&6; } +if test ${ac_cv_pthread+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_cc="$CC" CC="$CC -pthread" @@ -7865,4 +8520,5 @@ ac_save_cc="$CC" CC="$CC -pthread" -if test "$cross_compiling" = yes; then : +if test "$cross_compiling" = yes +then : ac_cv_pthread=no @@ -7868,5 +8524,5 @@ ac_cv_pthread=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7884,5 +8540,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_pthread=yes @@ -7888,5 +8545,5 @@ ac_cv_pthread=yes -else +else $as_nop ac_cv_pthread=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -7896,8 +8553,8 @@ CC="$ac_save_cc" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread" >&5 -$as_echo "$ac_cv_pthread" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread" >&5 +printf "%s\n" "$ac_cv_pthread" >&6; } fi # If we have set a CC compiler flag for thread support then @@ -7905,8 +8562,8 @@ ac_cv_cxx_thread=no if test ! -z "$CXX" then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX also accepts flags for thread support" >&5 -$as_echo_n "checking whether $CXX also accepts flags for thread support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX also accepts flags for thread support" >&5 +printf %s "checking whether $CXX also accepts flags for thread support... " >&6; } ac_save_cxx="$CXX" if test "$ac_cv_kpthread" = "yes" @@ -7936,10 +8593,10 @@ fi rm -fr conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_thread" >&5 -$as_echo "$ac_cv_cxx_thread" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_thread" >&5 +printf "%s\n" "$ac_cv_cxx_thread" >&6; } fi CXX="$ac_save_cxx" # checks for header files @@ -7941,146 +8598,511 @@ fi CXX="$ac_save_cxx" # checks for header files -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ctype.h> -#include <stdlib.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -for ac_header in asm/types.h crypt.h conio.h direct.h dlfcn.h errno.h \ -fcntl.h grp.h \ -ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \ -sched.h shadow.h signal.h stropts.h termios.h \ -utime.h \ -poll.h sys/devpoll.h sys/epoll.h sys/poll.h \ -sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \ -sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \ -sys/param.h sys/random.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \ -sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \ -sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \ -libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ -linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \ -sys/endian.h sys/sysmacros.h linux/memfd.h linux/wait.h sys/memfd.h \ -sys/mman.h sys/eventfd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done +# Autoupdate added the next two lines to ensure that your configure +# script's behavior did not change. They are probably safe to remove. + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + +ac_fn_c_check_header_compile "$LINENO" "asm/types.h" "ac_cv_header_asm_types_h" "$ac_includes_default" +if test "x$ac_cv_header_asm_types_h" = xyes +then : + printf "%s\n" "#define HAVE_ASM_TYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "crypt.h" "ac_cv_header_crypt_h" "$ac_includes_default" +if test "x$ac_cv_header_crypt_h" = xyes +then : + printf "%s\n" "#define HAVE_CRYPT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "conio.h" "ac_cv_header_conio_h" "$ac_includes_default" +if test "x$ac_cv_header_conio_h" = xyes +then : + printf "%s\n" "#define HAVE_CONIO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "direct.h" "ac_cv_header_direct_h" "$ac_includes_default" +if test "x$ac_cv_header_direct_h" = xyes +then : + printf "%s\n" "#define HAVE_DIRECT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = xyes +then : + printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = xyes +then : + printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "grp.h" "ac_cv_header_grp_h" "$ac_includes_default" +if test "x$ac_cv_header_grp_h" = xyes +then : + printf "%s\n" "#define HAVE_GRP_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "ieeefp.h" "ac_cv_header_ieeefp_h" "$ac_includes_default" +if test "x$ac_cv_header_ieeefp_h" = xyes +then : + printf "%s\n" "#define HAVE_IEEEFP_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "io.h" "ac_cv_header_io_h" "$ac_includes_default" +if test "x$ac_cv_header_io_h" = xyes +then : + printf "%s\n" "#define HAVE_IO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" +if test "x$ac_cv_header_langinfo_h" = xyes +then : + printf "%s\n" "#define HAVE_LANGINFO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default" +if test "x$ac_cv_header_libintl_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBINTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "process.h" "ac_cv_header_process_h" "$ac_includes_default" +if test "x$ac_cv_header_process_h" = xyes +then : + printf "%s\n" "#define HAVE_PROCESS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default" +if test "x$ac_cv_header_sched_h" = xyes +then : + printf "%s\n" "#define HAVE_SCHED_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "shadow.h" "ac_cv_header_shadow_h" "$ac_includes_default" +if test "x$ac_cv_header_shadow_h" = xyes +then : + printf "%s\n" "#define HAVE_SHADOW_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" +if test "x$ac_cv_header_signal_h" = xyes +then : + printf "%s\n" "#define HAVE_SIGNAL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stropts.h" "ac_cv_header_stropts_h" "$ac_includes_default" +if test "x$ac_cv_header_stropts_h" = xyes +then : + printf "%s\n" "#define HAVE_STROPTS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "termios.h" "ac_cv_header_termios_h" "$ac_includes_default" +if test "x$ac_cv_header_termios_h" = xyes +then : + printf "%s\n" "#define HAVE_TERMIOS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "utime.h" "ac_cv_header_utime_h" "$ac_includes_default" +if test "x$ac_cv_header_utime_h" = xyes +then : + printf "%s\n" "#define HAVE_UTIME_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" +if test "x$ac_cv_header_poll_h" = xyes +then : + printf "%s\n" "#define HAVE_POLL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/devpoll.h" "ac_cv_header_sys_devpoll_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_devpoll_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_DEVPOLL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/epoll.h" "ac_cv_header_sys_epoll_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_epoll_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_EPOLL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/poll.h" "ac_cv_header_sys_poll_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_poll_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_POLL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/audioio.h" "ac_cv_header_sys_audioio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_audioio_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_AUDIOIO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/xattr.h" "ac_cv_header_sys_xattr_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_xattr_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_XATTR_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/bsdtty.h" "ac_cv_header_sys_bsdtty_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_bsdtty_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_BSDTTY_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/event.h" "ac_cv_header_sys_event_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_event_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_EVENT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_file_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_ioctl_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/kern_control.h" "ac_cv_header_sys_kern_control_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_kern_control_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_KERN_CONTROL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/loadavg.h" "ac_cv_header_sys_loadavg_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_loadavg_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_LOADAVG_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/lock.h" "ac_cv_header_sys_lock_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_lock_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_LOCK_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mkdev_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_MKDEV_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/modem.h" "ac_cv_header_sys_modem_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_modem_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_MODEM_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/random.h" "ac_cv_header_sys_random_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_random_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_RANDOM_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_select_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SELECT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/sendfile.h" "ac_cv_header_sys_sendfile_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sendfile_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SENDFILE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_socket_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/statvfs.h" "ac_cv_header_sys_statvfs_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_statvfs_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_STATVFS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_stat_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_STAT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/syscall.h" "ac_cv_header_sys_syscall_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_syscall_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SYSCALL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/sys_domain.h" "ac_cv_header_sys_sys_domain_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sys_domain_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SYS_DOMAIN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/termio.h" "ac_cv_header_sys_termio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_termio_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TERMIO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/times.h" "ac_cv_header_sys_times_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_times_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIMES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_types_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TYPES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/uio.h" "ac_cv_header_sys_uio_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_uio_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_UIO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_un_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_UN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/utsname.h" "ac_cv_header_sys_utsname_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_utsname_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_UTSNAME_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/wait.h" "ac_cv_header_sys_wait_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_wait_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "pty.h" "ac_cv_header_pty_h" "$ac_includes_default" +if test "x$ac_cv_header_pty_h" = xyes +then : + printf "%s\n" "#define HAVE_PTY_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "libutil.h" "ac_cv_header_libutil_h" "$ac_includes_default" +if test "x$ac_cv_header_libutil_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBUTIL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_resource_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_RESOURCE_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "netpacket/packet.h" "ac_cv_header_netpacket_packet_h" "$ac_includes_default" +if test "x$ac_cv_header_netpacket_packet_h" = xyes +then : + printf "%s\n" "#define HAVE_NETPACKET_PACKET_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sysexits.h" "ac_cv_header_sysexits_h" "$ac_includes_default" +if test "x$ac_cv_header_sysexits_h" = xyes +then : + printf "%s\n" "#define HAVE_SYSEXITS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "bluetooth.h" "ac_cv_header_bluetooth_h" "$ac_includes_default" +if test "x$ac_cv_header_bluetooth_h" = xyes +then : + printf "%s\n" "#define HAVE_BLUETOOTH_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "linux/tipc.h" "ac_cv_header_linux_tipc_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_tipc_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_TIPC_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "linux/random.h" "ac_cv_header_linux_random_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_random_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_RANDOM_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "spawn.h" "ac_cv_header_spawn_h" "$ac_includes_default" +if test "x$ac_cv_header_spawn_h" = xyes +then : + printf "%s\n" "#define HAVE_SPAWN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "util.h" "ac_cv_header_util_h" "$ac_includes_default" +if test "x$ac_cv_header_util_h" = xyes +then : + printf "%s\n" "#define HAVE_UTIL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "alloca.h" "ac_cv_header_alloca_h" "$ac_includes_default" +if test "x$ac_cv_header_alloca_h" = xyes +then : + printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "endian.h" "ac_cv_header_endian_h" "$ac_includes_default" +if test "x$ac_cv_header_endian_h" = xyes +then : + printf "%s\n" "#define HAVE_ENDIAN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/endian.h" "ac_cv_header_sys_endian_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_endian_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_ENDIAN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sysmacros_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_SYSMACROS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "linux/memfd.h" "ac_cv_header_linux_memfd_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_memfd_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_MEMFD_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "linux/wait.h" "ac_cv_header_linux_wait_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_wait_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_WAIT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/memfd.h" "ac_cv_header_sys_memfd_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_memfd_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_MEMFD_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mman_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_MMAN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/eventfd.h" "ac_cv_header_sys_eventfd_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_eventfd_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_EVENTFD_H 1" >>confdefs.h + +fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do @@ -8084,15 +9106,16 @@ ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if eval \${$as_ac_Header+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +printf %s "checking for $ac_hdr that defines DIR... " >&6; } +if eval test \${$as_ac_Header+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <$ac_hdr> int @@ -8093,10 +9116,10 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <$ac_hdr> int -main () +main (void) { if ((DIR *) 0) return 0; @@ -8104,5 +9127,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_ac_Header=yes" @@ -8108,4 +9132,4 @@ eval "$as_ac_Header=yes" -else +else $as_nop eval "$as_ac_Header=no" fi @@ -8110,5 +9134,5 @@ eval "$as_ac_Header=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$as_ac_Header @@ -8113,6 +9137,7 @@ fi eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes" +then : cat >>confdefs.h <<_ACEOF @@ -8118,5 +9143,5 @@ cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -8125,11 +9150,12 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8137,8 +9163,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char opendir (); int @@ -8143,9 +9166,9 @@ char opendir (); int -main () +main (void) { return opendir (); ; return 0; } _ACEOF @@ -8146,13 +9169,14 @@ { return opendir (); ; return 0; } _ACEOF -for ac_lib in '' dir; do +for ac_lib in '' dir +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi @@ -8153,9 +9177,10 @@ if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_opendir=$ac_res fi @@ -8160,4 +9185,4 @@ ac_cv_search_opendir=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext @@ -8163,5 +9188,6 @@ conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : + if test ${ac_cv_search_opendir+y} +then : break fi done @@ -8165,11 +9191,12 @@ break fi done -if ${ac_cv_search_opendir+:} false; then : - -else +if test ${ac_cv_search_opendir+y} +then : + +else $as_nop ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi @@ -8171,8 +9198,8 @@ ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir @@ -8178,7 +9205,8 @@ ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else @@ -8180,13 +9208,14 @@ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +printf %s "checking for library containing opendir... " >&6; } +if test ${ac_cv_search_opendir+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8194,8 +9223,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char opendir (); int @@ -8200,9 +9226,9 @@ char opendir (); int -main () +main (void) { return opendir (); ; return 0; } _ACEOF @@ -8203,13 +9229,14 @@ { return opendir (); ; return 0; } _ACEOF -for ac_lib in '' x; do +for ac_lib in '' x +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi @@ -8210,9 +9237,10 @@ if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_opendir=$ac_res fi @@ -8217,4 +9245,4 @@ ac_cv_search_opendir=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext @@ -8220,5 +9248,6 @@ conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : + if test ${ac_cv_search_opendir+y} +then : break fi done @@ -8222,11 +9251,12 @@ break fi done -if ${ac_cv_search_opendir+:} false; then : - -else +if test ${ac_cv_search_opendir+y} +then : + +else $as_nop ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi @@ -8228,8 +9258,8 @@ ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +printf "%s\n" "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir @@ -8235,8 +9265,9 @@ ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi @@ -8237,57 +9268,27 @@ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5 -$as_echo_n "checking whether sys/types.h defines makedev... " >&6; } -if ${ac_cv_header_sys_types_h_makedev+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <sys/types.h> -int -main () -{ -return makedev(0, 0); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_header_sys_types_h_makedev=yes -else - ac_cv_header_sys_types_h_makedev=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_types_h_makedev" >&5 -$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; } - -if test $ac_cv_header_sys_types_h_makedev = no; then -ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mkdev_h" = xyes; then : - -$as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h - -fi - - - - if test $ac_cv_header_sys_mkdev_h = no; then - ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then : - -$as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h - -fi - - - fi + +ac_fn_c_check_header_compile "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mkdev_h" = xyes +then : + +printf "%s\n" "#define MAJOR_IN_MKDEV 1" >>confdefs.h + +fi + +if test $ac_cv_header_sys_mkdev_h = no; then + ac_fn_c_check_header_compile "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_sysmacros_h" = xyes +then : + +printf "%s\n" "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h + +fi + fi @@ -8295,18 +9296,13 @@ # http://permalink.gmane.org/gmane.linux.bluez.kernel/22294 SAVE_CFLAGS=$CFLAGS CFLAGS="-std=c99 $CFLAGS" -for ac_header in bluetooth/bluetooth.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "bluetooth/bluetooth.h" "ac_cv_header_bluetooth_bluetooth_h" "$ac_includes_default" -if test "x$ac_cv_header_bluetooth_bluetooth_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_BLUETOOTH_BLUETOOTH_H 1 -_ACEOF - -fi - -done +ac_fn_c_check_header_compile "$LINENO" "bluetooth/bluetooth.h" "ac_cv_header_bluetooth_bluetooth_h" "$ac_includes_default" +if test "x$ac_cv_header_bluetooth_bluetooth_h" = xyes +then : + printf "%s\n" "#define HAVE_BLUETOOTH_BLUETOOTH_H 1" >>confdefs.h + +fi CFLAGS=$SAVE_CFLAGS # On Darwin (OS X) net/if.h requires sys/socket.h to be imported first. @@ -8309,10 +9305,8 @@ CFLAGS=$SAVE_CFLAGS # On Darwin (OS X) net/if.h requires sys/socket.h to be imported first. -for ac_header in net/if.h -do : - ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "#include <stdio.h> +ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "#include <stdio.h> #ifdef STDC_HEADERS # include <stdlib.h> # include <stddef.h> @@ -8326,14 +9320,11 @@ #endif " -if test "x$ac_cv_header_net_if_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NET_IF_H 1 -_ACEOF - -fi - -done +if test "x$ac_cv_header_net_if_h" = xyes +then : + printf "%s\n" "#define HAVE_NET_IF_H 1" >>confdefs.h + +fi # On Linux, netlink.h requires asm/types.h @@ -8337,9 +9328,7 @@ # On Linux, netlink.h requires asm/types.h -for ac_header in linux/netlink.h -do : - ac_fn_c_check_header_compile "$LINENO" "linux/netlink.h" "ac_cv_header_linux_netlink_h" " +ac_fn_c_check_header_compile "$LINENO" "linux/netlink.h" "ac_cv_header_linux_netlink_h" " #ifdef HAVE_ASM_TYPES_H #include <asm/types.h> #endif @@ -8348,14 +9337,11 @@ #endif " -if test "x$ac_cv_header_linux_netlink_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LINUX_NETLINK_H 1 -_ACEOF - -fi - -done +if test "x$ac_cv_header_linux_netlink_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_NETLINK_H 1" >>confdefs.h + +fi # On Linux, qrtr.h requires asm/types.h @@ -8359,9 +9345,7 @@ # On Linux, qrtr.h requires asm/types.h -for ac_header in linux/qrtr.h -do : - ac_fn_c_check_header_compile "$LINENO" "linux/qrtr.h" "ac_cv_header_linux_qrtr_h" " +ac_fn_c_check_header_compile "$LINENO" "linux/qrtr.h" "ac_cv_header_linux_qrtr_h" " #ifdef HAVE_ASM_TYPES_H #include <asm/types.h> #endif @@ -8370,21 +9354,30 @@ #endif " -if test "x$ac_cv_header_linux_qrtr_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LINUX_QRTR_H 1 -_ACEOF - -fi - -done - - -for ac_header in linux/vm_sockets.h -do : - ac_fn_c_check_header_compile "$LINENO" "linux/vm_sockets.h" "ac_cv_header_linux_vm_sockets_h" " +if test "x$ac_cv_header_linux_qrtr_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_QRTR_H 1" >>confdefs.h + +fi + + +ac_fn_c_check_header_compile "$LINENO" "linux/vm_sockets.h" "ac_cv_header_linux_vm_sockets_h" " +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif + +" +if test "x$ac_cv_header_linux_vm_sockets_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_VM_SOCKETS_H 1" >>confdefs.h + +fi + + +# On Linux, can.h, can/bcm.h, can/j1939.h, can/raw.h require sys/socket.h +ac_fn_c_check_header_compile "$LINENO" "linux/can.h" "ac_cv_header_linux_can_h" " #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif " @@ -8386,25 +9379,27 @@ #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif " -if test "x$ac_cv_header_linux_vm_sockets_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LINUX_VM_SOCKETS_H 1 -_ACEOF - -fi - -done - - -# On Linux, can.h, can/bcm.h, can/j1939.h, can/raw.h require sys/socket.h -for ac_header in linux/can.h linux/can/bcm.h linux/can/j1939.h linux/can/raw.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " +if test "x$ac_cv_header_linux_can_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_CAN_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "linux/can/bcm.h" "ac_cv_header_linux_can_bcm_h" " +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif + +" +if test "x$ac_cv_header_linux_can_bcm_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_CAN_BCM_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "linux/can/j1939.h" "ac_cv_header_linux_can_j1939_h" " #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif " @@ -8406,17 +9401,25 @@ #ifdef HAVE_SYS_SOCKET_H #include <sys/socket.h> #endif " -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done +if test "x$ac_cv_header_linux_can_j1939_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_CAN_J1939_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "linux/can/raw.h" "ac_cv_header_linux_can_raw_h" " +#ifdef HAVE_SYS_SOCKET_H +#include <sys/socket.h> +#endif + +" +if test "x$ac_cv_header_linux_can_raw_h" = xyes +then : + printf "%s\n" "#define HAVE_LINUX_CAN_RAW_H 1" >>confdefs.h + +fi # checks for typedefs was_it_defined=no @@ -8419,12 +9422,13 @@ # checks for typedefs was_it_defined=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_t in time.h" >&5 -$as_echo_n "checking for clock_t in time.h... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_t in time.h" >&5 +printf %s "checking for clock_t in time.h... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <time.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | @@ -8425,8 +9429,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <time.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "clock_t" >/dev/null 2>&1; then : + $EGREP "clock_t" >/dev/null 2>&1 +then : was_it_defined=yes @@ -8432,18 +9437,18 @@ was_it_defined=yes -else - - -$as_echo "#define clock_t long" >>confdefs.h - - -fi -rm -f conftest* - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $was_it_defined" >&5 -$as_echo "$was_it_defined" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for makedev" >&5 -$as_echo_n "checking for makedev... " >&6; } +else $as_nop + + +printf "%s\n" "#define clock_t long" >>confdefs.h + + +fi +rm -rf conftest* + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $was_it_defined" >&5 +printf "%s\n" "$was_it_defined" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for makedev" >&5 +printf %s "checking for makedev... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8456,7 +9461,7 @@ #endif int -main () +main (void) { makedev(0, 0) @@ -8465,5 +9470,6 @@ } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_has_makedev=yes @@ -8469,4 +9475,4 @@ ac_cv_has_makedev=yes -else +else $as_nop ac_cv_has_makedev=no fi @@ -8471,8 +9477,8 @@ ac_cv_has_makedev=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_has_makedev" >&5 -$as_echo "$ac_cv_has_makedev" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_has_makedev" >&5 +printf "%s\n" "$ac_cv_has_makedev" >&6; } if test "$ac_cv_has_makedev" = "yes"; then @@ -8477,7 +9483,7 @@ if test "$ac_cv_has_makedev" = "yes"; then -$as_echo "#define HAVE_MAKEDEV 1" >>confdefs.h +printf "%s\n" "#define HAVE_MAKEDEV 1" >>confdefs.h fi # byte swapping @@ -8480,9 +9486,9 @@ fi # byte swapping -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for le64toh" >&5 -$as_echo_n "checking for le64toh... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for le64toh" >&5 +printf %s "checking for le64toh... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8493,7 +9499,7 @@ #endif int -main () +main (void) { le64toh(1) @@ -8502,5 +9508,6 @@ } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_has_le64toh=yes @@ -8506,4 +9513,4 @@ ac_cv_has_le64toh=yes -else +else $as_nop ac_cv_has_le64toh=no fi @@ -8508,8 +9515,8 @@ ac_cv_has_le64toh=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_has_le64toh" >&5 -$as_echo "$ac_cv_has_le64toh" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_has_le64toh" >&5 +printf "%s\n" "$ac_cv_has_le64toh" >&6; } if test "$ac_cv_has_le64toh" = "yes"; then @@ -8514,6 +9521,6 @@ if test "$ac_cv_has_le64toh" = "yes"; then -$as_echo "#define HAVE_HTOLE64 1" >>confdefs.h +printf "%s\n" "#define HAVE_HTOLE64 1" >>confdefs.h fi @@ -8529,8 +9536,8 @@ case $ac_sys_system/$ac_sys_release in AIX*) -$as_echo "#define _LARGE_FILES 1" >>confdefs.h +printf "%s\n" "#define _LARGE_FILES 1" >>confdefs.h ;; esac @@ -8533,11 +9540,11 @@ ;; esac -$as_echo "#define _LARGEFILE_SOURCE 1" >>confdefs.h - - -$as_echo "#define _FILE_OFFSET_BITS 64" >>confdefs.h +printf "%s\n" "#define _LARGEFILE_SOURCE 1" >>confdefs.h + + +printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h fi @@ -8550,14 +9557,13 @@ # Type availability checks ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" -if test "x$ac_cv_type_mode_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define mode_t int -_ACEOF +if test "x$ac_cv_type_mode_t" = xyes +then : + +else $as_nop + +printf "%s\n" "#define mode_t int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" @@ -8560,31 +9566,54 @@ fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" -if test "x$ac_cv_type_off_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define off_t long int -_ACEOF - -fi - -ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define pid_t int -_ACEOF - -fi - - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE void -_ACEOF +if test "x$ac_cv_type_off_t" = xyes +then : + +else $as_nop + +printf "%s\n" "#define off_t long int" >>confdefs.h + +fi + + + ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default +" +if test "x$ac_cv_type_pid_t" = xyes +then : + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main (void) +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_pid_type='int' +else $as_nop + ac_pid_type='__int64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h + + +fi + + + +printf "%s\n" "#define RETSIGTYPE void" >>confdefs.h ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" @@ -8589,23 +9618,23 @@ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -$as_echo_n "checking for uid_t in sys/types.h... " >&6; } -if ${ac_cv_type_uid_t+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "x$ac_cv_type_size_t" = xyes +then : + +else $as_nop + +printf "%s\n" "#define size_t unsigned int" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 +printf %s "checking for uid_t in sys/types.h... " >&6; } +if test ${ac_cv_type_uid_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | @@ -8606,8 +9635,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1; then : + $EGREP "uid_t" >/dev/null 2>&1 +then : ac_cv_type_uid_t=yes @@ -8613,4 +9643,4 @@ ac_cv_type_uid_t=yes -else +else $as_nop ac_cv_type_uid_t=no fi @@ -8615,9 +9645,9 @@ ac_cv_type_uid_t=no fi -rm -f conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -$as_echo "$ac_cv_type_uid_t" >&6; } +rm -rf conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 +printf "%s\n" "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then @@ -8622,11 +9652,11 @@ if test $ac_cv_type_uid_t = no; then -$as_echo "#define uid_t int" >>confdefs.h - - -$as_echo "#define gid_t int" >>confdefs.h +printf "%s\n" "#define uid_t int" >>confdefs.h + + +printf "%s\n" "#define gid_t int" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" @@ -8628,12 +9658,13 @@ fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" -if test "x$ac_cv_type_ssize_t" = xyes; then : - -$as_echo "#define HAVE_SSIZE_T 1" >>confdefs.h +if test "x$ac_cv_type_ssize_t" = xyes +then : + +printf "%s\n" "#define HAVE_SSIZE_T 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "__uint128_t" "ac_cv_type___uint128_t" "$ac_includes_default" @@ -8636,17 +9667,18 @@ fi ac_fn_c_check_type "$LINENO" "__uint128_t" "ac_cv_type___uint128_t" "$ac_includes_default" -if test "x$ac_cv_type___uint128_t" = xyes; then : - -$as_echo "#define HAVE_GCC_UINT128_T 1" >>confdefs.h - -fi - - -# Sizes of various common basic types +if test "x$ac_cv_type___uint128_t" = xyes +then : + +printf "%s\n" "#define HAVE_GCC_UINT128_T 1" >>confdefs.h + +fi + + +# Sizes and alignments of various common basic types # ANSI C requires sizeof(char) == 1, so no need to check it # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -8648,14 +9680,16 @@ # ANSI C requires sizeof(char) == 1, so no need to check it # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } -if ${ac_cv_sizeof_int+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : - -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 +printf %s "checking size of int... " >&6; } +if test ${ac_cv_sizeof_int+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" +then : + +else $as_nop if test "$ac_cv_type_int" = yes; then @@ -8661,6 +9695,6 @@ if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) See \`config.log' for more details" "$LINENO" 5; } else @@ -8669,17 +9703,15 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 +printf "%s\n" "$ac_cv_sizeof_int" >&6; } + + + +printf "%s\n" "#define SIZEOF_INT $ac_cv_sizeof_int" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -8680,15 +9712,17 @@ # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : - -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +printf %s "checking size of long... " >&6; } +if test ${ac_cv_sizeof_long+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" +then : + +else $as_nop if test "$ac_cv_type_long" = yes; then @@ -8694,6 +9728,6 @@ if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) See \`config.log' for more details" "$LINENO" 5; } else @@ -8702,17 +9736,47 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +printf "%s\n" "$ac_cv_sizeof_long" >&6; } + + + +printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h + + +# The cast to long int works around a bug in the HP C Compiler, +# see AC_CHECK_SIZEOF for more information. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking alignment of long" >&5 +printf %s "checking alignment of long... " >&6; } +if test ${ac_cv_alignof_long+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_long" "$ac_includes_default +typedef struct { char x; long y; } ac__type_alignof_;" +then : + +else $as_nop + if test "$ac_cv_type_long" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute alignment of long +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_alignof_long=0 + fi +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_long" >&5 +printf "%s\n" "$ac_cv_alignof_long" >&6; } + + + +printf "%s\n" "#define ALIGNOF_LONG $ac_cv_alignof_long" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -8713,15 +9777,17 @@ # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } -if ${ac_cv_sizeof_long_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : - -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +printf %s "checking size of long long... " >&6; } +if test ${ac_cv_sizeof_long_long+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default" +then : + +else $as_nop if test "$ac_cv_type_long_long" = yes; then @@ -8727,6 +9793,6 @@ if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long long) See \`config.log' for more details" "$LINENO" 5; } else @@ -8735,50 +9801,15 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 -$as_echo_n "checking size of void *... " >&6; } -if ${ac_cv_sizeof_void_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_void_p" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (void *) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_void_p=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 -$as_echo "$ac_cv_sizeof_void_p" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOID_P $ac_cv_sizeof_void_p -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +printf "%s\n" "$ac_cv_sizeof_long_long" >&6; } + + + +printf "%s\n" "#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -8779,20 +9810,22 @@ # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 -$as_echo_n "checking size of short... " >&6; } -if ${ac_cv_sizeof_short+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_short" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (short) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +printf %s "checking size of void *... " >&6; } +if test ${ac_cv_sizeof_void_p+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default" +then : + +else $as_nop + if test "$ac_cv_type_void_p" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (void *) See \`config.log' for more details" "$LINENO" 5; } else @@ -8797,7 +9830,7 @@ See \`config.log' for more details" "$LINENO" 5; } else - ac_cv_sizeof_short=0 + ac_cv_sizeof_void_p=0 fi fi fi @@ -8800,18 +9833,16 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 -$as_echo "$ac_cv_sizeof_short" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SHORT $ac_cv_sizeof_short -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 +printf "%s\n" "$ac_cv_sizeof_void_p" >&6; } + + + +printf "%s\n" "#define SIZEOF_VOID_P $ac_cv_sizeof_void_p" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -8812,20 +9843,22 @@ # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5 -$as_echo_n "checking size of float... " >&6; } -if ${ac_cv_sizeof_float+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_float" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (float) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 +printf %s "checking size of short... " >&6; } +if test ${ac_cv_sizeof_short+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default" +then : + +else $as_nop + if test "$ac_cv_type_short" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (short) See \`config.log' for more details" "$LINENO" 5; } else @@ -8830,7 +9863,7 @@ See \`config.log' for more details" "$LINENO" 5; } else - ac_cv_sizeof_float=0 + ac_cv_sizeof_short=0 fi fi fi @@ -8833,18 +9866,16 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_float" >&5 -$as_echo "$ac_cv_sizeof_float" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_FLOAT $ac_cv_sizeof_float -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 +printf "%s\n" "$ac_cv_sizeof_short" >&6; } + + + +printf "%s\n" "#define SIZEOF_SHORT $ac_cv_sizeof_short" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -8845,15 +9876,50 @@ # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 -$as_echo_n "checking size of double... " >&6; } -if ${ac_cv_sizeof_double+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then : - -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of float" >&5 +printf %s "checking size of float... " >&6; } +if test ${ac_cv_sizeof_float+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default" +then : + +else $as_nop + if test "$ac_cv_type_float" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (float) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_float=0 + fi +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_float" >&5 +printf "%s\n" "$ac_cv_sizeof_float" >&6; } + + + +printf "%s\n" "#define SIZEOF_FLOAT $ac_cv_sizeof_float" >>confdefs.h + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 +printf %s "checking size of double... " >&6; } +if test ${ac_cv_sizeof_double+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default" +then : + +else $as_nop if test "$ac_cv_type_double" = yes; then @@ -8859,6 +9925,6 @@ if test "$ac_cv_type_double" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (double) See \`config.log' for more details" "$LINENO" 5; } else @@ -8867,17 +9933,15 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5 -$as_echo "$ac_cv_sizeof_double" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_DOUBLE $ac_cv_sizeof_double -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_double" >&5 +printf "%s\n" "$ac_cv_sizeof_double" >&6; } + + + +printf "%s\n" "#define SIZEOF_DOUBLE $ac_cv_sizeof_double" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -8878,15 +9942,17 @@ # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of fpos_t" >&5 -$as_echo_n "checking size of fpos_t... " >&6; } -if ${ac_cv_sizeof_fpos_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (fpos_t))" "ac_cv_sizeof_fpos_t" "$ac_includes_default"; then : - -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of fpos_t" >&5 +printf %s "checking size of fpos_t... " >&6; } +if test ${ac_cv_sizeof_fpos_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (fpos_t))" "ac_cv_sizeof_fpos_t" "$ac_includes_default" +then : + +else $as_nop if test "$ac_cv_type_fpos_t" = yes; then @@ -8892,6 +9958,6 @@ if test "$ac_cv_type_fpos_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (fpos_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -8900,50 +9966,15 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_fpos_t" >&5 -$as_echo "$ac_cv_sizeof_fpos_t" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_FPOS_T $ac_cv_sizeof_fpos_t -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 -$as_echo_n "checking size of size_t... " >&6; } -if ${ac_cv_sizeof_size_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_size_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (size_t) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_size_t=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 -$as_echo "$ac_cv_sizeof_size_t" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_fpos_t" >&5 +printf "%s\n" "$ac_cv_sizeof_fpos_t" >&6; } + + + +printf "%s\n" "#define SIZEOF_FPOS_T $ac_cv_sizeof_fpos_t" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -8944,20 +9975,22 @@ # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pid_t" >&5 -$as_echo_n "checking size of pid_t... " >&6; } -if ${ac_cv_sizeof_pid_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pid_t))" "ac_cv_sizeof_pid_t" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_pid_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (pid_t) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of size_t" >&5 +printf %s "checking size of size_t... " >&6; } +if test ${ac_cv_sizeof_size_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default" +then : + +else $as_nop + if test "$ac_cv_type_size_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (size_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -8962,7 +9995,7 @@ See \`config.log' for more details" "$LINENO" 5; } else - ac_cv_sizeof_pid_t=0 + ac_cv_sizeof_size_t=0 fi fi fi @@ -8965,18 +9998,48 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pid_t" >&5 -$as_echo "$ac_cv_sizeof_pid_t" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_PID_T $ac_cv_sizeof_pid_t -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 +printf "%s\n" "$ac_cv_sizeof_size_t" >&6; } + + + +printf "%s\n" "#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t" >>confdefs.h + + +# The cast to long int works around a bug in the HP C Compiler, +# see AC_CHECK_SIZEOF for more information. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking alignment of size_t" >&5 +printf %s "checking alignment of size_t... " >&6; } +if test ${ac_cv_alignof_size_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) offsetof (ac__type_alignof_, y)" "ac_cv_alignof_size_t" "$ac_includes_default +typedef struct { char x; size_t y; } ac__type_alignof_;" +then : + +else $as_nop + if test "$ac_cv_type_size_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute alignment of size_t +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_alignof_size_t=0 + fi +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_alignof_size_t" >&5 +printf "%s\n" "$ac_cv_alignof_size_t" >&6; } + + + +printf "%s\n" "#define ALIGNOF_SIZE_T $ac_cv_alignof_size_t" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -8977,15 +10040,50 @@ # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of uintptr_t" >&5 -$as_echo_n "checking size of uintptr_t... " >&6; } -if ${ac_cv_sizeof_uintptr_t+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uintptr_t))" "ac_cv_sizeof_uintptr_t" "$ac_includes_default"; then : - -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of pid_t" >&5 +printf %s "checking size of pid_t... " >&6; } +if test ${ac_cv_sizeof_pid_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pid_t))" "ac_cv_sizeof_pid_t" "$ac_includes_default" +then : + +else $as_nop + if test "$ac_cv_type_pid_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (pid_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_pid_t=0 + fi +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pid_t" >&5 +printf "%s\n" "$ac_cv_sizeof_pid_t" >&6; } + + + +printf "%s\n" "#define SIZEOF_PID_T $ac_cv_sizeof_pid_t" >>confdefs.h + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of uintptr_t" >&5 +printf %s "checking size of uintptr_t... " >&6; } +if test ${ac_cv_sizeof_uintptr_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (uintptr_t))" "ac_cv_sizeof_uintptr_t" "$ac_includes_default" +then : + +else $as_nop if test "$ac_cv_type_uintptr_t" = yes; then @@ -8991,6 +10089,6 @@ if test "$ac_cv_type_uintptr_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (uintptr_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -8999,23 +10097,22 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_uintptr_t" >&5 -$as_echo "$ac_cv_sizeof_uintptr_t" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_UINTPTR_T $ac_cv_sizeof_uintptr_t -_ACEOF - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double" >&5 -$as_echo_n "checking for long double... " >&6; } -if ${ac_cv_type_long_double+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_uintptr_t" >&5 +printf "%s\n" "$ac_cv_sizeof_uintptr_t" >&6; } + + + +printf "%s\n" "#define SIZEOF_UINTPTR_T $ac_cv_sizeof_uintptr_t" >>confdefs.h + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long double" >&5 +printf %s "checking for long double... " >&6; } +if test ${ac_cv_type_long_double+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "$GCC" = yes; then ac_cv_type_long_double=yes else @@ -9025,7 +10122,7 @@ not support it. */ long double foo = 0.0L; int -main () +main (void) { static int test_array [1 - 2 * !(/* On Ultrix 4.3 cc, long double is 4 and double is 8. */ sizeof (double) <= sizeof (long double))]; @@ -9036,5 +10133,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_type_long_double=yes @@ -9040,4 +10138,4 @@ ac_cv_type_long_double=yes -else +else $as_nop ac_cv_type_long_double=no fi @@ -9042,5 +10140,5 @@ ac_cv_type_long_double=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi @@ -9045,6 +10143,6 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double" >&5 -$as_echo "$ac_cv_type_long_double" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double" >&5 +printf "%s\n" "$ac_cv_type_long_double" >&6; } if test $ac_cv_type_long_double = yes; then @@ -9049,6 +10147,6 @@ if test $ac_cv_type_long_double = yes; then -$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h +printf "%s\n" "#define HAVE_LONG_DOUBLE 1" >>confdefs.h fi @@ -9056,12 +10154,14 @@ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5 -$as_echo_n "checking size of long double... " >&6; } -if ${ac_cv_sizeof_long_double+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default"; then : - -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long double" >&5 +printf %s "checking size of long double... " >&6; } +if test ${ac_cv_sizeof_long_double+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long double))" "ac_cv_sizeof_long_double" "$ac_includes_default" +then : + +else $as_nop if test "$ac_cv_type_long_double" = yes; then @@ -9067,6 +10167,6 @@ if test "$ac_cv_type_long_double" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long double) See \`config.log' for more details" "$LINENO" 5; } else @@ -9075,14 +10175,12 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5 -$as_echo "$ac_cv_sizeof_long_double" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_double" >&5 +printf "%s\n" "$ac_cv_sizeof_long_double" >&6; } + + + +printf "%s\n" "#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double" >>confdefs.h @@ -9090,12 +10188,14 @@ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of _Bool" >&5 -$as_echo_n "checking size of _Bool... " >&6; } -if ${ac_cv_sizeof__Bool+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (_Bool))" "ac_cv_sizeof__Bool" "$ac_includes_default"; then : - -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of _Bool" >&5 +printf %s "checking size of _Bool... " >&6; } +if test ${ac_cv_sizeof__Bool+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (_Bool))" "ac_cv_sizeof__Bool" "$ac_includes_default" +then : + +else $as_nop if test "$ac_cv_type__Bool" = yes; then @@ -9101,6 +10201,6 @@ if test "$ac_cv_type__Bool" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (_Bool) See \`config.log' for more details" "$LINENO" 5; } else @@ -9109,14 +10209,12 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof__Bool" >&5 -$as_echo "$ac_cv_sizeof__Bool" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF__BOOL $ac_cv_sizeof__Bool -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof__Bool" >&5 +printf "%s\n" "$ac_cv_sizeof__Bool" >&6; } + + + +printf "%s\n" "#define SIZEOF__BOOL $ac_cv_sizeof__Bool" >>confdefs.h @@ -9124,13 +10222,14 @@ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 -$as_echo_n "checking size of off_t... " >&6; } -if ${ac_cv_sizeof_off_t+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 +printf %s "checking size of off_t... " >&6; } +if test ${ac_cv_sizeof_off_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" " #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif @@ -9132,9 +10231,10 @@ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" " #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> #endif -"; then : - -else +" +then : + +else $as_nop if test "$ac_cv_type_off_t" = yes; then @@ -9140,6 +10240,6 @@ if test "$ac_cv_type_off_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (off_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -9148,19 +10248,17 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 -$as_echo "$ac_cv_sizeof_off_t" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_OFF_T $ac_cv_sizeof_off_t -_ACEOF - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable large file support" >&5 -$as_echo_n "checking whether to enable large file support... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 +printf "%s\n" "$ac_cv_sizeof_off_t" >&6; } + + + +printf "%s\n" "#define SIZEOF_OFF_T $ac_cv_sizeof_off_t" >>confdefs.h + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable large file support" >&5 +printf %s "checking whether to enable large file support... " >&6; } if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then @@ -9164,16 +10262,16 @@ if test "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then -$as_echo "#define HAVE_LARGEFILE_SUPPORT 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +printf "%s\n" "#define HAVE_LARGEFILE_SUPPORT 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -9174,14 +10272,15 @@ fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 -$as_echo_n "checking size of time_t... " >&6; } -if ${ac_cv_sizeof_time_t+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 +printf %s "checking size of time_t... " >&6; } +if test ${ac_cv_sizeof_time_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" " #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> @@ -9190,7 +10289,8 @@ #include <time.h> #endif -"; then : - -else +" +then : + +else $as_nop if test "$ac_cv_type_time_t" = yes; then @@ -9196,6 +10296,6 @@ if test "$ac_cv_type_time_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (time_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -9204,14 +10304,12 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 -$as_echo "$ac_cv_sizeof_time_t" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_TIME_T $ac_cv_sizeof_time_t -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 +printf "%s\n" "$ac_cv_sizeof_time_t" >&6; } + + + +printf "%s\n" "#define SIZEOF_TIME_T $ac_cv_sizeof_time_t" >>confdefs.h @@ -9225,11 +10323,11 @@ then CC="$CC -pthread" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_t" >&5 -$as_echo_n "checking for pthread_t... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_t" >&5 +printf %s "checking for pthread_t... " >&6; } have_pthread_t=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <pthread.h> int @@ -9230,10 +10328,10 @@ have_pthread_t=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <pthread.h> int -main () +main (void) { pthread_t x; x = *(pthread_t*)0; ; @@ -9241,6 +10339,7 @@ } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : have_pthread_t=yes fi @@ -9245,10 +10344,10 @@ have_pthread_t=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_pthread_t" >&5 -$as_echo "$have_pthread_t" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_pthread_t" >&5 +printf "%s\n" "$have_pthread_t" >&6; } if test "$have_pthread_t" = yes ; then # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. @@ -9250,15 +10349,16 @@ if test "$have_pthread_t" = yes ; then # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5 -$as_echo_n "checking size of pthread_t... " >&6; } -if ${ac_cv_sizeof_pthread_t+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of pthread_t" >&5 +printf %s "checking size of pthread_t... " >&6; } +if test ${ac_cv_sizeof_pthread_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t" " #ifdef HAVE_PTHREAD_H #include <pthread.h> #endif @@ -9260,9 +10360,10 @@ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_t))" "ac_cv_sizeof_pthread_t" " #ifdef HAVE_PTHREAD_H #include <pthread.h> #endif -"; then : - -else +" +then : + +else $as_nop if test "$ac_cv_type_pthread_t" = yes; then @@ -9268,6 +10369,6 @@ if test "$ac_cv_type_pthread_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (pthread_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -9276,14 +10377,12 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_t" >&5 -$as_echo "$ac_cv_sizeof_pthread_t" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_t" >&5 +printf "%s\n" "$ac_cv_sizeof_pthread_t" >&6; } + + + +printf "%s\n" "#define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t" >>confdefs.h fi @@ -9294,9 +10393,10 @@ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of pthread_key_t" >&5 -$as_echo_n "checking size of pthread_key_t... " >&6; } -if ${ac_cv_sizeof_pthread_key_t+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of pthread_key_t" >&5 +printf %s "checking size of pthread_key_t... " >&6; } +if test ${ac_cv_sizeof_pthread_key_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_key_t))" "ac_cv_sizeof_pthread_key_t" "#include <pthread.h> @@ -9302,5 +10402,6 @@ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (pthread_key_t))" "ac_cv_sizeof_pthread_key_t" "#include <pthread.h> -"; then : - -else +" +then : + +else $as_nop if test "$ac_cv_type_pthread_key_t" = yes; then @@ -9306,6 +10407,6 @@ if test "$ac_cv_type_pthread_key_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (pthread_key_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -9314,20 +10415,18 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_key_t" >&5 -$as_echo "$ac_cv_sizeof_pthread_key_t" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_PTHREAD_KEY_T $ac_cv_sizeof_pthread_key_t -_ACEOF - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_key_t is compatible with int" >&5 -$as_echo_n "checking whether pthread_key_t is compatible with int... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_pthread_key_t" >&5 +printf "%s\n" "$ac_cv_sizeof_pthread_key_t" >&6; } + + + +printf "%s\n" "#define SIZEOF_PTHREAD_KEY_T $ac_cv_sizeof_pthread_key_t" >>confdefs.h + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthread_key_t is compatible with int" >&5 +printf %s "checking whether pthread_key_t is compatible with int... " >&6; } if test "$ac_cv_sizeof_pthread_key_t" -eq "$ac_cv_sizeof_int" ; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <pthread.h> int @@ -9329,12 +10428,12 @@ if test "$ac_cv_sizeof_pthread_key_t" -eq "$ac_cv_sizeof_int" ; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <pthread.h> int -main () +main (void) { pthread_key_t k; k * 1; ; return 0; } _ACEOF @@ -9335,8 +10434,9 @@ { pthread_key_t k; k * 1; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_pthread_key_t_is_arithmetic_type=yes @@ -9342,5 +10442,5 @@ ac_pthread_key_t_is_arithmetic_type=yes -else +else $as_nop ac_pthread_key_t_is_arithmetic_type=no fi @@ -9344,8 +10444,8 @@ ac_pthread_key_t_is_arithmetic_type=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pthread_key_t_is_arithmetic_type" >&5 -$as_echo "$ac_pthread_key_t_is_arithmetic_type" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pthread_key_t_is_arithmetic_type" >&5 +printf "%s\n" "$ac_pthread_key_t_is_arithmetic_type" >&6; } if test "$ac_pthread_key_t_is_arithmetic_type" = yes ; then @@ -9350,11 +10450,11 @@ if test "$ac_pthread_key_t_is_arithmetic_type" = yes ; then -$as_echo "#define PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT 1" >>confdefs.h - - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +printf "%s\n" "#define PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT 1" >>confdefs.h + + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi CC="$ac_save_cc" @@ -9388,5 +10488,6 @@ else LIBTOOL_CRUFT="" fi - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : ac_osx_32bit=yes @@ -9392,5 +10493,5 @@ ac_osx_32bit=yes -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9405,5 +10506,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_osx_32bit=yes @@ -9409,5 +10511,5 @@ ac_osx_32bit=yes -else +else $as_nop ac_osx_32bit=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -9449,11 +10551,11 @@ LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-framework" >&5 -$as_echo_n "checking for --enable-framework... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --enable-framework" >&5 +printf %s "checking for --enable-framework... " >&6; } if test "$enable_framework" then BASECFLAGS="$BASECFLAGS -fno-common -dynamic" # -F. is needed to allow linking to the framework while # in the build location. @@ -9454,15 +10556,15 @@ if test "$enable_framework" then BASECFLAGS="$BASECFLAGS -fno-common -dynamic" # -F. is needed to allow linking to the framework while # in the build location. -$as_echo "#define WITH_NEXT_FRAMEWORK 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +printf "%s\n" "#define WITH_NEXT_FRAMEWORK 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } if test $enable_shared = "yes" then as_fn_error $? "Specifying both --enable-shared and --enable-framework is not supported, use only --enable-framework instead" "$LINENO" 5 fi else @@ -9464,14 +10566,14 @@ if test $enable_shared = "yes" then as_fn_error $? "Specifying both --enable-shared and --enable-framework is not supported, use only --enable-framework instead" "$LINENO" 5 fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dyld" >&5 -$as_echo_n "checking for dyld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dyld" >&5 +printf %s "checking for dyld... " >&6; } case $ac_sys_system/$ac_sys_release in Darwin/*) @@ -9475,9 +10577,9 @@ case $ac_sys_system/$ac_sys_release in Darwin/*) -$as_echo "#define WITH_DYLD 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: always on for Darwin" >&5 -$as_echo "always on for Darwin" >&6; } +printf "%s\n" "#define WITH_DYLD 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: always on for Darwin" >&5 +printf "%s\n" "always on for Darwin" >&6; } ;; *) @@ -9482,7 +10584,7 @@ ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; esac @@ -9496,8 +10598,8 @@ # SHLIB_SUFFIX is the extension of shared libraries `(including the dot!) # -- usually .so, .sl on HP-UX, .dll on Cygwin -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the extension of shared libraries" >&5 -$as_echo_n "checking the extension of shared libraries... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the extension of shared libraries" >&5 +printf %s "checking the extension of shared libraries... " >&6; } if test -z "$SHLIB_SUFFIX"; then case $ac_sys_system in hp*|HP*) @@ -9510,10 +10612,10 @@ *) SHLIB_SUFFIX=.so;; esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHLIB_SUFFIX" >&5 -$as_echo "$SHLIB_SUFFIX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SHLIB_SUFFIX" >&5 +printf "%s\n" "$SHLIB_SUFFIX" >&6; } # LDSHARED is the ld *command* used to create shared library # -- "cc -G" on SunOS 5.x. # (Shared libraries in this instance are shared modules to be loaded into # Python, as opposed to building Python itself as a shared library.) @@ -9515,10 +10617,10 @@ # LDSHARED is the ld *command* used to create shared library # -- "cc -G" on SunOS 5.x. # (Shared libraries in this instance are shared modules to be loaded into # Python, as opposed to building Python itself as a shared library.) -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LDSHARED" >&5 -$as_echo_n "checking LDSHARED... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking LDSHARED" >&5 +printf %s "checking LDSHARED... " >&6; } if test -z "$LDSHARED" then case $ac_sys_system/$ac_sys_release in @@ -9648,9 +10750,9 @@ *) LDSHARED="ld";; esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDSHARED" >&5 -$as_echo "$LDSHARED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LDSHARED" >&5 +printf "%s\n" "$LDSHARED" >&6; } LDCXXSHARED=${LDCXXSHARED-$LDSHARED} BLDSHARED=${BLDSHARED-$LDSHARED} # CCSHARED are the C *flags* used to create objects to go into a shared # library (module) -- this is only needed for a few systems @@ -9653,9 +10755,9 @@ LDCXXSHARED=${LDCXXSHARED-$LDSHARED} BLDSHARED=${BLDSHARED-$LDSHARED} # CCSHARED are the C *flags* used to create objects to go into a shared # library (module) -- this is only needed for a few systems -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CCSHARED" >&5 -$as_echo_n "checking CCSHARED... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking CCSHARED" >&5 +printf %s "checking CCSHARED... " >&6; } if test -z "$CCSHARED" then case $ac_sys_system/$ac_sys_release in @@ -9686,7 +10788,7 @@ CCSHARED="-fpic -D__SO_PICABILINUX__ -ftls-model=global-dynamic" esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CCSHARED" >&5 -$as_echo "$CCSHARED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CCSHARED" >&5 +printf "%s\n" "$CCSHARED" >&6; } # LINKFORSHARED are the flags passed to the $(CC) command that links # the python executable -- this is only needed for a few systems @@ -9691,7 +10793,7 @@ # LINKFORSHARED are the flags passed to the $(CC) command that links # the python executable -- this is only needed for a few systems -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LINKFORSHARED" >&5 -$as_echo_n "checking LINKFORSHARED... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking LINKFORSHARED" >&5 +printf %s "checking LINKFORSHARED... " >&6; } if test -z "$LINKFORSHARED" then case $ac_sys_system/$ac_sys_release in @@ -9748,13 +10850,13 @@ LINKFORSHARED='-Wl,-export-dynamic';; esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINKFORSHARED" >&5 -$as_echo "$LINKFORSHARED" >&6; } - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CFLAGSFORSHARED" >&5 -$as_echo_n "checking CFLAGSFORSHARED... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LINKFORSHARED" >&5 +printf "%s\n" "$LINKFORSHARED" >&6; } + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking CFLAGSFORSHARED" >&5 +printf %s "checking CFLAGSFORSHARED... " >&6; } if test ! "$LIBRARY" = "$LDLIBRARY" then case $ac_sys_system in @@ -9766,8 +10868,8 @@ CFLAGSFORSHARED='$(CCSHARED)' esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CFLAGSFORSHARED" >&5 -$as_echo "$CFLAGSFORSHARED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CFLAGSFORSHARED" >&5 +printf "%s\n" "$CFLAGSFORSHARED" >&6; } # SHLIBS are libraries (except -lc and -lm) to link to the python shared # library (with --enable-shared). @@ -9778,9 +10880,9 @@ # don't need to link LIBS explicitly. The default should be only changed # on systems where this approach causes problems. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SHLIBS" >&5 -$as_echo_n "checking SHLIBS... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking SHLIBS" >&5 +printf %s "checking SHLIBS... " >&6; } case "$ac_sys_system" in *) SHLIBS='$(LIBS)';; esac @@ -9783,9 +10885,9 @@ case "$ac_sys_system" in *) SHLIBS='$(LIBS)';; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHLIBS" >&5 -$as_echo "$SHLIBS" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SHLIBS" >&5 +printf "%s\n" "$SHLIBS" >&6; } # checks for libraries @@ -9789,11 +10891,12 @@ # checks for libraries -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sendfile in -lsendfile" >&5 -$as_echo_n "checking for sendfile in -lsendfile... " >&6; } -if ${ac_cv_lib_sendfile_sendfile+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sendfile in -lsendfile" >&5 +printf %s "checking for sendfile in -lsendfile... " >&6; } +if test ${ac_cv_lib_sendfile_sendfile+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsendfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9802,8 +10905,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char sendfile (); int @@ -9808,9 +10908,9 @@ char sendfile (); int -main () +main (void) { return sendfile (); ; return 0; } _ACEOF @@ -9811,8 +10911,9 @@ { return sendfile (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_sendfile_sendfile=yes @@ -9818,4 +10919,4 @@ ac_cv_lib_sendfile_sendfile=yes -else +else $as_nop ac_cv_lib_sendfile_sendfile=no fi @@ -9820,6 +10921,6 @@ ac_cv_lib_sendfile_sendfile=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -9823,14 +10924,13 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sendfile_sendfile" >&5 -$as_echo "$ac_cv_lib_sendfile_sendfile" >&6; } -if test "x$ac_cv_lib_sendfile_sendfile" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBSENDFILE 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sendfile_sendfile" >&5 +printf "%s\n" "$ac_cv_lib_sendfile_sendfile" >&6; } +if test "x$ac_cv_lib_sendfile_sendfile" = xyes +then : + printf "%s\n" "#define HAVE_LIBSENDFILE 1" >>confdefs.h LIBS="-lsendfile $LIBS" fi @@ -9832,13 +10932,14 @@ LIBS="-lsendfile $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9847,8 +10948,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int @@ -9853,9 +10951,9 @@ char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF @@ -9856,8 +10954,9 @@ { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes @@ -9863,4 +10962,4 @@ ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi @@ -9865,6 +10964,6 @@ ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -9868,14 +10967,13 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBDL 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : + printf "%s\n" "#define HAVE_LIBDL 1" >>confdefs.h LIBS="-ldl $LIBS" fi # Dynamic linking for SunOS/Solaris and SYSV @@ -9877,13 +10975,14 @@ LIBS="-ldl $LIBS" fi # Dynamic linking for SunOS/Solaris and SYSV -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +printf %s "checking for shl_load in -ldld... " >&6; } +if test ${ac_cv_lib_dld_shl_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9892,8 +10991,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char shl_load (); int @@ -9898,9 +10994,9 @@ char shl_load (); int -main () +main (void) { return shl_load (); ; return 0; } _ACEOF @@ -9901,8 +10997,9 @@ { return shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_shl_load=yes @@ -9908,4 +11005,4 @@ ac_cv_lib_dld_shl_load=yes -else +else $as_nop ac_cv_lib_dld_shl_load=no fi @@ -9910,6 +11007,6 @@ ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -9913,12 +11010,11 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBDLD 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes +then : + printf "%s\n" "#define HAVE_LIBDLD 1" >>confdefs.h LIBS="-ldld $LIBS" @@ -9926,23 +11022,23 @@ # Dynamic linking for HP-UX # checks for uuid.h location -for ac_header in uuid/uuid.h uuid.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_time_safe" >&5 -$as_echo_n "checking for uuid_generate_time_safe... " >&6; } +ac_fn_c_check_header_compile "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" +if test "x$ac_cv_header_uuid_uuid_h" = xyes +then : + printf "%s\n" "#define HAVE_UUID_UUID_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default" +if test "x$ac_cv_header_uuid_h" = xyes +then : + printf "%s\n" "#define HAVE_UUID_H 1" >>confdefs.h + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uuid_generate_time_safe" >&5 +printf %s "checking for uuid_generate_time_safe... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <uuid/uuid.h> int @@ -9945,8 +11041,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <uuid/uuid.h> int -main () +main (void) { #ifndef uuid_generate_time_safe @@ -9957,18 +11053,19 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_UUID_GENERATE_TIME_SAFE 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_UUID_GENERATE_TIME_SAFE 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007) # FreeBSD and OpenBSD provides support as well @@ -9972,9 +11069,9 @@ # AIX provides support for RFC4122 (uuid) in libc.a starting with AIX 6.1 (anno 2007) # FreeBSD and OpenBSD provides support as well -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_create" >&5 -$as_echo_n "checking for uuid_create... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uuid_create" >&5 +printf %s "checking for uuid_create... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <uuid.h> int @@ -9977,8 +11074,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <uuid.h> int -main () +main (void) { #ifndef uuid_create @@ -9989,18 +11086,19 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_UUID_CREATE 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_UUID_CREATE 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet # stream in big-endian byte-order @@ -10004,9 +11102,9 @@ # Little-endian FreeBSD, OpenBSD and NetBSD needs encoding into an octet # stream in big-endian byte-order -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_enc_be" >&5 -$as_echo_n "checking for uuid_enc_be... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uuid_enc_be" >&5 +printf %s "checking for uuid_enc_be... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <uuid.h> int @@ -10009,8 +11107,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <uuid.h> int -main () +main (void) { #ifndef uuid_enc_be @@ -10021,19 +11119,20 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_UUID_ENC_BE 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_UUID_ENC_BE 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # 'Real Time' functions on Solaris # posix4 on Solaris 2.6 # pthread (first!) on Linux @@ -10036,12 +11135,13 @@ # 'Real Time' functions on Solaris # posix4 on Solaris 2.6 # pthread (first!) on Linux -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5 -$as_echo_n "checking for library containing sem_init... " >&6; } -if ${ac_cv_search_sem_init+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing sem_init" >&5 +printf %s "checking for library containing sem_init... " >&6; } +if test ${ac_cv_search_sem_init+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10049,8 +11149,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char sem_init (); int @@ -10055,9 +11152,9 @@ char sem_init (); int -main () +main (void) { return sem_init (); ; return 0; } _ACEOF @@ -10058,13 +11155,14 @@ { return sem_init (); ; return 0; } _ACEOF -for ac_lib in '' pthread rt posix4; do +for ac_lib in '' pthread rt posix4 +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi @@ -10065,9 +11163,10 @@ if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_sem_init=$ac_res fi @@ -10072,4 +11171,4 @@ ac_cv_search_sem_init=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext @@ -10075,5 +11174,6 @@ conftest$ac_exeext - if ${ac_cv_search_sem_init+:} false; then : + if test ${ac_cv_search_sem_init+y} +then : break fi done @@ -10077,11 +11177,12 @@ break fi done -if ${ac_cv_search_sem_init+:} false; then : - -else +if test ${ac_cv_search_sem_init+y} +then : + +else $as_nop ac_cv_search_sem_init=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi @@ -10083,8 +11184,8 @@ ac_cv_search_sem_init=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_init" >&5 -$as_echo "$ac_cv_search_sem_init" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sem_init" >&5 +printf "%s\n" "$ac_cv_search_sem_init" >&6; } ac_res=$ac_cv_search_sem_init @@ -10090,8 +11191,9 @@ ac_res=$ac_cv_search_sem_init -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # check if we need libintl for locale functions @@ -10092,14 +11194,15 @@ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # check if we need libintl for locale functions -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for textdomain in -lintl" >&5 -$as_echo_n "checking for textdomain in -lintl... " >&6; } -if ${ac_cv_lib_intl_textdomain+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for textdomain in -lintl" >&5 +printf %s "checking for textdomain in -lintl... " >&6; } +if test ${ac_cv_lib_intl_textdomain+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -10108,8 +11211,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char textdomain (); int @@ -10114,9 +11214,9 @@ char textdomain (); int -main () +main (void) { return textdomain (); ; return 0; } _ACEOF @@ -10117,8 +11217,9 @@ { return textdomain (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_intl_textdomain=yes @@ -10124,4 +11225,4 @@ ac_cv_lib_intl_textdomain=yes -else +else $as_nop ac_cv_lib_intl_textdomain=no fi @@ -10126,6 +11227,6 @@ ac_cv_lib_intl_textdomain=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -10129,11 +11230,12 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_textdomain" >&5 -$as_echo "$ac_cv_lib_intl_textdomain" >&6; } -if test "x$ac_cv_lib_intl_textdomain" = xyes; then : - -$as_echo "#define WITH_LIBINTL 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_textdomain" >&5 +printf "%s\n" "$ac_cv_lib_intl_textdomain" >&6; } +if test "x$ac_cv_lib_intl_textdomain" = xyes +then : + +printf "%s\n" "#define WITH_LIBINTL 1" >>confdefs.h LIBS="-lintl $LIBS" fi @@ -10141,10 +11243,10 @@ # checks for system dependent C++ extensions support case "$ac_sys_system" in - AIX*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for genuine AIX C++ extensions support" >&5 -$as_echo_n "checking for genuine AIX C++ extensions support... " >&6; } + AIX*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for genuine AIX C++ extensions support" >&5 +printf %s "checking for genuine AIX C++ extensions support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <load.h> int @@ -10146,9 +11248,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <load.h> int -main () +main (void) { loadAndInit("", 0, "") ; @@ -10156,22 +11258,23 @@ } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - -$as_echo "#define AIX_GENUINE_CPLUSPLUS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext \ +if ac_fn_c_try_link "$LINENO" +then : + + +printf "%s\n" "#define AIX_GENUINE_CPLUSPLUS 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # BUILD_GNU_TYPE + AIX_BUILDDATE are used to construct the platform_tag # of the AIX system used to build/package Python executable. This tag serves # as a baseline for bdist module packages @@ -10174,8 +11277,8 @@ conftest$ac_exeext conftest.$ac_ext # BUILD_GNU_TYPE + AIX_BUILDDATE are used to construct the platform_tag # of the AIX system used to build/package Python executable. This tag serves # as a baseline for bdist module packages - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the system builddate" >&5 -$as_echo_n "checking for the system builddate... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the system builddate" >&5 +printf %s "checking for the system builddate... " >&6; } AIX_BUILDDATE=$(lslpp -Lcq bos.mp64 | awk -F: '{ print $NF }') @@ -10180,13 +11283,11 @@ AIX_BUILDDATE=$(lslpp -Lcq bos.mp64 | awk -F: '{ print $NF }') -cat >>confdefs.h <<_ACEOF -#define AIX_BUILDDATE $AIX_BUILDDATE -_ACEOF - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AIX_BUILDDATE" >&5 -$as_echo "$AIX_BUILDDATE" >&6; } +printf "%s\n" "#define AIX_BUILDDATE $AIX_BUILDDATE" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AIX_BUILDDATE" >&5 +printf "%s\n" "$AIX_BUILDDATE" >&6; } ;; *) ;; esac # check for systems that require aligned memory access @@ -10188,12 +11289,14 @@ ;; *) ;; esac # check for systems that require aligned memory access -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking aligned memory access is required" >&5 -$as_echo_n "checking aligned memory access is required... " >&6; } -if ${ac_cv_aligned_required+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking aligned memory access is required" >&5 +printf %s "checking aligned memory access is required... " >&6; } +if test ${ac_cv_aligned_required+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_aligned_required=yes @@ -10199,5 +11302,5 @@ ac_cv_aligned_required=yes -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10214,5 +11317,6 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_aligned_required=no @@ -10218,5 +11322,5 @@ ac_cv_aligned_required=no -else +else $as_nop ac_cv_aligned_required=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -10226,7 +11330,7 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_aligned_required" >&5 -$as_echo "$ac_cv_aligned_required" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_aligned_required" >&5 +printf "%s\n" "$ac_cv_aligned_required" >&6; } if test "$ac_cv_aligned_required" = yes ; then @@ -10231,9 +11335,9 @@ if test "$ac_cv_aligned_required" = yes ; then -$as_echo "#define HAVE_ALIGNED_REQUIRED 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALIGNED_REQUIRED 1" >>confdefs.h fi # str, bytes and memoryview hash algorithm @@ -10234,10 +11338,10 @@ fi # str, bytes and memoryview hash algorithm -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-hash-algorithm" >&5 -$as_echo_n "checking for --with-hash-algorithm... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-hash-algorithm" >&5 +printf %s "checking for --with-hash-algorithm... " >&6; } # Check whether --with-hash_algorithm was given. @@ -10242,4 +11346,5 @@ # Check whether --with-hash_algorithm was given. -if test "${with_hash_algorithm+set}" = set; then : +if test ${with_hash_algorithm+y} +then : withval=$with_hash_algorithm; @@ -10245,5 +11350,5 @@ withval=$with_hash_algorithm; -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 -$as_echo "$withval" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +printf "%s\n" "$withval" >&6; } case "$withval" in siphash24) @@ -10248,6 +11353,6 @@ case "$withval" in siphash24) - $as_echo "#define Py_HASH_ALGORITHM 1" >>confdefs.h + printf "%s\n" "#define Py_HASH_ALGORITHM 1" >>confdefs.h ;; fnv) @@ -10251,7 +11356,7 @@ ;; fnv) - $as_echo "#define Py_HASH_ALGORITHM 2" >>confdefs.h + printf "%s\n" "#define Py_HASH_ALGORITHM 2" >>confdefs.h ;; *) @@ -10259,9 +11364,9 @@ ;; esac -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5 -$as_echo "default" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: default" >&5 +printf "%s\n" "default" >&6; } fi @@ -10280,7 +11385,7 @@ } TZPATH="/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/zoneinfo" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-tzpath" >&5 -$as_echo_n "checking for --with-tzpath... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-tzpath" >&5 +printf %s "checking for --with-tzpath... " >&6; } # Check whether --with-tzpath was given. @@ -10285,6 +11390,7 @@ # Check whether --with-tzpath was given. -if test "${with_tzpath+set}" = set; then : +if test ${with_tzpath+y} +then : withval=$with_tzpath; case "$withval" in yes) @@ -10293,8 +11399,8 @@ *) validate_tzpath "$withval" TZPATH="$withval" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$withval\"" >&5 -$as_echo "\"$withval\"" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$withval\"" >&5 +printf "%s\n" "\"$withval\"" >&6; } ;; esac @@ -10298,5 +11404,5 @@ ;; esac -else +else $as_nop validate_tzpath "$TZPATH" @@ -10302,11 +11408,11 @@ validate_tzpath "$TZPATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$TZPATH\"" >&5 -$as_echo "\"$TZPATH\"" >&6; } -fi - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-address-sanitizer" >&5 -$as_echo_n "checking for --with-address-sanitizer... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$TZPATH\"" >&5 +printf "%s\n" "\"$TZPATH\"" >&6; } +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-address-sanitizer" >&5 +printf %s "checking for --with-address-sanitizer... " >&6; } # Check whether --with-address_sanitizer was given. @@ -10311,4 +11417,5 @@ # Check whether --with-address_sanitizer was given. -if test "${with_address_sanitizer+set}" = set; then : +if test ${with_address_sanitizer+y} +then : withval=$with_address_sanitizer; @@ -10314,8 +11421,8 @@ withval=$with_address_sanitizer; -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 -$as_echo "$withval" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +printf "%s\n" "$withval" >&6; } BASECFLAGS="-fsanitize=address -fno-omit-frame-pointer $BASECFLAGS" LDFLAGS="-fsanitize=address $LDFLAGS" # ASan works by controlling memory allocation, our own malloc interferes. with_pymalloc="no" @@ -10317,15 +11424,15 @@ BASECFLAGS="-fsanitize=address -fno-omit-frame-pointer $BASECFLAGS" LDFLAGS="-fsanitize=address $LDFLAGS" # ASan works by controlling memory allocation, our own malloc interferes. with_pymalloc="no" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-memory-sanitizer" >&5 -$as_echo_n "checking for --with-memory-sanitizer... " >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-memory-sanitizer" >&5 +printf %s "checking for --with-memory-sanitizer... " >&6; } # Check whether --with-memory_sanitizer was given. @@ -10330,4 +11437,5 @@ # Check whether --with-memory_sanitizer was given. -if test "${with_memory_sanitizer+set}" = set; then : +if test ${with_memory_sanitizer+y} +then : withval=$with_memory_sanitizer; @@ -10333,8 +11441,8 @@ withval=$with_memory_sanitizer; -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 -$as_echo "$withval" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +printf "%s\n" "$withval" >&6; } BASECFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer $BASECFLAGS" LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 $LDFLAGS" # MSan works by controlling memory allocation, our own malloc interferes. with_pymalloc="no" @@ -10336,15 +11444,15 @@ BASECFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer $BASECFLAGS" LDFLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 $LDFLAGS" # MSan works by controlling memory allocation, our own malloc interferes. with_pymalloc="no" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-undefined-behavior-sanitizer" >&5 -$as_echo_n "checking for --with-undefined-behavior-sanitizer... " >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-undefined-behavior-sanitizer" >&5 +printf %s "checking for --with-undefined-behavior-sanitizer... " >&6; } # Check whether --with-undefined_behavior_sanitizer was given. @@ -10349,4 +11457,5 @@ # Check whether --with-undefined_behavior_sanitizer was given. -if test "${with_undefined_behavior_sanitizer+set}" = set; then : +if test ${with_undefined_behavior_sanitizer+y} +then : withval=$with_undefined_behavior_sanitizer; @@ -10352,6 +11461,6 @@ withval=$with_undefined_behavior_sanitizer; -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 -$as_echo "$withval" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +printf "%s\n" "$withval" >&6; } BASECFLAGS="-fsanitize=undefined $BASECFLAGS" LDFLAGS="-fsanitize=undefined $LDFLAGS" @@ -10355,10 +11464,10 @@ BASECFLAGS="-fsanitize=undefined $BASECFLAGS" LDFLAGS="-fsanitize=undefined $LDFLAGS" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. @@ -10361,12 +11470,13 @@ fi # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for t_open in -lnsl" >&5 -$as_echo_n "checking for t_open in -lnsl... " >&6; } -if ${ac_cv_lib_nsl_t_open+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for t_open in -lnsl" >&5 +printf %s "checking for t_open in -lnsl... " >&6; } +if test ${ac_cv_lib_nsl_t_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -10375,8 +11485,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char t_open (); int @@ -10381,9 +11488,9 @@ char t_open (); int -main () +main (void) { return t_open (); ; return 0; } _ACEOF @@ -10384,8 +11491,9 @@ { return t_open (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_nsl_t_open=yes @@ -10391,4 +11499,4 @@ ac_cv_lib_nsl_t_open=yes -else +else $as_nop ac_cv_lib_nsl_t_open=no fi @@ -10393,6 +11501,6 @@ ac_cv_lib_nsl_t_open=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -10396,9 +11504,10 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_t_open" >&5 -$as_echo "$ac_cv_lib_nsl_t_open" >&6; } -if test "x$ac_cv_lib_nsl_t_open" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_t_open" >&5 +printf "%s\n" "$ac_cv_lib_nsl_t_open" >&6; } +if test "x$ac_cv_lib_nsl_t_open" = xyes +then : LIBS="-lnsl $LIBS" fi # SVR4 @@ -10402,11 +11511,12 @@ LIBS="-lnsl $LIBS" fi # SVR4 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 -$as_echo_n "checking for socket in -lsocket... " >&6; } -if ${ac_cv_lib_socket_socket+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 +printf %s "checking for socket in -lsocket... " >&6; } +if test ${ac_cv_lib_socket_socket+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -10415,8 +11525,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char socket (); int @@ -10421,9 +11528,9 @@ char socket (); int -main () +main (void) { return socket (); ; return 0; } _ACEOF @@ -10424,8 +11531,9 @@ { return socket (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_socket_socket=yes @@ -10431,4 +11539,4 @@ ac_cv_lib_socket_socket=yes -else +else $as_nop ac_cv_lib_socket_socket=no fi @@ -10433,6 +11541,6 @@ ac_cv_lib_socket_socket=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -10436,10 +11544,11 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 -$as_echo "$ac_cv_lib_socket_socket" >&6; } -if test "x$ac_cv_lib_socket_socket" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 +printf "%s\n" "$ac_cv_lib_socket_socket" >&6; } +if test "x$ac_cv_lib_socket_socket" = xyes +then : LIBS="-lsocket $LIBS" fi # SVR4 sockets @@ -10442,8 +11551,8 @@ LIBS="-lsocket $LIBS" fi # SVR4 sockets -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-libs" >&5 -$as_echo_n "checking for --with-libs... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-libs" >&5 +printf %s "checking for --with-libs... " >&6; } # Check whether --with-libs was given. @@ -10448,4 +11557,5 @@ # Check whether --with-libs was given. -if test "${with_libs+set}" = set; then : +if test ${with_libs+y} +then : withval=$with_libs; @@ -10451,5 +11561,5 @@ withval=$with_libs; -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 -$as_echo "$withval" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +printf "%s\n" "$withval" >&6; } LIBS="$withval $LIBS" @@ -10454,8 +11564,8 @@ LIBS="$withval $LIBS" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10470,11 +11580,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. @@ -10484,5 +11595,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -10488,7 +11603,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10500,11 +11615,11 @@ fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf "%s\n" "$PKG_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10513,11 +11628,12 @@ ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. @@ -10527,5 +11643,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -10531,7 +11651,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10543,11 +11663,11 @@ fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then @@ -10555,8 +11675,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG @@ -10568,6 +11688,6 @@ fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then @@ -10573,4 +11693,4 @@ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else @@ -10576,8 +11696,8 @@ else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } PKG_CONFIG="" fi fi # Check for use of the system expat library @@ -10579,9 +11699,9 @@ PKG_CONFIG="" fi fi # Check for use of the system expat library -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-expat" >&5 -$as_echo_n "checking for --with-system-expat... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-system-expat" >&5 +printf %s "checking for --with-system-expat... " >&6; } # Check whether --with-system_expat was given. @@ -10586,4 +11706,5 @@ # Check whether --with-system_expat was given. -if test "${with_system_expat+set}" = set; then : +if test ${with_system_expat+y} +then : withval=$with_system_expat; @@ -10589,6 +11710,6 @@ withval=$with_system_expat; -else +else $as_nop with_system_expat="no" fi @@ -10591,8 +11712,8 @@ with_system_expat="no" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_system_expat" >&5 -$as_echo "$with_system_expat" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_system_expat" >&5 +printf "%s\n" "$with_system_expat" >&6; } # Check for use of the system libffi library @@ -10597,6 +11718,6 @@ # Check for use of the system libffi library -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-ffi" >&5 -$as_echo_n "checking for --with-system-ffi... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-system-ffi" >&5 +printf %s "checking for --with-system-ffi... " >&6; } # Check whether --with-system_ffi was given. @@ -10601,6 +11722,7 @@ # Check whether --with-system_ffi was given. -if test "${with_system_ffi+set}" = set; then : +if test ${with_system_ffi+y} +then : withval=$with_system_ffi; fi @@ -10617,10 +11739,10 @@ as_fn_error $? "--with-system-ffi accepts no arguments" "$LINENO" 5 ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_system_ffi" >&5 -$as_echo "$with_system_ffi" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_system_ffi" >&5 +printf "%s\n" "$with_system_ffi" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } if test "$with_system_ffi" != "" then @@ -10625,7 +11747,7 @@ if test "$with_system_ffi" != "" then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with(out)-system-ffi is ignored on this platform" >&5 -$as_echo "$as_me: WARNING: --with(out)-system-ffi is ignored on this platform" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: --with(out)-system-ffi is ignored on this platform" >&5 +printf "%s\n" "$as_me: WARNING: --with(out)-system-ffi is ignored on this platform" >&2;} fi with_system_ffi="yes" fi @@ -10638,7 +11760,7 @@ # Check for use of the system libmpdec library -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-libmpdec" >&5 -$as_echo_n "checking for --with-system-libmpdec... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-system-libmpdec" >&5 +printf %s "checking for --with-system-libmpdec... " >&6; } # Check whether --with-system_libmpdec was given. @@ -10643,4 +11765,5 @@ # Check whether --with-system_libmpdec was given. -if test "${with_system_libmpdec+set}" = set; then : +if test ${with_system_libmpdec+y} +then : withval=$with_system_libmpdec; @@ -10646,6 +11769,6 @@ withval=$with_system_libmpdec; -else +else $as_nop with_system_libmpdec="no" fi @@ -10648,8 +11771,8 @@ with_system_libmpdec="no" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_system_libmpdec" >&5 -$as_echo "$with_system_libmpdec" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_system_libmpdec" >&5 +printf "%s\n" "$with_system_libmpdec" >&6; } # Check whether _decimal should use a coroutine-local or thread-local context @@ -10654,6 +11777,6 @@ # Check whether _decimal should use a coroutine-local or thread-local context -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-decimal-contextvar" >&5 -$as_echo_n "checking for --with-decimal-contextvar... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-decimal-contextvar" >&5 +printf %s "checking for --with-decimal-contextvar... " >&6; } # Check whether --with-decimal_contextvar was given. @@ -10658,4 +11781,5 @@ # Check whether --with-decimal_contextvar was given. -if test "${with_decimal_contextvar+set}" = set; then : +if test ${with_decimal_contextvar+y} +then : withval=$with_decimal_contextvar; @@ -10661,5 +11785,5 @@ withval=$with_decimal_contextvar; -else +else $as_nop with_decimal_contextvar="yes" fi @@ -10667,11 +11791,11 @@ if test "$with_decimal_contextvar" != "no" then -$as_echo "#define WITH_DECIMAL_CONTEXTVAR 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_decimal_contextvar" >&5 -$as_echo "$with_decimal_contextvar" >&6; } +printf "%s\n" "#define WITH_DECIMAL_CONTEXTVAR 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_decimal_contextvar" >&5 +printf "%s\n" "$with_decimal_contextvar" >&6; } # Check for support for loadable sqlite extensions @@ -10676,5 +11800,5 @@ # Check for support for loadable sqlite extensions -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-loadable-sqlite-extensions" >&5 -$as_echo_n "checking for --enable-loadable-sqlite-extensions... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --enable-loadable-sqlite-extensions" >&5 +printf %s "checking for --enable-loadable-sqlite-extensions... " >&6; } # Check whether --enable-loadable-sqlite-extensions was given. @@ -10680,3 +11804,4 @@ # Check whether --enable-loadable-sqlite-extensions was given. -if test "${enable_loadable_sqlite_extensions+set}" = set; then : +if test ${enable_loadable_sqlite_extensions+y} +then : enableval=$enable_loadable_sqlite_extensions; @@ -10682,6 +11807,6 @@ enableval=$enable_loadable_sqlite_extensions; -else +else $as_nop enable_loadable_sqlite_extensions="no" fi @@ -10684,10 +11809,10 @@ enable_loadable_sqlite_extensions="no" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_loadable_sqlite_extensions" >&5 -$as_echo "$enable_loadable_sqlite_extensions" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_loadable_sqlite_extensions" >&5 +printf "%s\n" "$enable_loadable_sqlite_extensions" >&6; } # Check for --with-tcltk-includes=path and --with-tcltk-libs=path @@ -10690,8 +11815,8 @@ # Check for --with-tcltk-includes=path and --with-tcltk-libs=path -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-tcltk-includes" >&5 -$as_echo_n "checking for --with-tcltk-includes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-tcltk-includes" >&5 +printf %s "checking for --with-tcltk-includes... " >&6; } # Check whether --with-tcltk-includes was given. @@ -10696,4 +11821,5 @@ # Check whether --with-tcltk-includes was given. -if test "${with_tcltk_includes+set}" = set; then : +if test ${with_tcltk_includes+y} +then : withval=$with_tcltk_includes; @@ -10699,5 +11825,5 @@ withval=$with_tcltk_includes; -else +else $as_nop with_tcltk_includes="default" fi @@ -10701,9 +11827,9 @@ with_tcltk_includes="default" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_tcltk_includes" >&5 -$as_echo "$with_tcltk_includes" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-tcltk-libs" >&5 -$as_echo_n "checking for --with-tcltk-libs... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_tcltk_includes" >&5 +printf "%s\n" "$with_tcltk_includes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-tcltk-libs" >&5 +printf %s "checking for --with-tcltk-libs... " >&6; } # Check whether --with-tcltk-libs was given. @@ -10708,4 +11834,5 @@ # Check whether --with-tcltk-libs was given. -if test "${with_tcltk_libs+set}" = set; then : +if test ${with_tcltk_libs+y} +then : withval=$with_tcltk_libs; @@ -10711,5 +11838,5 @@ withval=$with_tcltk_libs; -else +else $as_nop with_tcltk_libs="default" fi @@ -10713,8 +11840,8 @@ with_tcltk_libs="default" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_tcltk_libs" >&5 -$as_echo "$with_tcltk_libs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_tcltk_libs" >&5 +printf "%s\n" "$with_tcltk_libs" >&6; } if test "x$with_tcltk_includes" = xdefault || test "x$with_tcltk_libs" = xdefault then if test "x$with_tcltk_includes" != "x$with_tcltk_libs" @@ -10734,7 +11861,7 @@ fi # Check for --with-dbmliborder -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-dbmliborder" >&5 -$as_echo_n "checking for --with-dbmliborder... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-dbmliborder" >&5 +printf %s "checking for --with-dbmliborder... " >&6; } # Check whether --with-dbmliborder was given. @@ -10739,6 +11866,7 @@ # Check whether --with-dbmliborder was given. -if test "${with_dbmliborder+set}" = set; then : +if test ${with_dbmliborder+y} +then : withval=$with_dbmliborder; if test x$with_dbmliborder = xyes then @@ -10753,8 +11881,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_dbmliborder" >&5 -$as_echo "$with_dbmliborder" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_dbmliborder" >&5 +printf "%s\n" "$with_dbmliborder" >&6; } # Templates for things AC_DEFINEd more than once. # For a single AC_DEFINE, no template is needed. @@ -10763,7 +11891,7 @@ if test "$ac_cv_pthread_is_default" = yes then # Defining _REENTRANT on system with POSIX threads should not hurt. - $as_echo "#define _REENTRANT 1" >>confdefs.h + printf "%s\n" "#define _REENTRANT 1" >>confdefs.h posix_threads=yes if test "$ac_sys_system" = "SunOS"; then @@ -10798,8 +11926,8 @@ # According to the POSIX spec, a pthreads implementation must # define _POSIX_THREADS in unistd.h. Some apparently don't # (e.g. gnu pth with pthread emulation) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _POSIX_THREADS in unistd.h" >&5 -$as_echo_n "checking for _POSIX_THREADS in unistd.h... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _POSIX_THREADS in unistd.h" >&5 +printf %s "checking for _POSIX_THREADS in unistd.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10810,5 +11938,6 @@ _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : + $EGREP "yes" >/dev/null 2>&1 +then : unistd_defines_pthreads=yes @@ -10814,4 +11943,4 @@ unistd_defines_pthreads=yes -else +else $as_nop unistd_defines_pthreads=no fi @@ -10816,14 +11945,14 @@ unistd_defines_pthreads=no fi -rm -f conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $unistd_defines_pthreads" >&5 -$as_echo "$unistd_defines_pthreads" >&6; } - - $as_echo "#define _REENTRANT 1" >>confdefs.h +rm -rf conftest* + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $unistd_defines_pthreads" >&5 +printf "%s\n" "$unistd_defines_pthreads" >&6; } + + printf "%s\n" "#define _REENTRANT 1" >>confdefs.h # Just looking for pthread_create in libpthread is not enough: # on HP/UX, pthread.h renames pthread_create to a different symbol name. # So we really have to include pthread.h, and then link. _libs=$LIBS LIBS="$LIBS -lpthread" @@ -10824,11 +11953,11 @@ # Just looking for pthread_create in libpthread is not enough: # on HP/UX, pthread.h renames pthread_create to a different symbol name. # So we really have to include pthread.h, and then link. _libs=$LIBS LIBS="$LIBS -lpthread" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 +printf %s "checking for pthread_create in -lpthread... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -10837,7 +11966,7 @@ void * start_routine (void *arg) { exit (0); } int -main () +main (void) { pthread_create (NULL, NULL, start_routine, NULL) @@ -10845,9 +11974,10 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } posix_threads=yes @@ -10852,6 +11982,6 @@ posix_threads=yes -else +else $as_nop LIBS=$_libs ac_fn_c_check_func "$LINENO" "pthread_detach" "ac_cv_func_pthread_detach" @@ -10855,7 +11985,8 @@ LIBS=$_libs ac_fn_c_check_func "$LINENO" "pthread_detach" "ac_cv_func_pthread_detach" -if test "x$ac_cv_func_pthread_detach" = xyes; then : +if test "x$ac_cv_func_pthread_detach" = xyes +then : posix_threads=yes @@ -10859,13 +11990,14 @@ posix_threads=yes -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthreads" >&5 -$as_echo_n "checking for pthread_create in -lpthreads... " >&6; } -if ${ac_cv_lib_pthreads_pthread_create+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthreads" >&5 +printf %s "checking for pthread_create in -lpthreads... " >&6; } +if test ${ac_cv_lib_pthreads_pthread_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -10874,8 +12006,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_create (); int @@ -10880,9 +12009,9 @@ char pthread_create (); int -main () +main (void) { return pthread_create (); ; return 0; } _ACEOF @@ -10883,8 +12012,9 @@ { return pthread_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthreads_pthread_create=yes @@ -10890,4 +12020,4 @@ ac_cv_lib_pthreads_pthread_create=yes -else +else $as_nop ac_cv_lib_pthreads_pthread_create=no fi @@ -10892,6 +12022,6 @@ ac_cv_lib_pthreads_pthread_create=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -10895,10 +12025,11 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; } -if test "x$ac_cv_lib_pthreads_pthread_create" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthreads_pthread_create" >&5 +printf "%s\n" "$ac_cv_lib_pthreads_pthread_create" >&6; } +if test "x$ac_cv_lib_pthreads_pthread_create" = xyes +then : posix_threads=yes LIBS="$LIBS -lpthreads" @@ -10901,14 +12032,15 @@ posix_threads=yes LIBS="$LIBS -lpthreads" -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc_r" >&5 -$as_echo_n "checking for pthread_create in -lc_r... " >&6; } -if ${ac_cv_lib_c_r_pthread_create+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lc_r" >&5 +printf %s "checking for pthread_create in -lc_r... " >&6; } +if test ${ac_cv_lib_c_r_pthread_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -10917,8 +12049,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_create (); int @@ -10923,9 +12052,9 @@ char pthread_create (); int -main () +main (void) { return pthread_create (); ; return 0; } _ACEOF @@ -10926,8 +12055,9 @@ { return pthread_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_c_r_pthread_create=yes @@ -10933,4 +12063,4 @@ ac_cv_lib_c_r_pthread_create=yes -else +else $as_nop ac_cv_lib_c_r_pthread_create=no fi @@ -10935,6 +12065,6 @@ ac_cv_lib_c_r_pthread_create=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -10938,10 +12068,11 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_create" >&5 -$as_echo "$ac_cv_lib_c_r_pthread_create" >&6; } -if test "x$ac_cv_lib_c_r_pthread_create" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_create" >&5 +printf "%s\n" "$ac_cv_lib_c_r_pthread_create" >&6; } +if test "x$ac_cv_lib_c_r_pthread_create" = xyes +then : posix_threads=yes LIBS="$LIBS -lc_r" @@ -10944,14 +12075,15 @@ posix_threads=yes LIBS="$LIBS -lc_r" -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __pthread_create_system in -lpthread" >&5 -$as_echo_n "checking for __pthread_create_system in -lpthread... " >&6; } -if ${ac_cv_lib_pthread___pthread_create_system+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __pthread_create_system in -lpthread" >&5 +printf %s "checking for __pthread_create_system in -lpthread... " >&6; } +if test ${ac_cv_lib_pthread___pthread_create_system+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -10960,8 +12092,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char __pthread_create_system (); int @@ -10966,9 +12095,9 @@ char __pthread_create_system (); int -main () +main (void) { return __pthread_create_system (); ; return 0; } _ACEOF @@ -10969,8 +12098,9 @@ { return __pthread_create_system (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_pthread___pthread_create_system=yes @@ -10976,4 +12106,4 @@ ac_cv_lib_pthread___pthread_create_system=yes -else +else $as_nop ac_cv_lib_pthread___pthread_create_system=no fi @@ -10978,6 +12108,6 @@ ac_cv_lib_pthread___pthread_create_system=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -10981,10 +12111,11 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_create_system" >&5 -$as_echo "$ac_cv_lib_pthread___pthread_create_system" >&6; } -if test "x$ac_cv_lib_pthread___pthread_create_system" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread___pthread_create_system" >&5 +printf "%s\n" "$ac_cv_lib_pthread___pthread_create_system" >&6; } +if test "x$ac_cv_lib_pthread___pthread_create_system" = xyes +then : posix_threads=yes LIBS="$LIBS -lpthread" @@ -10987,14 +12118,15 @@ posix_threads=yes LIBS="$LIBS -lpthread" -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lcma" >&5 -$as_echo_n "checking for pthread_create in -lcma... " >&6; } -if ${ac_cv_lib_cma_pthread_create+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lcma" >&5 +printf %s "checking for pthread_create in -lcma... " >&6; } +if test ${ac_cv_lib_cma_pthread_create+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcma $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -11003,8 +12135,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_create (); int @@ -11009,9 +12138,9 @@ char pthread_create (); int -main () +main (void) { return pthread_create (); ; return 0; } _ACEOF @@ -11012,8 +12141,9 @@ { return pthread_create (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_cma_pthread_create=yes @@ -11019,4 +12149,4 @@ ac_cv_lib_cma_pthread_create=yes -else +else $as_nop ac_cv_lib_cma_pthread_create=no fi @@ -11021,6 +12151,6 @@ ac_cv_lib_cma_pthread_create=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -11024,10 +12154,11 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cma_pthread_create" >&5 -$as_echo "$ac_cv_lib_cma_pthread_create" >&6; } -if test "x$ac_cv_lib_cma_pthread_create" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cma_pthread_create" >&5 +printf "%s\n" "$ac_cv_lib_cma_pthread_create" >&6; } +if test "x$ac_cv_lib_cma_pthread_create" = xyes +then : posix_threads=yes LIBS="$LIBS -lcma" @@ -11030,8 +12161,8 @@ posix_threads=yes LIBS="$LIBS -lcma" -else +else $as_nop as_fn_error $? "could not find pthreads on your system" "$LINENO" 5 @@ -11047,14 +12178,15 @@ fi fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for usconfig in -lmpc" >&5 -$as_echo_n "checking for usconfig in -lmpc... " >&6; } -if ${ac_cv_lib_mpc_usconfig+:} false; then : - $as_echo_n "(cached) " >&6 -else +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for usconfig in -lmpc" >&5 +printf %s "checking for usconfig in -lmpc... " >&6; } +if test ${ac_cv_lib_mpc_usconfig+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lmpc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -11063,8 +12195,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char usconfig (); int @@ -11069,9 +12198,9 @@ char usconfig (); int -main () +main (void) { return usconfig (); ; return 0; } _ACEOF @@ -11072,8 +12201,9 @@ { return usconfig (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_mpc_usconfig=yes @@ -11079,4 +12209,4 @@ ac_cv_lib_mpc_usconfig=yes -else +else $as_nop ac_cv_lib_mpc_usconfig=no fi @@ -11081,6 +12211,6 @@ ac_cv_lib_mpc_usconfig=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -11084,9 +12214,10 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpc_usconfig" >&5 -$as_echo "$ac_cv_lib_mpc_usconfig" >&6; } -if test "x$ac_cv_lib_mpc_usconfig" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpc_usconfig" >&5 +printf "%s\n" "$ac_cv_lib_mpc_usconfig" >&6; } +if test "x$ac_cv_lib_mpc_usconfig" = xyes +then : LIBS="$LIBS -lmpc" @@ -11098,10 +12229,10 @@ if test "$posix_threads" = "yes"; then if test "$unistd_defines_pthreads" = "no"; then -$as_echo "#define _POSIX_THREADS 1" >>confdefs.h +printf "%s\n" "#define _POSIX_THREADS 1" >>confdefs.h fi # Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8. case $ac_sys_system/$ac_sys_release in SunOS/5.6) @@ -11102,10 +12233,10 @@ fi # Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8. case $ac_sys_system/$ac_sys_release in SunOS/5.6) -$as_echo "#define HAVE_PTHREAD_DESTRUCTOR 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD_DESTRUCTOR 1" >>confdefs.h ;; SunOS/5.8) @@ -11109,7 +12240,7 @@ ;; SunOS/5.8) -$as_echo "#define HAVE_BROKEN_POSIX_SEMAPHORES 1" >>confdefs.h +printf "%s\n" "#define HAVE_BROKEN_POSIX_SEMAPHORES 1" >>confdefs.h ;; AIX/*) @@ -11113,8 +12244,8 @@ ;; AIX/*) -$as_echo "#define HAVE_BROKEN_POSIX_SEMAPHORES 1" >>confdefs.h +printf "%s\n" "#define HAVE_BROKEN_POSIX_SEMAPHORES 1" >>confdefs.h ;; esac @@ -11117,11 +12248,13 @@ ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 -$as_echo_n "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; } - if ${ac_cv_pthread_system_supported+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 +printf %s "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; } + if test ${ac_cv_pthread_system_supported+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_pthread_system_supported=no @@ -11127,5 +12260,5 @@ ac_cv_pthread_system_supported=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11143,5 +12276,6 @@ return (0); } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_pthread_system_supported=yes @@ -11147,5 +12281,5 @@ ac_cv_pthread_system_supported=yes -else +else $as_nop ac_cv_pthread_system_supported=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -11155,7 +12289,7 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread_system_supported" >&5 -$as_echo "$ac_cv_pthread_system_supported" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_pthread_system_supported" >&5 +printf "%s\n" "$ac_cv_pthread_system_supported" >&6; } if test "$ac_cv_pthread_system_supported" = "yes"; then @@ -11160,5 +12294,5 @@ if test "$ac_cv_pthread_system_supported" = "yes"; then -$as_echo "#define PTHREAD_SYSTEM_SCHED_SUPPORTED 1" >>confdefs.h +printf "%s\n" "#define PTHREAD_SYSTEM_SCHED_SUPPORTED 1" >>confdefs.h fi @@ -11163,5 +12297,6 @@ fi - for ac_func in pthread_sigmask + + for ac_func in pthread_sigmask do : ac_fn_c_check_func "$LINENO" "pthread_sigmask" "ac_cv_func_pthread_sigmask" @@ -11166,9 +12301,8 @@ do : ac_fn_c_check_func "$LINENO" "pthread_sigmask" "ac_cv_func_pthread_sigmask" -if test "x$ac_cv_func_pthread_sigmask" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_SIGMASK 1 -_ACEOF +if test "x$ac_cv_func_pthread_sigmask" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_SIGMASK 1" >>confdefs.h case $ac_sys_system in CYGWIN*) @@ -11172,8 +12306,8 @@ case $ac_sys_system in CYGWIN*) -$as_echo "#define HAVE_BROKEN_PTHREAD_SIGMASK 1" >>confdefs.h +printf "%s\n" "#define HAVE_BROKEN_PTHREAD_SIGMASK 1" >>confdefs.h ;; esac fi @@ -11176,22 +12310,18 @@ ;; esac fi -done - - for ac_func in pthread_getcpuclockid -do : - ac_fn_c_check_func "$LINENO" "pthread_getcpuclockid" "ac_cv_func_pthread_getcpuclockid" -if test "x$ac_cv_func_pthread_getcpuclockid" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_PTHREAD_GETCPUCLOCKID 1 -_ACEOF - -fi -done + +done + ac_fn_c_check_func "$LINENO" "pthread_getcpuclockid" "ac_cv_func_pthread_getcpuclockid" +if test "x$ac_cv_func_pthread_getcpuclockid" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_GETCPUCLOCKID 1" >>confdefs.h + +fi fi # Check for enable-ipv6 @@ -11192,9 +12322,9 @@ fi # Check for enable-ipv6 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if --enable-ipv6 is specified" >&5 -$as_echo_n "checking if --enable-ipv6 is specified... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if --enable-ipv6 is specified" >&5 +printf %s "checking if --enable-ipv6 is specified... " >&6; } # Check whether --enable-ipv6 was given. @@ -11200,4 +12330,5 @@ # Check whether --enable-ipv6 was given. -if test "${enable_ipv6+set}" = set; then : +if test ${enable_ipv6+y} +then : enableval=$enable_ipv6; case "$enableval" in no) @@ -11202,6 +12333,6 @@ enableval=$enable_ipv6; case "$enableval" in no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ipv6=no ;; @@ -11206,9 +12337,9 @@ ipv6=no ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - $as_echo "#define ENABLE_IPV6 1" >>confdefs.h + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + printf "%s\n" "#define ENABLE_IPV6 1" >>confdefs.h ipv6=yes ;; esac @@ -11211,8 +12342,8 @@ ipv6=yes ;; esac -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -11220,10 +12351,10 @@ #include <sys/types.h> #include <sys/socket.h> int -main () +main (void) { int domain = AF_INET6; ; return 0; } _ACEOF @@ -11224,12 +12355,13 @@ { int domain = AF_INET6; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ipv6=yes @@ -11234,9 +12366,9 @@ ipv6=yes -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ipv6=no fi @@ -11240,6 +12372,6 @@ ipv6=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "$ipv6" = "yes"; then @@ -11244,10 +12376,10 @@ if test "$ipv6" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if RFC2553 API is available" >&5 -$as_echo_n "checking if RFC2553 API is available... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if RFC2553 API is available" >&5 +printf %s "checking if RFC2553 API is available... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <netinet/in.h> int @@ -11248,10 +12380,10 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <netinet/in.h> int -main () +main (void) { struct sockaddr_in6 x; x.sin6_scope_id; @@ -11260,9 +12392,10 @@ } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ipv6=yes @@ -11267,9 +12400,9 @@ ipv6=yes -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ipv6=no fi @@ -11273,7 +12406,7 @@ ipv6=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test "$ipv6" = "yes"; then @@ -11277,7 +12410,7 @@ fi if test "$ipv6" = "yes"; then - $as_echo "#define ENABLE_IPV6 1" >>confdefs.h + printf "%s\n" "#define ENABLE_IPV6 1" >>confdefs.h fi @@ -11289,8 +12422,8 @@ ipv6trylibc=no if test "$ipv6" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking ipv6 stack type" >&5 -$as_echo_n "checking ipv6 stack type... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ipv6 stack type" >&5 +printf %s "checking ipv6 stack type... " >&6; } for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta; do case $i in @@ -11304,6 +12437,7 @@ #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : + $EGREP "yes" >/dev/null 2>&1 +then : ipv6type=$i fi @@ -11308,6 +12442,6 @@ ipv6type=$i fi -rm -f conftest* +rm -rf conftest* ;; kame) @@ -11320,9 +12454,10 @@ #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : + $EGREP "yes" >/dev/null 2>&1 +then : ipv6type=$i; ipv6lib=inet6 ipv6libdir=/usr/local/v6/lib ipv6trylibc=yes fi @@ -11324,9 +12459,9 @@ ipv6type=$i; ipv6lib=inet6 ipv6libdir=/usr/local/v6/lib ipv6trylibc=yes fi -rm -f conftest* +rm -rf conftest* ;; linux-glibc) @@ -11339,7 +12474,8 @@ #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : + $EGREP "yes" >/dev/null 2>&1 +then : ipv6type=$i; ipv6trylibc=yes fi @@ -11343,7 +12479,7 @@ ipv6type=$i; ipv6trylibc=yes fi -rm -f conftest* +rm -rf conftest* ;; linux-inet6) @@ -11372,8 +12508,9 @@ #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : + $EGREP "yes" >/dev/null 2>&1 +then : ipv6type=$i; ipv6lib=inet6; ipv6libdir=/usr/local/v6/lib fi @@ -11376,8 +12513,8 @@ ipv6type=$i; ipv6lib=inet6; ipv6libdir=/usr/local/v6/lib fi -rm -f conftest* +rm -rf conftest* ;; v6d) @@ -11390,9 +12527,10 @@ #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : + $EGREP "yes" >/dev/null 2>&1 +then : ipv6type=$i; ipv6lib=v6; ipv6libdir=/usr/local/v6/lib; BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS" fi @@ -11394,9 +12532,9 @@ ipv6type=$i; ipv6lib=v6; ipv6libdir=/usr/local/v6/lib; BASECFLAGS="-I/usr/local/v6/include $BASECFLAGS" fi -rm -f conftest* +rm -rf conftest* ;; zeta) @@ -11409,8 +12547,9 @@ #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : + $EGREP "yes" >/dev/null 2>&1 +then : ipv6type=$i; ipv6lib=inet6; ipv6libdir=/usr/local/v6/lib fi @@ -11413,8 +12552,8 @@ ipv6type=$i; ipv6lib=inet6; ipv6libdir=/usr/local/v6/lib fi -rm -f conftest* +rm -rf conftest* ;; esac @@ -11422,8 +12561,8 @@ break fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ipv6type" >&5 -$as_echo "$ipv6type" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ipv6type" >&5 +printf "%s\n" "$ipv6type" >&6; } fi if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then @@ -11442,10 +12581,10 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAN_RAW_FD_FRAMES" >&5 -$as_echo_n "checking for CAN_RAW_FD_FRAMES... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CAN_RAW_FD_FRAMES" >&5 +printf %s "checking for CAN_RAW_FD_FRAMES... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* CAN_RAW_FD_FRAMES available check */ #include <linux/can/raw.h> int @@ -11447,12 +12586,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* CAN_RAW_FD_FRAMES available check */ #include <linux/can/raw.h> int -main () +main (void) { int can_raw_fd_frames = CAN_RAW_FD_FRAMES; ; return 0; } _ACEOF @@ -11453,29 +12592,30 @@ { int can_raw_fd_frames = CAN_RAW_FD_FRAMES; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - -$as_echo "#define HAVE_LINUX_CAN_RAW_FD_FRAMES 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CAN_RAW_JOIN_FILTERS" >&5 -$as_echo_n "checking for CAN_RAW_JOIN_FILTERS... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + + +printf "%s\n" "#define HAVE_LINUX_CAN_RAW_FD_FRAMES 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CAN_RAW_JOIN_FILTERS" >&5 +printf %s "checking for CAN_RAW_JOIN_FILTERS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <linux/can/raw.h> int @@ -11477,12 +12617,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <linux/can/raw.h> int -main () +main (void) { int can_raw_join_filters = CAN_RAW_JOIN_FILTERS; ; return 0; } _ACEOF @@ -11483,23 +12623,24 @@ { int can_raw_join_filters = CAN_RAW_JOIN_FILTERS; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - -$as_echo "#define HAVE_LINUX_CAN_RAW_JOIN_FILTERS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO" +then : + + +printf "%s\n" "#define HAVE_LINUX_CAN_RAW_JOIN_FILTERS 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Check for --with-doc-strings @@ -11504,6 +12645,6 @@ # Check for --with-doc-strings -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-doc-strings" >&5 -$as_echo_n "checking for --with-doc-strings... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-doc-strings" >&5 +printf %s "checking for --with-doc-strings... " >&6; } # Check whether --with-doc-strings was given. @@ -11508,6 +12649,7 @@ # Check whether --with-doc-strings was given. -if test "${with_doc_strings+set}" = set; then : +if test ${with_doc_strings+y} +then : withval=$with_doc_strings; fi @@ -11518,10 +12660,10 @@ if test "$with_doc_strings" != "no" then -$as_echo "#define WITH_DOC_STRINGS 1" >>confdefs.h - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_doc_strings" >&5 -$as_echo "$with_doc_strings" >&6; } +printf "%s\n" "#define WITH_DOC_STRINGS 1" >>confdefs.h + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_doc_strings" >&5 +printf "%s\n" "$with_doc_strings" >&6; } # Check for Python-specific malloc support @@ -11526,6 +12668,6 @@ # Check for Python-specific malloc support -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-pymalloc" >&5 -$as_echo_n "checking for --with-pymalloc... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-pymalloc" >&5 +printf %s "checking for --with-pymalloc... " >&6; } # Check whether --with-pymalloc was given. @@ -11530,6 +12672,7 @@ # Check whether --with-pymalloc was given. -if test "${with_pymalloc+set}" = set; then : +if test ${with_pymalloc+y} +then : withval=$with_pymalloc; fi @@ -11541,10 +12684,10 @@ if test "$with_pymalloc" != "no" then -$as_echo "#define WITH_PYMALLOC 1" >>confdefs.h - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pymalloc" >&5 -$as_echo "$with_pymalloc" >&6; } +printf "%s\n" "#define WITH_PYMALLOC 1" >>confdefs.h + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_pymalloc" >&5 +printf "%s\n" "$with_pymalloc" >&6; } # Check for --with-c-locale-coercion @@ -11549,6 +12692,6 @@ # Check for --with-c-locale-coercion -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-c-locale-coercion" >&5 -$as_echo_n "checking for --with-c-locale-coercion... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-c-locale-coercion" >&5 +printf %s "checking for --with-c-locale-coercion... " >&6; } # Check whether --with-c-locale-coercion was given. @@ -11553,6 +12696,7 @@ # Check whether --with-c-locale-coercion was given. -if test "${with_c_locale_coercion+set}" = set; then : +if test ${with_c_locale_coercion+y} +then : withval=$with_c_locale_coercion; fi @@ -11564,10 +12708,10 @@ if test "$with_c_locale_coercion" != "no" then -$as_echo "#define PY_COERCE_C_LOCALE 1" >>confdefs.h - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_c_locale_coercion" >&5 -$as_echo "$with_c_locale_coercion" >&6; } +printf "%s\n" "#define PY_COERCE_C_LOCALE 1" >>confdefs.h + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_c_locale_coercion" >&5 +printf "%s\n" "$with_c_locale_coercion" >&6; } # Check for Valgrind support @@ -11572,6 +12716,6 @@ # Check for Valgrind support -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-valgrind" >&5 -$as_echo_n "checking for --with-valgrind... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-valgrind" >&5 +printf %s "checking for --with-valgrind... " >&6; } # Check whether --with-valgrind was given. @@ -11576,4 +12720,5 @@ # Check whether --with-valgrind was given. -if test "${with_valgrind+set}" = set; then : +if test ${with_valgrind+y} +then : withval=$with_valgrind; @@ -11579,5 +12724,5 @@ withval=$with_valgrind; -else +else $as_nop with_valgrind=no fi @@ -11581,6 +12726,6 @@ with_valgrind=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_valgrind" >&5 -$as_echo "$with_valgrind" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_valgrind" >&5 +printf "%s\n" "$with_valgrind" >&6; } if test "$with_valgrind" != no; then @@ -11586,11 +12731,12 @@ if test "$with_valgrind" != no; then - ac_fn_c_check_header_mongrel "$LINENO" "valgrind/valgrind.h" "ac_cv_header_valgrind_valgrind_h" "$ac_includes_default" -if test "x$ac_cv_header_valgrind_valgrind_h" = xyes; then : - -$as_echo "#define WITH_VALGRIND 1" >>confdefs.h - -else + ac_fn_c_check_header_compile "$LINENO" "valgrind/valgrind.h" "ac_cv_header_valgrind_valgrind_h" "$ac_includes_default" +if test "x$ac_cv_header_valgrind_valgrind_h" = xyes +then : + +printf "%s\n" "#define WITH_VALGRIND 1" >>confdefs.h + +else $as_nop as_fn_error $? "Valgrind support requested but headers not available" "$LINENO" 5 fi @@ -11593,9 +12739,8 @@ as_fn_error $? "Valgrind support requested but headers not available" "$LINENO" 5 fi - OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" fi # Check for DTrace support @@ -11598,8 +12743,8 @@ OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT" fi # Check for DTrace support -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-dtrace" >&5 -$as_echo_n "checking for --with-dtrace... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-dtrace" >&5 +printf %s "checking for --with-dtrace... " >&6; } # Check whether --with-dtrace was given. @@ -11604,4 +12749,5 @@ # Check whether --with-dtrace was given. -if test "${with_dtrace+set}" = set; then : +if test ${with_dtrace+y} +then : withval=$with_dtrace; @@ -11607,5 +12753,5 @@ withval=$with_dtrace; -else +else $as_nop with_dtrace=no fi @@ -11609,8 +12755,8 @@ with_dtrace=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_dtrace" >&5 -$as_echo "$with_dtrace" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_dtrace" >&5 +printf "%s\n" "$with_dtrace" >&6; } @@ -11624,11 +12770,12 @@ then # Extract the first word of "dtrace", so it can be a program name with args. set dummy dtrace; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_DTRACE+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_DTRACE+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $DTRACE in [\\/]* | ?:[\\/]*) ac_cv_path_DTRACE="$DTRACE" # Let the user override the test with a path. @@ -11638,5 +12785,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -11642,7 +12793,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_DTRACE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_DTRACE="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11655,11 +12806,11 @@ fi DTRACE=$ac_cv_path_DTRACE if test -n "$DTRACE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5 -$as_echo "$DTRACE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DTRACE" >&5 +printf "%s\n" "$DTRACE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -11667,7 +12818,7 @@ as_fn_error $? "dtrace command not found on \$PATH" "$LINENO" 5 fi -$as_echo "#define WITH_DTRACE 1" >>confdefs.h +printf "%s\n" "#define WITH_DTRACE 1" >>confdefs.h DTRACE_HEADERS="Include/pydtrace_probes.h" @@ -11675,14 +12826,15 @@ # linked into the binary. Correspondingly, dtrace(1) is missing the ELF # generation flag '-G'. We check for presence of this flag, rather than # hardcoding support by OS, in the interest of robustness. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether DTrace probes require linking" >&5 -$as_echo_n "checking whether DTrace probes require linking... " >&6; } -if ${ac_cv_dtrace_link+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether DTrace probes require linking" >&5 +printf %s "checking whether DTrace probes require linking... " >&6; } +if test ${ac_cv_dtrace_link+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_dtrace_link=no echo 'BEGIN{}' > conftest.d "$DTRACE" $DFLAGS -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \ ac_cv_dtrace_link=yes fi @@ -11683,11 +12835,11 @@ ac_cv_dtrace_link=no echo 'BEGIN{}' > conftest.d "$DTRACE" $DFLAGS -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \ ac_cv_dtrace_link=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_dtrace_link" >&5 -$as_echo "$ac_cv_dtrace_link" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_dtrace_link" >&5 +printf "%s\n" "$ac_cv_dtrace_link" >&6; } if test "$ac_cv_dtrace_link" = "yes"; then DTRACE_OBJS="Python/pydtrace.o" fi @@ -11699,18 +12851,14 @@ # the dlopen() function means we might want to use dynload_shlib.o. some # platforms have dlopen(), but don't want to use it. -for ac_func in dlopen -do : - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLOPEN 1 -_ACEOF - -fi -done +ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes +then : + printf "%s\n" "#define HAVE_DLOPEN 1" >>confdefs.h + +fi # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic # loading of modules. @@ -11712,10 +12860,10 @@ # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic # loading of modules. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking DYNLOADFILE" >&5 -$as_echo_n "checking DYNLOADFILE... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking DYNLOADFILE" >&5 +printf %s "checking DYNLOADFILE... " >&6; } if test -z "$DYNLOADFILE" then case $ac_sys_system/$ac_sys_release in @@ -11730,8 +12878,8 @@ ;; esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DYNLOADFILE" >&5 -$as_echo "$DYNLOADFILE" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DYNLOADFILE" >&5 +printf "%s\n" "$DYNLOADFILE" >&6; } if test "$DYNLOADFILE" != "dynload_stub.o" then @@ -11735,10 +12883,10 @@ if test "$DYNLOADFILE" != "dynload_stub.o" then -$as_echo "#define HAVE_DYNAMIC_LOADING 1" >>confdefs.h +printf "%s\n" "#define HAVE_DYNAMIC_LOADING 1" >>confdefs.h fi # MACHDEP_OBJS can be set to platform-specific object files needed by Python @@ -11739,11 +12887,11 @@ fi # MACHDEP_OBJS can be set to platform-specific object files needed by Python -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking MACHDEP_OBJS" >&5 -$as_echo_n "checking MACHDEP_OBJS... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking MACHDEP_OBJS" >&5 +printf %s "checking MACHDEP_OBJS... " >&6; } if test -z "$MACHDEP_OBJS" then MACHDEP_OBJS=$extra_machdep_objs @@ -11751,11 +12899,11 @@ MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs" fi if test -z "$MACHDEP_OBJS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MACHDEP_OBJS" >&5 -$as_echo "$MACHDEP_OBJS" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MACHDEP_OBJS" >&5 +printf "%s\n" "$MACHDEP_OBJS" >&6; } fi # checks for library functions @@ -11759,44 +12907,993 @@ fi # checks for library functions -for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \ - clock confstr close_range copy_file_range ctermid dup3 execv explicit_bzero \ - explicit_memset faccessat fchmod fchmodat fchown fchownat \ - fdwalk fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \ - futimens futimes gai_strerror getentropy \ - getgrgid_r getgrnam_r \ - getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \ - getpriority getresuid getresgid getpwent getpwnam_r getpwuid_r getspnam getspent getsid getwd \ - if_nameindex \ - initgroups kill killpg lchown lockf linkat lstat lutimes mmap \ - memrchr mbrtowc mkdirat mkfifo \ - madvise mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \ - posix_fallocate posix_fadvise posix_spawn posix_spawnp pread preadv preadv2 \ - pthread_condattr_setclock pthread_init pthread_kill pwrite pwritev pwritev2 \ - readlink readlinkat readv realpath renameat \ - sem_open sem_timedwait sem_getvalue sem_unlink sendfile setegid seteuid \ - setgid sethostname \ - setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setpriority setuid setvbuf \ - sched_get_priority_max sched_setaffinity sched_setscheduler sched_setparam \ - sched_rr_get_interval \ - sigaction sigaltstack sigfillset siginterrupt sigpending sigrelse \ - sigtimedwait sigwait sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \ - sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ - truncate uname unlinkat utimensat utimes vfork waitid waitpid wait3 wait4 \ - wcscoll wcsftime wcsxfrm wmemcmp writev _getpty rtpSpawn -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done +ac_fn_c_check_func "$LINENO" "alarm" "ac_cv_func_alarm" +if test "x$ac_cv_func_alarm" = xyes +then : + printf "%s\n" "#define HAVE_ALARM 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "accept4" "ac_cv_func_accept4" +if test "x$ac_cv_func_accept4" = xyes +then : + printf "%s\n" "#define HAVE_ACCEPT4 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setitimer" "ac_cv_func_setitimer" +if test "x$ac_cv_func_setitimer" = xyes +then : + printf "%s\n" "#define HAVE_SETITIMER 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getitimer" "ac_cv_func_getitimer" +if test "x$ac_cv_func_getitimer" = xyes +then : + printf "%s\n" "#define HAVE_GETITIMER 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "bind_textdomain_codeset" "ac_cv_func_bind_textdomain_codeset" +if test "x$ac_cv_func_bind_textdomain_codeset" = xyes +then : + printf "%s\n" "#define HAVE_BIND_TEXTDOMAIN_CODESET 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "chown" "ac_cv_func_chown" +if test "x$ac_cv_func_chown" = xyes +then : + printf "%s\n" "#define HAVE_CHOWN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "clock" "ac_cv_func_clock" +if test "x$ac_cv_func_clock" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "confstr" "ac_cv_func_confstr" +if test "x$ac_cv_func_confstr" = xyes +then : + printf "%s\n" "#define HAVE_CONFSTR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "close_range" "ac_cv_func_close_range" +if test "x$ac_cv_func_close_range" = xyes +then : + printf "%s\n" "#define HAVE_CLOSE_RANGE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "copy_file_range" "ac_cv_func_copy_file_range" +if test "x$ac_cv_func_copy_file_range" = xyes +then : + printf "%s\n" "#define HAVE_COPY_FILE_RANGE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ctermid" "ac_cv_func_ctermid" +if test "x$ac_cv_func_ctermid" = xyes +then : + printf "%s\n" "#define HAVE_CTERMID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "dup3" "ac_cv_func_dup3" +if test "x$ac_cv_func_dup3" = xyes +then : + printf "%s\n" "#define HAVE_DUP3 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "execv" "ac_cv_func_execv" +if test "x$ac_cv_func_execv" = xyes +then : + printf "%s\n" "#define HAVE_EXECV 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "explicit_bzero" "ac_cv_func_explicit_bzero" +if test "x$ac_cv_func_explicit_bzero" = xyes +then : + printf "%s\n" "#define HAVE_EXPLICIT_BZERO 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "explicit_memset" "ac_cv_func_explicit_memset" +if test "x$ac_cv_func_explicit_memset" = xyes +then : + printf "%s\n" "#define HAVE_EXPLICIT_MEMSET 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "faccessat" "ac_cv_func_faccessat" +if test "x$ac_cv_func_faccessat" = xyes +then : + printf "%s\n" "#define HAVE_FACCESSAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fchmod" "ac_cv_func_fchmod" +if test "x$ac_cv_func_fchmod" = xyes +then : + printf "%s\n" "#define HAVE_FCHMOD 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fchmodat" "ac_cv_func_fchmodat" +if test "x$ac_cv_func_fchmodat" = xyes +then : + printf "%s\n" "#define HAVE_FCHMODAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fchown" "ac_cv_func_fchown" +if test "x$ac_cv_func_fchown" = xyes +then : + printf "%s\n" "#define HAVE_FCHOWN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fchownat" "ac_cv_func_fchownat" +if test "x$ac_cv_func_fchownat" = xyes +then : + printf "%s\n" "#define HAVE_FCHOWNAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fdwalk" "ac_cv_func_fdwalk" +if test "x$ac_cv_func_fdwalk" = xyes +then : + printf "%s\n" "#define HAVE_FDWALK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fexecve" "ac_cv_func_fexecve" +if test "x$ac_cv_func_fexecve" = xyes +then : + printf "%s\n" "#define HAVE_FEXECVE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fdopendir" "ac_cv_func_fdopendir" +if test "x$ac_cv_func_fdopendir" = xyes +then : + printf "%s\n" "#define HAVE_FDOPENDIR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fork" "ac_cv_func_fork" +if test "x$ac_cv_func_fork" = xyes +then : + printf "%s\n" "#define HAVE_FORK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fpathconf" "ac_cv_func_fpathconf" +if test "x$ac_cv_func_fpathconf" = xyes +then : + printf "%s\n" "#define HAVE_FPATHCONF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fstatat" "ac_cv_func_fstatat" +if test "x$ac_cv_func_fstatat" = xyes +then : + printf "%s\n" "#define HAVE_FSTATAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ftime" "ac_cv_func_ftime" +if test "x$ac_cv_func_ftime" = xyes +then : + printf "%s\n" "#define HAVE_FTIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ftruncate" "ac_cv_func_ftruncate" +if test "x$ac_cv_func_ftruncate" = xyes +then : + printf "%s\n" "#define HAVE_FTRUNCATE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "futimesat" "ac_cv_func_futimesat" +if test "x$ac_cv_func_futimesat" = xyes +then : + printf "%s\n" "#define HAVE_FUTIMESAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "futimens" "ac_cv_func_futimens" +if test "x$ac_cv_func_futimens" = xyes +then : + printf "%s\n" "#define HAVE_FUTIMENS 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "futimes" "ac_cv_func_futimes" +if test "x$ac_cv_func_futimes" = xyes +then : + printf "%s\n" "#define HAVE_FUTIMES 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "gai_strerror" "ac_cv_func_gai_strerror" +if test "x$ac_cv_func_gai_strerror" = xyes +then : + printf "%s\n" "#define HAVE_GAI_STRERROR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getentropy" "ac_cv_func_getentropy" +if test "x$ac_cv_func_getentropy" = xyes +then : + printf "%s\n" "#define HAVE_GETENTROPY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getgrgid_r" "ac_cv_func_getgrgid_r" +if test "x$ac_cv_func_getgrgid_r" = xyes +then : + printf "%s\n" "#define HAVE_GETGRGID_R 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getgrnam_r" "ac_cv_func_getgrnam_r" +if test "x$ac_cv_func_getgrnam_r" = xyes +then : + printf "%s\n" "#define HAVE_GETGRNAM_R 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getgrouplist" "ac_cv_func_getgrouplist" +if test "x$ac_cv_func_getgrouplist" = xyes +then : + printf "%s\n" "#define HAVE_GETGROUPLIST 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getgroups" "ac_cv_func_getgroups" +if test "x$ac_cv_func_getgroups" = xyes +then : + printf "%s\n" "#define HAVE_GETGROUPS 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getlogin" "ac_cv_func_getlogin" +if test "x$ac_cv_func_getlogin" = xyes +then : + printf "%s\n" "#define HAVE_GETLOGIN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getloadavg" "ac_cv_func_getloadavg" +if test "x$ac_cv_func_getloadavg" = xyes +then : + printf "%s\n" "#define HAVE_GETLOADAVG 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getpeername" "ac_cv_func_getpeername" +if test "x$ac_cv_func_getpeername" = xyes +then : + printf "%s\n" "#define HAVE_GETPEERNAME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getpgid" "ac_cv_func_getpgid" +if test "x$ac_cv_func_getpgid" = xyes +then : + printf "%s\n" "#define HAVE_GETPGID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getpid" "ac_cv_func_getpid" +if test "x$ac_cv_func_getpid" = xyes +then : + printf "%s\n" "#define HAVE_GETPID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getpriority" "ac_cv_func_getpriority" +if test "x$ac_cv_func_getpriority" = xyes +then : + printf "%s\n" "#define HAVE_GETPRIORITY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getresuid" "ac_cv_func_getresuid" +if test "x$ac_cv_func_getresuid" = xyes +then : + printf "%s\n" "#define HAVE_GETRESUID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getresgid" "ac_cv_func_getresgid" +if test "x$ac_cv_func_getresgid" = xyes +then : + printf "%s\n" "#define HAVE_GETRESGID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getpwent" "ac_cv_func_getpwent" +if test "x$ac_cv_func_getpwent" = xyes +then : + printf "%s\n" "#define HAVE_GETPWENT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getpwnam_r" "ac_cv_func_getpwnam_r" +if test "x$ac_cv_func_getpwnam_r" = xyes +then : + printf "%s\n" "#define HAVE_GETPWNAM_R 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getpwuid_r" "ac_cv_func_getpwuid_r" +if test "x$ac_cv_func_getpwuid_r" = xyes +then : + printf "%s\n" "#define HAVE_GETPWUID_R 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getspnam" "ac_cv_func_getspnam" +if test "x$ac_cv_func_getspnam" = xyes +then : + printf "%s\n" "#define HAVE_GETSPNAM 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getspent" "ac_cv_func_getspent" +if test "x$ac_cv_func_getspent" = xyes +then : + printf "%s\n" "#define HAVE_GETSPENT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getsid" "ac_cv_func_getsid" +if test "x$ac_cv_func_getsid" = xyes +then : + printf "%s\n" "#define HAVE_GETSID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getwd" "ac_cv_func_getwd" +if test "x$ac_cv_func_getwd" = xyes +then : + printf "%s\n" "#define HAVE_GETWD 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "if_nameindex" "ac_cv_func_if_nameindex" +if test "x$ac_cv_func_if_nameindex" = xyes +then : + printf "%s\n" "#define HAVE_IF_NAMEINDEX 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "initgroups" "ac_cv_func_initgroups" +if test "x$ac_cv_func_initgroups" = xyes +then : + printf "%s\n" "#define HAVE_INITGROUPS 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "kill" "ac_cv_func_kill" +if test "x$ac_cv_func_kill" = xyes +then : + printf "%s\n" "#define HAVE_KILL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "killpg" "ac_cv_func_killpg" +if test "x$ac_cv_func_killpg" = xyes +then : + printf "%s\n" "#define HAVE_KILLPG 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "lchown" "ac_cv_func_lchown" +if test "x$ac_cv_func_lchown" = xyes +then : + printf "%s\n" "#define HAVE_LCHOWN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "lockf" "ac_cv_func_lockf" +if test "x$ac_cv_func_lockf" = xyes +then : + printf "%s\n" "#define HAVE_LOCKF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "linkat" "ac_cv_func_linkat" +if test "x$ac_cv_func_linkat" = xyes +then : + printf "%s\n" "#define HAVE_LINKAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "lstat" "ac_cv_func_lstat" +if test "x$ac_cv_func_lstat" = xyes +then : + printf "%s\n" "#define HAVE_LSTAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "lutimes" "ac_cv_func_lutimes" +if test "x$ac_cv_func_lutimes" = xyes +then : + printf "%s\n" "#define HAVE_LUTIMES 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + printf "%s\n" "#define HAVE_MMAP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr" +if test "x$ac_cv_func_memrchr" = xyes +then : + printf "%s\n" "#define HAVE_MEMRCHR 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mbrtowc" "ac_cv_func_mbrtowc" +if test "x$ac_cv_func_mbrtowc" = xyes +then : + printf "%s\n" "#define HAVE_MBRTOWC 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mkdirat" "ac_cv_func_mkdirat" +if test "x$ac_cv_func_mkdirat" = xyes +then : + printf "%s\n" "#define HAVE_MKDIRAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mkfifo" "ac_cv_func_mkfifo" +if test "x$ac_cv_func_mkfifo" = xyes +then : + printf "%s\n" "#define HAVE_MKFIFO 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "madvise" "ac_cv_func_madvise" +if test "x$ac_cv_func_madvise" = xyes +then : + printf "%s\n" "#define HAVE_MADVISE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mkfifoat" "ac_cv_func_mkfifoat" +if test "x$ac_cv_func_mkfifoat" = xyes +then : + printf "%s\n" "#define HAVE_MKFIFOAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mknod" "ac_cv_func_mknod" +if test "x$ac_cv_func_mknod" = xyes +then : + printf "%s\n" "#define HAVE_MKNOD 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mknodat" "ac_cv_func_mknodat" +if test "x$ac_cv_func_mknodat" = xyes +then : + printf "%s\n" "#define HAVE_MKNODAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mktime" "ac_cv_func_mktime" +if test "x$ac_cv_func_mktime" = xyes +then : + printf "%s\n" "#define HAVE_MKTIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "mremap" "ac_cv_func_mremap" +if test "x$ac_cv_func_mremap" = xyes +then : + printf "%s\n" "#define HAVE_MREMAP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "nice" "ac_cv_func_nice" +if test "x$ac_cv_func_nice" = xyes +then : + printf "%s\n" "#define HAVE_NICE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "openat" "ac_cv_func_openat" +if test "x$ac_cv_func_openat" = xyes +then : + printf "%s\n" "#define HAVE_OPENAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pathconf" "ac_cv_func_pathconf" +if test "x$ac_cv_func_pathconf" = xyes +then : + printf "%s\n" "#define HAVE_PATHCONF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pause" "ac_cv_func_pause" +if test "x$ac_cv_func_pause" = xyes +then : + printf "%s\n" "#define HAVE_PAUSE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pipe2" "ac_cv_func_pipe2" +if test "x$ac_cv_func_pipe2" = xyes +then : + printf "%s\n" "#define HAVE_PIPE2 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "plock" "ac_cv_func_plock" +if test "x$ac_cv_func_plock" = xyes +then : + printf "%s\n" "#define HAVE_PLOCK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "poll" "ac_cv_func_poll" +if test "x$ac_cv_func_poll" = xyes +then : + printf "%s\n" "#define HAVE_POLL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "posix_fallocate" "ac_cv_func_posix_fallocate" +if test "x$ac_cv_func_posix_fallocate" = xyes +then : + printf "%s\n" "#define HAVE_POSIX_FALLOCATE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "posix_fadvise" "ac_cv_func_posix_fadvise" +if test "x$ac_cv_func_posix_fadvise" = xyes +then : + printf "%s\n" "#define HAVE_POSIX_FADVISE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "posix_spawn" "ac_cv_func_posix_spawn" +if test "x$ac_cv_func_posix_spawn" = xyes +then : + printf "%s\n" "#define HAVE_POSIX_SPAWN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "posix_spawnp" "ac_cv_func_posix_spawnp" +if test "x$ac_cv_func_posix_spawnp" = xyes +then : + printf "%s\n" "#define HAVE_POSIX_SPAWNP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pread" "ac_cv_func_pread" +if test "x$ac_cv_func_pread" = xyes +then : + printf "%s\n" "#define HAVE_PREAD 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "preadv" "ac_cv_func_preadv" +if test "x$ac_cv_func_preadv" = xyes +then : + printf "%s\n" "#define HAVE_PREADV 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "preadv2" "ac_cv_func_preadv2" +if test "x$ac_cv_func_preadv2" = xyes +then : + printf "%s\n" "#define HAVE_PREADV2 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pthread_condattr_setclock" "ac_cv_func_pthread_condattr_setclock" +if test "x$ac_cv_func_pthread_condattr_setclock" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pthread_init" "ac_cv_func_pthread_init" +if test "x$ac_cv_func_pthread_init" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_INIT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pthread_kill" "ac_cv_func_pthread_kill" +if test "x$ac_cv_func_pthread_kill" = xyes +then : + printf "%s\n" "#define HAVE_PTHREAD_KILL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pwrite" "ac_cv_func_pwrite" +if test "x$ac_cv_func_pwrite" = xyes +then : + printf "%s\n" "#define HAVE_PWRITE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pwritev" "ac_cv_func_pwritev" +if test "x$ac_cv_func_pwritev" = xyes +then : + printf "%s\n" "#define HAVE_PWRITEV 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "pwritev2" "ac_cv_func_pwritev2" +if test "x$ac_cv_func_pwritev2" = xyes +then : + printf "%s\n" "#define HAVE_PWRITEV2 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "readlink" "ac_cv_func_readlink" +if test "x$ac_cv_func_readlink" = xyes +then : + printf "%s\n" "#define HAVE_READLINK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "readlinkat" "ac_cv_func_readlinkat" +if test "x$ac_cv_func_readlinkat" = xyes +then : + printf "%s\n" "#define HAVE_READLINKAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "readv" "ac_cv_func_readv" +if test "x$ac_cv_func_readv" = xyes +then : + printf "%s\n" "#define HAVE_READV 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "realpath" "ac_cv_func_realpath" +if test "x$ac_cv_func_realpath" = xyes +then : + printf "%s\n" "#define HAVE_REALPATH 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "renameat" "ac_cv_func_renameat" +if test "x$ac_cv_func_renameat" = xyes +then : + printf "%s\n" "#define HAVE_RENAMEAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sem_open" "ac_cv_func_sem_open" +if test "x$ac_cv_func_sem_open" = xyes +then : + printf "%s\n" "#define HAVE_SEM_OPEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sem_timedwait" "ac_cv_func_sem_timedwait" +if test "x$ac_cv_func_sem_timedwait" = xyes +then : + printf "%s\n" "#define HAVE_SEM_TIMEDWAIT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sem_getvalue" "ac_cv_func_sem_getvalue" +if test "x$ac_cv_func_sem_getvalue" = xyes +then : + printf "%s\n" "#define HAVE_SEM_GETVALUE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sem_unlink" "ac_cv_func_sem_unlink" +if test "x$ac_cv_func_sem_unlink" = xyes +then : + printf "%s\n" "#define HAVE_SEM_UNLINK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sendfile" "ac_cv_func_sendfile" +if test "x$ac_cv_func_sendfile" = xyes +then : + printf "%s\n" "#define HAVE_SENDFILE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setegid" "ac_cv_func_setegid" +if test "x$ac_cv_func_setegid" = xyes +then : + printf "%s\n" "#define HAVE_SETEGID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "seteuid" "ac_cv_func_seteuid" +if test "x$ac_cv_func_seteuid" = xyes +then : + printf "%s\n" "#define HAVE_SETEUID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setgid" "ac_cv_func_setgid" +if test "x$ac_cv_func_setgid" = xyes +then : + printf "%s\n" "#define HAVE_SETGID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sethostname" "ac_cv_func_sethostname" +if test "x$ac_cv_func_sethostname" = xyes +then : + printf "%s\n" "#define HAVE_SETHOSTNAME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setlocale" "ac_cv_func_setlocale" +if test "x$ac_cv_func_setlocale" = xyes +then : + printf "%s\n" "#define HAVE_SETLOCALE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setregid" "ac_cv_func_setregid" +if test "x$ac_cv_func_setregid" = xyes +then : + printf "%s\n" "#define HAVE_SETREGID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setreuid" "ac_cv_func_setreuid" +if test "x$ac_cv_func_setreuid" = xyes +then : + printf "%s\n" "#define HAVE_SETREUID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setresuid" "ac_cv_func_setresuid" +if test "x$ac_cv_func_setresuid" = xyes +then : + printf "%s\n" "#define HAVE_SETRESUID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setresgid" "ac_cv_func_setresgid" +if test "x$ac_cv_func_setresgid" = xyes +then : + printf "%s\n" "#define HAVE_SETRESGID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setsid" "ac_cv_func_setsid" +if test "x$ac_cv_func_setsid" = xyes +then : + printf "%s\n" "#define HAVE_SETSID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setpgid" "ac_cv_func_setpgid" +if test "x$ac_cv_func_setpgid" = xyes +then : + printf "%s\n" "#define HAVE_SETPGID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setpgrp" "ac_cv_func_setpgrp" +if test "x$ac_cv_func_setpgrp" = xyes +then : + printf "%s\n" "#define HAVE_SETPGRP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setpriority" "ac_cv_func_setpriority" +if test "x$ac_cv_func_setpriority" = xyes +then : + printf "%s\n" "#define HAVE_SETPRIORITY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setuid" "ac_cv_func_setuid" +if test "x$ac_cv_func_setuid" = xyes +then : + printf "%s\n" "#define HAVE_SETUID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setvbuf" "ac_cv_func_setvbuf" +if test "x$ac_cv_func_setvbuf" = xyes +then : + printf "%s\n" "#define HAVE_SETVBUF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sched_get_priority_max" "ac_cv_func_sched_get_priority_max" +if test "x$ac_cv_func_sched_get_priority_max" = xyes +then : + printf "%s\n" "#define HAVE_SCHED_GET_PRIORITY_MAX 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sched_setaffinity" "ac_cv_func_sched_setaffinity" +if test "x$ac_cv_func_sched_setaffinity" = xyes +then : + printf "%s\n" "#define HAVE_SCHED_SETAFFINITY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sched_setscheduler" "ac_cv_func_sched_setscheduler" +if test "x$ac_cv_func_sched_setscheduler" = xyes +then : + printf "%s\n" "#define HAVE_SCHED_SETSCHEDULER 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sched_setparam" "ac_cv_func_sched_setparam" +if test "x$ac_cv_func_sched_setparam" = xyes +then : + printf "%s\n" "#define HAVE_SCHED_SETPARAM 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sched_rr_get_interval" "ac_cv_func_sched_rr_get_interval" +if test "x$ac_cv_func_sched_rr_get_interval" = xyes +then : + printf "%s\n" "#define HAVE_SCHED_RR_GET_INTERVAL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sigaction" "ac_cv_func_sigaction" +if test "x$ac_cv_func_sigaction" = xyes +then : + printf "%s\n" "#define HAVE_SIGACTION 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sigaltstack" "ac_cv_func_sigaltstack" +if test "x$ac_cv_func_sigaltstack" = xyes +then : + printf "%s\n" "#define HAVE_SIGALTSTACK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sigfillset" "ac_cv_func_sigfillset" +if test "x$ac_cv_func_sigfillset" = xyes +then : + printf "%s\n" "#define HAVE_SIGFILLSET 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "siginterrupt" "ac_cv_func_siginterrupt" +if test "x$ac_cv_func_siginterrupt" = xyes +then : + printf "%s\n" "#define HAVE_SIGINTERRUPT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sigpending" "ac_cv_func_sigpending" +if test "x$ac_cv_func_sigpending" = xyes +then : + printf "%s\n" "#define HAVE_SIGPENDING 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sigrelse" "ac_cv_func_sigrelse" +if test "x$ac_cv_func_sigrelse" = xyes +then : + printf "%s\n" "#define HAVE_SIGRELSE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sigtimedwait" "ac_cv_func_sigtimedwait" +if test "x$ac_cv_func_sigtimedwait" = xyes +then : + printf "%s\n" "#define HAVE_SIGTIMEDWAIT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sigwait" "ac_cv_func_sigwait" +if test "x$ac_cv_func_sigwait" = xyes +then : + printf "%s\n" "#define HAVE_SIGWAIT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sigwaitinfo" "ac_cv_func_sigwaitinfo" +if test "x$ac_cv_func_sigwaitinfo" = xyes +then : + printf "%s\n" "#define HAVE_SIGWAITINFO 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes +then : + printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "splice" "ac_cv_func_splice" +if test "x$ac_cv_func_splice" = xyes +then : + printf "%s\n" "#define HAVE_SPLICE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" +if test "x$ac_cv_func_strftime" = xyes +then : + printf "%s\n" "#define HAVE_STRFTIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strlcpy" "ac_cv_func_strlcpy" +if test "x$ac_cv_func_strlcpy" = xyes +then : + printf "%s\n" "#define HAVE_STRLCPY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strsignal" "ac_cv_func_strsignal" +if test "x$ac_cv_func_strsignal" = xyes +then : + printf "%s\n" "#define HAVE_STRSIGNAL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "symlinkat" "ac_cv_func_symlinkat" +if test "x$ac_cv_func_symlinkat" = xyes +then : + printf "%s\n" "#define HAVE_SYMLINKAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sync" "ac_cv_func_sync" +if test "x$ac_cv_func_sync" = xyes +then : + printf "%s\n" "#define HAVE_SYNC 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "sysconf" "ac_cv_func_sysconf" +if test "x$ac_cv_func_sysconf" = xyes +then : + printf "%s\n" "#define HAVE_SYSCONF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "tcgetpgrp" "ac_cv_func_tcgetpgrp" +if test "x$ac_cv_func_tcgetpgrp" = xyes +then : + printf "%s\n" "#define HAVE_TCGETPGRP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "tcsetpgrp" "ac_cv_func_tcsetpgrp" +if test "x$ac_cv_func_tcsetpgrp" = xyes +then : + printf "%s\n" "#define HAVE_TCSETPGRP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "tempnam" "ac_cv_func_tempnam" +if test "x$ac_cv_func_tempnam" = xyes +then : + printf "%s\n" "#define HAVE_TEMPNAM 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "timegm" "ac_cv_func_timegm" +if test "x$ac_cv_func_timegm" = xyes +then : + printf "%s\n" "#define HAVE_TIMEGM 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "times" "ac_cv_func_times" +if test "x$ac_cv_func_times" = xyes +then : + printf "%s\n" "#define HAVE_TIMES 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "tmpfile" "ac_cv_func_tmpfile" +if test "x$ac_cv_func_tmpfile" = xyes +then : + printf "%s\n" "#define HAVE_TMPFILE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "tmpnam" "ac_cv_func_tmpnam" +if test "x$ac_cv_func_tmpnam" = xyes +then : + printf "%s\n" "#define HAVE_TMPNAM 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "tmpnam_r" "ac_cv_func_tmpnam_r" +if test "x$ac_cv_func_tmpnam_r" = xyes +then : + printf "%s\n" "#define HAVE_TMPNAM_R 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "truncate" "ac_cv_func_truncate" +if test "x$ac_cv_func_truncate" = xyes +then : + printf "%s\n" "#define HAVE_TRUNCATE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "uname" "ac_cv_func_uname" +if test "x$ac_cv_func_uname" = xyes +then : + printf "%s\n" "#define HAVE_UNAME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "unlinkat" "ac_cv_func_unlinkat" +if test "x$ac_cv_func_unlinkat" = xyes +then : + printf "%s\n" "#define HAVE_UNLINKAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "utimensat" "ac_cv_func_utimensat" +if test "x$ac_cv_func_utimensat" = xyes +then : + printf "%s\n" "#define HAVE_UTIMENSAT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "utimes" "ac_cv_func_utimes" +if test "x$ac_cv_func_utimes" = xyes +then : + printf "%s\n" "#define HAVE_UTIMES 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "vfork" "ac_cv_func_vfork" +if test "x$ac_cv_func_vfork" = xyes +then : + printf "%s\n" "#define HAVE_VFORK 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "waitid" "ac_cv_func_waitid" +if test "x$ac_cv_func_waitid" = xyes +then : + printf "%s\n" "#define HAVE_WAITID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "waitpid" "ac_cv_func_waitpid" +if test "x$ac_cv_func_waitpid" = xyes +then : + printf "%s\n" "#define HAVE_WAITPID 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wait3" "ac_cv_func_wait3" +if test "x$ac_cv_func_wait3" = xyes +then : + printf "%s\n" "#define HAVE_WAIT3 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wait4" "ac_cv_func_wait4" +if test "x$ac_cv_func_wait4" = xyes +then : + printf "%s\n" "#define HAVE_WAIT4 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcscoll" "ac_cv_func_wcscoll" +if test "x$ac_cv_func_wcscoll" = xyes +then : + printf "%s\n" "#define HAVE_WCSCOLL 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcsftime" "ac_cv_func_wcsftime" +if test "x$ac_cv_func_wcsftime" = xyes +then : + printf "%s\n" "#define HAVE_WCSFTIME 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wcsxfrm" "ac_cv_func_wcsxfrm" +if test "x$ac_cv_func_wcsxfrm" = xyes +then : + printf "%s\n" "#define HAVE_WCSXFRM 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "wmemcmp" "ac_cv_func_wmemcmp" +if test "x$ac_cv_func_wmemcmp" = xyes +then : + printf "%s\n" "#define HAVE_WMEMCMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "writev" "ac_cv_func_writev" +if test "x$ac_cv_func_writev" = xyes +then : + printf "%s\n" "#define HAVE_WRITEV 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "_getpty" "ac_cv_func__getpty" +if test "x$ac_cv_func__getpty" = xyes +then : + printf "%s\n" "#define HAVE__GETPTY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "rtpSpawn" "ac_cv_func_rtpSpawn" +if test "x$ac_cv_func_rtpSpawn" = xyes +then : + printf "%s\n" "#define HAVE_RTPSPAWN 1" >>confdefs.h + +fi # Force lchmod off for Linux. Linux disallows changing the mode of symbolic # links. Some libc implementations have a stub lchmod implementation that always # returns an error. if test "$MACHDEP" != linux; then @@ -11797,9 +13894,7 @@ # Force lchmod off for Linux. Linux disallows changing the mode of symbolic # links. Some libc implementations have a stub lchmod implementation that always # returns an error. if test "$MACHDEP" != linux; then - for ac_func in lchmod -do : ac_fn_c_check_func "$LINENO" "lchmod" "ac_cv_func_lchmod" @@ -11805,13 +13900,91 @@ ac_fn_c_check_func "$LINENO" "lchmod" "ac_cv_func_lchmod" -if test "x$ac_cv_func_lchmod" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LCHMOD 1 -_ACEOF - -fi -done - -fi - -ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h> +if test "x$ac_cv_func_lchmod" = xyes +then : + printf "%s\n" "#define HAVE_LCHMOD 1" >>confdefs.h + +fi + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 +printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } +if test ${ac_cv_c_undeclared_builtin_options+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CFLAGS=$CFLAGS + ac_cv_c_undeclared_builtin_options='cannot detect' + for ac_arg in '' -fno-builtin; do + CFLAGS="$ac_save_CFLAGS $ac_arg" + # This test program should *not* compile successfully. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +(void) strchr; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + # This test program should compile successfully. + # No library function is consistently available on + # freestanding implementations, so test against a dummy + # declaration. Include always-available headers on the + # off chance that they somehow elicit warnings. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <float.h> +#include <limits.h> +#include <stdarg.h> +#include <stddef.h> +extern void ac_decl (int, char *); + +int +main (void) +{ +(void) ac_decl (0, (char *) 0); + (void) ac_decl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if test x"$ac_arg" = x +then : + ac_cv_c_undeclared_builtin_options='none needed' +else $as_nop + ac_cv_c_undeclared_builtin_options=$ac_arg +fi + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done + CFLAGS=$ac_save_CFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 +printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } + case $ac_cv_c_undeclared_builtin_options in #( + 'cannot detect') : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot make $CC report undeclared builtins +See \`config.log' for more details" "$LINENO" 5; } ;; #( + 'none needed') : + ac_c_undeclared_builtin_options='' ;; #( + *) : + ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; +esac + +ac_fn_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h> #include <dirent.h> @@ -11817,11 +13990,11 @@ #include <dirent.h> -" -if test "x$ac_cv_have_decl_dirfd" = xyes; then : - -$as_echo "#define HAVE_DIRFD 1" >>confdefs.h - -fi - +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_dirfd" = xyes +then : + +printf "%s\n" "#define HAVE_DIRFD 1" >>confdefs.h + +fi # For some functions, having a definition is not sufficient, since # we want to take their address. @@ -11825,9 +13998,9 @@ # For some functions, having a definition is not sufficient, since # we want to take their address. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for chroot" >&5 -$as_echo_n "checking for chroot... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for chroot" >&5 +printf %s "checking for chroot... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> int @@ -11830,11 +14003,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> int -main () +main (void) { void *x=chroot ; return 0; } _ACEOF @@ -11835,74 +14008,25 @@ { void *x=chroot ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_CHROOT 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for link" >&5 -$as_echo_n "checking for link... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <unistd.h> -int -main () -{ -void *x=link - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_LINK 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for symlink" >&5 -$as_echo_n "checking for symlink... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <unistd.h> -int -main () -{ -void *x=symlink - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_SYMLINK 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fchdir" >&5 -$as_echo_n "checking for fchdir... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_CHROOT 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for link" >&5 +printf %s "checking for link... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> int @@ -11905,29 +14029,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> int -main () -{ -void *x=fchdir - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_FCHDIR 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fsync" >&5 -$as_echo_n "checking for fsync... " >&6; } +main (void) +{ +void *x=link + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_LINK 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for symlink" >&5 +printf %s "checking for symlink... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> int @@ -11930,29 +14055,56 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> int -main () -{ -void *x=fsync - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_FSYNC 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fdatasync" >&5 -$as_echo_n "checking for fdatasync... " >&6; } +main (void) +{ +void *x=symlink + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_SYMLINK 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fchdir" >&5 +printf %s "checking for fchdir... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> +int +main (void) +{ +void *x=fchdir + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_FCHDIR 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fsync" >&5 +printf %s "checking for fsync... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> int @@ -11955,11 +14107,37 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> int -main () +main (void) +{ +void *x=fsync + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_FSYNC 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fdatasync" >&5 +printf %s "checking for fdatasync... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <unistd.h> +int +main (void) { void *x=fdatasync ; return 0; } _ACEOF @@ -11960,24 +14138,25 @@ { void *x=fdatasync ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_FDATASYNC 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for epoll" >&5 -$as_echo_n "checking for epoll... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_FDATASYNC 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for epoll" >&5 +printf %s "checking for epoll... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/epoll.h> int @@ -11980,11 +14159,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/epoll.h> int -main () +main (void) { void *x=epoll_create ; return 0; } _ACEOF @@ -11985,24 +14164,25 @@ { void *x=epoll_create ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_EPOLL 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for epoll_create1" >&5 -$as_echo_n "checking for epoll_create1... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_EPOLL 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for epoll_create1" >&5 +printf %s "checking for epoll_create1... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/epoll.h> int @@ -12005,11 +14185,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/epoll.h> int -main () +main (void) { void *x=epoll_create1 ; return 0; } _ACEOF @@ -12010,23 +14190,24 @@ { void *x=epoll_create1 ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_EPOLL_CREATE1 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for kqueue" >&5 -$as_echo_n "checking for kqueue... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_EPOLL_CREATE1 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for kqueue" >&5 +printf %s "checking for kqueue... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12034,10 +14215,10 @@ #include <sys/event.h> int -main () +main (void) { int x=kqueue() ; return 0; } _ACEOF @@ -12038,23 +14219,24 @@ { int x=kqueue() ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_KQUEUE 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for prlimit" >&5 -$as_echo_n "checking for prlimit... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_KQUEUE 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for prlimit" >&5 +printf %s "checking for prlimit... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12062,10 +14244,10 @@ #include <sys/resource.h> int -main () +main (void) { void *x=prlimit ; return 0; } _ACEOF @@ -12066,24 +14248,25 @@ { void *x=prlimit ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_PRLIMIT 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _dyld_shared_cache_contains_path" >&5 -$as_echo_n "checking for _dyld_shared_cache_contains_path... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_PRLIMIT 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _dyld_shared_cache_contains_path" >&5 +printf %s "checking for _dyld_shared_cache_contains_path... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <mach-o/dyld.h> int @@ -12086,11 +14269,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <mach-o/dyld.h> int -main () +main (void) { void *x=_dyld_shared_cache_contains_path ; return 0; } _ACEOF @@ -12091,24 +14274,25 @@ { void *x=_dyld_shared_cache_contains_path ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for memfd_create" >&5 -$as_echo_n "checking for memfd_create... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for memfd_create" >&5 +printf %s "checking for memfd_create... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12120,10 +14304,10 @@ #endif int -main () +main (void) { void *x=memfd_create ; return 0; } _ACEOF @@ -12124,24 +14308,25 @@ { void *x=memfd_create ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_MEMFD_CREATE 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for eventfd" >&5 -$as_echo_n "checking for eventfd... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_MEMFD_CREATE 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for eventfd" >&5 +printf %s "checking for eventfd... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12150,10 +14335,10 @@ #endif int -main () +main (void) { int x = eventfd(0, EFD_CLOEXEC) ; return 0; } _ACEOF @@ -12154,21 +14339,22 @@ { int x = eventfd(0, EFD_CLOEXEC) ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_EVENTFD 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_EVENTFD 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # On some systems (eg. FreeBSD 5), we would find a definition of the # functions ctermid_r, setgroups in the library, but no prototype @@ -12176,11 +14362,11 @@ # address to avoid compiler warnings and potential miscompilations # because of the missing prototypes. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ctermid_r" >&5 -$as_echo_n "checking for ctermid_r... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ctermid_r" >&5 +printf %s "checking for ctermid_r... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdio.h> int @@ -12181,13 +14367,13 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdio.h> int -main () +main (void) { void* p = ctermid_r ; return 0; } _ACEOF @@ -12188,28 +14374,30 @@ { void* p = ctermid_r ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_CTERMID_R 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock declaration" >&5 -$as_echo_n "checking for flock declaration... " >&6; } -if ${ac_cv_flock_decl+:} false; then : - $as_echo_n "(cached) " >&6 -else +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_CTERMID_R 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flock declaration" >&5 +printf %s "checking for flock declaration... " >&6; } +if test ${ac_cv_flock_decl+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/file.h> int @@ -12212,8 +14400,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/file.h> int -main () +main (void) { void* p = flock @@ -12221,5 +14409,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_flock_decl=yes @@ -12225,5 +14414,5 @@ ac_cv_flock_decl=yes -else +else $as_nop ac_cv_flock_decl=no fi @@ -12227,9 +14416,9 @@ ac_cv_flock_decl=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_flock_decl" >&5 -$as_echo "$ac_cv_flock_decl" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_flock_decl" >&5 +printf "%s\n" "$ac_cv_flock_decl" >&6; } if test "x${ac_cv_flock_decl}" = xyes; then @@ -12235,4 +14424,5 @@ if test "x${ac_cv_flock_decl}" = xyes; then + for ac_func in flock do : ac_fn_c_check_func "$LINENO" "flock" "ac_cv_func_flock" @@ -12236,17 +14426,17 @@ for ac_func in flock do : ac_fn_c_check_func "$LINENO" "flock" "ac_cv_func_flock" -if test "x$ac_cv_func_flock" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FLOCK 1 -_ACEOF - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock in -lbsd" >&5 -$as_echo_n "checking for flock in -lbsd... " >&6; } -if ${ac_cv_lib_bsd_flock+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "x$ac_cv_func_flock" = xyes +then : + printf "%s\n" "#define HAVE_FLOCK 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flock in -lbsd" >&5 +printf %s "checking for flock in -lbsd... " >&6; } +if test ${ac_cv_lib_bsd_flock+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12255,8 +14445,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char flock (); int @@ -12261,9 +14448,9 @@ char flock (); int -main () +main (void) { return flock (); ; return 0; } _ACEOF @@ -12264,8 +14451,9 @@ { return flock (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bsd_flock=yes @@ -12271,4 +14459,4 @@ ac_cv_lib_bsd_flock=yes -else +else $as_nop ac_cv_lib_bsd_flock=no fi @@ -12273,6 +14461,6 @@ ac_cv_lib_bsd_flock=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -12276,28 +14464,29 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_flock" >&5 -$as_echo "$ac_cv_lib_bsd_flock" >&6; } -if test "x$ac_cv_lib_bsd_flock" = xyes; then : - $as_echo "#define HAVE_FLOCK 1" >>confdefs.h - - -$as_echo "#define FLOCK_NEEDS_LIBBSD 1" >>confdefs.h - - -fi - - -fi -done - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5 -$as_echo_n "checking for getpagesize... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_flock" >&5 +printf "%s\n" "$ac_cv_lib_bsd_flock" >&6; } +if test "x$ac_cv_lib_bsd_flock" = xyes +then : + printf "%s\n" "#define HAVE_FLOCK 1" >>confdefs.h + + +printf "%s\n" "#define FLOCK_NEEDS_LIBBSD 1" >>confdefs.h + + +fi + + +fi + +done +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5 +printf %s "checking for getpagesize... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> int @@ -12298,13 +14487,13 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> int -main () +main (void) { void* p = getpagesize ; return 0; } _ACEOF @@ -12305,27 +14494,28 @@ { void* p = getpagesize ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_GETPAGESIZE 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken unsetenv" >&5 -$as_echo_n "checking for broken unsetenv... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_GETPAGESIZE 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for broken unsetenv" >&5 +printf %s "checking for broken unsetenv... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> int @@ -12326,13 +14516,13 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdlib.h> int -main () +main (void) { int res = unsetenv("DUMMY") ; return 0; } _ACEOF @@ -12333,23 +14523,24 @@ { int res = unsetenv("DUMMY") ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -else - -$as_echo "#define HAVE_BROKEN_UNSETENV 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +else $as_nop + +printf "%s\n" "#define HAVE_BROKEN_UNSETENV 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext for ac_prog in true do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -12351,13 +14542,14 @@ for ac_prog in true do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_TRUE+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_TRUE+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$TRUE"; then ac_cv_prog_TRUE="$TRUE" # Let the user override the test. else @@ -12365,5 +14557,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -12369,3 +14565,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_TRUE="$ac_prog" @@ -12371,5 +14567,5 @@ ac_cv_prog_TRUE="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -12380,11 +14576,11 @@ fi TRUE=$ac_cv_prog_TRUE if test -n "$TRUE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TRUE" >&5 -$as_echo "$TRUE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TRUE" >&5 +printf "%s\n" "$TRUE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -12393,11 +14589,12 @@ test -n "$TRUE" || TRUE="/bin/true" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lc" >&5 -$as_echo_n "checking for inet_aton in -lc... " >&6; } -if ${ac_cv_lib_c_inet_aton+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lc" >&5 +printf %s "checking for inet_aton in -lc... " >&6; } +if test ${ac_cv_lib_c_inet_aton+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12406,8 +14603,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char inet_aton (); int @@ -12412,9 +14606,9 @@ char inet_aton (); int -main () +main (void) { return inet_aton (); ; return 0; } _ACEOF @@ -12415,8 +14609,9 @@ { return inet_aton (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_c_inet_aton=yes @@ -12422,4 +14617,4 @@ ac_cv_lib_c_inet_aton=yes -else +else $as_nop ac_cv_lib_c_inet_aton=no fi @@ -12424,6 +14619,6 @@ ac_cv_lib_c_inet_aton=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -12427,7 +14622,8 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_inet_aton" >&5 -$as_echo "$ac_cv_lib_c_inet_aton" >&6; } -if test "x$ac_cv_lib_c_inet_aton" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_inet_aton" >&5 +printf "%s\n" "$ac_cv_lib_c_inet_aton" >&6; } +if test "x$ac_cv_lib_c_inet_aton" = xyes +then : $ac_cv_prog_TRUE @@ -12433,10 +14629,11 @@ $ac_cv_prog_TRUE -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv" >&5 -$as_echo_n "checking for inet_aton in -lresolv... " >&6; } -if ${ac_cv_lib_resolv_inet_aton+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv" >&5 +printf %s "checking for inet_aton in -lresolv... " >&6; } +if test ${ac_cv_lib_resolv_inet_aton+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12445,8 +14642,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char inet_aton (); int @@ -12451,9 +14645,9 @@ char inet_aton (); int -main () +main (void) { return inet_aton (); ; return 0; } _ACEOF @@ -12454,8 +14648,9 @@ { return inet_aton (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_resolv_inet_aton=yes @@ -12461,4 +14656,4 @@ ac_cv_lib_resolv_inet_aton=yes -else +else $as_nop ac_cv_lib_resolv_inet_aton=no fi @@ -12463,6 +14658,6 @@ ac_cv_lib_resolv_inet_aton=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -12466,12 +14661,11 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton" >&5 -$as_echo "$ac_cv_lib_resolv_inet_aton" >&6; } -if test "x$ac_cv_lib_resolv_inet_aton" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBRESOLV 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton" >&5 +printf "%s\n" "$ac_cv_lib_resolv_inet_aton" >&6; } +if test "x$ac_cv_lib_resolv_inet_aton" = xyes +then : + printf "%s\n" "#define HAVE_LIBRESOLV 1" >>confdefs.h LIBS="-lresolv $LIBS" @@ -12483,10 +14677,12 @@ # On Tru64, chflags seems to be present, but calling it will # exit Python -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for chflags" >&5 -$as_echo_n "checking for chflags... " >&6; } -if ${ac_cv_have_chflags+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for chflags" >&5 +printf %s "checking for chflags... " >&6; } +if test ${ac_cv_have_chflags+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_have_chflags=cross @@ -12492,5 +14688,5 @@ ac_cv_have_chflags=cross -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12504,5 +14700,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_have_chflags=yes @@ -12508,5 +14705,5 @@ ac_cv_have_chflags=yes -else +else $as_nop ac_cv_have_chflags=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -12515,7 +14712,7 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_chflags" >&5 -$as_echo "$ac_cv_have_chflags" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_chflags" >&5 +printf "%s\n" "$ac_cv_have_chflags" >&6; } if test "$ac_cv_have_chflags" = cross ; then ac_fn_c_check_func "$LINENO" "chflags" "ac_cv_func_chflags" @@ -12520,4 +14717,5 @@ if test "$ac_cv_have_chflags" = cross ; then ac_fn_c_check_func "$LINENO" "chflags" "ac_cv_func_chflags" -if test "x$ac_cv_func_chflags" = xyes; then : +if test "x$ac_cv_func_chflags" = xyes +then : ac_cv_have_chflags="yes" @@ -12523,8 +14721,8 @@ ac_cv_have_chflags="yes" -else +else $as_nop ac_cv_have_chflags="no" fi fi if test "$ac_cv_have_chflags" = yes ; then @@ -12525,17 +14723,19 @@ ac_cv_have_chflags="no" fi fi if test "$ac_cv_have_chflags" = yes ; then -$as_echo "#define HAVE_CHFLAGS 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lchflags" >&5 -$as_echo_n "checking for lchflags... " >&6; } -if ${ac_cv_have_lchflags+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +printf "%s\n" "#define HAVE_CHFLAGS 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lchflags" >&5 +printf %s "checking for lchflags... " >&6; } +if test ${ac_cv_have_lchflags+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_have_lchflags=cross @@ -12541,5 +14741,5 @@ ac_cv_have_lchflags=cross -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12553,5 +14753,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_have_lchflags=yes @@ -12557,5 +14758,5 @@ ac_cv_have_lchflags=yes -else +else $as_nop ac_cv_have_lchflags=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -12564,7 +14765,7 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_lchflags" >&5 -$as_echo "$ac_cv_have_lchflags" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_lchflags" >&5 +printf "%s\n" "$ac_cv_have_lchflags" >&6; } if test "$ac_cv_have_lchflags" = cross ; then ac_fn_c_check_func "$LINENO" "lchflags" "ac_cv_func_lchflags" @@ -12569,4 +14770,5 @@ if test "$ac_cv_have_lchflags" = cross ; then ac_fn_c_check_func "$LINENO" "lchflags" "ac_cv_func_lchflags" -if test "x$ac_cv_func_lchflags" = xyes; then : +if test "x$ac_cv_func_lchflags" = xyes +then : ac_cv_have_lchflags="yes" @@ -12572,8 +14774,8 @@ ac_cv_have_lchflags="yes" -else +else $as_nop ac_cv_have_lchflags="no" fi fi if test "$ac_cv_have_lchflags" = yes ; then @@ -12574,10 +14776,10 @@ ac_cv_have_lchflags="no" fi fi if test "$ac_cv_have_lchflags" = yes ; then -$as_echo "#define HAVE_LCHFLAGS 1" >>confdefs.h +printf "%s\n" "#define HAVE_LCHFLAGS 1" >>confdefs.h fi @@ -12590,11 +14792,12 @@ ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz" >&5 -$as_echo_n "checking for inflateCopy in -lz... " >&6; } -if ${ac_cv_lib_z_inflateCopy+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inflateCopy in -lz" >&5 +printf %s "checking for inflateCopy in -lz... " >&6; } +if test ${ac_cv_lib_z_inflateCopy+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12603,8 +14806,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char inflateCopy (); int @@ -12609,9 +14809,9 @@ char inflateCopy (); int -main () +main (void) { return inflateCopy (); ; return 0; } _ACEOF @@ -12612,8 +14812,9 @@ { return inflateCopy (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_z_inflateCopy=yes @@ -12619,4 +14820,4 @@ ac_cv_lib_z_inflateCopy=yes -else +else $as_nop ac_cv_lib_z_inflateCopy=no fi @@ -12621,6 +14822,6 @@ ac_cv_lib_z_inflateCopy=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -12624,11 +14825,12 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateCopy" >&5 -$as_echo "$ac_cv_lib_z_inflateCopy" >&6; } -if test "x$ac_cv_lib_z_inflateCopy" = xyes; then : - -$as_echo "#define HAVE_ZLIB_COPY 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateCopy" >&5 +printf "%s\n" "$ac_cv_lib_z_inflateCopy" >&6; } +if test "x$ac_cv_lib_z_inflateCopy" = xyes +then : + +printf "%s\n" "#define HAVE_ZLIB_COPY 1" >>confdefs.h fi @@ -12640,11 +14842,11 @@ ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hstrerror" >&5 -$as_echo_n "checking for hstrerror... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hstrerror" >&5 +printf %s "checking for hstrerror... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <netdb.h> int @@ -12645,13 +14847,13 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <netdb.h> int -main () +main (void) { void* p = hstrerror; hstrerror(0) ; return 0; } _ACEOF @@ -12652,25 +14854,26 @@ { void* p = hstrerror; hstrerror(0) ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -$as_echo "#define HAVE_HSTRERROR 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton" >&5 -$as_echo_n "checking for inet_aton... " >&6; } +if ac_fn_c_try_link "$LINENO" +then : + +printf "%s\n" "#define HAVE_HSTRERROR 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_aton" >&5 +printf %s "checking for inet_aton... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12680,10 +14883,10 @@ #include <arpa/inet.h> int -main () +main (void) { void* p = inet_aton;inet_aton(0,0) ; return 0; } _ACEOF @@ -12684,25 +14887,26 @@ { void* p = inet_aton;inet_aton(0,0) ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -$as_echo "#define HAVE_INET_ATON 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_pton" >&5 -$as_echo_n "checking for inet_pton... " >&6; } +if ac_fn_c_try_link "$LINENO" +then : + +printf "%s\n" "#define HAVE_INET_ATON 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inet_pton" >&5 +printf %s "checking for inet_pton... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12712,10 +14916,10 @@ #include <arpa/inet.h> int -main () +main (void) { void* p = inet_pton ; return 0; } _ACEOF @@ -12716,20 +14920,21 @@ { void* p = inet_pton ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_INET_PTON 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_INET_PTON 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # On some systems, setgroups is in unistd.h, on others, in grp.h @@ -12734,7 +14939,7 @@ # On some systems, setgroups is in unistd.h, on others, in grp.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setgroups" >&5 -$as_echo_n "checking for setgroups... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for setgroups" >&5 +printf %s "checking for setgroups... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12744,10 +14949,10 @@ #endif int -main () +main (void) { void* p = setgroups ; return 0; } _ACEOF @@ -12748,21 +14953,22 @@ { void* p = setgroups ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_SETGROUPS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_SETGROUPS 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # check for openpty and forkpty @@ -12766,6 +14972,7 @@ # check for openpty and forkpty -for ac_func in openpty + + for ac_func in openpty do : ac_fn_c_check_func "$LINENO" "openpty" "ac_cv_func_openpty" @@ -12770,16 +14977,16 @@ do : ac_fn_c_check_func "$LINENO" "openpty" "ac_cv_func_openpty" -if test "x$ac_cv_func_openpty" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_OPENPTY 1 -_ACEOF - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lutil" >&5 -$as_echo_n "checking for openpty in -lutil... " >&6; } -if ${ac_cv_lib_util_openpty+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "x$ac_cv_func_openpty" = xyes +then : + printf "%s\n" "#define HAVE_OPENPTY 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openpty in -lutil" >&5 +printf %s "checking for openpty in -lutil... " >&6; } +if test ${ac_cv_lib_util_openpty+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12788,8 +14995,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char openpty (); int @@ -12794,9 +14998,9 @@ char openpty (); int -main () +main (void) { return openpty (); ; return 0; } _ACEOF @@ -12797,8 +15001,9 @@ { return openpty (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_util_openpty=yes @@ -12804,4 +15009,4 @@ ac_cv_lib_util_openpty=yes -else +else $as_nop ac_cv_lib_util_openpty=no fi @@ -12806,6 +15011,6 @@ ac_cv_lib_util_openpty=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -12809,8 +15014,9 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_openpty" >&5 -$as_echo "$ac_cv_lib_util_openpty" >&6; } -if test "x$ac_cv_lib_util_openpty" = xyes; then : - $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_openpty" >&5 +printf "%s\n" "$ac_cv_lib_util_openpty" >&6; } +if test "x$ac_cv_lib_util_openpty" = xyes +then : + printf "%s\n" "#define HAVE_OPENPTY 1" >>confdefs.h LIBS="$LIBS -lutil" @@ -12816,10 +15022,11 @@ LIBS="$LIBS -lutil" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openpty in -lbsd" >&5 -$as_echo_n "checking for openpty in -lbsd... " >&6; } -if ${ac_cv_lib_bsd_openpty+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openpty in -lbsd" >&5 +printf %s "checking for openpty in -lbsd... " >&6; } +if test ${ac_cv_lib_bsd_openpty+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12828,8 +15035,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char openpty (); int @@ -12834,9 +15038,9 @@ char openpty (); int -main () +main (void) { return openpty (); ; return 0; } _ACEOF @@ -12837,8 +15041,9 @@ { return openpty (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bsd_openpty=yes @@ -12844,4 +15049,4 @@ ac_cv_lib_bsd_openpty=yes -else +else $as_nop ac_cv_lib_bsd_openpty=no fi @@ -12846,6 +15051,6 @@ ac_cv_lib_bsd_openpty=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -12849,10 +15054,11 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_openpty" >&5 -$as_echo "$ac_cv_lib_bsd_openpty" >&6; } -if test "x$ac_cv_lib_bsd_openpty" = xyes; then : - $as_echo "#define HAVE_OPENPTY 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_openpty" >&5 +printf "%s\n" "$ac_cv_lib_bsd_openpty" >&6; } +if test "x$ac_cv_lib_bsd_openpty" = xyes +then : + printf "%s\n" "#define HAVE_OPENPTY 1" >>confdefs.h LIBS="$LIBS -lbsd" fi @@ -12861,8 +15067,9 @@ fi -done - -for ac_func in forkpty + +done + + for ac_func in forkpty do : ac_fn_c_check_func "$LINENO" "forkpty" "ac_cv_func_forkpty" @@ -12867,16 +15074,16 @@ do : ac_fn_c_check_func "$LINENO" "forkpty" "ac_cv_func_forkpty" -if test "x$ac_cv_func_forkpty" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FORKPTY 1 -_ACEOF - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lutil" >&5 -$as_echo_n "checking for forkpty in -lutil... " >&6; } -if ${ac_cv_lib_util_forkpty+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "x$ac_cv_func_forkpty" = xyes +then : + printf "%s\n" "#define HAVE_FORKPTY 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lutil" >&5 +printf %s "checking for forkpty in -lutil... " >&6; } +if test ${ac_cv_lib_util_forkpty+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12885,8 +15092,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char forkpty (); int @@ -12891,9 +15095,9 @@ char forkpty (); int -main () +main (void) { return forkpty (); ; return 0; } _ACEOF @@ -12894,8 +15098,9 @@ { return forkpty (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_util_forkpty=yes @@ -12901,4 +15106,4 @@ ac_cv_lib_util_forkpty=yes -else +else $as_nop ac_cv_lib_util_forkpty=no fi @@ -12903,6 +15108,6 @@ ac_cv_lib_util_forkpty=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -12906,8 +15111,9 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_forkpty" >&5 -$as_echo "$ac_cv_lib_util_forkpty" >&6; } -if test "x$ac_cv_lib_util_forkpty" = xyes; then : - $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_util_forkpty" >&5 +printf "%s\n" "$ac_cv_lib_util_forkpty" >&6; } +if test "x$ac_cv_lib_util_forkpty" = xyes +then : + printf "%s\n" "#define HAVE_FORKPTY 1" >>confdefs.h LIBS="$LIBS -lutil" @@ -12913,10 +15119,11 @@ LIBS="$LIBS -lutil" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lbsd" >&5 -$as_echo_n "checking for forkpty in -lbsd... " >&6; } -if ${ac_cv_lib_bsd_forkpty+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for forkpty in -lbsd" >&5 +printf %s "checking for forkpty in -lbsd... " >&6; } +if test ${ac_cv_lib_bsd_forkpty+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12925,8 +15132,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char forkpty (); int @@ -12931,9 +15135,9 @@ char forkpty (); int -main () +main (void) { return forkpty (); ; return 0; } _ACEOF @@ -12934,8 +15138,9 @@ { return forkpty (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bsd_forkpty=yes @@ -12941,4 +15146,4 @@ ac_cv_lib_bsd_forkpty=yes -else +else $as_nop ac_cv_lib_bsd_forkpty=no fi @@ -12943,6 +15148,6 @@ ac_cv_lib_bsd_forkpty=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -12946,10 +15151,11 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_forkpty" >&5 -$as_echo "$ac_cv_lib_bsd_forkpty" >&6; } -if test "x$ac_cv_lib_bsd_forkpty" = xyes; then : - $as_echo "#define HAVE_FORKPTY 1" >>confdefs.h +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_forkpty" >&5 +printf "%s\n" "$ac_cv_lib_bsd_forkpty" >&6; } +if test "x$ac_cv_lib_bsd_forkpty" = xyes +then : + printf "%s\n" "#define HAVE_FORKPTY 1" >>confdefs.h LIBS="$LIBS -lbsd" fi @@ -12958,7 +15164,7 @@ fi -done - + +done # check for long file support functions @@ -12963,16 +15169,41 @@ # check for long file support functions -for ac_func in fseek64 fseeko fstatvfs ftell64 ftello statvfs -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done +ac_fn_c_check_func "$LINENO" "fseek64" "ac_cv_func_fseek64" +if test "x$ac_cv_func_fseek64" = xyes +then : + printf "%s\n" "#define HAVE_FSEEK64 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fseeko" "ac_cv_func_fseeko" +if test "x$ac_cv_func_fseeko" = xyes +then : + printf "%s\n" "#define HAVE_FSEEKO 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "fstatvfs" "ac_cv_func_fstatvfs" +if test "x$ac_cv_func_fstatvfs" = xyes +then : + printf "%s\n" "#define HAVE_FSTATVFS 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ftell64" "ac_cv_func_ftell64" +if test "x$ac_cv_func_ftell64" = xyes +then : + printf "%s\n" "#define HAVE_FTELL64 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "ftello" "ac_cv_func_ftello" +if test "x$ac_cv_func_ftello" = xyes +then : + printf "%s\n" "#define HAVE_FTELLO 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "statvfs" "ac_cv_func_statvfs" +if test "x$ac_cv_func_statvfs" = xyes +then : + printf "%s\n" "#define HAVE_STATVFS 1" >>confdefs.h + +fi ac_fn_c_check_func "$LINENO" "dup2" "ac_cv_func_dup2" @@ -12976,10 +15207,11 @@ ac_fn_c_check_func "$LINENO" "dup2" "ac_cv_func_dup2" -if test "x$ac_cv_func_dup2" = xyes; then : - $as_echo "#define HAVE_DUP2 1" >>confdefs.h - -else +if test "x$ac_cv_func_dup2" = xyes +then : + printf "%s\n" "#define HAVE_DUP2 1" >>confdefs.h + +else $as_nop case " $LIBOBJS " in *" dup2.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS dup2.$ac_objext" @@ -12989,6 +15221,6 @@ fi -for ac_func in getpgrp + for ac_func in getpgrp do : ac_fn_c_check_func "$LINENO" "getpgrp" "ac_cv_func_getpgrp" @@ -12993,10 +15225,9 @@ do : ac_fn_c_check_func "$LINENO" "getpgrp" "ac_cv_func_getpgrp" -if test "x$ac_cv_func_getpgrp" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETPGRP 1 -_ACEOF +if test "x$ac_cv_func_getpgrp" = xyes +then : + printf "%s\n" "#define HAVE_GETPGRP 1" >>confdefs.h cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> int @@ -12999,11 +15230,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> int -main () +main (void) { getpgrp(0); ; return 0; } _ACEOF @@ -13004,19 +15235,21 @@ { getpgrp(0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define GETPGRP_HAVE_ARG 1" >>confdefs.h - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -done - -for ac_func in setpgrp +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define GETPGRP_HAVE_ARG 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi + +done + + for ac_func in setpgrp do : ac_fn_c_check_func "$LINENO" "setpgrp" "ac_cv_func_setpgrp" @@ -13021,10 +15254,9 @@ do : ac_fn_c_check_func "$LINENO" "setpgrp" "ac_cv_func_setpgrp" -if test "x$ac_cv_func_setpgrp" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SETPGRP 1 -_ACEOF +if test "x$ac_cv_func_setpgrp" = xyes +then : + printf "%s\n" "#define HAVE_SETPGRP 1" >>confdefs.h cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> int @@ -13027,11 +15259,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <unistd.h> int -main () +main (void) { setpgrp(0,0); ; return 0; } _ACEOF @@ -13032,19 +15264,20 @@ { setpgrp(0,0); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define SETPGRP_HAVE_ARG 1" >>confdefs.h - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -done - +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define SETPGRP_HAVE_ARG 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi + +done # We search for both crypt and crypt_r as one or the other may be defined # This gets us our -lcrypt in LIBS when required on the target platform. @@ -13048,11 +15281,12 @@ # We search for both crypt and crypt_r as one or the other may be defined # This gets us our -lcrypt in LIBS when required on the target platform. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5 -$as_echo_n "checking for library containing crypt... " >&6; } -if ${ac_cv_search_crypt+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5 +printf %s "checking for library containing crypt... " >&6; } +if test ${ac_cv_search_crypt+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13060,8 +15294,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char crypt (); int @@ -13066,9 +15297,9 @@ char crypt (); int -main () +main (void) { return crypt (); ; return 0; } _ACEOF @@ -13069,13 +15300,14 @@ { return crypt (); ; return 0; } _ACEOF -for ac_lib in '' crypt; do +for ac_lib in '' crypt +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi @@ -13076,9 +15308,10 @@ if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_crypt=$ac_res fi @@ -13083,4 +15316,4 @@ ac_cv_search_crypt=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext @@ -13086,5 +15319,6 @@ conftest$ac_exeext - if ${ac_cv_search_crypt+:} false; then : + if test ${ac_cv_search_crypt+y} +then : break fi done @@ -13088,11 +15322,12 @@ break fi done -if ${ac_cv_search_crypt+:} false; then : - -else +if test ${ac_cv_search_crypt+y} +then : + +else $as_nop ac_cv_search_crypt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi @@ -13094,8 +15329,8 @@ ac_cv_search_crypt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5 -$as_echo "$ac_cv_search_crypt" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5 +printf "%s\n" "$ac_cv_search_crypt" >&6; } ac_res=$ac_cv_search_crypt @@ -13101,6 +15336,7 @@ ac_res=$ac_cv_search_crypt -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -13103,12 +15339,13 @@ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt_r" >&5 -$as_echo_n "checking for library containing crypt_r... " >&6; } -if ${ac_cv_search_crypt_r+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing crypt_r" >&5 +printf %s "checking for library containing crypt_r... " >&6; } +if test ${ac_cv_search_crypt_r+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13116,8 +15353,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char crypt_r (); int @@ -13122,9 +15356,9 @@ char crypt_r (); int -main () +main (void) { return crypt_r (); ; return 0; } _ACEOF @@ -13125,13 +15359,14 @@ { return crypt_r (); ; return 0; } _ACEOF -for ac_lib in '' crypt; do +for ac_lib in '' crypt +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi @@ -13132,9 +15367,10 @@ if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_crypt_r=$ac_res fi @@ -13139,4 +15375,4 @@ ac_cv_search_crypt_r=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext @@ -13142,5 +15378,6 @@ conftest$ac_exeext - if ${ac_cv_search_crypt_r+:} false; then : + if test ${ac_cv_search_crypt_r+y} +then : break fi done @@ -13144,11 +15381,12 @@ break fi done -if ${ac_cv_search_crypt_r+:} false; then : - -else +if test ${ac_cv_search_crypt_r+y} +then : + +else $as_nop ac_cv_search_crypt_r=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi @@ -13150,8 +15388,8 @@ ac_cv_search_crypt_r=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt_r" >&5 -$as_echo "$ac_cv_search_crypt_r" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt_r" >&5 +printf "%s\n" "$ac_cv_search_crypt_r" >&6; } ac_res=$ac_cv_search_crypt_r @@ -13157,8 +15395,9 @@ ac_res=$ac_cv_search_crypt_r -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ac_fn_c_check_func "$LINENO" "crypt_r" "ac_cv_func_crypt_r" @@ -13159,10 +15398,11 @@ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi ac_fn_c_check_func "$LINENO" "crypt_r" "ac_cv_func_crypt_r" -if test "x$ac_cv_func_crypt_r" = xyes; then : +if test "x$ac_cv_func_crypt_r" = xyes +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13170,7 +15410,7 @@ #include <crypt.h> int -main () +main (void) { struct crypt_data d; @@ -13180,16 +15420,18 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_CRYPT_R 1" >>confdefs.h - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi - - -for ac_func in clock_gettime +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_CRYPT_R 1" >>confdefs.h + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi + + + + for ac_func in clock_gettime do : ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" @@ -13194,17 +15436,17 @@ do : ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" -if test "x$ac_cv_func_clock_gettime" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CLOCK_GETTIME 1 -_ACEOF - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 -$as_echo_n "checking for clock_gettime in -lrt... " >&6; } -if ${ac_cv_lib_rt_clock_gettime+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "x$ac_cv_func_clock_gettime" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 +printf %s "checking for clock_gettime in -lrt... " >&6; } +if test ${ac_cv_lib_rt_clock_gettime+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -13213,8 +15455,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char clock_gettime (); int @@ -13219,9 +15458,9 @@ char clock_gettime (); int -main () +main (void) { return clock_gettime (); ; return 0; } _ACEOF @@ -13222,8 +15461,9 @@ { return clock_gettime (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_rt_clock_gettime=yes @@ -13229,4 +15469,4 @@ ac_cv_lib_rt_clock_gettime=yes -else +else $as_nop ac_cv_lib_rt_clock_gettime=no fi @@ -13231,6 +15471,6 @@ ac_cv_lib_rt_clock_gettime=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -13234,8 +15474,9 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 -$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } -if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 +printf "%s\n" "$ac_cv_lib_rt_clock_gettime" >&6; } +if test "x$ac_cv_lib_rt_clock_gettime" = xyes +then : LIBS="$LIBS -lrt" @@ -13240,18 +15481,19 @@ LIBS="$LIBS -lrt" - $as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h - - -$as_echo "#define TIMEMODULE_LIB rt" >>confdefs.h - - -fi - - -fi -done - - -for ac_func in clock_getres + printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h + + +printf "%s\n" "#define TIMEMODULE_LIB rt" >>confdefs.h + + +fi + + +fi + +done + + + for ac_func in clock_getres do : ac_fn_c_check_func "$LINENO" "clock_getres" "ac_cv_func_clock_getres" @@ -13256,17 +15498,17 @@ do : ac_fn_c_check_func "$LINENO" "clock_getres" "ac_cv_func_clock_getres" -if test "x$ac_cv_func_clock_getres" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CLOCK_GETRES 1 -_ACEOF - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_getres in -lrt" >&5 -$as_echo_n "checking for clock_getres in -lrt... " >&6; } -if ${ac_cv_lib_rt_clock_getres+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "x$ac_cv_func_clock_getres" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK_GETRES 1" >>confdefs.h + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_getres in -lrt" >&5 +printf %s "checking for clock_getres in -lrt... " >&6; } +if test ${ac_cv_lib_rt_clock_getres+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -13275,8 +15517,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char clock_getres (); int @@ -13281,9 +15520,9 @@ char clock_getres (); int -main () +main (void) { return clock_getres (); ; return 0; } _ACEOF @@ -13284,8 +15523,9 @@ { return clock_getres (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_rt_clock_getres=yes @@ -13291,4 +15531,4 @@ ac_cv_lib_rt_clock_getres=yes -else +else $as_nop ac_cv_lib_rt_clock_getres=no fi @@ -13293,6 +15533,6 @@ ac_cv_lib_rt_clock_getres=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -13296,20 +15536,22 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_getres" >&5 -$as_echo "$ac_cv_lib_rt_clock_getres" >&6; } -if test "x$ac_cv_lib_rt_clock_getres" = xyes; then : - - $as_echo "#define HAVE_CLOCK_GETRES 1" >>confdefs.h - - -fi - - -fi -done - - -for ac_func in clock_settime +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_getres" >&5 +printf "%s\n" "$ac_cv_lib_rt_clock_getres" >&6; } +if test "x$ac_cv_lib_rt_clock_getres" = xyes +then : + + printf "%s\n" "#define HAVE_CLOCK_GETRES 1" >>confdefs.h + + +fi + + +fi + +done + + + for ac_func in clock_settime do : ac_fn_c_check_func "$LINENO" "clock_settime" "ac_cv_func_clock_settime" @@ -13314,17 +15556,17 @@ do : ac_fn_c_check_func "$LINENO" "clock_settime" "ac_cv_func_clock_settime" -if test "x$ac_cv_func_clock_settime" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CLOCK_SETTIME 1 -_ACEOF - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_settime in -lrt" >&5 -$as_echo_n "checking for clock_settime in -lrt... " >&6; } -if ${ac_cv_lib_rt_clock_settime+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "x$ac_cv_func_clock_settime" = xyes +then : + printf "%s\n" "#define HAVE_CLOCK_SETTIME 1" >>confdefs.h + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clock_settime in -lrt" >&5 +printf %s "checking for clock_settime in -lrt... " >&6; } +if test ${ac_cv_lib_rt_clock_settime+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -13333,8 +15575,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char clock_settime (); int @@ -13339,9 +15578,9 @@ char clock_settime (); int -main () +main (void) { return clock_settime (); ; return 0; } _ACEOF @@ -13342,8 +15581,9 @@ { return clock_settime (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_rt_clock_settime=yes @@ -13349,4 +15589,4 @@ ac_cv_lib_rt_clock_settime=yes -else +else $as_nop ac_cv_lib_rt_clock_settime=no fi @@ -13351,6 +15591,6 @@ ac_cv_lib_rt_clock_settime=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -13354,22 +15594,23 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_settime" >&5 -$as_echo "$ac_cv_lib_rt_clock_settime" >&6; } -if test "x$ac_cv_lib_rt_clock_settime" = xyes; then : - - $as_echo "#define HAVE_CLOCK_SETTIME 1" >>confdefs.h - - -fi - - -fi -done - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for major" >&5 -$as_echo_n "checking for major... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_settime" >&5 +printf "%s\n" "$ac_cv_lib_rt_clock_settime" >&6; } +if test "x$ac_cv_lib_rt_clock_settime" = xyes +then : + + printf "%s\n" "#define HAVE_CLOCK_SETTIME 1" >>confdefs.h + + +fi + + +fi + +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for major" >&5 +printf %s "checking for major... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13382,7 +15623,7 @@ #endif int -main () +main (void) { makedev(major(0),minor(0)); @@ -13391,22 +15632,23 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - -$as_echo "#define HAVE_DEVICE_MACROS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext \ +if ac_fn_c_try_link "$LINENO" +then : + + +printf "%s\n" "#define HAVE_DEVICE_MACROS 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # On OSF/1 V5.1, getaddrinfo is available, but a define # for [no]getaddrinfo in netdb.h. @@ -13409,9 +15651,9 @@ conftest$ac_exeext conftest.$ac_ext # On OSF/1 V5.1, getaddrinfo is available, but a define # for [no]getaddrinfo in netdb.h. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo" >&5 -$as_echo_n "checking for getaddrinfo... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo" >&5 +printf %s "checking for getaddrinfo... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13421,10 +15663,10 @@ #include <stdio.h> int -main () +main (void) { getaddrinfo(NULL, NULL, NULL, NULL); ; return 0; } _ACEOF @@ -13425,8 +15667,9 @@ { getaddrinfo(NULL, NULL, NULL, NULL); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : have_getaddrinfo=yes @@ -13432,4 +15675,4 @@ have_getaddrinfo=yes -else +else $as_nop have_getaddrinfo=no fi @@ -13434,8 +15677,8 @@ have_getaddrinfo=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_getaddrinfo" >&5 -$as_echo "$have_getaddrinfo" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_getaddrinfo" >&5 +printf "%s\n" "$have_getaddrinfo" >&6; } if test $have_getaddrinfo = yes then @@ -13440,14 +15683,16 @@ if test $have_getaddrinfo = yes then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking getaddrinfo bug" >&5 -$as_echo_n "checking getaddrinfo bug... " >&6; } - if ${ac_cv_buggy_getaddrinfo+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking getaddrinfo bug" >&5 +printf %s "checking getaddrinfo bug... " >&6; } + if test ${ac_cv_buggy_getaddrinfo+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : if test "${enable_ipv6+set}" = set; then ac_cv_buggy_getaddrinfo="no -- configured with --(en|dis)able-ipv6" else ac_cv_buggy_getaddrinfo=yes fi @@ -13448,10 +15693,10 @@ if test "${enable_ipv6+set}" = set; then ac_cv_buggy_getaddrinfo="no -- configured with --(en|dis)able-ipv6" else ac_cv_buggy_getaddrinfo=yes fi -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13545,5 +15790,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_buggy_getaddrinfo=no @@ -13549,5 +15795,5 @@ ac_cv_buggy_getaddrinfo=no -else +else $as_nop ac_cv_buggy_getaddrinfo=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -13558,8 +15804,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_buggy_getaddrinfo" >&5 -$as_echo "$ac_cv_buggy_getaddrinfo" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_buggy_getaddrinfo" >&5 +printf "%s\n" "$ac_cv_buggy_getaddrinfo" >&6; } if test $have_getaddrinfo = no || test "$ac_cv_buggy_getaddrinfo" = yes then @@ -13571,20 +15817,16 @@ fi else -$as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h - -fi - -for ac_func in getnameinfo -do : - ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo" -if test "x$ac_cv_func_getnameinfo" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETNAMEINFO 1 -_ACEOF - -fi -done +printf "%s\n" "#define HAVE_GETADDRINFO 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "getnameinfo" "ac_cv_func_getnameinfo" +if test "x$ac_cv_func_getnameinfo" = xyes +then : + printf "%s\n" "#define HAVE_GETNAMEINFO 1" >>confdefs.h + +fi # checks for structures @@ -13588,49 +15830,25 @@ # checks for structures -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -if ${ac_cv_header_time+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <sys/types.h> -#include <sys/time.h> -#include <time.h> - -int -main () -{ -if ((struct tm *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_time=yes -else - ac_cv_header_time=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } -if test $ac_cv_header_time = yes; then - -$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if ${ac_cv_struct_tm+:} false; then : - $as_echo_n "(cached) " >&6 -else + + +# Obsolete code to be removed. +if test $ac_cv_header_sys_time_h = yes; then + +printf "%s\n" "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi +# End of obsolete code. + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +printf %s "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if test ${ac_cv_struct_tm+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <time.h> int @@ -13631,10 +15849,10 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <time.h> int -main () +main (void) { struct tm tm; int *p = &tm.tm_sec; @@ -13643,5 +15861,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_struct_tm=time.h @@ -13647,4 +15866,4 @@ ac_cv_struct_tm=time.h -else +else $as_nop ac_cv_struct_tm=sys/time.h fi @@ -13649,8 +15868,8 @@ ac_cv_struct_tm=sys/time.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +printf "%s\n" "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then @@ -13655,6 +15874,6 @@ if test $ac_cv_struct_tm = sys/time.h; then -$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h +printf "%s\n" "#define TM_IN_SYS_TIME 1" >>confdefs.h fi @@ -13662,14 +15881,13 @@ #include <$ac_cv_struct_tm> " -if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_TM_TM_ZONE 1 -_ACEOF +if test "x$ac_cv_member_struct_tm_tm_zone" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_TM_TM_ZONE 1" >>confdefs.h fi if test "$ac_cv_member_struct_tm_tm_zone" = yes; then @@ -13670,13 +15888,14 @@ fi if test "$ac_cv_member_struct_tm_tm_zone" = yes; then -$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h - -else - ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h> -" -if test "x$ac_cv_have_decl_tzname" = xyes; then : +printf "%s\n" "#define HAVE_TM_ZONE 1" >>confdefs.h + +else + ac_fn_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include <time.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_tzname" = xyes +then : ac_have_decl=1 @@ -13682,4 +15901,4 @@ ac_have_decl=1 -else +else $as_nop ac_have_decl=0 fi @@ -13684,15 +15903,13 @@ ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_TZNAME $ac_have_decl -_ACEOF - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 -$as_echo_n "checking for tzname... " >&6; } -if ${ac_cv_var_tzname+:} false; then : - $as_echo_n "(cached) " >&6 -else +printf "%s\n" "#define HAVE_DECL_TZNAME $ac_have_decl" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 +printf %s "checking for tzname... " >&6; } +if test ${ac_cv_var_tzname+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <time.h> @@ -13701,10 +15918,10 @@ #endif int -main () +main (void) { return tzname[0][0]; ; return 0; } _ACEOF @@ -13705,8 +15922,9 @@ { return tzname[0][0]; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_var_tzname=yes @@ -13712,4 +15930,4 @@ ac_cv_var_tzname=yes -else +else $as_nop ac_cv_var_tzname=no fi @@ -13714,9 +15932,9 @@ ac_cv_var_tzname=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 -$as_echo "$ac_cv_var_tzname" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 +printf "%s\n" "$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then @@ -13721,8 +15939,8 @@ if test $ac_cv_var_tzname = yes; then -$as_echo "#define HAVE_TZNAME 1" >>confdefs.h +printf "%s\n" "#define HAVE_TZNAME 1" >>confdefs.h fi fi ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" @@ -13724,15 +15942,14 @@ fi fi ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_RDEV 1 -_ACEOF +if test "x$ac_cv_member_struct_stat_st_rdev" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_RDEV 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" @@ -13734,15 +15951,14 @@ fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 -_ACEOF +if test "x$ac_cv_member_struct_stat_st_blksize" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLKSIZE 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_flags" "ac_cv_member_struct_stat_st_flags" "$ac_includes_default" @@ -13744,15 +15960,14 @@ fi ac_fn_c_check_member "$LINENO" "struct stat" "st_flags" "ac_cv_member_struct_stat_st_flags" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_flags" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_FLAGS 1 -_ACEOF +if test "x$ac_cv_member_struct_stat_st_flags" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_FLAGS 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_gen" "ac_cv_member_struct_stat_st_gen" "$ac_includes_default" @@ -13754,15 +15969,14 @@ fi ac_fn_c_check_member "$LINENO" "struct stat" "st_gen" "ac_cv_member_struct_stat_st_gen" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_gen" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_GEN 1 -_ACEOF +if test "x$ac_cv_member_struct_stat_st_gen" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_GEN 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtime" "ac_cv_member_struct_stat_st_birthtime" "$ac_includes_default" @@ -13764,15 +15978,14 @@ fi ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtime" "ac_cv_member_struct_stat_st_birthtime" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_birthtime" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 -_ACEOF +if test "x$ac_cv_member_struct_stat_st_birthtime" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1" >>confdefs.h fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" @@ -13774,13 +15987,12 @@ fi ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default" -if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STAT_ST_BLOCKS 1 -_ACEOF +if test "x$ac_cv_member_struct_stat_st_blocks" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BLOCKS 1" >>confdefs.h fi @@ -13790,11 +16002,10 @@ #include <pwd.h> " -if test "x$ac_cv_member_struct_passwd_pw_gecos" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_PASSWD_PW_GECOS 1 -_ACEOF +if test "x$ac_cv_member_struct_passwd_pw_gecos" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_PASSWD_PW_GECOS 1" >>confdefs.h fi @@ -13803,11 +16014,10 @@ #include <pwd.h> " -if test "x$ac_cv_member_struct_passwd_pw_passwd" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_PASSWD_PW_PASSWD 1 -_ACEOF +if test "x$ac_cv_member_struct_passwd_pw_passwd" = xyes +then : + +printf "%s\n" "#define HAVE_STRUCT_PASSWD_PW_PASSWD 1" >>confdefs.h fi @@ -13815,23 +16025,23 @@ # Issue #21085: In Cygwin, siginfo_t does not have si_band field. ac_fn_c_check_member "$LINENO" "siginfo_t" "si_band" "ac_cv_member_siginfo_t_si_band" "#include <signal.h> " -if test "x$ac_cv_member_siginfo_t_si_band" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_SIGINFO_T_SI_BAND 1 -_ACEOF - - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for time.h that defines altzone" >&5 -$as_echo_n "checking for time.h that defines altzone... " >&6; } -if ${ac_cv_header_time_altzone+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "x$ac_cv_member_siginfo_t_si_band" = xyes +then : + +printf "%s\n" "#define HAVE_SIGINFO_T_SI_BAND 1" >>confdefs.h + + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for time.h that defines altzone" >&5 +printf %s "checking for time.h that defines altzone... " >&6; } +if test ${ac_cv_header_time_altzone+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <time.h> int @@ -13833,12 +16043,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <time.h> int -main () +main (void) { return altzone; ; return 0; } _ACEOF @@ -13839,8 +16049,9 @@ { return altzone; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_header_time_altzone=yes @@ -13846,4 +16057,4 @@ ac_cv_header_time_altzone=yes -else +else $as_nop ac_cv_header_time_altzone=no fi @@ -13848,10 +16059,10 @@ ac_cv_header_time_altzone=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time_altzone" >&5 -$as_echo "$ac_cv_header_time_altzone" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time_altzone" >&5 +printf "%s\n" "$ac_cv_header_time_altzone" >&6; } if test $ac_cv_header_time_altzone = yes; then @@ -13856,7 +16067,7 @@ if test $ac_cv_header_time_altzone = yes; then -$as_echo "#define HAVE_ALTZONE 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALTZONE 1" >>confdefs.h fi was_it_defined=no @@ -13859,9 +16070,9 @@ fi was_it_defined=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/select.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether sys/select.h and sys/time.h may both be included... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether sys/select.h and sys/time.h may both be included" >&5 +printf %s "checking whether sys/select.h and sys/time.h may both be included... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13870,10 +16081,10 @@ #include <sys/time.h> int -main () +main (void) { ; ; return 0; } _ACEOF @@ -13874,14 +16085,15 @@ { ; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - -$as_echo "#define SYS_SELECT_WITH_SYS_TIME 1" >>confdefs.h +if ac_fn_c_try_compile "$LINENO" +then : + + +printf "%s\n" "#define SYS_SELECT_WITH_SYS_TIME 1" >>confdefs.h was_it_defined=yes fi @@ -13884,17 +16096,18 @@ was_it_defined=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $was_it_defined" >&5 -$as_echo "$was_it_defined" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for addrinfo" >&5 -$as_echo_n "checking for addrinfo... " >&6; } -if ${ac_cv_struct_addrinfo+:} false; then : - $as_echo_n "(cached) " >&6 -else +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $was_it_defined" >&5 +printf "%s\n" "$was_it_defined" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for addrinfo" >&5 +printf %s "checking for addrinfo... " >&6; } +if test ${ac_cv_struct_addrinfo+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <netdb.h> int @@ -13897,11 +16110,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <netdb.h> int -main () +main (void) { struct addrinfo a ; return 0; } _ACEOF @@ -13902,8 +16115,9 @@ { struct addrinfo a ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_struct_addrinfo=yes @@ -13909,4 +16123,4 @@ ac_cv_struct_addrinfo=yes -else +else $as_nop ac_cv_struct_addrinfo=no fi @@ -13911,9 +16125,9 @@ ac_cv_struct_addrinfo=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_addrinfo" >&5 -$as_echo "$ac_cv_struct_addrinfo" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_addrinfo" >&5 +printf "%s\n" "$ac_cv_struct_addrinfo" >&6; } if test $ac_cv_struct_addrinfo = yes; then @@ -13918,17 +16132,18 @@ if test $ac_cv_struct_addrinfo = yes; then -$as_echo "#define HAVE_ADDRINFO 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage" >&5 -$as_echo_n "checking for sockaddr_storage... " >&6; } -if ${ac_cv_struct_sockaddr_storage+:} false; then : - $as_echo_n "(cached) " >&6 -else +printf "%s\n" "#define HAVE_ADDRINFO 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage" >&5 +printf %s "checking for sockaddr_storage... " >&6; } +if test ${ac_cv_struct_sockaddr_storage+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include <sys/types.h> # include <sys/socket.h> int @@ -13929,13 +16144,13 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include <sys/types.h> # include <sys/socket.h> int -main () +main (void) { struct sockaddr_storage s ; return 0; } _ACEOF @@ -13936,8 +16151,9 @@ { struct sockaddr_storage s ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_struct_sockaddr_storage=yes @@ -13943,4 +16159,4 @@ ac_cv_struct_sockaddr_storage=yes -else +else $as_nop ac_cv_struct_sockaddr_storage=no fi @@ -13945,9 +16161,9 @@ ac_cv_struct_sockaddr_storage=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_sockaddr_storage" >&5 -$as_echo "$ac_cv_struct_sockaddr_storage" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_sockaddr_storage" >&5 +printf "%s\n" "$ac_cv_struct_sockaddr_storage" >&6; } if test $ac_cv_struct_sockaddr_storage = yes; then @@ -13952,14 +16168,15 @@ if test $ac_cv_struct_sockaddr_storage = yes; then -$as_echo "#define HAVE_SOCKADDR_STORAGE 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_alg" >&5 -$as_echo_n "checking for sockaddr_alg... " >&6; } -if ${ac_cv_struct_sockaddr_alg+:} false; then : - $as_echo_n "(cached) " >&6 -else +printf "%s\n" "#define HAVE_SOCKADDR_STORAGE 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sockaddr_alg" >&5 +printf %s "checking for sockaddr_alg... " >&6; } +if test ${ac_cv_struct_sockaddr_alg+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13967,10 +16184,10 @@ # include <sys/socket.h> # include <linux/if_alg.h> int -main () +main (void) { struct sockaddr_alg s ; return 0; } _ACEOF @@ -13971,8 +16188,9 @@ { struct sockaddr_alg s ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_struct_sockaddr_alg=yes @@ -13978,4 +16196,4 @@ ac_cv_struct_sockaddr_alg=yes -else +else $as_nop ac_cv_struct_sockaddr_alg=no fi @@ -13980,9 +16198,9 @@ ac_cv_struct_sockaddr_alg=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_sockaddr_alg" >&5 -$as_echo "$ac_cv_struct_sockaddr_alg" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_sockaddr_alg" >&5 +printf "%s\n" "$ac_cv_struct_sockaddr_alg" >&6; } if test $ac_cv_struct_sockaddr_alg = yes; then @@ -13987,8 +16205,8 @@ if test $ac_cv_struct_sockaddr_alg = yes; then -$as_echo "#define HAVE_SOCKADDR_ALG 1" >>confdefs.h +printf "%s\n" "#define HAVE_SOCKADDR_ALG 1" >>confdefs.h fi # checks for compiler characteristics @@ -13990,14 +16208,15 @@ fi # checks for compiler characteristics -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 -$as_echo_n "checking whether char is unsigned... " >&6; } -if ${ac_cv_c_char_unsigned+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether char is unsigned" >&5 +printf %s "checking whether char is unsigned... " >&6; } +if test ${ac_cv_c_char_unsigned+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -14000,8 +16219,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { static int test_array [1 - 2 * !(((char) -1) < 0)]; test_array [0] = 0; @@ -14011,5 +16230,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_char_unsigned=no @@ -14015,4 +16235,4 @@ ac_cv_c_char_unsigned=no -else +else $as_nop ac_cv_c_char_unsigned=yes fi @@ -14017,24 +16237,25 @@ ac_cv_c_char_unsigned=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 -$as_echo "$ac_cv_c_char_unsigned" >&6; } -if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then - $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 +printf "%s\n" "$ac_cv_c_char_unsigned" >&6; } +if test $ac_cv_c_char_unsigned = yes; then + printf "%s\n" "#define __CHAR_UNSIGNED__ 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) { #ifndef __cplusplus @@ -14047,7 +16268,7 @@ /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. + /* IBM XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ @@ -14075,7 +16296,7 @@ iptr p = 0; ++p; } - { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; @@ -14091,5 +16312,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_const=yes @@ -14095,4 +16317,4 @@ ac_cv_c_const=yes -else +else $as_nop ac_cv_c_const=no fi @@ -14097,8 +16319,8 @@ ac_cv_c_const=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then @@ -14103,8 +16325,8 @@ if test $ac_cv_c_const = no; then -$as_echo "#define const /**/" >>confdefs.h +printf "%s\n" "#define const /**/" >>confdefs.h fi works=no @@ -14106,18 +16328,18 @@ fi works=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working signed char" >&5 -$as_echo_n "checking for working signed char... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working signed char" >&5 +printf %s "checking for working signed char... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) { signed char c; ; return 0; } _ACEOF @@ -14118,8 +16340,9 @@ { signed char c; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : works=yes @@ -14125,12 +16348,12 @@ works=yes -else - -$as_echo "#define signed /**/" >>confdefs.h - - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $works" >&5 -$as_echo "$works" >&6; } +else $as_nop + +printf "%s\n" "#define signed /**/" >>confdefs.h + + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $works" >&5 +printf "%s\n" "$works" >&6; } have_prototypes=no @@ -14135,8 +16358,8 @@ have_prototypes=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for prototypes" >&5 -$as_echo_n "checking for prototypes... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for prototypes" >&5 +printf %s "checking for prototypes... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo(int x) { return 0; } int @@ -14139,11 +16362,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo(int x) { return 0; } int -main () +main (void) { return foo(10); ; return 0; } _ACEOF @@ -14144,12 +16367,13 @@ { return foo(10); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_PROTOTYPES 1" >>confdefs.h +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_PROTOTYPES 1" >>confdefs.h have_prototypes=yes fi @@ -14153,8 +16377,8 @@ have_prototypes=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_prototypes" >&5 -$as_echo "$have_prototypes" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_prototypes" >&5 +printf "%s\n" "$have_prototypes" >&6; } works=no @@ -14159,7 +16383,7 @@ works=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for variable length prototypes and stdarg.h" >&5 -$as_echo_n "checking for variable length prototypes and stdarg.h... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variable length prototypes and stdarg.h" >&5 +printf %s "checking for variable length prototypes and stdarg.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14174,10 +16398,10 @@ } int -main () +main (void) { return foo(10, "", 3.14); ; return 0; } _ACEOF @@ -14178,14 +16402,15 @@ { return foo(10, "", 3.14); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - -$as_echo "#define HAVE_STDARG_PROTOTYPES 1" >>confdefs.h +if ac_fn_c_try_compile "$LINENO" +then : + + +printf "%s\n" "#define HAVE_STDARG_PROTOTYPES 1" >>confdefs.h works=yes fi @@ -14188,9 +16413,9 @@ works=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $works" >&5 -$as_echo "$works" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $works" >&5 +printf "%s\n" "$works" >&6; } # check for socketpair @@ -14195,7 +16420,7 @@ # check for socketpair -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socketpair" >&5 -$as_echo_n "checking for socketpair... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socketpair" >&5 +printf %s "checking for socketpair... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14203,10 +16428,10 @@ #include <sys/socket.h> int -main () +main (void) { void *x=socketpair ; return 0; } _ACEOF @@ -14207,20 +16432,21 @@ { void *x=socketpair ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_SOCKETPAIR 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_SOCKETPAIR 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # check if sockaddr has sa_len member @@ -14225,9 +16451,9 @@ # check if sockaddr has sa_len member -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if sockaddr has sa_len member" >&5 -$as_echo_n "checking if sockaddr has sa_len member... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if sockaddr has sa_len member" >&5 +printf %s "checking if sockaddr has sa_len member... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/socket.h> int @@ -14229,9 +16455,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/types.h> #include <sys/socket.h> int -main () +main (void) { struct sockaddr x; x.sa_len = 0; @@ -14239,20 +16465,21 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-( ac_fn_c_check_func "$LINENO" "gethostbyname_r" "ac_cv_func_gethostbyname_r" @@ -14254,14 +16481,15 @@ # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-( ac_fn_c_check_func "$LINENO" "gethostbyname_r" "ac_cv_func_gethostbyname_r" -if test "x$ac_cv_func_gethostbyname_r" = xyes; then : - - $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r with 6 args" >&5 -$as_echo_n "checking gethostbyname_r with 6 args... " >&6; } +if test "x$ac_cv_func_gethostbyname_r" = xyes +then : + + printf "%s\n" "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r with 6 args" >&5 +printf %s "checking gethostbyname_r with 6 args... " >&6; } OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14270,7 +16498,7 @@ # include <netdb.h> int -main () +main (void) { char *name; @@ -14285,25 +16513,26 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h - - -$as_echo "#define HAVE_GETHOSTBYNAME_R_6_ARG 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r with 5 args" >&5 -$as_echo_n "checking gethostbyname_r with 5 args... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + + printf "%s\n" "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h + + +printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_6_ARG 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r with 5 args" >&5 +printf %s "checking gethostbyname_r with 5 args... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include <netdb.h> int @@ -14304,10 +16533,10 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include <netdb.h> int -main () +main (void) { char *name; @@ -14322,25 +16551,26 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h - - -$as_echo "#define HAVE_GETHOSTBYNAME_R_5_ARG 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r with 3 args" >&5 -$as_echo_n "checking gethostbyname_r with 3 args... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + + printf "%s\n" "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h + + +printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_5_ARG 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gethostbyname_r with 3 args" >&5 +printf %s "checking gethostbyname_r with 3 args... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include <netdb.h> int @@ -14341,10 +16571,10 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include <netdb.h> int -main () +main (void) { char *name; @@ -14357,28 +16587,29 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - $as_echo "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h - - -$as_echo "#define HAVE_GETHOSTBYNAME_R_3_ARG 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO" +then : + + printf "%s\n" "#define HAVE_GETHOSTBYNAME_R 1" >>confdefs.h + + +printf "%s\n" "#define HAVE_GETHOSTBYNAME_R_3_ARG 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$OLD_CFLAGS @@ -14383,7 +16614,5 @@ CFLAGS=$OLD_CFLAGS -else - - for ac_func in gethostbyname -do : +else $as_nop + ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" @@ -14389,11 +16618,9 @@ ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" -if test "x$ac_cv_func_gethostbyname" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETHOSTBYNAME 1 -_ACEOF - -fi -done +if test "x$ac_cv_func_gethostbyname" = xyes +then : + printf "%s\n" "#define HAVE_GETHOSTBYNAME 1" >>confdefs.h + +fi fi @@ -14409,14 +16636,16 @@ # Linux requires this for correct f.p. operations ac_fn_c_check_func "$LINENO" "__fpu_control" "ac_cv_func___fpu_control" -if test "x$ac_cv_func___fpu_control" = xyes; then : - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __fpu_control in -lieee" >&5 -$as_echo_n "checking for __fpu_control in -lieee... " >&6; } -if ${ac_cv_lib_ieee___fpu_control+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "x$ac_cv_func___fpu_control" = xyes +then : + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __fpu_control in -lieee" >&5 +printf %s "checking for __fpu_control in -lieee... " >&6; } +if test ${ac_cv_lib_ieee___fpu_control+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -14425,8 +16654,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char __fpu_control (); int @@ -14431,9 +16657,9 @@ char __fpu_control (); int -main () +main (void) { return __fpu_control (); ; return 0; } _ACEOF @@ -14434,8 +16660,9 @@ { return __fpu_control (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ieee___fpu_control=yes @@ -14441,4 +16668,4 @@ ac_cv_lib_ieee___fpu_control=yes -else +else $as_nop ac_cv_lib_ieee___fpu_control=no fi @@ -14443,6 +16670,6 @@ ac_cv_lib_ieee___fpu_control=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi @@ -14446,12 +16673,11 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ieee___fpu_control" >&5 -$as_echo "$ac_cv_lib_ieee___fpu_control" >&6; } -if test "x$ac_cv_lib_ieee___fpu_control" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBIEEE 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ieee___fpu_control" >&5 +printf "%s\n" "$ac_cv_lib_ieee___fpu_control" >&6; } +if test "x$ac_cv_lib_ieee___fpu_control" = xyes +then : + printf "%s\n" "#define HAVE_LIBIEEE 1" >>confdefs.h LIBS="-lieee $LIBS" @@ -14467,7 +16693,7 @@ Darwin) ;; *) LIBM=-lm esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-libm=STRING" >&5 -$as_echo_n "checking for --with-libm=STRING... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-libm=STRING" >&5 +printf %s "checking for --with-libm=STRING... " >&6; } # Check whether --with-libm was given. @@ -14472,6 +16698,7 @@ # Check whether --with-libm was given. -if test "${with_libm+set}" = set; then : +if test ${with_libm+y} +then : withval=$with_libm; if test "$withval" = no then LIBM= @@ -14475,7 +16702,7 @@ withval=$with_libm; if test "$withval" = no then LIBM= - { $as_echo "$as_me:${as_lineno-$LINENO}: result: force LIBM empty" >&5 -$as_echo "force LIBM empty" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: force LIBM empty" >&5 +printf "%s\n" "force LIBM empty" >&6; } elif test "$withval" != yes then LIBM=$withval @@ -14480,6 +16707,6 @@ elif test "$withval" != yes then LIBM=$withval - { $as_echo "$as_me:${as_lineno-$LINENO}: result: set LIBM=\"$withval\"" >&5 -$as_echo "set LIBM=\"$withval\"" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: set LIBM=\"$withval\"" >&5 +printf "%s\n" "set LIBM=\"$withval\"" >&6; } else as_fn_error $? "proper usage is --with-libm=STRING" "$LINENO" 5 fi @@ -14484,10 +16711,10 @@ else as_fn_error $? "proper usage is --with-libm=STRING" "$LINENO" 5 fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: default LIBM=\"$LIBM\"" >&5 -$as_echo "default LIBM=\"$LIBM\"" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: default LIBM=\"$LIBM\"" >&5 +printf "%s\n" "default LIBM=\"$LIBM\"" >&6; } fi # check for --with-libc=... @@ -14489,9 +16716,9 @@ fi # check for --with-libc=... -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-libc=STRING" >&5 -$as_echo_n "checking for --with-libc=STRING... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-libc=STRING" >&5 +printf %s "checking for --with-libc=STRING... " >&6; } # Check whether --with-libc was given. @@ -14496,6 +16723,7 @@ # Check whether --with-libc was given. -if test "${with_libc+set}" = set; then : +if test ${with_libc+y} +then : withval=$with_libc; if test "$withval" = no then LIBC= @@ -14499,7 +16727,7 @@ withval=$with_libc; if test "$withval" = no then LIBC= - { $as_echo "$as_me:${as_lineno-$LINENO}: result: force LIBC empty" >&5 -$as_echo "force LIBC empty" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: force LIBC empty" >&5 +printf "%s\n" "force LIBC empty" >&6; } elif test "$withval" != yes then LIBC=$withval @@ -14504,6 +16732,6 @@ elif test "$withval" != yes then LIBC=$withval - { $as_echo "$as_me:${as_lineno-$LINENO}: result: set LIBC=\"$withval\"" >&5 -$as_echo "set LIBC=\"$withval\"" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: set LIBC=\"$withval\"" >&5 +printf "%s\n" "set LIBC=\"$withval\"" >&6; } else as_fn_error $? "proper usage is --with-libc=STRING" "$LINENO" 5 fi @@ -14508,8 +16736,8 @@ else as_fn_error $? "proper usage is --with-libc=STRING" "$LINENO" 5 fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: default LIBC=\"$LIBC\"" >&5 -$as_echo "default LIBC=\"$LIBC\"" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: default LIBC=\"$LIBC\"" >&5 +printf "%s\n" "default LIBC=\"$LIBC\"" >&6; } fi @@ -14517,13 +16745,13 @@ # * Check for gcc x64 inline assembler * # ************************************** -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x64 gcc inline assembler" >&5 -$as_echo_n "checking for x64 gcc inline assembler... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for x64 gcc inline assembler" >&5 +printf %s "checking for x64 gcc inline assembler... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) { __asm__ __volatile__ ("movq %rcx, %rax"); @@ -14532,5 +16760,6 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : have_gcc_asm_for_x64=yes @@ -14536,4 +16765,4 @@ have_gcc_asm_for_x64=yes -else +else $as_nop have_gcc_asm_for_x64=no fi @@ -14538,9 +16767,9 @@ have_gcc_asm_for_x64=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_asm_for_x64" >&5 -$as_echo "$have_gcc_asm_for_x64" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gcc_asm_for_x64" >&5 +printf "%s\n" "$have_gcc_asm_for_x64" >&6; } if test "$have_gcc_asm_for_x64" = yes then @@ -14544,7 +16773,7 @@ if test "$have_gcc_asm_for_x64" = yes then -$as_echo "#define HAVE_GCC_ASM_FOR_X64 1" >>confdefs.h +printf "%s\n" "#define HAVE_GCC_ASM_FOR_X64 1" >>confdefs.h fi @@ -14552,11 +16781,12 @@ # * Check for various properties of floating point * # ************************************************** -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether float word ordering is bigendian" >&5 -$as_echo_n "checking whether float word ordering is bigendian... " >&6; } -if ${ax_cv_c_float_words_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether float word ordering is bigendian" >&5 +printf %s "checking whether float word ordering is bigendian... " >&6; } +if test ${ax_cv_c_float_words_bigendian+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_cv_c_float_words_bigendian=unknown @@ -14568,9 +16798,10 @@ _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - -if $GREP noonsees conftest.$ac_objext >/dev/null ; then +if ac_fn_c_try_compile "$LINENO" +then : + + +if grep noonsees conftest.$ac_objext >/dev/null ; then ax_cv_c_float_words_bigendian=yes fi @@ -14575,6 +16806,6 @@ ax_cv_c_float_words_bigendian=yes fi -if $GREP seesnoon conftest.$ac_objext >/dev/null ; then +if grep seesnoon conftest.$ac_objext >/dev/null ; then if test "$ax_cv_c_float_words_bigendian" = unknown; then ax_cv_c_float_words_bigendian=no else @@ -14584,11 +16815,11 @@ fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_float_words_bigendian" >&5 -$as_echo "$ax_cv_c_float_words_bigendian" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_float_words_bigendian" >&5 +printf "%s\n" "$ax_cv_c_float_words_bigendian" >&6; } case $ax_cv_c_float_words_bigendian in yes) @@ -14591,8 +16822,8 @@ case $ax_cv_c_float_words_bigendian in yes) -$as_echo "#define FLOAT_WORDS_BIGENDIAN 1" >>confdefs.h +printf "%s\n" "#define FLOAT_WORDS_BIGENDIAN 1" >>confdefs.h ;; no) ;; @@ -14609,8 +16840,8 @@ if test "$ax_cv_c_float_words_bigendian" = "yes" then -$as_echo "#define DOUBLE_IS_BIG_ENDIAN_IEEE754 1" >>confdefs.h +printf "%s\n" "#define DOUBLE_IS_BIG_ENDIAN_IEEE754 1" >>confdefs.h elif test "$ax_cv_c_float_words_bigendian" = "no" then @@ -14613,8 +16844,8 @@ elif test "$ax_cv_c_float_words_bigendian" = "no" then -$as_echo "#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1" >>confdefs.h +printf "%s\n" "#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1" >>confdefs.h else # Some ARM platforms use a mixed-endian representation for doubles. @@ -14624,7 +16855,7 @@ # FLOAT_WORDS_BIGENDIAN doesnt actually detect this case, but if it's not big # or little, then it must be this? -$as_echo "#define DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 1" >>confdefs.h +printf "%s\n" "#define DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 1" >>confdefs.h fi @@ -14638,13 +16869,13 @@ # This inline assembler syntax may also work for suncc and icc, # so we try it on all platforms. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can use gcc inline assembler to get and set x87 control word" >&5 -$as_echo_n "checking whether we can use gcc inline assembler to get and set x87 control word... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can use gcc inline assembler to get and set x87 control word" >&5 +printf %s "checking whether we can use gcc inline assembler to get and set x87 control word... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) { unsigned short cw; @@ -14655,5 +16886,6 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : have_gcc_asm_for_x87=yes @@ -14659,4 +16891,4 @@ have_gcc_asm_for_x87=yes -else +else $as_nop have_gcc_asm_for_x87=no fi @@ -14661,9 +16893,9 @@ have_gcc_asm_for_x87=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_asm_for_x87" >&5 -$as_echo "$have_gcc_asm_for_x87" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gcc_asm_for_x87" >&5 +printf "%s\n" "$have_gcc_asm_for_x87" >&6; } if test "$have_gcc_asm_for_x87" = yes then @@ -14667,17 +16899,17 @@ if test "$have_gcc_asm_for_x87" = yes then -$as_echo "#define HAVE_GCC_ASM_FOR_X87 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can use gcc inline assembler to get and set mc68881 fpcr" >&5 -$as_echo_n "checking whether we can use gcc inline assembler to get and set mc68881 fpcr... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () +printf "%s\n" "#define HAVE_GCC_ASM_FOR_X87 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can use gcc inline assembler to get and set mc68881 fpcr" >&5 +printf %s "checking whether we can use gcc inline assembler to get and set mc68881 fpcr... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) { unsigned int fpcr; @@ -14688,5 +16920,6 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : have_gcc_asm_for_mc68881=yes @@ -14692,4 +16925,4 @@ have_gcc_asm_for_mc68881=yes -else +else $as_nop have_gcc_asm_for_mc68881=no fi @@ -14694,9 +16927,9 @@ have_gcc_asm_for_mc68881=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gcc_asm_for_mc68881" >&5 -$as_echo "$have_gcc_asm_for_mc68881" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gcc_asm_for_mc68881" >&5 +printf "%s\n" "$have_gcc_asm_for_mc68881" >&6; } if test "$have_gcc_asm_for_mc68881" = yes then @@ -14700,7 +16933,7 @@ if test "$have_gcc_asm_for_mc68881" = yes then -$as_echo "#define HAVE_GCC_ASM_FOR_MC68881 1" >>confdefs.h +printf "%s\n" "#define HAVE_GCC_ASM_FOR_MC68881 1" >>confdefs.h fi @@ -14709,8 +16942,8 @@ # IEEE 754 platforms. On IEEE 754, test should return 1 if rounding # mode is round-to-nearest and double rounding issues are present, and # 0 otherwise. See http://bugs.python.org/issue2937 for more info. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for x87-style double rounding" >&5 -$as_echo_n "checking for x87-style double rounding... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for x87-style double rounding" >&5 +printf %s "checking for x87-style double rounding... " >&6; } # $BASECFLAGS may affect the result ac_save_cc="$CC" CC="$CC $BASECFLAGS" @@ -14714,5 +16947,6 @@ # $BASECFLAGS may affect the result ac_save_cc="$CC" CC="$CC $BASECFLAGS" -if test "$cross_compiling" = yes; then : +if test "$cross_compiling" = yes +then : ac_cv_x87_double_rounding=no @@ -14718,5 +16952,5 @@ ac_cv_x87_double_rounding=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14740,5 +16974,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_x87_double_rounding=no @@ -14744,5 +16979,5 @@ ac_cv_x87_double_rounding=no -else +else $as_nop ac_cv_x87_double_rounding=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -14750,8 +16985,8 @@ fi CC="$ac_save_cc" -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_x87_double_rounding" >&5 -$as_echo "$ac_cv_x87_double_rounding" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_x87_double_rounding" >&5 +printf "%s\n" "$ac_cv_x87_double_rounding" >&6; } if test "$ac_cv_x87_double_rounding" = yes then @@ -14755,7 +16990,7 @@ if test "$ac_cv_x87_double_rounding" = yes then -$as_echo "#define X87_DOUBLE_ROUNDING 1" >>confdefs.h +printf "%s\n" "#define X87_DOUBLE_ROUNDING 1" >>confdefs.h fi @@ -14766,31 +17001,100 @@ LIBS_SAVE=$LIBS LIBS="$LIBS $LIBM" -for ac_func in acosh asinh atanh copysign erf erfc expm1 finite gamma -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -for ac_func in hypot lgamma log1p log2 round tgamma -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -ac_fn_c_check_decl "$LINENO" "isinf" "ac_cv_have_decl_isinf" "#include <math.h> -" -if test "x$ac_cv_have_decl_isinf" = xyes; then : +ac_fn_c_check_func "$LINENO" "acosh" "ac_cv_func_acosh" +if test "x$ac_cv_func_acosh" = xyes +then : + printf "%s\n" "#define HAVE_ACOSH 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "asinh" "ac_cv_func_asinh" +if test "x$ac_cv_func_asinh" = xyes +then : + printf "%s\n" "#define HAVE_ASINH 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "atanh" "ac_cv_func_atanh" +if test "x$ac_cv_func_atanh" = xyes +then : + printf "%s\n" "#define HAVE_ATANH 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "copysign" "ac_cv_func_copysign" +if test "x$ac_cv_func_copysign" = xyes +then : + printf "%s\n" "#define HAVE_COPYSIGN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "erf" "ac_cv_func_erf" +if test "x$ac_cv_func_erf" = xyes +then : + printf "%s\n" "#define HAVE_ERF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "erfc" "ac_cv_func_erfc" +if test "x$ac_cv_func_erfc" = xyes +then : + printf "%s\n" "#define HAVE_ERFC 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "expm1" "ac_cv_func_expm1" +if test "x$ac_cv_func_expm1" = xyes +then : + printf "%s\n" "#define HAVE_EXPM1 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "finite" "ac_cv_func_finite" +if test "x$ac_cv_func_finite" = xyes +then : + printf "%s\n" "#define HAVE_FINITE 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "gamma" "ac_cv_func_gamma" +if test "x$ac_cv_func_gamma" = xyes +then : + printf "%s\n" "#define HAVE_GAMMA 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "hypot" "ac_cv_func_hypot" +if test "x$ac_cv_func_hypot" = xyes +then : + printf "%s\n" "#define HAVE_HYPOT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "lgamma" "ac_cv_func_lgamma" +if test "x$ac_cv_func_lgamma" = xyes +then : + printf "%s\n" "#define HAVE_LGAMMA 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "log1p" "ac_cv_func_log1p" +if test "x$ac_cv_func_log1p" = xyes +then : + printf "%s\n" "#define HAVE_LOG1P 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "log2" "ac_cv_func_log2" +if test "x$ac_cv_func_log2" = xyes +then : + printf "%s\n" "#define HAVE_LOG2 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "round" "ac_cv_func_round" +if test "x$ac_cv_func_round" = xyes +then : + printf "%s\n" "#define HAVE_ROUND 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "tgamma" "ac_cv_func_tgamma" +if test "x$ac_cv_func_tgamma" = xyes +then : + printf "%s\n" "#define HAVE_TGAMMA 1" >>confdefs.h + +fi + +ac_fn_check_decl "$LINENO" "isinf" "ac_cv_have_decl_isinf" "#include <math.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_isinf" = xyes +then : ac_have_decl=1 @@ -14796,4 +17100,4 @@ ac_have_decl=1 -else +else $as_nop ac_have_decl=0 fi @@ -14798,10 +17102,8 @@ ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ISINF $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "isnan" "ac_cv_have_decl_isnan" "#include <math.h> -" -if test "x$ac_cv_have_decl_isnan" = xyes; then : +printf "%s\n" "#define HAVE_DECL_ISINF $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "isnan" "ac_cv_have_decl_isnan" "#include <math.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_isnan" = xyes +then : ac_have_decl=1 @@ -14807,4 +17109,4 @@ ac_have_decl=1 -else +else $as_nop ac_have_decl=0 fi @@ -14809,10 +17111,8 @@ ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ISNAN $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "isfinite" "ac_cv_have_decl_isfinite" "#include <math.h> -" -if test "x$ac_cv_have_decl_isfinite" = xyes; then : +printf "%s\n" "#define HAVE_DECL_ISNAN $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "isfinite" "ac_cv_have_decl_isfinite" "#include <math.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_isfinite" = xyes +then : ac_have_decl=1 @@ -14818,4 +17118,4 @@ ac_have_decl=1 -else +else $as_nop ac_have_decl=0 fi @@ -14820,9 +17120,6 @@ ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ISFINITE $ac_have_decl -_ACEOF +printf "%s\n" "#define HAVE_DECL_ISFINITE $ac_have_decl" >>confdefs.h # For multiprocessing module, check that sem_open @@ -14830,10 +17127,12 @@ # the kernel module that provides POSIX semaphores # isn't loaded by default, so an attempt to call # sem_open results in a 'Signal 12' error. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX semaphores are enabled" >&5 -$as_echo_n "checking whether POSIX semaphores are enabled... " >&6; } -if ${ac_cv_posix_semaphores_enabled+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether POSIX semaphores are enabled" >&5 +printf %s "checking whether POSIX semaphores are enabled... " >&6; } +if test ${ac_cv_posix_semaphores_enabled+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_posix_semaphores_enabled=yes @@ -14839,5 +17138,5 @@ ac_cv_posix_semaphores_enabled=yes -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14859,5 +17158,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_posix_semaphores_enabled=yes @@ -14863,5 +17163,5 @@ ac_cv_posix_semaphores_enabled=yes -else +else $as_nop ac_cv_posix_semaphores_enabled=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -14871,8 +17171,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_posix_semaphores_enabled" >&5 -$as_echo "$ac_cv_posix_semaphores_enabled" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_posix_semaphores_enabled" >&5 +printf "%s\n" "$ac_cv_posix_semaphores_enabled" >&6; } if test $ac_cv_posix_semaphores_enabled = no then @@ -14876,8 +17176,8 @@ if test $ac_cv_posix_semaphores_enabled = no then -$as_echo "#define POSIX_SEMAPHORES_NOT_ENABLED 1" >>confdefs.h +printf "%s\n" "#define POSIX_SEMAPHORES_NOT_ENABLED 1" >>confdefs.h fi # Multiprocessing check for broken sem_getvalue @@ -14880,11 +17180,13 @@ fi # Multiprocessing check for broken sem_getvalue -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken sem_getvalue" >&5 -$as_echo_n "checking for broken sem_getvalue... " >&6; } -if ${ac_cv_broken_sem_getvalue+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for broken sem_getvalue" >&5 +printf %s "checking for broken sem_getvalue... " >&6; } +if test ${ac_cv_broken_sem_getvalue+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_broken_sem_getvalue=yes @@ -14890,5 +17192,5 @@ ac_cv_broken_sem_getvalue=yes -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14914,5 +17216,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_broken_sem_getvalue=no @@ -14918,5 +17221,5 @@ ac_cv_broken_sem_getvalue=no -else +else $as_nop ac_cv_broken_sem_getvalue=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -14926,8 +17229,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_sem_getvalue" >&5 -$as_echo "$ac_cv_broken_sem_getvalue" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_sem_getvalue" >&5 +printf "%s\n" "$ac_cv_broken_sem_getvalue" >&6; } if test $ac_cv_broken_sem_getvalue = yes then @@ -14931,22 +17234,12 @@ if test $ac_cv_broken_sem_getvalue = yes then -$as_echo "#define HAVE_BROKEN_SEM_GETVALUE 1" >>confdefs.h - -fi - -ac_fn_c_check_decl "$LINENO" "RTLD_LAZY" "ac_cv_have_decl_RTLD_LAZY" "#include <dlfcn.h> -" -if test "x$ac_cv_have_decl_RTLD_LAZY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_RTLD_LAZY $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "RTLD_NOW" "ac_cv_have_decl_RTLD_NOW" "#include <dlfcn.h> -" -if test "x$ac_cv_have_decl_RTLD_NOW" = xyes; then : +printf "%s\n" "#define HAVE_BROKEN_SEM_GETVALUE 1" >>confdefs.h + +fi + +ac_fn_check_decl "$LINENO" "RTLD_LAZY" "ac_cv_have_decl_RTLD_LAZY" "#include <dlfcn.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_RTLD_LAZY" = xyes +then : ac_have_decl=1 @@ -14952,4 +17245,4 @@ ac_have_decl=1 -else +else $as_nop ac_have_decl=0 fi @@ -14954,10 +17247,8 @@ ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_RTLD_NOW $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "RTLD_GLOBAL" "ac_cv_have_decl_RTLD_GLOBAL" "#include <dlfcn.h> -" -if test "x$ac_cv_have_decl_RTLD_GLOBAL" = xyes; then : +printf "%s\n" "#define HAVE_DECL_RTLD_LAZY $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "RTLD_NOW" "ac_cv_have_decl_RTLD_NOW" "#include <dlfcn.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_RTLD_NOW" = xyes +then : ac_have_decl=1 @@ -14963,4 +17254,4 @@ ac_have_decl=1 -else +else $as_nop ac_have_decl=0 fi @@ -14965,10 +17256,8 @@ ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_RTLD_GLOBAL $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "RTLD_LOCAL" "ac_cv_have_decl_RTLD_LOCAL" "#include <dlfcn.h> -" -if test "x$ac_cv_have_decl_RTLD_LOCAL" = xyes; then : +printf "%s\n" "#define HAVE_DECL_RTLD_NOW $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "RTLD_GLOBAL" "ac_cv_have_decl_RTLD_GLOBAL" "#include <dlfcn.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_RTLD_GLOBAL" = xyes +then : ac_have_decl=1 @@ -14974,4 +17263,4 @@ ac_have_decl=1 -else +else $as_nop ac_have_decl=0 fi @@ -14976,10 +17265,8 @@ ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_RTLD_LOCAL $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "RTLD_NODELETE" "ac_cv_have_decl_RTLD_NODELETE" "#include <dlfcn.h> -" -if test "x$ac_cv_have_decl_RTLD_NODELETE" = xyes; then : +printf "%s\n" "#define HAVE_DECL_RTLD_GLOBAL $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "RTLD_LOCAL" "ac_cv_have_decl_RTLD_LOCAL" "#include <dlfcn.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_RTLD_LOCAL" = xyes +then : ac_have_decl=1 @@ -14985,4 +17272,4 @@ ac_have_decl=1 -else +else $as_nop ac_have_decl=0 fi @@ -14987,10 +17274,8 @@ ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_RTLD_NODELETE $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "RTLD_NOLOAD" "ac_cv_have_decl_RTLD_NOLOAD" "#include <dlfcn.h> -" -if test "x$ac_cv_have_decl_RTLD_NOLOAD" = xyes; then : +printf "%s\n" "#define HAVE_DECL_RTLD_LOCAL $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "RTLD_NODELETE" "ac_cv_have_decl_RTLD_NODELETE" "#include <dlfcn.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_RTLD_NODELETE" = xyes +then : ac_have_decl=1 @@ -14996,4 +17281,4 @@ ac_have_decl=1 -else +else $as_nop ac_have_decl=0 fi @@ -14998,10 +17283,8 @@ ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_RTLD_NOLOAD $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "RTLD_DEEPBIND" "ac_cv_have_decl_RTLD_DEEPBIND" "#include <dlfcn.h> -" -if test "x$ac_cv_have_decl_RTLD_DEEPBIND" = xyes; then : +printf "%s\n" "#define HAVE_DECL_RTLD_NODELETE $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "RTLD_NOLOAD" "ac_cv_have_decl_RTLD_NOLOAD" "#include <dlfcn.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_RTLD_NOLOAD" = xyes +then : ac_have_decl=1 @@ -15007,4 +17290,4 @@ ac_have_decl=1 -else +else $as_nop ac_have_decl=0 fi @@ -15009,10 +17292,8 @@ ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_RTLD_DEEPBIND $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "RTLD_MEMBER" "ac_cv_have_decl_RTLD_MEMBER" "#include <dlfcn.h> -" -if test "x$ac_cv_have_decl_RTLD_MEMBER" = xyes; then : +printf "%s\n" "#define HAVE_DECL_RTLD_NOLOAD $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "RTLD_DEEPBIND" "ac_cv_have_decl_RTLD_DEEPBIND" "#include <dlfcn.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_RTLD_DEEPBIND" = xyes +then : ac_have_decl=1 @@ -15018,4 +17299,4 @@ ac_have_decl=1 -else +else $as_nop ac_have_decl=0 fi @@ -15020,9 +17301,15 @@ ac_have_decl=0 fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_RTLD_MEMBER $ac_have_decl -_ACEOF +printf "%s\n" "#define HAVE_DECL_RTLD_DEEPBIND $ac_have_decl" >>confdefs.h +ac_fn_check_decl "$LINENO" "RTLD_MEMBER" "ac_cv_have_decl_RTLD_MEMBER" "#include <dlfcn.h> +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_RTLD_MEMBER" = xyes +then : + ac_have_decl=1 +else $as_nop + ac_have_decl=0 +fi +printf "%s\n" "#define HAVE_DECL_RTLD_MEMBER $ac_have_decl" >>confdefs.h # determine what size digit to use for Python's longs @@ -15026,6 +17313,6 @@ # determine what size digit to use for Python's longs -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking digit size for Python's longs" >&5 -$as_echo_n "checking digit size for Python's longs... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking digit size for Python's longs" >&5 +printf %s "checking digit size for Python's longs... " >&6; } # Check whether --enable-big-digits was given. @@ -15031,5 +17318,6 @@ # Check whether --enable-big-digits was given. -if test "${enable_big_digits+set}" = set; then : +if test ${enable_big_digits+y} +then : enableval=$enable_big_digits; case $enable_big_digits in yes) enable_big_digits=30 ;; @@ -15040,18 +17328,16 @@ *) as_fn_error $? "bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30" "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_big_digits" >&5 -$as_echo "$enable_big_digits" >&6; } - -cat >>confdefs.h <<_ACEOF -#define PYLONG_BITS_IN_DIGIT $enable_big_digits -_ACEOF - - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no value specified" >&5 -$as_echo "no value specified" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_big_digits" >&5 +printf "%s\n" "$enable_big_digits" >&6; } + +printf "%s\n" "#define PYLONG_BITS_IN_DIGIT $enable_big_digits" >>confdefs.h + + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no value specified" >&5 +printf "%s\n" "no value specified" >&6; } fi # check for wchar.h @@ -15054,12 +17340,13 @@ fi # check for wchar.h -ac_fn_c_check_header_mongrel "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" -if test "x$ac_cv_header_wchar_h" = xyes; then : - - -$as_echo "#define HAVE_WCHAR_H 1" >>confdefs.h +ac_fn_c_check_header_compile "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default" +if test "x$ac_cv_header_wchar_h" = xyes +then : + + +printf "%s\n" "#define HAVE_WCHAR_H 1" >>confdefs.h wchar_h="yes" @@ -15063,9 +17350,9 @@ wchar_h="yes" -else +else $as_nop wchar_h="no" fi @@ -15067,9 +17354,8 @@ wchar_h="no" fi - # determine wchar_t size if test "$wchar_h" = yes then @@ -15077,9 +17363,10 @@ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5 -$as_echo_n "checking size of wchar_t... " >&6; } -if ${ac_cv_sizeof_wchar_t+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5 +printf %s "checking size of wchar_t... " >&6; } +if test ${ac_cv_sizeof_wchar_t+y} +then : + printf %s "(cached) " >&6 +else $as_nop if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "#include <wchar.h> @@ -15085,5 +17372,6 @@ if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "#include <wchar.h> -"; then : - -else +" +then : + +else $as_nop if test "$ac_cv_type_wchar_t" = yes; then @@ -15089,6 +17377,6 @@ if test "$ac_cv_type_wchar_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (wchar_t) See \`config.log' for more details" "$LINENO" 5; } else @@ -15097,20 +17385,18 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_wchar_t" >&5 -$as_echo "$ac_cv_sizeof_wchar_t" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t -_ACEOF - - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UCS-4 tcl" >&5 -$as_echo_n "checking for UCS-4 tcl... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_wchar_t" >&5 +printf "%s\n" "$ac_cv_sizeof_wchar_t" >&6; } + + + +printf "%s\n" "#define SIZEOF_WCHAR_T $ac_cv_sizeof_wchar_t" >>confdefs.h + + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for UCS-4 tcl" >&5 +printf %s "checking for UCS-4 tcl... " >&6; } have_ucs4_tcl=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15120,18 +17406,19 @@ # error "NOT UCS4_TCL" #endif int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - -$as_echo "#define HAVE_UCS4_TCL 1" >>confdefs.h +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + +printf "%s\n" "#define HAVE_UCS4_TCL 1" >>confdefs.h have_ucs4_tcl=yes fi @@ -15134,12 +17421,12 @@ have_ucs4_tcl=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ucs4_tcl" >&5 -$as_echo "$have_ucs4_tcl" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_ucs4_tcl" >&5 +printf "%s\n" "$have_ucs4_tcl" >&6; } # check whether wchar_t is signed or not if test "$wchar_h" = yes then # check whether wchar_t is signed or not @@ -15141,13 +17428,15 @@ # check whether wchar_t is signed or not if test "$wchar_h" = yes then # check whether wchar_t is signed or not - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wchar_t is signed" >&5 -$as_echo_n "checking whether wchar_t is signed... " >&6; } - if ${ac_cv_wchar_t_signed+:} false; then : - $as_echo_n "(cached) " >&6 -else - - if test "$cross_compiling" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wchar_t is signed" >&5 +printf %s "checking whether wchar_t is signed... " >&6; } + if test ${ac_cv_wchar_t_signed+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + if test "$cross_compiling" = yes +then : ac_cv_wchar_t_signed=yes @@ -15153,5 +17442,5 @@ ac_cv_wchar_t_signed=yes -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15163,5 +17452,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_wchar_t_signed=yes @@ -15167,5 +17457,5 @@ ac_cv_wchar_t_signed=yes -else +else $as_nop ac_cv_wchar_t_signed=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -15174,14 +17464,14 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_wchar_t_signed" >&5 -$as_echo "$ac_cv_wchar_t_signed" >&6; } -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wchar_t is usable" >&5 -$as_echo_n "checking whether wchar_t is usable... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_wchar_t_signed" >&5 +printf "%s\n" "$ac_cv_wchar_t_signed" >&6; } +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wchar_t is usable" >&5 +printf %s "checking whether wchar_t is usable... " >&6; } # wchar_t is only usable if it maps to an unsigned type if test "$ac_cv_sizeof_wchar_t" -ge 2 \ -a "$ac_cv_wchar_t_signed" = "no" then @@ -15183,15 +17473,15 @@ # wchar_t is only usable if it maps to an unsigned type if test "$ac_cv_sizeof_wchar_t" -ge 2 \ -a "$ac_cv_wchar_t_signed" = "no" then -$as_echo "#define HAVE_USABLE_WCHAR_T 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +printf "%s\n" "#define HAVE_USABLE_WCHAR_T 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # check for endianness @@ -15195,11 +17485,12 @@ fi # check for endianness - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15210,7 +17501,8 @@ typedef int dummy; _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. @@ -15234,7 +17526,7 @@ fi done fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15243,7 +17535,7 @@ #include <sys/param.h> int -main () +main (void) { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ @@ -15255,7 +17547,8 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15263,7 +17556,7 @@ #include <sys/param.h> int -main () +main (void) { #if BYTE_ORDER != BIG_ENDIAN not big endian @@ -15273,5 +17566,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes @@ -15277,4 +17571,4 @@ ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi @@ -15279,8 +17573,8 @@ ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). @@ -15289,7 +17583,7 @@ #include <limits.h> int -main () +main (void) { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros @@ -15299,10 +17593,11 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <limits.h> int @@ -15303,10 +17598,10 @@ # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <limits.h> int -main () +main (void) { #ifndef _BIG_ENDIAN not big endian @@ -15316,5 +17611,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes @@ -15320,4 +17616,4 @@ ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi @@ -15322,8 +17618,8 @@ ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. @@ -15327,7 +17623,8 @@ fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15331,5 +17628,5 @@ # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -short int ascii_mm[] = +unsigned short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; @@ -15335,6 +17632,6 @@ { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = + unsigned short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } @@ -15337,6 +17634,6 @@ { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } - short int ebcdic_ii[] = + unsigned short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; @@ -15342,5 +17639,5 @@ { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = + unsigned short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; @@ -15348,10 +17645,10 @@ extern int foo; int -main () +main (void) { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF @@ -15352,10 +17649,11 @@ { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi @@ -15368,9 +17666,9 @@ fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -15373,8 +17671,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { /* Are we little or big endian? From Harbison&Steele. */ @@ -15390,5 +17688,6 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_c_bigendian=no @@ -15394,5 +17693,5 @@ ac_cv_c_bigendian=no -else +else $as_nop ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -15401,7 +17700,7 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) @@ -15406,8 +17705,8 @@ case $ac_cv_c_bigendian in #( yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h + printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) @@ -15409,9 +17708,9 @@ ;; #( no) ;; #( universal) -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) @@ -15436,10 +17735,10 @@ # In Python 3.2 and older, --with-wide-unicode added a 'u' flag. # In Python 3.7 and older, --with-pymalloc added a 'm' flag. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking ABIFLAGS" >&5 -$as_echo_n "checking ABIFLAGS... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ABIFLAGS" >&5 -$as_echo "$ABIFLAGS" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5 -$as_echo_n "checking SOABI... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ABIFLAGS" >&5 +printf %s "checking ABIFLAGS... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ABIFLAGS" >&5 +printf "%s\n" "$ABIFLAGS" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking SOABI" >&5 +printf %s "checking SOABI... " >&6; } SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET} @@ -15445,6 +17744,6 @@ SOABI='cpython-'`echo $VERSION | tr -d .`${ABIFLAGS}${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET} -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5 -$as_echo "$SOABI" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SOABI" >&5 +printf "%s\n" "$SOABI" >&6; } # Release and debug (Py_DEBUG) ABI are compatible, but not Py_TRACE_REFS ABI if test "$Py_DEBUG" = 'true' -a "$with_trace_refs" != "yes"; then @@ -15452,12 +17751,10 @@ ALT_SOABI='cpython-'`echo $VERSION | tr -d .``echo $ABIFLAGS | tr -d d`${PLATFORM_TRIPLET:+-$PLATFORM_TRIPLET} -cat >>confdefs.h <<_ACEOF -#define ALT_SOABI "${ALT_SOABI}" -_ACEOF +printf "%s\n" "#define ALT_SOABI \"${ALT_SOABI}\"" >>confdefs.h fi EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX} @@ -15458,9 +17755,9 @@ fi EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LDVERSION" >&5 -$as_echo_n "checking LDVERSION... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking LDVERSION" >&5 +printf %s "checking LDVERSION... " >&6; } LDVERSION='$(VERSION)$(ABIFLAGS)' @@ -15466,6 +17763,6 @@ LDVERSION='$(VERSION)$(ABIFLAGS)' -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDVERSION" >&5 -$as_echo "$LDVERSION" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LDVERSION" >&5 +printf "%s\n" "$LDVERSION" >&6; } # On Android and Cygwin the shared libraries must be linked with libpython. @@ -15484,7 +17781,7 @@ # /usr/$LIDIRNAME/python$VERSION PLATLIBDIR="lib" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-platlibdir" >&5 -$as_echo_n "checking for --with-platlibdir... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-platlibdir" >&5 +printf %s "checking for --with-platlibdir... " >&6; } # Check whether --with-platlibdir was given. @@ -15489,6 +17786,7 @@ # Check whether --with-platlibdir was given. -if test "${with_platlibdir+set}" = set; then : +if test ${with_platlibdir+y} +then : withval=$with_platlibdir; # ignore 3 options: # --with-platlibdir @@ -15496,8 +17794,8 @@ # --without-platlibdir if test -n "$withval" -a "$withval" != yes -a "$withval" != no then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } PLATLIBDIR="$withval" BINLIBDEST='${exec_prefix}/${PLATLIBDIR}/python$(VERSION)' else @@ -15501,12 +17799,12 @@ PLATLIBDIR="$withval" BINLIBDEST='${exec_prefix}/${PLATLIBDIR}/python$(VERSION)' else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -15522,7 +17820,7 @@ # Check for --with-wheel-pkg-dir=PATH WHEEL_PKG_DIR="" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-wheel-pkg-dir" >&5 -$as_echo_n "checking for --with-wheel-pkg-dir... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-wheel-pkg-dir" >&5 +printf %s "checking for --with-wheel-pkg-dir... " >&6; } # Check whether --with-wheel-pkg-dir was given. @@ -15527,5 +17825,6 @@ # Check whether --with-wheel-pkg-dir was given. -if test "${with_wheel_pkg_dir+set}" = set; then : +if test ${with_wheel_pkg_dir+y} +then : withval=$with_wheel_pkg_dir; if test -n "$withval"; then @@ -15530,6 +17829,6 @@ withval=$with_wheel_pkg_dir; if test -n "$withval"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } WHEEL_PKG_DIR="$withval" else @@ -15534,13 +17833,13 @@ WHEEL_PKG_DIR="$withval" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # Check whether right shifting a negative integer extends the sign bit # or fills with zeros (like the Cray J90, according to Tim Peters). @@ -15542,13 +17841,15 @@ fi # Check whether right shifting a negative integer extends the sign bit # or fills with zeros (like the Cray J90, according to Tim Peters). -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether right shift extends the sign bit" >&5 -$as_echo_n "checking whether right shift extends the sign bit... " >&6; } -if ${ac_cv_rshift_extends_sign+:} false; then : - $as_echo_n "(cached) " >&6 -else - -if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether right shift extends the sign bit" >&5 +printf %s "checking whether right shift extends the sign bit... " >&6; } +if test ${ac_cv_rshift_extends_sign+y} +then : + printf %s "(cached) " >&6 +else $as_nop + +if test "$cross_compiling" = yes +then : ac_cv_rshift_extends_sign=yes @@ -15554,5 +17855,5 @@ ac_cv_rshift_extends_sign=yes -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15562,5 +17863,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_rshift_extends_sign=yes @@ -15566,5 +17868,5 @@ ac_cv_rshift_extends_sign=yes -else +else $as_nop ac_cv_rshift_extends_sign=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -15573,8 +17875,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_rshift_extends_sign" >&5 -$as_echo "$ac_cv_rshift_extends_sign" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_rshift_extends_sign" >&5 +printf "%s\n" "$ac_cv_rshift_extends_sign" >&6; } if test "$ac_cv_rshift_extends_sign" = no then @@ -15578,8 +17880,8 @@ if test "$ac_cv_rshift_extends_sign" = no then -$as_echo "#define SIGNED_RIGHT_SHIFT_ZERO_FILLS 1" >>confdefs.h +printf "%s\n" "#define SIGNED_RIGHT_SHIFT_ZERO_FILLS 1" >>confdefs.h fi # check for getc_unlocked and related locking functions @@ -15582,14 +17884,15 @@ fi # check for getc_unlocked and related locking functions -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getc_unlocked() and friends" >&5 -$as_echo_n "checking for getc_unlocked() and friends... " >&6; } -if ${ac_cv_have_getc_unlocked+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getc_unlocked() and friends" >&5 +printf %s "checking for getc_unlocked() and friends... " >&6; } +if test ${ac_cv_have_getc_unlocked+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdio.h> int @@ -15591,9 +17894,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <stdio.h> int -main () +main (void) { FILE *f = fopen("/dev/null", "r"); @@ -15605,5 +17908,6 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_have_getc_unlocked=yes @@ -15609,4 +17913,4 @@ ac_cv_have_getc_unlocked=yes -else +else $as_nop ac_cv_have_getc_unlocked=no fi @@ -15611,11 +17915,11 @@ ac_cv_have_getc_unlocked=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_getc_unlocked" >&5 -$as_echo "$ac_cv_have_getc_unlocked" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_getc_unlocked" >&5 +printf "%s\n" "$ac_cv_have_getc_unlocked" >&6; } if test "$ac_cv_have_getc_unlocked" = yes then @@ -15619,9 +17923,9 @@ if test "$ac_cv_have_getc_unlocked" = yes then -$as_echo "#define HAVE_GETC_UNLOCKED 1" >>confdefs.h +printf "%s\n" "#define HAVE_GETC_UNLOCKED 1" >>confdefs.h fi # Check whether --with-readline was given. @@ -15623,7 +17927,8 @@ fi # Check whether --with-readline was given. -if test "${with_readline+set}" = set; then : +if test ${with_readline+y} +then : withval=$with_readline; @@ -15629,5 +17934,5 @@ withval=$with_readline; -else +else $as_nop with_readline=yes fi @@ -15642,7 +17947,7 @@ editline|edit) LIBREADLINE=edit -$as_echo "#define WITH_EDITLINE 1" >>confdefs.h +printf "%s\n" "#define WITH_EDITLINE 1" >>confdefs.h ;; yes|readline) @@ -15656,8 +17961,8 @@ # On some systems we need to link readline to a termcap compatible # library. NOTE: Keep the precedence of listed libraries synchronised # with setup.py. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link readline libs" >&5 -$as_echo_n "checking how to link readline libs... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link readline libs" >&5 +printf %s "checking how to link readline libs... " >&6; } for py_libtermcap in "" tinfo ncursesw ncurses curses termcap; do if test -z "$py_libtermcap"; then READLINE_LIBS="-l$LIBREADLINE" @@ -15671,8 +17976,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char readline (); int @@ -15677,9 +17979,9 @@ char readline (); int -main () +main (void) { return readline (); ; return 0; } _ACEOF @@ -15680,9 +17982,10 @@ { return readline (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : py_cv_lib_readline=yes fi @@ -15687,6 +17990,6 @@ py_cv_lib_readline=yes fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test $py_cv_lib_readline = yes; then break @@ -15696,6 +17999,6 @@ # Uncomment this line if you want to use READLINE_LIBS in Makefile or scripts #AC_SUBST([READLINE_LIBS]) if test $py_cv_lib_readline = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } else @@ -15701,11 +18004,11 @@ else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINE_LIBS" >&5 -$as_echo "$READLINE_LIBS" >&6; } - -$as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $READLINE_LIBS" >&5 +printf "%s\n" "$READLINE_LIBS" >&6; } + +printf "%s\n" "#define HAVE_LIBREADLINE 1" >>confdefs.h fi fi if test "$py_cv_lib_readline" = yes; then # check for readline 2.2 @@ -15706,10 +18009,10 @@ fi fi if test "$py_cv_lib_readline" = yes; then # check for readline 2.2 - ac_fn_c_check_decl "$LINENO" "rl_completion_append_character" "ac_cv_have_decl_rl_completion_append_character" " + ac_fn_check_decl "$LINENO" "rl_completion_append_character" "ac_cv_have_decl_rl_completion_append_character" " #include <stdio.h> /* Must be first for Gnu Readline */ #ifdef WITH_EDITLINE # include <editline/readline.h> @@ -15717,14 +18020,14 @@ # include <readline/readline.h> #endif -" -if test "x$ac_cv_have_decl_rl_completion_append_character" = xyes; then : - -$as_echo "#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1" >>confdefs.h - -fi - - ac_fn_c_check_decl "$LINENO" "rl_completion_suppress_append" "ac_cv_have_decl_rl_completion_suppress_append" " +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_rl_completion_append_character" = xyes +then : + +printf "%s\n" "#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1" >>confdefs.h + +fi + ac_fn_check_decl "$LINENO" "rl_completion_suppress_append" "ac_cv_have_decl_rl_completion_suppress_append" " #include <stdio.h> /* Must be first for Gnu Readline */ #ifdef WITH_EDITLINE # include <editline/readline.h> @@ -15732,12 +18035,12 @@ # include <readline/readline.h> #endif -" -if test "x$ac_cv_have_decl_rl_completion_suppress_append" = xyes; then : - -$as_echo "#define HAVE_RL_COMPLETION_SUPPRESS_APPEND 1" >>confdefs.h - -fi - +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_rl_completion_suppress_append" = xyes +then : + +printf "%s\n" "#define HAVE_RL_COMPLETION_SUPPRESS_APPEND 1" >>confdefs.h + +fi # check for readline 4.0 @@ -15742,11 +18045,12 @@ # check for readline 4.0 - as_ac_Lib=`$as_echo "ac_cv_lib_$LIBREADLINE''_rl_pre_input_hook" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in -l$LIBREADLINE" >&5 -$as_echo_n "checking for rl_pre_input_hook in -l$LIBREADLINE... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$LIBREADLINE""_rl_pre_input_hook" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rl_pre_input_hook in -l$LIBREADLINE" >&5 +printf %s "checking for rl_pre_input_hook in -l$LIBREADLINE... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-l$LIBREADLINE $READLINE_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15755,8 +18059,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char rl_pre_input_hook (); int @@ -15761,9 +18062,9 @@ char rl_pre_input_hook (); int -main () +main (void) { return rl_pre_input_hook (); ; return 0; } _ACEOF @@ -15764,8 +18065,9 @@ { return rl_pre_input_hook (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_ac_Lib=yes" @@ -15771,4 +18073,4 @@ eval "$as_ac_Lib=yes" -else +else $as_nop eval "$as_ac_Lib=no" fi @@ -15773,7 +18075,7 @@ eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib @@ -15776,14 +18078,15 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - -$as_echo "#define HAVE_RL_PRE_INPUT_HOOK 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + +printf "%s\n" "#define HAVE_RL_PRE_INPUT_HOOK 1" >>confdefs.h fi # also in 4.0 @@ -15785,14 +18088,15 @@ fi # also in 4.0 - as_ac_Lib=`$as_echo "ac_cv_lib_$LIBREADLINE''_rl_completion_display_matches_hook" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_display_matches_hook in -l$LIBREADLINE" >&5 -$as_echo_n "checking for rl_completion_display_matches_hook in -l$LIBREADLINE... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$LIBREADLINE""_rl_completion_display_matches_hook" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rl_completion_display_matches_hook in -l$LIBREADLINE" >&5 +printf %s "checking for rl_completion_display_matches_hook in -l$LIBREADLINE... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-l$LIBREADLINE $READLINE_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15801,8 +18105,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char rl_completion_display_matches_hook (); int @@ -15807,9 +18108,9 @@ char rl_completion_display_matches_hook (); int -main () +main (void) { return rl_completion_display_matches_hook (); ; return 0; } _ACEOF @@ -15810,8 +18111,9 @@ { return rl_completion_display_matches_hook (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_ac_Lib=yes" @@ -15817,4 +18119,4 @@ eval "$as_ac_Lib=yes" -else +else $as_nop eval "$as_ac_Lib=no" fi @@ -15819,7 +18121,7 @@ eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib @@ -15822,14 +18124,15 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - -$as_echo "#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + +printf "%s\n" "#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1" >>confdefs.h fi # also in 4.0, but not in editline @@ -15831,14 +18134,15 @@ fi # also in 4.0, but not in editline - as_ac_Lib=`$as_echo "ac_cv_lib_$LIBREADLINE''_rl_resize_terminal" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_resize_terminal in -l$LIBREADLINE" >&5 -$as_echo_n "checking for rl_resize_terminal in -l$LIBREADLINE... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$LIBREADLINE""_rl_resize_terminal" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rl_resize_terminal in -l$LIBREADLINE" >&5 +printf %s "checking for rl_resize_terminal in -l$LIBREADLINE... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-l$LIBREADLINE $READLINE_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15847,8 +18151,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char rl_resize_terminal (); int @@ -15853,9 +18154,9 @@ char rl_resize_terminal (); int -main () +main (void) { return rl_resize_terminal (); ; return 0; } _ACEOF @@ -15856,8 +18157,9 @@ { return rl_resize_terminal (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_ac_Lib=yes" @@ -15863,4 +18165,4 @@ eval "$as_ac_Lib=yes" -else +else $as_nop eval "$as_ac_Lib=no" fi @@ -15865,7 +18167,7 @@ eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib @@ -15868,14 +18170,15 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - -$as_echo "#define HAVE_RL_RESIZE_TERMINAL 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + +printf "%s\n" "#define HAVE_RL_RESIZE_TERMINAL 1" >>confdefs.h fi # check for readline 4.2 @@ -15877,14 +18180,15 @@ fi # check for readline 4.2 - as_ac_Lib=`$as_echo "ac_cv_lib_$LIBREADLINE''_rl_completion_matches" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -l$LIBREADLINE" >&5 -$as_echo_n "checking for rl_completion_matches in -l$LIBREADLINE... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$LIBREADLINE""_rl_completion_matches" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for rl_completion_matches in -l$LIBREADLINE" >&5 +printf %s "checking for rl_completion_matches in -l$LIBREADLINE... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-l$LIBREADLINE $READLINE_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15893,8 +18197,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char rl_completion_matches (); int @@ -15899,9 +18200,9 @@ char rl_completion_matches (); int -main () +main (void) { return rl_completion_matches (); ; return 0; } _ACEOF @@ -15902,8 +18203,9 @@ { return rl_completion_matches (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_ac_Lib=yes" @@ -15909,4 +18211,4 @@ eval "$as_ac_Lib=yes" -else +else $as_nop eval "$as_ac_Lib=no" fi @@ -15911,7 +18213,7 @@ eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib @@ -15914,14 +18216,15 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - -$as_echo "#define HAVE_RL_COMPLETION_MATCHES 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + +printf "%s\n" "#define HAVE_RL_COMPLETION_MATCHES 1" >>confdefs.h fi # also in readline 4.2 @@ -15923,9 +18226,9 @@ fi # also in readline 4.2 - ac_fn_c_check_decl "$LINENO" "rl_catch_signals" "ac_cv_have_decl_rl_catch_signals" " + ac_fn_check_decl "$LINENO" "rl_catch_signals" "ac_cv_have_decl_rl_catch_signals" " #include <stdio.h> /* Must be first for Gnu Readline */ #ifdef WITH_EDITLINE # include <editline/readline.h> @@ -15933,20 +18236,21 @@ # include <readline/readline.h> #endif -" -if test "x$ac_cv_have_decl_rl_catch_signals" = xyes; then : - -$as_echo "#define HAVE_RL_CATCH_SIGNAL 1" >>confdefs.h - -fi - - - as_ac_Lib=`$as_echo "ac_cv_lib_$LIBREADLINE''_append_history" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for append_history in -l$LIBREADLINE" >&5 -$as_echo_n "checking for append_history in -l$LIBREADLINE... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else +" "$ac_c_undeclared_builtin_options" "CFLAGS" +if test "x$ac_cv_have_decl_rl_catch_signals" = xyes +then : + +printf "%s\n" "#define HAVE_RL_CATCH_SIGNAL 1" >>confdefs.h + +fi + + as_ac_Lib=`printf "%s\n" "ac_cv_lib_$LIBREADLINE""_append_history" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for append_history in -l$LIBREADLINE" >&5 +printf %s "checking for append_history in -l$LIBREADLINE... " >&6; } +if eval test \${$as_ac_Lib+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-l$LIBREADLINE $READLINE_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -15955,8 +18259,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char append_history (); int @@ -15961,9 +18262,9 @@ char append_history (); int -main () +main (void) { return append_history (); ; return 0; } _ACEOF @@ -15964,8 +18265,9 @@ { return append_history (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_ac_Lib=yes" @@ -15971,4 +18273,4 @@ eval "$as_ac_Lib=yes" -else +else $as_nop eval "$as_ac_Lib=no" fi @@ -15973,7 +18275,7 @@ eval "$as_ac_Lib=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib @@ -15976,12 +18278,13 @@ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - -$as_echo "#define HAVE_RL_APPEND_HISTORY 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Lib"\" = x"yes" +then : + +printf "%s\n" "#define HAVE_RL_APPEND_HISTORY 1" >>confdefs.h fi @@ -15990,11 +18293,13 @@ # End of readline checks: restore LIBS LIBS=$LIBS_no_readline -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken nice()" >&5 -$as_echo_n "checking for broken nice()... " >&6; } -if ${ac_cv_broken_nice+:} false; then : - $as_echo_n "(cached) " >&6 -else - -if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for broken nice()" >&5 +printf %s "checking for broken nice()... " >&6; } +if test ${ac_cv_broken_nice+y} +then : + printf %s "(cached) " >&6 +else $as_nop + +if test "$cross_compiling" = yes +then : ac_cv_broken_nice=no @@ -16000,5 +18305,5 @@ ac_cv_broken_nice=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16013,5 +18318,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_broken_nice=yes @@ -16017,5 +18323,5 @@ ac_cv_broken_nice=yes -else +else $as_nop ac_cv_broken_nice=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16024,8 +18330,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_nice" >&5 -$as_echo "$ac_cv_broken_nice" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_nice" >&5 +printf "%s\n" "$ac_cv_broken_nice" >&6; } if test "$ac_cv_broken_nice" = yes then @@ -16029,14 +18335,16 @@ if test "$ac_cv_broken_nice" = yes then -$as_echo "#define HAVE_BROKEN_NICE 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken poll()" >&5 -$as_echo_n "checking for broken poll()... " >&6; } -if ${ac_cv_broken_poll+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +printf "%s\n" "#define HAVE_BROKEN_NICE 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for broken poll()" >&5 +printf %s "checking for broken poll()... " >&6; } +if test ${ac_cv_broken_poll+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_broken_poll=no @@ -16042,5 +18350,5 @@ ac_cv_broken_poll=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16064,5 +18372,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_broken_poll=yes @@ -16068,5 +18377,5 @@ ac_cv_broken_poll=yes -else +else $as_nop ac_cv_broken_poll=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16075,8 +18384,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_poll" >&5 -$as_echo "$ac_cv_broken_poll" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_poll" >&5 +printf "%s\n" "$ac_cv_broken_poll" >&6; } if test "$ac_cv_broken_poll" = yes then @@ -16080,8 +18389,8 @@ if test "$ac_cv_broken_poll" = yes then -$as_echo "#define HAVE_BROKEN_POLL 1" >>confdefs.h +printf "%s\n" "#define HAVE_BROKEN_POLL 1" >>confdefs.h fi # check tzset(3) exists and works like we expect it to @@ -16084,12 +18393,14 @@ fi # check tzset(3) exists and works like we expect it to -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working tzset()" >&5 -$as_echo_n "checking for working tzset()... " >&6; } -if ${ac_cv_working_tzset+:} false; then : - $as_echo_n "(cached) " >&6 -else - -if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working tzset()" >&5 +printf %s "checking for working tzset()... " >&6; } +if test ${ac_cv_working_tzset+y} +then : + printf %s "(cached) " >&6 +else $as_nop + +if test "$cross_compiling" = yes +then : ac_cv_working_tzset=no @@ -16095,5 +18406,5 @@ ac_cv_working_tzset=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16161,5 +18472,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_working_tzset=yes @@ -16165,5 +18477,5 @@ ac_cv_working_tzset=yes -else +else $as_nop ac_cv_working_tzset=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16172,8 +18484,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_tzset" >&5 -$as_echo "$ac_cv_working_tzset" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_tzset" >&5 +printf "%s\n" "$ac_cv_working_tzset" >&6; } if test "$ac_cv_working_tzset" = yes then @@ -16177,8 +18489,8 @@ if test "$ac_cv_working_tzset" = yes then -$as_echo "#define HAVE_WORKING_TZSET 1" >>confdefs.h +printf "%s\n" "#define HAVE_WORKING_TZSET 1" >>confdefs.h fi # Look for subsecond timestamps in struct stat @@ -16181,13 +18493,14 @@ fi # Look for subsecond timestamps in struct stat -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tv_nsec in struct stat" >&5 -$as_echo_n "checking for tv_nsec in struct stat... " >&6; } -if ${ac_cv_stat_tv_nsec+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tv_nsec in struct stat" >&5 +printf %s "checking for tv_nsec in struct stat... " >&6; } +if test ${ac_cv_stat_tv_nsec+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/stat.h> int @@ -16190,8 +18503,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/stat.h> int -main () +main (void) { struct stat st; @@ -16201,5 +18514,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_stat_tv_nsec=yes @@ -16205,4 +18519,4 @@ ac_cv_stat_tv_nsec=yes -else +else $as_nop ac_cv_stat_tv_nsec=no fi @@ -16207,10 +18521,10 @@ ac_cv_stat_tv_nsec=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_stat_tv_nsec" >&5 -$as_echo "$ac_cv_stat_tv_nsec" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_stat_tv_nsec" >&5 +printf "%s\n" "$ac_cv_stat_tv_nsec" >&6; } if test "$ac_cv_stat_tv_nsec" = yes then @@ -16214,8 +18528,8 @@ if test "$ac_cv_stat_tv_nsec" = yes then -$as_echo "#define HAVE_STAT_TV_NSEC 1" >>confdefs.h +printf "%s\n" "#define HAVE_STAT_TV_NSEC 1" >>confdefs.h fi # Look for BSD style subsecond timestamps in struct stat @@ -16218,13 +18532,14 @@ fi # Look for BSD style subsecond timestamps in struct stat -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tv_nsec2 in struct stat" >&5 -$as_echo_n "checking for tv_nsec2 in struct stat... " >&6; } -if ${ac_cv_stat_tv_nsec2+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tv_nsec2 in struct stat" >&5 +printf %s "checking for tv_nsec2 in struct stat... " >&6; } +if test ${ac_cv_stat_tv_nsec2+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/stat.h> int @@ -16227,8 +18542,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <sys/stat.h> int -main () +main (void) { struct stat st; @@ -16238,5 +18553,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_stat_tv_nsec2=yes @@ -16242,4 +18558,4 @@ ac_cv_stat_tv_nsec2=yes -else +else $as_nop ac_cv_stat_tv_nsec2=no fi @@ -16244,10 +18560,10 @@ ac_cv_stat_tv_nsec2=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_stat_tv_nsec2" >&5 -$as_echo "$ac_cv_stat_tv_nsec2" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_stat_tv_nsec2" >&5 +printf "%s\n" "$ac_cv_stat_tv_nsec2" >&6; } if test "$ac_cv_stat_tv_nsec2" = yes then @@ -16251,7 +18567,7 @@ if test "$ac_cv_stat_tv_nsec2" = yes then -$as_echo "#define HAVE_STAT_TV_NSEC2 1" >>confdefs.h +printf "%s\n" "#define HAVE_STAT_TV_NSEC2 1" >>confdefs.h fi @@ -16261,18 +18577,18 @@ CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" fi -for ac_header in curses.h ncurses.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done +ac_fn_c_check_header_compile "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" +if test "x$ac_cv_header_curses_h" = xyes +then : + printf "%s\n" "#define HAVE_CURSES_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default" +if test "x$ac_cv_header_ncurses_h" = xyes +then : + printf "%s\n" "#define HAVE_NCURSES_H 1" >>confdefs.h + +fi # On Solaris, term.h requires curses.h @@ -16276,11 +18592,9 @@ # On Solaris, term.h requires curses.h -for ac_header in term.h -do : - ac_fn_c_check_header_compile "$LINENO" "term.h" "ac_cv_header_term_h" " +ac_fn_c_check_header_compile "$LINENO" "term.h" "ac_cv_header_term_h" " #ifdef HAVE_CURSES_H #include <curses.h> #endif " @@ -16282,16 +18596,13 @@ #ifdef HAVE_CURSES_H #include <curses.h> #endif " -if test "x$ac_cv_header_term_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_TERM_H 1 -_ACEOF - -fi - -done +if test "x$ac_cv_header_term_h" = xyes +then : + printf "%s\n" "#define HAVE_TERM_H 1" >>confdefs.h + +fi # On HP/UX 11.0, mvwdelch is a block with a return statement @@ -16295,12 +18606,13 @@ # On HP/UX 11.0, mvwdelch is a block with a return statement -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mvwdelch is an expression" >&5 -$as_echo_n "checking whether mvwdelch is an expression... " >&6; } -if ${ac_cv_mvwdelch_is_expression+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mvwdelch is an expression" >&5 +printf %s "checking whether mvwdelch is an expression... " >&6; } +if test ${ac_cv_mvwdelch_is_expression+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int @@ -16303,8 +18615,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int -main () +main (void) { int rtn; @@ -16314,5 +18626,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_mvwdelch_is_expression=yes @@ -16318,4 +18631,4 @@ ac_cv_mvwdelch_is_expression=yes -else +else $as_nop ac_cv_mvwdelch_is_expression=no fi @@ -16320,11 +18633,11 @@ ac_cv_mvwdelch_is_expression=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mvwdelch_is_expression" >&5 -$as_echo "$ac_cv_mvwdelch_is_expression" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_mvwdelch_is_expression" >&5 +printf "%s\n" "$ac_cv_mvwdelch_is_expression" >&6; } if test "$ac_cv_mvwdelch_is_expression" = yes then @@ -16327,8 +18640,8 @@ if test "$ac_cv_mvwdelch_is_expression" = yes then -$as_echo "#define MVWDELCH_IS_EXPRESSION 1" >>confdefs.h +printf "%s\n" "#define MVWDELCH_IS_EXPRESSION 1" >>confdefs.h fi @@ -16336,11 +18649,12 @@ # structs since version 5.7. If the macro is defined as zero before including # [n]curses.h, ncurses will expose fields of the structs regardless of the # configuration. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether WINDOW has _flags" >&5 -$as_echo_n "checking whether WINDOW has _flags... " >&6; } -if ${ac_cv_window_has_flags+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether WINDOW has _flags" >&5 +printf %s "checking whether WINDOW has _flags... " >&6; } +if test ${ac_cv_window_has_flags+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16348,7 +18662,7 @@ #include <curses.h> int -main () +main (void) { WINDOW *w; @@ -16358,5 +18672,6 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_window_has_flags=yes @@ -16362,4 +18677,4 @@ ac_cv_window_has_flags=yes -else +else $as_nop ac_cv_window_has_flags=no fi @@ -16364,12 +18679,12 @@ ac_cv_window_has_flags=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_window_has_flags" >&5 -$as_echo "$ac_cv_window_has_flags" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_window_has_flags" >&5 +printf "%s\n" "$ac_cv_window_has_flags" >&6; } if test "$ac_cv_window_has_flags" = yes then @@ -16371,15 +18686,15 @@ if test "$ac_cv_window_has_flags" = yes then -$as_echo "#define WINDOW_HAS_FLAGS 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for is_pad" >&5 -$as_echo_n "checking for is_pad... " >&6; } +printf "%s\n" "#define WINDOW_HAS_FLAGS 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for is_pad" >&5 +printf %s "checking for is_pad... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int @@ -16382,8 +18697,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int -main () +main (void) { #ifndef is_pad @@ -16394,22 +18709,23 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_CURSES_IS_PAD 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for is_term_resized" >&5 -$as_echo_n "checking for is_term_resized... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_CURSES_IS_PAD 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for is_term_resized" >&5 +printf %s "checking for is_term_resized... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int @@ -16412,11 +18728,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int -main () +main (void) { void *x=is_term_resized ; return 0; } _ACEOF @@ -16417,25 +18733,26 @@ { void *x=is_term_resized ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_CURSES_IS_TERM_RESIZED 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for resize_term" >&5 -$as_echo_n "checking for resize_term... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_CURSES_IS_TERM_RESIZED 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for resize_term" >&5 +printf %s "checking for resize_term... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int @@ -16438,11 +18755,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int -main () +main (void) { void *x=resize_term ; return 0; } _ACEOF @@ -16443,25 +18760,26 @@ { void *x=resize_term ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_CURSES_RESIZE_TERM 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for resizeterm" >&5 -$as_echo_n "checking for resizeterm... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_CURSES_RESIZE_TERM 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for resizeterm" >&5 +printf %s "checking for resizeterm... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int @@ -16464,11 +18782,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int -main () +main (void) { void *x=resizeterm ; return 0; } _ACEOF @@ -16469,25 +18787,26 @@ { void *x=resizeterm ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_CURSES_RESIZETERM 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for immedok" >&5 -$as_echo_n "checking for immedok... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_CURSES_RESIZETERM 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for immedok" >&5 +printf %s "checking for immedok... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int @@ -16490,8 +18809,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int -main () +main (void) { #ifndef immedok @@ -16502,22 +18821,23 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_CURSES_IMMEDOK 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for syncok" >&5 -$as_echo_n "checking for syncok... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_CURSES_IMMEDOK 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for syncok" >&5 +printf %s "checking for syncok... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int @@ -16520,8 +18840,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int -main () +main (void) { #ifndef syncok @@ -16532,22 +18852,23 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_CURSES_SYNCOK 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchgat" >&5 -$as_echo_n "checking for wchgat... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_CURSES_SYNCOK 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wchgat" >&5 +printf %s "checking for wchgat... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int @@ -16550,8 +18871,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int -main () +main (void) { #ifndef wchgat @@ -16562,22 +18883,23 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_CURSES_WCHGAT 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for filter" >&5 -$as_echo_n "checking for filter... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_CURSES_WCHGAT 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for filter" >&5 +printf %s "checking for filter... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int @@ -16580,8 +18902,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int -main () +main (void) { #ifndef filter @@ -16592,22 +18914,23 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_CURSES_FILTER 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for has_key" >&5 -$as_echo_n "checking for has_key... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_CURSES_FILTER 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for has_key" >&5 +printf %s "checking for has_key... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int @@ -16610,8 +18933,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int -main () +main (void) { #ifndef has_key @@ -16622,22 +18945,23 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_CURSES_HAS_KEY 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for typeahead" >&5 -$as_echo_n "checking for typeahead... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_CURSES_HAS_KEY 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for typeahead" >&5 +printf %s "checking for typeahead... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int @@ -16640,8 +18964,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int -main () +main (void) { #ifndef typeahead @@ -16652,22 +18976,23 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_CURSES_TYPEAHEAD 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for use_env" >&5 -$as_echo_n "checking for use_env... " >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_CURSES_TYPEAHEAD 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for use_env" >&5 +printf %s "checking for use_env... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int @@ -16670,8 +18995,8 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <curses.h> int -main () +main (void) { #ifndef use_env @@ -16682,18 +19007,19 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_CURSES_USE_ENV 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE_CURSES_USE_ENV 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # last curses configure check CPPFLAGS=$ac_save_cppflags @@ -16697,8 +19023,8 @@ # last curses configure check CPPFLAGS=$ac_save_cppflags -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for device files" >&5 -$as_echo "$as_me: checking for device files" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for device files" >&5 +printf "%s\n" "$as_me: checking for device files" >&6;} if test "x$cross_compiling" = xyes; then if test "${ac_cv_file__dev_ptmx+set}" != set; then @@ -16702,10 +19028,10 @@ if test "x$cross_compiling" = xyes; then if test "${ac_cv_file__dev_ptmx+set}" != set; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/ptmx" >&5 -$as_echo_n "checking for /dev/ptmx... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not set" >&5 -$as_echo "not set" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/ptmx" >&5 +printf %s "checking for /dev/ptmx... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not set" >&5 +printf "%s\n" "not set" >&6; } as_fn_error $? "set ac_cv_file__dev_ptmx to yes/no in your CONFIG_SITE file when cross compiling" "$LINENO" 5 fi if test "${ac_cv_file__dev_ptc+set}" != set; then @@ -16709,11 +19035,11 @@ as_fn_error $? "set ac_cv_file__dev_ptmx to yes/no in your CONFIG_SITE file when cross compiling" "$LINENO" 5 fi if test "${ac_cv_file__dev_ptc+set}" != set; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/ptc" >&5 -$as_echo_n "checking for /dev/ptc... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not set" >&5 -$as_echo "not set" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/ptc" >&5 +printf %s "checking for /dev/ptc... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not set" >&5 +printf "%s\n" "not set" >&6; } as_fn_error $? "set ac_cv_file__dev_ptc to yes/no in your CONFIG_SITE file when cross compiling" "$LINENO" 5 fi fi @@ -16716,12 +19042,13 @@ as_fn_error $? "set ac_cv_file__dev_ptc to yes/no in your CONFIG_SITE file when cross compiling" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/ptmx" >&5 -$as_echo_n "checking for /dev/ptmx... " >&6; } -if ${ac_cv_file__dev_ptmx+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/ptmx" >&5 +printf %s "checking for /dev/ptmx... " >&6; } +if test ${ac_cv_file__dev_ptmx+y} +then : + printf %s "(cached) " >&6 +else $as_nop test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/dev/ptmx"; then @@ -16730,11 +19057,12 @@ ac_cv_file__dev_ptmx=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_ptmx" >&5 -$as_echo "$ac_cv_file__dev_ptmx" >&6; } -if test "x$ac_cv_file__dev_ptmx" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_ptmx" >&5 +printf "%s\n" "$ac_cv_file__dev_ptmx" >&6; } +if test "x$ac_cv_file__dev_ptmx" = xyes +then : fi if test "x$ac_cv_file__dev_ptmx" = xyes; then @@ -16736,16 +19064,17 @@ fi if test "x$ac_cv_file__dev_ptmx" = xyes; then -$as_echo "#define HAVE_DEV_PTMX 1" >>confdefs.h - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/ptc" >&5 -$as_echo_n "checking for /dev/ptc... " >&6; } -if ${ac_cv_file__dev_ptc+:} false; then : - $as_echo_n "(cached) " >&6 -else +printf "%s\n" "#define HAVE_DEV_PTMX 1" >>confdefs.h + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for /dev/ptc" >&5 +printf %s "checking for /dev/ptc... " >&6; } +if test ${ac_cv_file__dev_ptc+y} +then : + printf %s "(cached) " >&6 +else $as_nop test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/dev/ptc"; then @@ -16754,11 +19083,12 @@ ac_cv_file__dev_ptc=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_ptc" >&5 -$as_echo "$ac_cv_file__dev_ptc" >&6; } -if test "x$ac_cv_file__dev_ptc" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_ptc" >&5 +printf "%s\n" "$ac_cv_file__dev_ptc" >&6; } +if test "x$ac_cv_file__dev_ptc" = xyes +then : fi if test "x$ac_cv_file__dev_ptc" = xyes; then @@ -16760,9 +19090,9 @@ fi if test "x$ac_cv_file__dev_ptc" = xyes; then -$as_echo "#define HAVE_DEV_PTC 1" >>confdefs.h +printf "%s\n" "#define HAVE_DEV_PTC 1" >>confdefs.h fi @@ -16771,11 +19101,13 @@ LIBS="$LIBS -framework CoreFoundation" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for %zd printf() format support" >&5 -$as_echo_n "checking for %zd printf() format support... " >&6; } -if ${ac_cv_have_size_t_format+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for %zd printf() format support" >&5 +printf %s "checking for %zd printf() format support... " >&6; } +if test ${ac_cv_have_size_t_format+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_have_size_t_format="cross -- assuming yes" @@ -16780,6 +19112,6 @@ ac_cv_have_size_t_format="cross -- assuming yes" -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16819,5 +19151,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_have_size_t_format=yes @@ -16823,5 +19156,5 @@ ac_cv_have_size_t_format=yes -else +else $as_nop ac_cv_have_size_t_format=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16829,7 +19162,7 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_size_t_format" >&5 -$as_echo "$ac_cv_have_size_t_format" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_size_t_format" >&5 +printf "%s\n" "$ac_cv_have_size_t_format" >&6; } if test "$ac_cv_have_size_t_format" != no ; then @@ -16834,6 +19167,6 @@ if test "$ac_cv_have_size_t_format" != no ; then -$as_echo "#define PY_FORMAT_SIZE_T \"z\"" >>confdefs.h +printf "%s\n" "#define PY_FORMAT_SIZE_T \"z\"" >>confdefs.h fi @@ -16846,19 +19179,22 @@ #endif " -if test "x$ac_cv_type_socklen_t" = xyes; then : - -else - -$as_echo "#define socklen_t int" >>confdefs.h - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken mbstowcs" >&5 -$as_echo_n "checking for broken mbstowcs... " >&6; } -if ${ac_cv_broken_mbstowcs+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +if test "x$ac_cv_type_socklen_t" = xyes +then : + +else $as_nop + +printf "%s\n" "#define socklen_t int" >>confdefs.h + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for broken mbstowcs" >&5 +printf %s "checking for broken mbstowcs... " >&6; } +if test ${ac_cv_broken_mbstowcs+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_broken_mbstowcs=no @@ -16864,5 +19200,5 @@ ac_cv_broken_mbstowcs=no -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16876,5 +19212,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_broken_mbstowcs=no @@ -16880,5 +19217,5 @@ ac_cv_broken_mbstowcs=no -else +else $as_nop ac_cv_broken_mbstowcs=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16887,8 +19224,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_mbstowcs" >&5 -$as_echo "$ac_cv_broken_mbstowcs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_broken_mbstowcs" >&5 +printf "%s\n" "$ac_cv_broken_mbstowcs" >&6; } if test "$ac_cv_broken_mbstowcs" = yes then @@ -16892,8 +19229,8 @@ if test "$ac_cv_broken_mbstowcs" = yes then -$as_echo "#define HAVE_BROKEN_MBSTOWCS 1" >>confdefs.h +printf "%s\n" "#define HAVE_BROKEN_MBSTOWCS 1" >>confdefs.h fi # Check for --with-computed-gotos @@ -16896,8 +19233,8 @@ fi # Check for --with-computed-gotos -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-computed-gotos" >&5 -$as_echo_n "checking for --with-computed-gotos... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-computed-gotos" >&5 +printf %s "checking for --with-computed-gotos... " >&6; } # Check whether --with-computed-gotos was given. @@ -16902,7 +19239,8 @@ # Check whether --with-computed-gotos was given. -if test "${with_computed_gotos+set}" = set; then : +if test ${with_computed_gotos+y} +then : withval=$with_computed_gotos; if test "$withval" = yes then @@ -16905,12 +19243,12 @@ withval=$with_computed_gotos; if test "$withval" = yes then -$as_echo "#define USE_COMPUTED_GOTOS 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +printf "%s\n" "#define USE_COMPUTED_GOTOS 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi if test "$withval" = no then @@ -16913,27 +19251,29 @@ fi if test "$withval" = no then -$as_echo "#define USE_COMPUTED_GOTOS 0" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no value specified" >&5 -$as_echo "no value specified" >&6; } -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports computed gotos" >&5 -$as_echo_n "checking whether $CC supports computed gotos... " >&6; } -if ${ac_cv_computed_gotos+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +printf "%s\n" "#define USE_COMPUTED_GOTOS 0" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no value specified" >&5 +printf "%s\n" "no value specified" >&6; } +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports computed gotos" >&5 +printf %s "checking whether $CC supports computed gotos... " >&6; } +if test ${ac_cv_computed_gotos+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : if test "${with_computed_gotos+set}" = set; then ac_cv_computed_gotos="$with_computed_gotos -- configured --with(out)-computed-gotos" else ac_cv_computed_gotos=no fi @@ -16935,9 +19275,9 @@ if test "${with_computed_gotos+set}" = set; then ac_cv_computed_gotos="$with_computed_gotos -- configured --with(out)-computed-gotos" else ac_cv_computed_gotos=no fi -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16953,5 +19293,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_computed_gotos=yes @@ -16957,5 +19298,5 @@ ac_cv_computed_gotos=yes -else +else $as_nop ac_cv_computed_gotos=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -16964,7 +19305,7 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_computed_gotos" >&5 -$as_echo "$ac_cv_computed_gotos" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_computed_gotos" >&5 +printf "%s\n" "$ac_cv_computed_gotos" >&6; } case "$ac_cv_computed_gotos" in yes*) @@ -16969,9 +19310,9 @@ case "$ac_cv_computed_gotos" in yes*) -$as_echo "#define HAVE_COMPUTED_GOTOS 1" >>confdefs.h +printf "%s\n" "#define HAVE_COMPUTED_GOTOS 1" >>confdefs.h esac case $ac_sys_system in AIX*) @@ -16972,10 +19313,10 @@ esac case $ac_sys_system in AIX*) -$as_echo "#define HAVE_BROKEN_PIPE_BUF 1" >>confdefs.h +printf "%s\n" "#define HAVE_BROKEN_PIPE_BUF 1" >>confdefs.h ;; esac @@ -16989,10 +19330,10 @@ SRCDIRS="Parser Objects Python Modules Modules/_io Programs" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for build directories" >&5 -$as_echo_n "checking for build directories... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for build directories" >&5 +printf %s "checking for build directories... " >&6; } for dir in $SRCDIRS; do if test ! -d $dir; then mkdir $dir fi done @@ -16994,9 +19335,9 @@ for dir in $SRCDIRS; do if test ! -d $dir; then mkdir $dir fi done -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } # Availability of -O2: @@ -17001,10 +19342,10 @@ # Availability of -O2: -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -O2" >&5 -$as_echo_n "checking for -O2... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -O2" >&5 +printf %s "checking for -O2... " >&6; } saved_cflags="$CFLAGS" CFLAGS="-O2" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -17005,16 +19346,17 @@ saved_cflags="$CFLAGS" CFLAGS="-O2" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () -{ - - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +main (void) +{ + + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : have_O2=yes @@ -17020,4 +19362,4 @@ have_O2=yes -else +else $as_nop have_O2=no fi @@ -17022,9 +19364,9 @@ have_O2=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_O2" >&5 -$as_echo "$have_O2" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_O2" >&5 +printf "%s\n" "$have_O2" >&6; } CFLAGS="$saved_cflags" # _FORTIFY_SOURCE wrappers for memmove and bcopy are incorrect: # http://sourceware.org/ml/libc-alpha/2010-12/msg00009.html @@ -17027,11 +19369,11 @@ CFLAGS="$saved_cflags" # _FORTIFY_SOURCE wrappers for memmove and bcopy are incorrect: # http://sourceware.org/ml/libc-alpha/2010-12/msg00009.html -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for glibc _FORTIFY_SOURCE/memmove bug" >&5 -$as_echo_n "checking for glibc _FORTIFY_SOURCE/memmove bug... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for glibc _FORTIFY_SOURCE/memmove bug" >&5 +printf %s "checking for glibc _FORTIFY_SOURCE/memmove bug... " >&6; } saved_cflags="$CFLAGS" CFLAGS="-O2 -D_FORTIFY_SOURCE=2" if test "$have_O2" = no; then CFLAGS="" fi @@ -17033,7 +19375,8 @@ saved_cflags="$CFLAGS" CFLAGS="-O2 -D_FORTIFY_SOURCE=2" if test "$have_O2" = no; then CFLAGS="" fi -if test "$cross_compiling" = yes; then : +if test "$cross_compiling" = yes +then : have_glibc_memmove_bug=undefined @@ -17039,5 +19382,5 @@ have_glibc_memmove_bug=undefined -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17057,5 +19400,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : have_glibc_memmove_bug=no @@ -17061,5 +19405,5 @@ have_glibc_memmove_bug=no -else +else $as_nop have_glibc_memmove_bug=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17067,7 +19411,7 @@ fi CFLAGS="$saved_cflags" -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_glibc_memmove_bug" >&5 -$as_echo "$have_glibc_memmove_bug" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_glibc_memmove_bug" >&5 +printf "%s\n" "$have_glibc_memmove_bug" >&6; } if test "$have_glibc_memmove_bug" = yes; then @@ -17072,6 +19416,6 @@ if test "$have_glibc_memmove_bug" = yes; then -$as_echo "#define HAVE_GLIBC_MEMMOVE_BUG 1" >>confdefs.h +printf "%s\n" "#define HAVE_GLIBC_MEMMOVE_BUG 1" >>confdefs.h fi @@ -17081,7 +19425,7 @@ # http://gcc.gnu.org/ml/gcc/2010-11/msg00366.html case $CC in *gcc*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc ipa-pure-const bug" >&5 -$as_echo_n "checking for gcc ipa-pure-const bug... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gcc ipa-pure-const bug" >&5 +printf %s "checking for gcc ipa-pure-const bug... " >&6; } saved_cflags="$CFLAGS" CFLAGS="-O2" @@ -17086,4 +19430,5 @@ saved_cflags="$CFLAGS" CFLAGS="-O2" - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : have_ipa_pure_const_bug=undefined @@ -17089,5 +19434,5 @@ have_ipa_pure_const_bug=undefined -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17108,5 +19453,6 @@ } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : have_ipa_pure_const_bug=no @@ -17112,5 +19458,5 @@ have_ipa_pure_const_bug=no -else +else $as_nop have_ipa_pure_const_bug=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -17118,7 +19464,7 @@ fi CFLAGS="$saved_cflags" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ipa_pure_const_bug" >&5 -$as_echo "$have_ipa_pure_const_bug" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_ipa_pure_const_bug" >&5 +printf "%s\n" "$have_ipa_pure_const_bug" >&6; } if test "$have_ipa_pure_const_bug" = yes; then @@ -17123,6 +19469,6 @@ if test "$have_ipa_pure_const_bug" = yes; then -$as_echo "#define HAVE_IPA_PURE_CONST_BUG 1" >>confdefs.h +printf "%s\n" "#define HAVE_IPA_PURE_CONST_BUG 1" >>confdefs.h fi ;; @@ -17130,8 +19476,8 @@ fi # Check for stdatomic.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdatomic.h" >&5 -$as_echo_n "checking for stdatomic.h... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdatomic.h" >&5 +printf %s "checking for stdatomic.h... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17148,5 +19494,6 @@ _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : have_stdatomic_h=yes @@ -17152,4 +19499,4 @@ have_stdatomic_h=yes -else +else $as_nop have_stdatomic_h=no fi @@ -17154,10 +19501,10 @@ have_stdatomic_h=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_stdatomic_h" >&5 -$as_echo "$have_stdatomic_h" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_stdatomic_h" >&5 +printf "%s\n" "$have_stdatomic_h" >&6; } if test "$have_stdatomic_h" = yes; then @@ -17161,8 +19508,8 @@ if test "$have_stdatomic_h" = yes; then -$as_echo "#define HAVE_STD_ATOMIC 1" >>confdefs.h +printf "%s\n" "#define HAVE_STD_ATOMIC 1" >>confdefs.h fi # Check for GCC >= 4.7 and clang __atomic builtin functions @@ -17165,9 +19512,9 @@ fi # Check for GCC >= 4.7 and clang __atomic builtin functions -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic_load_n and __atomic_store_n functions" >&5 -$as_echo_n "checking for builtin __atomic_load_n and __atomic_store_n functions... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for builtin __atomic_load_n and __atomic_store_n functions" >&5 +printf %s "checking for builtin __atomic_load_n and __atomic_store_n functions... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17181,5 +19528,6 @@ _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : have_builtin_atomic=yes @@ -17185,4 +19533,4 @@ have_builtin_atomic=yes -else +else $as_nop have_builtin_atomic=no fi @@ -17187,10 +19535,10 @@ have_builtin_atomic=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_builtin_atomic" >&5 -$as_echo "$have_builtin_atomic" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_builtin_atomic" >&5 +printf "%s\n" "$have_builtin_atomic" >&6; } if test "$have_builtin_atomic" = yes; then @@ -17194,8 +19542,8 @@ if test "$have_builtin_atomic" = yes; then -$as_echo "#define HAVE_BUILTIN_ATOMIC 1" >>confdefs.h +printf "%s\n" "#define HAVE_BUILTIN_ATOMIC 1" >>confdefs.h fi # ensurepip option @@ -17198,8 +19546,8 @@ fi # ensurepip option -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ensurepip" >&5 -$as_echo_n "checking for ensurepip... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ensurepip" >&5 +printf %s "checking for ensurepip... " >&6; } # Check whether --with-ensurepip was given. @@ -17204,4 +19552,5 @@ # Check whether --with-ensurepip was given. -if test "${with_ensurepip+set}" = set; then : +if test ${with_ensurepip+y} +then : withval=$with_ensurepip; @@ -17207,5 +19556,5 @@ withval=$with_ensurepip; -else +else $as_nop with_ensurepip=upgrade fi @@ -17219,8 +19568,8 @@ *) : as_fn_error $? "--with-ensurepip=upgrade|install|no" "$LINENO" 5 ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENSUREPIP" >&5 -$as_echo "$ENSUREPIP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ENSUREPIP" >&5 +printf "%s\n" "$ENSUREPIP" >&6; } # check if the dirent structure of a d_type field and DT_UNKNOWN is defined @@ -17224,8 +19573,8 @@ # check if the dirent structure of a d_type field and DT_UNKNOWN is defined -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the dirent structure of a d_type field" >&5 -$as_echo_n "checking if the dirent structure of a d_type field... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the dirent structure of a d_type field" >&5 +printf %s "checking if the dirent structure of a d_type field... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17239,5 +19588,6 @@ _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : have_dirent_d_type=yes @@ -17243,4 +19593,4 @@ have_dirent_d_type=yes -else +else $as_nop have_dirent_d_type=no fi @@ -17245,9 +19595,9 @@ have_dirent_d_type=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_dirent_d_type" >&5 -$as_echo "$have_dirent_d_type" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_dirent_d_type" >&5 +printf "%s\n" "$have_dirent_d_type" >&6; } if test "$have_dirent_d_type" = yes; then @@ -17251,8 +19601,8 @@ if test "$have_dirent_d_type" = yes; then -$as_echo "#define HAVE_DIRENT_D_TYPE 1" >>confdefs.h +printf "%s\n" "#define HAVE_DIRENT_D_TYPE 1" >>confdefs.h fi # check if the Linux getrandom() syscall is available @@ -17255,9 +19605,9 @@ fi # check if the Linux getrandom() syscall is available -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Linux getrandom() syscall" >&5 -$as_echo_n "checking for the Linux getrandom() syscall... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the Linux getrandom() syscall" >&5 +printf %s "checking for the Linux getrandom() syscall... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17277,5 +19627,6 @@ _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : have_getrandom_syscall=yes @@ -17281,4 +19632,4 @@ have_getrandom_syscall=yes -else +else $as_nop have_getrandom_syscall=no fi @@ -17283,9 +19634,9 @@ have_getrandom_syscall=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_getrandom_syscall" >&5 -$as_echo "$have_getrandom_syscall" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_getrandom_syscall" >&5 +printf "%s\n" "$have_getrandom_syscall" >&6; } if test "$have_getrandom_syscall" = yes; then @@ -17289,9 +19640,9 @@ if test "$have_getrandom_syscall" = yes; then -$as_echo "#define HAVE_GETRANDOM_SYSCALL 1" >>confdefs.h +printf "%s\n" "#define HAVE_GETRANDOM_SYSCALL 1" >>confdefs.h fi # check if the getrandom() function is available # the test was written for the Solaris function of <sys/random.h> @@ -17293,10 +19644,10 @@ fi # check if the getrandom() function is available # the test was written for the Solaris function of <sys/random.h> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the getrandom() function" >&5 -$as_echo_n "checking for the getrandom() function... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the getrandom() function" >&5 +printf %s "checking for the getrandom() function... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17314,5 +19665,6 @@ _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : have_getrandom=yes @@ -17318,4 +19670,4 @@ have_getrandom=yes -else +else $as_nop have_getrandom=no fi @@ -17320,9 +19672,9 @@ have_getrandom=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_getrandom" >&5 -$as_echo "$have_getrandom" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_getrandom" >&5 +printf "%s\n" "$have_getrandom" >&6; } if test "$have_getrandom" = yes; then @@ -17326,7 +19678,7 @@ if test "$have_getrandom" = yes; then -$as_echo "#define HAVE_GETRANDOM 1" >>confdefs.h +printf "%s\n" "#define HAVE_GETRANDOM 1" >>confdefs.h fi @@ -17334,11 +19686,12 @@ # shm_* may only be available if linking against librt save_LIBS="$LIBS" save_includes_default="$ac_includes_default" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5 -$as_echo_n "checking for library containing shm_open... " >&6; } -if ${ac_cv_search_shm_open+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5 +printf %s "checking for library containing shm_open... " >&6; } +if test ${ac_cv_search_shm_open+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17346,8 +19699,5 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char shm_open (); int @@ -17352,9 +19702,9 @@ char shm_open (); int -main () +main (void) { return shm_open (); ; return 0; } _ACEOF @@ -17355,13 +19705,14 @@ { return shm_open (); ; return 0; } _ACEOF -for ac_lib in '' rt; do +for ac_lib in '' rt +do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi @@ -17362,9 +19713,10 @@ if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi - if ac_fn_c_try_link "$LINENO"; then : + if ac_fn_c_try_link "$LINENO" +then : ac_cv_search_shm_open=$ac_res fi @@ -17369,4 +19721,4 @@ ac_cv_search_shm_open=$ac_res fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext @@ -17372,5 +19724,6 @@ conftest$ac_exeext - if ${ac_cv_search_shm_open+:} false; then : + if test ${ac_cv_search_shm_open+y} +then : break fi done @@ -17374,11 +19727,12 @@ break fi done -if ${ac_cv_search_shm_open+:} false; then : - -else +if test ${ac_cv_search_shm_open+y} +then : + +else $as_nop ac_cv_search_shm_open=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi @@ -17380,8 +19734,8 @@ ac_cv_search_shm_open=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_open" >&5 -$as_echo "$ac_cv_search_shm_open" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_shm_open" >&5 +printf "%s\n" "$ac_cv_search_shm_open" >&6; } ac_res=$ac_cv_search_shm_open @@ -17387,8 +19741,9 @@ ac_res=$ac_cv_search_shm_open -if test "$ac_res" != no; then : +if test "$ac_res" != no +then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi if test "$ac_cv_search_shm_open" = "-lrt"; then @@ -17389,23 +19744,18 @@ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi if test "$ac_cv_search_shm_open" = "-lrt"; then -$as_echo "#define SHM_NEEDS_LIBRT 1" >>confdefs.h - -fi -for ac_header in sys/mman.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mman_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_MMAN_H 1 -_ACEOF - -fi - -done +printf "%s\n" "#define SHM_NEEDS_LIBRT 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mman_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_MMAN_H 1" >>confdefs.h + +fi # temporarily override ac_includes_default for AC_CHECK_FUNCS below ac_includes_default="\ @@ -17416,17 +19766,18 @@ # endif #endif " -for ac_func in shm_open shm_unlink -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done +ac_fn_c_check_func "$LINENO" "shm_open" "ac_cv_func_shm_open" +if test "x$ac_cv_func_shm_open" = xyes +then : + printf "%s\n" "#define HAVE_SHM_OPEN 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "shm_unlink" "ac_cv_func_shm_unlink" +if test "x$ac_cv_func_shm_unlink" = xyes +then : + printf "%s\n" "#define HAVE_SHM_UNLINK 1" >>confdefs.h + +fi # we don't want to link with librt always, restore LIBS LIBS="$save_LIBS" @@ -17437,7 +19788,8 @@ found=false # Check whether --with-openssl was given. -if test "${with_openssl+set}" = set; then : +if test ${with_openssl+y} +then : withval=$with_openssl; case "$withval" in "" | y | ye | yes | n | no) @@ -17447,10 +19799,10 @@ ;; esac -else +else $as_nop # if pkg-config is installed and openssl has installed a .pc file, # then use that information and don't search ssldirs if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 @@ -17451,14 +19803,15 @@ # if pkg-config is installed and openssl has installed a .pc file, # then use that information and don't search ssldirs if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$PKG_CONFIG"; then ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test. else @@ -17466,5 +19819,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -17470,3 +19827,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config" @@ -17472,5 +19829,5 @@ ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -17481,11 +19838,11 @@ fi PKG_CONFIG=$ac_cv_prog_PKG_CONFIG if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf "%s\n" "$PKG_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -17494,11 +19851,12 @@ ac_ct_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_PKG_CONFIG"; then ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_CONFIG" # Let the user override the test. else @@ -17506,5 +19864,9 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do @@ -17510,3 +19872,3 @@ for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_PKG_CONFIG="pkg-config" @@ -17512,5 +19874,5 @@ ac_cv_prog_ac_ct_PKG_CONFIG="pkg-config" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -17521,11 +19883,11 @@ fi ac_ct_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG if test -n "$ac_ct_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKG_CONFIG" >&5 -$as_echo "$ac_ct_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKG_CONFIG" >&5 +printf "%s\n" "$ac_ct_PKG_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_PKG_CONFIG" = x; then @@ -17533,8 +19895,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_ct_PKG_CONFIG @@ -17568,10 +19930,10 @@ if ! $found; then OPENSSL_INCLUDES= for ssldir in $ssldirs; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl/ssl.h in $ssldir" >&5 -$as_echo_n "checking for openssl/ssl.h in $ssldir... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for openssl/ssl.h in $ssldir" >&5 +printf %s "checking for openssl/ssl.h in $ssldir... " >&6; } if test -f "$ssldir/include/openssl/ssl.h"; then OPENSSL_INCLUDES="-I$ssldir/include" OPENSSL_LDFLAGS="-L$ssldir/lib" OPENSSL_LIBS="-lssl -lcrypto" found=true @@ -17573,9 +19935,9 @@ if test -f "$ssldir/include/openssl/ssl.h"; then OPENSSL_INCLUDES="-I$ssldir/include" OPENSSL_LDFLAGS="-L$ssldir/lib" OPENSSL_LIBS="-lssl -lcrypto" found=true - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } break else @@ -17580,7 +19942,7 @@ break else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi done @@ -17591,8 +19953,8 @@ # try the preprocessor and linker with our new flags, # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling and linking against OpenSSL works" >&5 -$as_echo_n "checking whether compiling and linking against OpenSSL works... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether compiling and linking against OpenSSL works" >&5 +printf %s "checking whether compiling and linking against OpenSSL works... " >&6; } echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&5 @@ -17606,10 +19968,10 @@ /* end confdefs.h. */ #include <openssl/ssl.h> int -main () +main (void) { SSL_new(NULL) ; return 0; } _ACEOF @@ -17610,12 +19972,13 @@ { SSL_new(NULL) ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } have_openssl=yes @@ -17620,9 +19983,9 @@ have_openssl=yes -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } have_openssl=no fi @@ -17626,7 +19989,7 @@ have_openssl=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" @@ -17638,8 +20001,8 @@ if test "$have_openssl" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X509_VERIFY_PARAM_set1_host in libssl" >&5 -$as_echo_n "checking for X509_VERIFY_PARAM_set1_host in libssl... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for X509_VERIFY_PARAM_set1_host in libssl" >&5 +printf %s "checking for X509_VERIFY_PARAM_set1_host in libssl... " >&6; } save_LIBS="$LIBS" save_LDFLAGS="$LDFLAGS" @@ -17654,7 +20017,7 @@ #include <openssl/x509_vfy.h> int -main () +main (void) { X509_VERIFY_PARAM *p = X509_VERIFY_PARAM_new(); @@ -17667,7 +20030,8 @@ } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_has_x509_verify_param_set1_host=yes @@ -17671,8 +20035,8 @@ ac_cv_has_x509_verify_param_set1_host=yes -else +else $as_nop ac_cv_has_x509_verify_param_set1_host=no fi @@ -17675,10 +20039,10 @@ ac_cv_has_x509_verify_param_set1_host=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_has_x509_verify_param_set1_host" >&5 -$as_echo "$ac_cv_has_x509_verify_param_set1_host" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_has_x509_verify_param_set1_host" >&5 +printf "%s\n" "$ac_cv_has_x509_verify_param_set1_host" >&6; } if test "$ac_cv_has_x509_verify_param_set1_host" = "yes"; then @@ -17683,6 +20047,6 @@ if test "$ac_cv_has_x509_verify_param_set1_host" = "yes"; then -$as_echo "#define HAVE_X509_VERIFY_PARAM_SET1_HOST 1" >>confdefs.h +printf "%s\n" "#define HAVE_X509_VERIFY_PARAM_SET1_HOST 1" >>confdefs.h fi @@ -17692,7 +20056,7 @@ fi # rpath to libssl and libcrypto -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-openssl-rpath" >&5 -$as_echo_n "checking for --with-openssl-rpath... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-openssl-rpath" >&5 +printf %s "checking for --with-openssl-rpath... " >&6; } # Check whether --with-openssl-rpath was given. @@ -17697,4 +20061,5 @@ # Check whether --with-openssl-rpath was given. -if test "${with_openssl_rpath+set}" = set; then : +if test ${with_openssl_rpath+y} +then : withval=$with_openssl_rpath; @@ -17700,5 +20065,5 @@ withval=$with_openssl_rpath; -else +else $as_nop with_openssl_rpath=no fi @@ -17709,5 +20074,6 @@ no) : OPENSSL_RPATH= ;; #( *) : - if test -d "$with_openssl_rpath"; then : + if test -d "$with_openssl_rpath" +then : OPENSSL_RPATH="$with_openssl_rpath" @@ -17713,7 +20079,7 @@ OPENSSL_RPATH="$with_openssl_rpath" -else +else $as_nop as_fn_error $? "--with-openssl-rpath \"$with_openssl_rpath\" is not a directory" "$LINENO" 5 fi ;; esac @@ -17715,13 +20081,13 @@ as_fn_error $? "--with-openssl-rpath \"$with_openssl_rpath\" is not a directory" "$LINENO" 5 fi ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENSSL_RPATH" >&5 -$as_echo "$OPENSSL_RPATH" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OPENSSL_RPATH" >&5 +printf "%s\n" "$OPENSSL_RPATH" >&6; } # ssl module default cipher suite string @@ -17722,10 +20088,10 @@ # ssl module default cipher suite string -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-ssl-default-suites" >&5 -$as_echo_n "checking for --with-ssl-default-suites... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-ssl-default-suites" >&5 +printf %s "checking for --with-ssl-default-suites... " >&6; } # Check whether --with-ssl-default-suites was given. @@ -17730,4 +20096,5 @@ # Check whether --with-ssl-default-suites was given. -if test "${with_ssl_default_suites+set}" = set; then : +if test ${with_ssl_default_suites+y} +then : withval=$with_ssl_default_suites; @@ -17733,5 +20100,5 @@ withval=$with_ssl_default_suites; -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 -$as_echo "$withval" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +printf "%s\n" "$withval" >&6; } case "$withval" in python) @@ -17736,6 +20103,6 @@ case "$withval" in python) - $as_echo "#define PY_SSL_DEFAULT_CIPHERS 1" >>confdefs.h + printf "%s\n" "#define PY_SSL_DEFAULT_CIPHERS 1" >>confdefs.h ;; openssl) @@ -17739,7 +20106,7 @@ ;; openssl) - $as_echo "#define PY_SSL_DEFAULT_CIPHERS 2" >>confdefs.h + printf "%s\n" "#define PY_SSL_DEFAULT_CIPHERS 2" >>confdefs.h ;; *) @@ -17743,12 +20110,10 @@ ;; *) - $as_echo "#define PY_SSL_DEFAULT_CIPHERS 0" >>confdefs.h - - cat >>confdefs.h <<_ACEOF -#define PY_SSL_DEFAULT_CIPHER_STRING "$withval" -_ACEOF + printf "%s\n" "#define PY_SSL_DEFAULT_CIPHERS 0" >>confdefs.h + + printf "%s\n" "#define PY_SSL_DEFAULT_CIPHER_STRING \"$withval\"" >>confdefs.h ;; esac @@ -17751,12 +20116,12 @@ ;; esac -else - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: python" >&5 -$as_echo "python" >&6; } -$as_echo "#define PY_SSL_DEFAULT_CIPHERS 1" >>confdefs.h +else $as_nop + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: python" >&5 +printf "%s\n" "python" >&6; } +printf "%s\n" "#define PY_SSL_DEFAULT_CIPHERS 1" >>confdefs.h fi @@ -17765,9 +20130,9 @@ # builtin hash modules default_hashlib_hashes="md5,sha1,sha256,sha512,sha3,blake2" -$as_echo "#define PY_BUILTIN_HASHLIB_HASHES /**/" >>confdefs.h - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-builtin-hashlib-hashes" >&5 -$as_echo_n "checking for --with-builtin-hashlib-hashes... " >&6; } +printf "%s\n" "#define PY_BUILTIN_HASHLIB_HASHES /**/" >>confdefs.h + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-builtin-hashlib-hashes" >&5 +printf %s "checking for --with-builtin-hashlib-hashes... " >&6; } # Check whether --with-builtin-hashlib-hashes was given. @@ -17772,6 +20137,7 @@ # Check whether --with-builtin-hashlib-hashes was given. -if test "${with_builtin_hashlib_hashes+set}" = set; then : +if test ${with_builtin_hashlib_hashes+y} +then : withval=$with_builtin_hashlib_hashes; case "$withval" in yes) @@ -17781,20 +20147,16 @@ withval="" ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 -$as_echo "$withval" >&6; } -cat >>confdefs.h <<_ACEOF -#define PY_BUILTIN_HASHLIB_HASHES "$withval" -_ACEOF - - -else - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $default_hashlib_hashes" >&5 -$as_echo "$default_hashlib_hashes" >&6; }; -cat >>confdefs.h <<_ACEOF -#define PY_BUILTIN_HASHLIB_HASHES "$default_hashlib_hashes" -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 +printf "%s\n" "$withval" >&6; } +printf "%s\n" "#define PY_BUILTIN_HASHLIB_HASHES \"$withval\"" >>confdefs.h + + +else $as_nop + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $default_hashlib_hashes" >&5 +printf "%s\n" "$default_hashlib_hashes" >&6; }; +printf "%s\n" "#define PY_BUILTIN_HASHLIB_HASHES \"$default_hashlib_hashes\"" >>confdefs.h fi @@ -17802,7 +20164,7 @@ # --with-experimental-isolated-subinterpreters -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-experimental-isolated-subinterpreters" >&5 -$as_echo_n "checking for --with-experimental-isolated-subinterpreters... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-experimental-isolated-subinterpreters" >&5 +printf %s "checking for --with-experimental-isolated-subinterpreters... " >&6; } # Check whether --with-experimental-isolated-subinterpreters was given. @@ -17807,6 +20169,7 @@ # Check whether --with-experimental-isolated-subinterpreters was given. -if test "${with_experimental_isolated_subinterpreters+set}" = set; then : +if test ${with_experimental_isolated_subinterpreters+y} +then : withval=$with_experimental_isolated_subinterpreters; if test "$withval" != no then @@ -17810,19 +20173,19 @@ withval=$with_experimental_isolated_subinterpreters; if test "$withval" != no then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; - $as_echo "#define EXPERIMENTAL_ISOLATED_SUBINTERPRETERS 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; }; -fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; }; + printf "%s\n" "#define EXPERIMENTAL_ISOLATED_SUBINTERPRETERS 1" >>confdefs.h + +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; +fi +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi # --with-static-libpython STATIC_LIBPYTHON=1 @@ -17824,9 +20187,9 @@ fi # --with-static-libpython STATIC_LIBPYTHON=1 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-static-libpython" >&5 -$as_echo_n "checking for --with-static-libpython... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-static-libpython" >&5 +printf %s "checking for --with-static-libpython... " >&6; } # Check whether --with-static-libpython was given. @@ -17831,6 +20194,7 @@ # Check whether --with-static-libpython was given. -if test "${with_static_libpython+set}" = set; then : +if test ${with_static_libpython+y} +then : withval=$with_static_libpython; if test "$withval" = no then @@ -17834,7 +20198,7 @@ withval=$with_static_libpython; if test "$withval" = no then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; }; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; STATIC_LIBPYTHON=0 else @@ -17839,11 +20203,11 @@ STATIC_LIBPYTHON=0 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; -fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; }; +fi +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } fi LIBRARY_DEPS='$(PY3LIBRARY) $(EXPORTSYMS)' @@ -17860,6 +20224,6 @@ # Check whether to disable test modules. Once set, setup.py will not build # test extension modules and "make install" will not install test suites. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --disable-test-modules" >&5 -$as_echo_n "checking for --disable-test-modules... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --disable-test-modules" >&5 +printf %s "checking for --disable-test-modules... " >&6; } # Check whether --enable-test-modules was given. @@ -17865,7 +20229,8 @@ # Check whether --enable-test-modules was given. -if test "${enable_test_modules+set}" = set; then : +if test ${enable_test_modules+y} +then : enableval=$enable_test_modules; fi if test "$enable_test_modules" = no; then TEST_MODULES=no @@ -17867,9 +20232,9 @@ enableval=$enable_test_modules; fi if test "$enable_test_modules" = no; then TEST_MODULES=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else TEST_MODULES=yes @@ -17874,7 +20239,7 @@ else TEST_MODULES=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -17911,8 +20276,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -17942,10 +20307,10 @@ /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then @@ -17946,11 +20311,11 @@ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -17964,8 +20329,8 @@ fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -17982,7 +20347,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -17999,8 +20364,8 @@ ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -18023,10 +20388,12 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -18027,10 +20394,10 @@ emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -18040,6 +20407,14 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl @@ -18043,39 +20418,31 @@ as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi +if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. @@ -18080,6 +20447,6 @@ # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -18088,13 +20455,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -18103,8 +20463,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -18116,7 +20480,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi @@ -18120,26 +20484,6 @@ exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -18152,10 +20496,10 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -18158,7 +20502,8 @@ as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -18185,9 +20530,10 @@ { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. @@ -18188,11 +20534,12 @@ # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' @@ -18195,8 +20542,8 @@ eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -18208,8 +20555,9 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' @@ -18212,8 +20560,8 @@ eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -18244,7 +20592,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -18266,6 +20614,10 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -18279,6 +20631,12 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -18320,7 +20678,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -18329,7 +20687,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -18392,7 +20750,7 @@ # values after options handling. ac_log=" This file was extended by python $as_me 3.10, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -18450,4 +20808,6 @@ Report bugs to <https://bugs.python.org/>." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -18453,4 +20813,4 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ python config.status 3.10 @@ -18455,5 +20815,5 @@ ac_cs_version="\\ python config.status 3.10 -configured by $0, generated by GNU Autoconf 2.69, +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" @@ -18458,6 +20818,6 @@ with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -18496,5 +20856,5 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) @@ -18500,7 +20860,7 @@ --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in @@ -18502,9 +20862,9 @@ --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -18512,7 +20872,7 @@ --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -18521,7 +20881,7 @@ as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -18549,7 +20909,7 @@ if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -18563,7 +20923,7 @@ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -18597,8 +20957,8 @@ # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree @@ -18934,7 +21294,7 @@ esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -18942,7 +21302,7 @@ # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" @@ -18946,9 +21306,9 @@ `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) @@ -18951,8 +21311,8 @@ fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -18969,7 +21329,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -18993,5 +21353,5 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. @@ -18997,5 +21357,5 @@ # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -19057,8 +21417,8 @@ case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -19102,5 +21462,5 @@ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 @@ -19106,5 +21466,5 @@ which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -19120,8 +21480,8 @@ # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then @@ -19124,12 +21484,12 @@ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else @@ -19130,10 +21490,10 @@ else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -19179,8 +21539,8 @@ $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi @@ -19204,3 +21564,4 @@ echo "" >&6 echo "" >&6 fi + diff --git a/configure.ac b/configure.ac index d44ad9a90312e58b44562e9ca531de7ed4ce5736_Y29uZmlndXJlLmFj..8dd72af26abae4c1395bdd7572059de8fccc8d87_Y29uZmlndXJlLmFj 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,9 @@ -dnl *********************************************** -dnl * Please run autoreconf to test your changes! * -dnl *********************************************** +dnl *************************************************** +dnl * Please run autoreconf -if to test your changes! * +dnl *************************************************** +dnl +dnl Python's configure script requires autoconf 2.69 and autoconf-archive. +dnl # Set VERSION so we only need to edit in one place (i.e., here) m4_define(PYTHON_VERSION, 3.10) @@ -9,10 +12,14 @@ AC_INIT([python],[PYTHON_VERSION],[https://bugs.python.org/]) -AC_CONFIG_MACRO_DIR(m4) +m4_ifdef( + [AX_C_FLOAT_WORDS_BIGENDIAN], + [], + [AC_MSG_ERROR([Please install autoconf-archive package and re-run autoreconf])] +) AC_SUBST(BASECPPFLAGS) if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then # If we're building out-of-tree, we need to make sure the following # resources get picked up before their $srcdir counterparts. # Objects/ -> typeslots.inc @@ -13,10 +20,10 @@ AC_SUBST(BASECPPFLAGS) if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then # If we're building out-of-tree, we need to make sure the following # resources get picked up before their $srcdir counterparts. # Objects/ -> typeslots.inc - # Include/ -> Python-ast.h + # Include/ -> Python.h # Python/ -> importlib.h # (A side effect of this is that these resources will automatically be # regenerated when building out-of-tree, regardless of whether or not @@ -2347,7 +2354,7 @@ AC_CHECK_TYPE(__uint128_t, AC_DEFINE(HAVE_GCC_UINT128_T, 1, [Define if your compiler provides __uint128_t]),,) -# Sizes of various common basic types +# Sizes and alignments of various common basic types # ANSI C requires sizeof(char) == 1, so no need to check it AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) @@ -2351,6 +2358,7 @@ # ANSI C requires sizeof(char) == 1, so no need to check it AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) +AC_CHECK_ALIGNOF(long) AC_CHECK_SIZEOF(long long, 8) AC_CHECK_SIZEOF(void *, 4) AC_CHECK_SIZEOF(short, 2) @@ -2358,6 +2366,7 @@ AC_CHECK_SIZEOF(double, 8) AC_CHECK_SIZEOF(fpos_t, 4) AC_CHECK_SIZEOF(size_t, 4) +AC_CHECK_ALIGNOF(size_t) AC_CHECK_SIZEOF(pid_t, 4) AC_CHECK_SIZEOF(uintptr_t) diff --git a/m4/ax_c_float_words_bigendian.m4 b/m4/ax_c_float_words_bigendian.m4 deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_bTQvYXhfY19mbG9hdF93b3Jkc19iaWdlbmRpYW4ubTQ=..0000000000000000000000000000000000000000 --- a/m4/ax_c_float_words_bigendian.m4 +++ /dev/null @@ -1,83 +0,0 @@ -# =============================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_c_float_words_bigendian.html -# =============================================================================== -# -# SYNOPSIS -# -# AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) -# -# DESCRIPTION -# -# Checks the ordering of words within a multi-word float. This check is -# necessary because on some systems (e.g. certain ARM systems), the float -# word ordering can be different from the byte ordering. In a multi-word -# float context, "big-endian" implies that the word containing the sign -# bit is found in the memory location with the lowest address. This -# implementation was inspired by the AC_C_BIGENDIAN macro in autoconf. -# -# The endianness is detected by first compiling C code that contains a -# special double float value, then grepping the resulting object file for -# certain strings of ASCII values. The double is specially crafted to have -# a binary representation that corresponds with a simple string. In this -# implementation, the string "noonsees" was selected because the -# individual word values ("noon" and "sees") are palindromes, thus making -# this test byte-order agnostic. If grep finds the string "noonsees" in -# the object file, the target platform stores float words in big-endian -# order. If grep finds "seesnoon", float words are in little-endian order. -# If neither value is found, the user is instructed to specify the -# ordering. -# -# LICENSE -# -# Copyright (c) 2008 Daniel Amelang <dan@amelang.net> -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 11 - -AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN], - [AC_CACHE_CHECK(whether float word ordering is bigendian, - ax_cv_c_float_words_bigendian, [ - -ax_cv_c_float_words_bigendian=unknown -AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ - -double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0; - -]])], [ - -if $GREP noonsees conftest.$ac_objext >/dev/null ; then - ax_cv_c_float_words_bigendian=yes -fi -if $GREP seesnoon conftest.$ac_objext >/dev/null ; then - if test "$ax_cv_c_float_words_bigendian" = unknown; then - ax_cv_c_float_words_bigendian=no - else - ax_cv_c_float_words_bigendian=unknown - fi -fi - -])]) - -case $ax_cv_c_float_words_bigendian in - yes) - m4_default([$1], - [AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1, - [Define to 1 if your system stores words within floats - with the most significant word first])]) ;; - no) - $2 ;; - *) - m4_default([$3], - [AC_MSG_ERROR([ - -Unknown float word ordering. You need to manually preset -ax_cv_c_float_words_bigendian=no (or yes) according to your system. - - ])]) ;; -esac - -])# AX_C_FLOAT_WORDS_BIGENDIAN diff --git a/m4/ax_check_openssl.m4 b/m4/ax_check_openssl.m4 deleted file mode 100644 index d44ad9a90312e58b44562e9ca531de7ed4ce5736_bTQvYXhfY2hlY2tfb3BlbnNzbC5tNA==..0000000000000000000000000000000000000000 --- a/m4/ax_check_openssl.m4 +++ /dev/null @@ -1,124 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]]) -# -# DESCRIPTION -# -# Look for OpenSSL in a number of default spots, or in a user-selected -# spot (via --with-openssl). Sets -# -# OPENSSL_INCLUDES to the include directives required -# OPENSSL_LIBS to the -l directives required -# OPENSSL_LDFLAGS to the -L or -R flags required -# -# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately -# -# This macro sets OPENSSL_INCLUDES such that source files should use the -# openssl/ directory in include directives: -# -# #include <openssl/hmac.h> -# -# LICENSE -# -# Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/> -# Copyright (c) 2009,2010 Dustin J. Mitchell <dustin@zmanda.com> -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 10 - -AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL]) -AC_DEFUN([AX_CHECK_OPENSSL], [ - found=false - AC_ARG_WITH([openssl], - [AS_HELP_STRING([--with-openssl=DIR], - [override root of the OpenSSL directory to DIR])], - [ - case "$withval" in - "" | y | ye | yes | n | no) - AC_MSG_ERROR([Invalid --with-openssl value]) - ;; - *) ssldirs="$withval" - ;; - esac - ], [ - # if pkg-config is installed and openssl has installed a .pc file, - # then use that information and don't search ssldirs - AC_CHECK_TOOL([PKG_CONFIG], [pkg-config]) - if test x"$PKG_CONFIG" != x""; then - OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` - if test $? = 0; then - OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` - OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` - found=true - fi - fi - - # no such luck; use some default ssldirs - if ! $found; then - ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" - fi - ] - ) - - - # note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in - # an 'openssl' subdirectory - - if ! $found; then - OPENSSL_INCLUDES= - for ssldir in $ssldirs; do - AC_MSG_CHECKING([for openssl/ssl.h in $ssldir]) - if test -f "$ssldir/include/openssl/ssl.h"; then - OPENSSL_INCLUDES="-I$ssldir/include" - OPENSSL_LDFLAGS="-L$ssldir/lib" - OPENSSL_LIBS="-lssl -lcrypto" - found=true - AC_MSG_RESULT([yes]) - break - else - AC_MSG_RESULT([no]) - fi - done - - # if the file wasn't found, well, go ahead and try the link anyway -- maybe - # it will just work! - fi - - # try the preprocessor and linker with our new flags, - # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS - - AC_MSG_CHECKING([whether compiling and linking against OpenSSL works]) - echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ - "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD - - save_LIBS="$LIBS" - save_LDFLAGS="$LDFLAGS" - save_CPPFLAGS="$CPPFLAGS" - LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" - LIBS="$OPENSSL_LIBS $LIBS" - CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([#include <openssl/ssl.h>], [SSL_new(NULL)])], - [ - AC_MSG_RESULT([yes]) - $1 - ], [ - AC_MSG_RESULT([no]) - $2 - ]) - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - - AC_SUBST([OPENSSL_INCLUDES]) - AC_SUBST([OPENSSL_LIBS]) - AC_SUBST([OPENSSL_LDFLAGS]) -]) diff --git a/pyconfig.h.in b/pyconfig.h.in index d44ad9a90312e58b44562e9ca531de7ed4ce5736_cHljb25maWcuaC5pbg==..8dd72af26abae4c1395bdd7572059de8fccc8d87_cHljb25maWcuaC5pbg== 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -16,6 +16,12 @@ support for AIX C++ shared extension modules. */ #undef AIX_GENUINE_CPLUSPLUS +/* The normal alignment of `long', in bytes. */ +#undef ALIGNOF_LONG + +/* The normal alignment of `size_t', in bytes. */ +#undef ALIGNOF_SIZE_T + /* Alternative SOABI used in debug build to load C extensions built in release mode */ #undef ALT_SOABI diff --git a/setup.py b/setup.py index d44ad9a90312e58b44562e9ca531de7ed4ce5736_c2V0dXAucHk=..8dd72af26abae4c1395bdd7572059de8fccc8d87_c2V0dXAucHk= 100644 --- a/setup.py +++ b/setup.py @@ -1864,15 +1864,8 @@ ## # Uncomment these lines if you want to play with xxmodule.c ## self.add(Extension('xx', ['xxmodule.c'])) - if 'd' not in sysconfig.get_config_var('ABIFLAGS'): - # Non-debug mode: Build xxlimited with limited API - self.add(Extension('xxlimited', ['xxlimited.c'], - define_macros=[('Py_LIMITED_API', '0x03100000')])) - self.add(Extension('xxlimited_35', ['xxlimited_35.c'], - define_macros=[('Py_LIMITED_API', '0x03050000')])) - else: - # Debug mode: Build xxlimited with the full API - # (which is compatible with the limited one) + # The limited C API is not compatible with the Py_TRACE_REFS macro. + if not sysconfig.get_config_var('Py_TRACE_REFS'): self.add(Extension('xxlimited', ['xxlimited.c'])) self.add(Extension('xxlimited_35', ['xxlimited_35.c'])) @@ -2290,7 +2283,7 @@ undef_macros = [] if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"): include_dirs = [] - libraries = [':libmpdec.so.2'] + libraries = ['mpdec'] sources = ['_decimal/_decimal.c'] depends = ['_decimal/docstrings.h'] else: @@ -2447,4 +2440,26 @@ else: runtime_library_dirs = [openssl_rpath] + openssl_extension_kwargs = dict( + include_dirs=openssl_includes, + library_dirs=openssl_libdirs, + libraries=openssl_libs, + runtime_library_dirs=runtime_library_dirs, + ) + + # This static linking is NOT OFFICIALLY SUPPORTED. + # Requires static OpenSSL build with position-independent code. Some + # features like DSO engines or external OSSL providers don't work. + # Only tested on GCC and clang on X86_64. + if os.environ.get("PY_UNSUPPORTED_OPENSSL_BUILD") == "static": + extra_linker_args = [] + for lib in openssl_extension_kwargs["libraries"]: + # link statically + extra_linker_args.append(f"-l:lib{lib}.a") + # don't export symbols + extra_linker_args.append(f"-Wl,--exclude-libs,lib{lib}.a") + openssl_extension_kwargs["extra_link_args"] = extra_linker_args + # don't link OpenSSL shared libraries. + openssl_extension_kwargs["libraries"] = [] + if config_vars.get("HAVE_X509_VERIFY_PARAM_SET1_HOST"): @@ -2450,12 +2465,18 @@ if config_vars.get("HAVE_X509_VERIFY_PARAM_SET1_HOST"): - self.add(Extension( - '_ssl', ['_ssl.c'], - include_dirs=openssl_includes, - library_dirs=openssl_libdirs, - libraries=openssl_libs, - runtime_library_dirs=runtime_library_dirs, - depends=['socketmodule.h', '_ssl/debughelpers.c']) + self.add( + Extension( + '_ssl', + ['_ssl.c'], + depends=[ + 'socketmodule.h', + '_ssl/debughelpers.c', + '_ssl_data.h', + '_ssl_data_111.h', + '_ssl_data_300.h', + ], + **openssl_extension_kwargs + ) ) else: self.missing.append('_ssl') @@ -2458,13 +2479,15 @@ ) else: self.missing.append('_ssl') - self.add(Extension('_hashlib', ['_hashopenssl.c'], - depends=['hashlib.h'], - include_dirs=openssl_includes, - library_dirs=openssl_libdirs, - runtime_library_dirs=runtime_library_dirs, - libraries=openssl_libs)) + self.add( + Extension( + '_hashlib', + ['_hashopenssl.c'], + depends=['hashlib.h'], + **openssl_extension_kwargs, + ) + ) def detect_hash_builtins(self): # By default we always compile these even when OpenSSL is available