diff --git a/ompi/mpi/cxx/mpicxx.cc b/ompi/mpi/cxx/mpicxx.cc index f452654a93..3bfb109abe 100644 --- a/ompi/mpi/cxx/mpicxx.cc +++ b/ompi/mpi/cxx/mpicxx.cc @@ -18,14 +18,10 @@ // // $HEADER$ -#include -static const int ompi_stdio_seek_set = SEEK_SET; -static const int ompi_stdio_seek_cur = SEEK_CUR; -static const int ompi_stdio_seek_end = SEEK_END; - #include "mpicxx.h" -/* Need to include ompi_config.h after mpicxx.h... */ +/* Need to include ompi_config.h after mpicxx.h so that we get + SEEK_SET and friends right */ #include "ompi_config.h" #if OMPI_CXX_USE_PRAGMA_IDENT @@ -39,13 +35,6 @@ namespace MPI { #include "ompi/errhandler/errhandler.h" -#if OMPI_PROVIDE_MPI_FILE_INTERFACE && OMPI_WANT_MPI_CXX_SEEK - -const int SEEK_SET = ompi_stdio_seek_set; -const int SEEK_CUR = ompi_stdio_seek_cur; -const int SEEK_END = ompi_stdio_seek_end; -#endif - namespace MPI { #if ! OMPI_HAVE_CXX_EXCEPTION_SUPPORT diff --git a/ompi/mpi/cxx/mpicxx.h b/ompi/mpi/cxx/mpicxx.h index 3070eb45c1..fa603a19cf 100644 --- a/ompi/mpi/cxx/mpicxx.h +++ b/ompi/mpi/cxx/mpicxx.h @@ -49,6 +49,10 @@ // a #define (it's used in an enum). #include +static const int ompi_stdio_seek_set = SEEK_SET; +static const int ompi_stdio_seek_cur = SEEK_CUR; +static const int ompi_stdio_seek_end = SEEK_END; + // smash SEEK_* #defines #ifdef SEEK_SET #undef SEEK_SET @@ -57,9 +61,9 @@ #endif // make globally scoped constants to replace smashed #defines -extern const int SEEK_SET; -extern const int SEEK_CUR; -extern const int SEEK_END; +static const int SEEK_SET = ompi_stdio_seek_set; +static const int SEEK_CUR = ompi_stdio_seek_cur; +static const int SEEK_END = ompi_stdio_seek_end; #endif // forward declare so that we can still do inlining