Commit 6efcb6d3 authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

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
parent d757aaf9
...@@ -9,23 +9,27 @@ ...@@ -9,23 +9,27 @@
#include <locale.h> #include <locale.h>
#if defined(MS_WINDOWS) || defined(__CYGWIN__) #if defined(MS_WINDOWS) || defined(__CYGWIN__)
#include <windows.h> # include <windows.h>
#ifdef HAVE_IO_H # ifdef HAVE_IO_H
#include <io.h> # include <io.h>
#endif # endif
#ifdef HAVE_FCNTL_H # ifdef HAVE_FCNTL_H
#include <fcntl.h> # include <fcntl.h>
#endif # endif
#endif #endif
#ifdef _MSC_VER #ifdef _MSC_VER
#include <crtdbg.h> # include <crtdbg.h>
#endif
#ifdef __FreeBSD__
# include <fenv.h>
#endif #endif
#if defined(MS_WINDOWS) #if defined(MS_WINDOWS)
#define PYTHONHOMEHELP "<prefix>\\python{major}{minor}" # define PYTHONHOMEHELP "<prefix>\\python{major}{minor}"
#else #else
#define PYTHONHOMEHELP "<prefix>/lib/pythonX.X" # define PYTHONHOMEHELP "<prefix>/lib/pythonX.X"
#endif #endif
#define COPYRIGHT \ #define COPYRIGHT \
......
/* Minimal main program -- everything is loaded from the library */ /* Minimal main program -- everything is loaded from the library */
#include "Python.h" #include "Python.h"
#include "internal/pystate.h"
#include <locale.h>
#ifdef __FreeBSD__
#include <fenv.h>
#endif
#ifdef MS_WINDOWS #ifdef MS_WINDOWS
int int
...@@ -15,8 +9,6 @@ wmain(int argc, wchar_t **argv) ...@@ -15,8 +9,6 @@ wmain(int argc, wchar_t **argv)
return Py_Main(argc, argv); return Py_Main(argc, argv);
} }
#else #else
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment