forked from pypa/setuptools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
distutils.ccompiler: Make has_function work with more C99 compilers
C99 removed support for implicit function declarations. This means that just calling a function, without declaring the function first, can result in a compilation error. Today, has_function works with most compilers because they issue just a warning, create an object file, and attempt a link, which then detects available of the symbol at link time, as intended. With future compilers, compilation will already fail, and no link test is performed. The has_function interface provides the caller with a way to supply a list of header files to include. However, even with today's compilers, this only works if the function does not expect any parameters. Otherwise, the function call in the C fragment created by has_function will not supply the correct argument list and fail compilation. Therefore, this change supplies and incorrect prototype without arguments. This is what autoconf does today in a very similar situation, so it is quite likely that compilers will support this construct in this context in the future. The includes and include_dirs arguments are deprecated because of the parameter list mismatch issue. Fixes pypa#3648.
- Loading branch information
1 parent
6f7dd7c
commit 99700e2
Showing
2 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters