From 6efcb6d3d5911aaf699f9df3bb3bc26e94f38e6d Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 18 Dec 2017 23:42:55 +0100 Subject: bpo-32030: Fix compilation on FreeBSD, #include (#4919) * main.c: add missing #include on FreeBSD * indent also other #ifdef in main.c * cleanup Programs/python.c --- Modules/main.c | 24 ++++++++++++++---------- Programs/python.c | 8 -------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/Modules/main.c b/Modules/main.c index 00de7f0..4312ef7 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -9,23 +9,27 @@ #include #if defined(MS_WINDOWS) || defined(__CYGWIN__) -#include -#ifdef HAVE_IO_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif +# include +# ifdef HAVE_IO_H +# include +# endif +# ifdef HAVE_FCNTL_H +# include +# endif #endif #ifdef _MSC_VER -#include +# include +#endif + +#ifdef __FreeBSD__ +# include #endif #if defined(MS_WINDOWS) -#define PYTHONHOMEHELP "\\python{major}{minor}" +# define PYTHONHOMEHELP "\\python{major}{minor}" #else -#define PYTHONHOMEHELP "/lib/pythonX.X" +# define PYTHONHOMEHELP "/lib/pythonX.X" #endif #define COPYRIGHT \ diff --git a/Programs/python.c b/Programs/python.c index a295486..78e48f8 100644 --- a/Programs/python.c +++ b/Programs/python.c @@ -1,12 +1,6 @@ /* Minimal main program -- everything is loaded from the library */ #include "Python.h" -#include "internal/pystate.h" -#include - -#ifdef __FreeBSD__ -#include -#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) { -- cgit v0.12