From fa132e4f0fd7aa379833f8beb3f18888990bfe1e Mon Sep 17 00:00:00 2001 From: Matthias Wolf Date: Wed, 1 Nov 2023 14:47:38 +0100 Subject: [PATCH] unistd: add include guards for header (#2590) * unistd: add include guards for header --- src/ivoc/pwman.cpp | 2 ++ src/nrniv/nrncore_write/utils/nrncore_utils.cpp | 2 ++ src/nrnoc/init.cpp | 2 ++ src/nrnpython/rxd_intracellular.cpp | 2 ++ src/oc/code2.cpp | 2 ++ src/oc/fileio.cpp | 2 ++ src/oc/hoc.cpp | 2 ++ src/oc/mswinprt.cpp | 2 ++ src/oc/scoprand.cpp | 2 ++ src/parallel/bbsclimpi.cpp | 2 ++ src/parallel/bbsdirectmpi.cpp | 2 ++ src/parallel/bbssrvmpi.cpp | 2 ++ 12 files changed, 24 insertions(+) diff --git a/src/ivoc/pwman.cpp b/src/ivoc/pwman.cpp index 3e137781c6..c393eb47a7 100644 --- a/src/ivoc/pwman.cpp +++ b/src/ivoc/pwman.cpp @@ -41,7 +41,9 @@ void iv_display_scale(Coord, Coord); // Make if fit into the screen char* hoc_back2forward(char*); #endif +#ifdef HAVE_UNISTD_H #include +#endif #define IOS_OUT std::ios::out #include diff --git a/src/nrniv/nrncore_write/utils/nrncore_utils.cpp b/src/nrniv/nrncore_write/utils/nrncore_utils.cpp index 5a24cad859..9267bd0c96 100644 --- a/src/nrniv/nrncore_write/utils/nrncore_utils.cpp +++ b/src/nrniv/nrncore_write/utils/nrncore_utils.cpp @@ -11,7 +11,9 @@ #include "vrecitem.h" // for nrnbbcore_vecplay_write #include "parse.hpp" #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include #include diff --git a/src/nrnoc/init.cpp b/src/nrnoc/init.cpp index c46b11f368..6a67507a8e 100644 --- a/src/nrnoc/init.cpp +++ b/src/nrnoc/init.cpp @@ -7,7 +7,9 @@ #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include "section.h" #include "parse.hpp" #include "nrniv_mf.h" diff --git a/src/nrnpython/rxd_intracellular.cpp b/src/nrnpython/rxd_intracellular.cpp index ca95795c54..093cb728de 100644 --- a/src/nrnpython/rxd_intracellular.cpp +++ b/src/nrnpython/rxd_intracellular.cpp @@ -5,7 +5,9 @@ #include "grids.h" #include "rxd.h" #include +#ifdef HAVE_UNISTD_H #include +#endif #include diff --git a/src/oc/code2.cpp b/src/oc/code2.cpp index dd17fd3d17..3e804d103c 100644 --- a/src/oc/code2.cpp +++ b/src/oc/code2.cpp @@ -7,7 +7,9 @@ #include "hocparse.h" #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include #include "nrnfilewrap.h" diff --git a/src/oc/fileio.cpp b/src/oc/fileio.cpp index 88b7e96f2f..455d0220a1 100644 --- a/src/oc/fileio.cpp +++ b/src/oc/fileio.cpp @@ -4,7 +4,9 @@ #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include "hoc.h" #include "ocmisc.h" #include "hocstr.h" diff --git a/src/oc/hoc.cpp b/src/oc/hoc.cpp index d0354c18a4..f4542a9586 100644 --- a/src/oc/hoc.cpp +++ b/src/oc/hoc.cpp @@ -4,7 +4,9 @@ #include "equation.h" #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include #include "parse.hpp" diff --git a/src/oc/mswinprt.cpp b/src/oc/mswinprt.cpp index abfc906154..202a86db82 100644 --- a/src/oc/mswinprt.cpp +++ b/src/oc/mswinprt.cpp @@ -2,7 +2,9 @@ #ifdef MINGW +#ifdef HAVE_UNISTD_H #include +#endif #include #include #include diff --git a/src/oc/scoprand.cpp b/src/oc/scoprand.cpp index c7683b2ae8..7f08ae8814 100644 --- a/src/oc/scoprand.cpp +++ b/src/oc/scoprand.cpp @@ -1,6 +1,8 @@ #include <../../nrnconf.h> #include +#ifdef HAVE_UNISTD_H #include +#endif /* this was removed from the scopmath library since there could be multiple copies of the static value below. One in neuron.exe and the diff --git a/src/parallel/bbsclimpi.cpp b/src/parallel/bbsclimpi.cpp index 571b9bad14..4e95b5b336 100644 --- a/src/parallel/bbsclimpi.cpp +++ b/src/parallel/bbsclimpi.cpp @@ -4,7 +4,9 @@ #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include "nrnpy.h" #include "oc2iv.h" diff --git a/src/parallel/bbsdirectmpi.cpp b/src/parallel/bbsdirectmpi.cpp index a09e0424ac..4e62dbe0bf 100644 --- a/src/parallel/bbsdirectmpi.cpp +++ b/src/parallel/bbsdirectmpi.cpp @@ -3,7 +3,9 @@ #ifdef NRNMPI // to end of file #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include #include "oc2iv.h" #include "bbs.h" diff --git a/src/parallel/bbssrvmpi.cpp b/src/parallel/bbssrvmpi.cpp index 97f49c037f..53aef3cd3b 100644 --- a/src/parallel/bbssrvmpi.cpp +++ b/src/parallel/bbssrvmpi.cpp @@ -2,7 +2,9 @@ #include #ifdef NRNMPI // to end of file #include +#ifdef HAVE_UNISTD_H #include +#endif #include "bbssrv2mpi.h" #include "bbssrv.h"