bpo-32030: Fix compilation on FreeBSD, #include <fenv.h> (#4919)

* main.c: add missing #include <fenv.h> on FreeBSD
* indent also other #ifdef in main.c
* cleanup Programs/python.c
This commit is contained in:
Victor Stinner 2017-12-18 23:42:55 +01:00 committed by GitHub
parent d757aaf9dd
commit 6efcb6d3d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 18 deletions

View File

@ -9,23 +9,27 @@
#include <locale.h>
#if defined(MS_WINDOWS) || defined(__CYGWIN__)
#include <windows.h>
#ifdef HAVE_IO_H
#include <io.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
# include <windows.h>
# ifdef HAVE_IO_H
# include <io.h>
# endif
# ifdef HAVE_FCNTL_H
# include <fcntl.h>
# endif
#endif
#ifdef _MSC_VER
#include <crtdbg.h>
# include <crtdbg.h>
#endif
#ifdef __FreeBSD__
# include <fenv.h>
#endif
#if defined(MS_WINDOWS)
#define PYTHONHOMEHELP "<prefix>\\python{major}{minor}"
# define PYTHONHOMEHELP "<prefix>\\python{major}{minor}"
#else
#define PYTHONHOMEHELP "<prefix>/lib/pythonX.X"
# define PYTHONHOMEHELP "<prefix>/lib/pythonX.X"
#endif
#define COPYRIGHT \

View File

@ -1,12 +1,6 @@
/* Minimal main program -- everything is loaded from the library */
#include "Python.h"
#include "internal/pystate.h"
#include <locale.h>
#ifdef __FreeBSD__
#include <fenv.h>
#endif
#ifdef MS_WINDOWS
int
@ -15,8 +9,6 @@ wmain(int argc, wchar_t **argv)
return Py_Main(argc, argv);
}
#else
int
main(int argc, char **argv)
{