]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-116869: Fix redefinition of the _PyOptimizerObject type (#116963)
authorVictor Stinner <vstinner@python.org>
Mon, 18 Mar 2024 16:14:42 +0000 (17:14 +0100)
committerGitHub <noreply@github.com>
Mon, 18 Mar 2024 16:14:42 +0000 (16:14 +0000)
commitf139d840fb543f8357ce9fc8f845c4e945a0ce85
tree6460482ad0453e4e5be5c2b26daa1a2b562090b6
parent1d95451be1f3080904c00cc4c4a6cc519efdf321
gh-116869: Fix redefinition of the _PyOptimizerObject type (#116963)

Defining a type twice is a C11 feature and so makes the C API
incompatible with C99. Fix the issue by only defining the type once.

Example of warning (treated as an error):

    In file included from Include/Python.h:122:
    Include/cpython/optimizer.h:77:3: error: redefinition of typedef
    '_PyOptimizerObject' is a C11 feature [-Werror,-Wtypedef-redefinition]
    } _PyOptimizerObject;
    ^
    build/Include/cpython/optimizer.h:60:35: note: previous definition is here
    typedef struct _PyOptimizerObject _PyOptimizerObject;
                                    ^
Include/cpython/optimizer.h