Retract the statement that all functions called by Python (even method
defs) need to be declared extern "C" -- it seems to have no basis in truth (any more?).
This commit is contained in:
parent
03710d2a40
commit
afcd589027
|
@ -1227,10 +1227,9 @@ It is possible to write extension modules in \Cpp{}. Some restrictions
|
||||||
apply. If the main program (the Python interpreter) is compiled and
|
apply. If the main program (the Python interpreter) is compiled and
|
||||||
linked by the \C{} compiler, global or static objects with constructors
|
linked by the \C{} compiler, global or static objects with constructors
|
||||||
cannot be used. This is not a problem if the main program is linked
|
cannot be used. This is not a problem if the main program is linked
|
||||||
by the \Cpp{} compiler. All functions that will be called directly or
|
by the \Cpp{} compiler. Functions that will be called by the
|
||||||
indirectly (i.e. via function pointers) by the Python interpreter will
|
Python interpreter (in particular, module initalization functions)
|
||||||
have to be declared using \code{extern "C"}; this applies to all
|
have to be declared using \code{extern "C"}.
|
||||||
``methods'' as well as to the module's initialization function.
|
|
||||||
It is unnecessary to enclose the Python header files in
|
It is unnecessary to enclose the Python header files in
|
||||||
\code{extern "C" \{...\}} --- they use this form already if the symbol
|
\code{extern "C" \{...\}} --- they use this form already if the symbol
|
||||||
\samp{__cplusplus} is defined (all recent \Cpp{} compilers define this
|
\samp{__cplusplus} is defined (all recent \Cpp{} compilers define this
|
||||||
|
|
|
@ -1227,10 +1227,9 @@ It is possible to write extension modules in \Cpp{}. Some restrictions
|
||||||
apply. If the main program (the Python interpreter) is compiled and
|
apply. If the main program (the Python interpreter) is compiled and
|
||||||
linked by the \C{} compiler, global or static objects with constructors
|
linked by the \C{} compiler, global or static objects with constructors
|
||||||
cannot be used. This is not a problem if the main program is linked
|
cannot be used. This is not a problem if the main program is linked
|
||||||
by the \Cpp{} compiler. All functions that will be called directly or
|
by the \Cpp{} compiler. Functions that will be called by the
|
||||||
indirectly (i.e. via function pointers) by the Python interpreter will
|
Python interpreter (in particular, module initalization functions)
|
||||||
have to be declared using \code{extern "C"}; this applies to all
|
have to be declared using \code{extern "C"}.
|
||||||
``methods'' as well as to the module's initialization function.
|
|
||||||
It is unnecessary to enclose the Python header files in
|
It is unnecessary to enclose the Python header files in
|
||||||
\code{extern "C" \{...\}} --- they use this form already if the symbol
|
\code{extern "C" \{...\}} --- they use this form already if the symbol
|
||||||
\samp{__cplusplus} is defined (all recent \Cpp{} compilers define this
|
\samp{__cplusplus} is defined (all recent \Cpp{} compilers define this
|
||||||
|
|
Loading…
Reference in New Issue