diff -rupN gmsh-3.0.6-source/Common/CommandLine.cpp gmsh-3.0.6-source-new/Common/CommandLine.cpp
--- gmsh-3.0.6-source/Common/CommandLine.cpp 2017-11-04 20:27:37.000000000 +0100
+++ gmsh-3.0.6-source-new/Common/CommandLine.cpp 2017-11-05 16:49:19.468093753 +0100
@@ -20,15 +20,6 @@
#include "CreateFile.h"
#include "OS.h"
-#if defined(HAVE_FLTK)
-#include <FL/Fl.H>
-#if (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION >= 3)
-// OK
-#else
-#error "Gmsh requires FLTK >= 1.3"
-#endif
-#endif
-
#if defined(HAVE_PETSC)
#include "petsc.h"
#endif
@@ -49,6 +40,15 @@
#include "Parser.h"
#endif
+#if defined(HAVE_FLTK)
+#include <FL/Fl.H>
+#if (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION >= 3)
+// OK
+#else
+#error "Gmsh requires FLTK >= 1.3"
+#endif
+#endif
+
int GetGmshMajorVersion(){ return GMSH_MAJOR_VERSION; }
int GetGmshMinorVersion(){ return GMSH_MINOR_VERSION; }
int GetGmshPatchVersion(){ return GMSH_PATCH_VERSION; }
diff -rupN gmsh-3.0.6-source/Fltk/helpWindow.cpp gmsh-3.0.6-source-new/Fltk/helpWindow.cpp
--- gmsh-3.0.6-source/Fltk/helpWindow.cpp 2017-10-03 22:01:51.000000000 +0200
+++ gmsh-3.0.6-source-new/Fltk/helpWindow.cpp 2017-11-05 16:49:19.468093753 +0100
@@ -3,13 +3,18 @@
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@onelab.info>.
+#include "GmshConfig.h"
+
+#if defined(HAVE_MED)
+#include "med.h"
+#endif
+
#include <sstream>
#include <algorithm>
#include <FL/Fl_Help_View.H>
#include <FL/Fl_Check_Button.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Color_Chooser.H>
-#include "GmshConfig.h"
#include "FlGui.h"
#include "inputValue.h"
#include "helpWindow.h"
@@ -33,10 +38,6 @@
#include "Standard_Version.hxx"
#endif
-#if defined(HAVE_MED)
-#include "med.h"
-#endif
-
static const char *help_link(Fl_Widget *w, const char *uri)
{
fl_open_uri(uri);
diff -rupN gmsh-3.0.6-source/Geo/GModelIO_MED.cpp gmsh-3.0.6-source-new/Geo/GModelIO_MED.cpp
--- gmsh-3.0.6-source/Geo/GModelIO_MED.cpp 2017-10-03 22:01:51.000000000 +0200
+++ gmsh-3.0.6-source-new/Geo/GModelIO_MED.cpp 2017-11-05 16:49:19.469093752 +0100
@@ -25,9 +25,7 @@
#include "MPyramid.h"
#include "discreteVertex.h"
-extern "C" {
#include <med.h>
-}
#if (MED_MAJOR_NUM == 3)
// To avoid too many ifdefs below we use defines for the bits of the
diff -rupN gmsh-3.0.6-source/Post/PViewDataGModelIO.cpp gmsh-3.0.6-source-new/Post/PViewDataGModelIO.cpp
--- gmsh-3.0.6-source/Post/PViewDataGModelIO.cpp 2017-10-03 22:01:51.000000000 +0200
+++ gmsh-3.0.6-source-new/Post/PViewDataGModelIO.cpp 2017-11-05 16:49:19.469093752 +0100
@@ -361,9 +361,7 @@ void PViewDataGModel::importLists(int N[
#if defined(HAVE_MED)
-extern "C" {
#include <med.h>
-}
#if (MED_MAJOR_NUM == 3)
// To avoid too many ifdefs below we use defines for the bits of the