diff --git a/Common/Gmsh.cpp b/Common/Gmsh.cpp
index 9620056c0323e7e06128f8ee676583c0f0d06399..b66c668cf0673fd19e6fdbc893b34a29abcc1212 100644
--- a/Common/Gmsh.cpp
+++ b/Common/Gmsh.cpp
@@ -6,6 +6,11 @@
 #include <string>
 #include <time.h>
 #include "GmshConfig.h"
+#if !defined(HAVE_NO_STDINT_H)
+#include <stdint.h>
+#elif defined(HAVE_NO_INTPTR_T)
+typedef unsigned long intptr_t;
+#endif
 #include "GmshVersion.h"
 #include "GmshMessage.h"
 #include "GmshDefines.h"
diff --git a/Common/OpenFile.cpp b/Common/OpenFile.cpp
index c5488092272e8813645ffd2efc277ac6e6b84477..9e73180a24c106c081c5ae2de6b38396c92fa55a 100644
--- a/Common/OpenFile.cpp
+++ b/Common/OpenFile.cpp
@@ -6,6 +6,11 @@
 #include <sstream>
 #include <string.h>
 #include "GmshConfig.h"
+#if !defined(HAVE_NO_STDINT_H)
+#include <stdint.h>
+#elif defined(HAVE_NO_INTPTR_T)
+typedef unsigned long intptr_t;
+#endif
 #include "GmshMessage.h"
 #include "GmshIO.h"
 #include "Options.h"
diff --git a/Common/gmshLocalNetworkClient.cpp b/Common/gmshLocalNetworkClient.cpp
index 21a3ad0758ac28b5d0e5efe3ef7cd12e972afa8e..af96039249717dd5ec3c8f249f178d05dad615eb 100644
--- a/Common/gmshLocalNetworkClient.cpp
+++ b/Common/gmshLocalNetworkClient.cpp
@@ -4,6 +4,11 @@
 // bugs and problems to the public mailing list <gmsh@onelab.info>.
 
 #include "GmshConfig.h"
+#if !defined(HAVE_NO_STDINT_H)
+#include <stdint.h>
+#elif defined(HAVE_NO_INTPTR_T)
+typedef unsigned long intptr_t;
+#endif
 #include "Gmsh.h"
 #include "Context.h"
 #include "OS.h"
diff --git a/Fltk/FlGui.cpp b/Fltk/FlGui.cpp
index 9e8aaaadebbf6a37c4e497b1d4a2576d9de6b081..f1aa75b2eda8fb389e85a3cb3e4db957b0ec58b0 100644
--- a/Fltk/FlGui.cpp
+++ b/Fltk/FlGui.cpp
@@ -4,11 +4,6 @@
 // bugs and problems to the public mailing list <gmsh@onelab.info>.
 
 #include "GmshConfig.h"
-#if !defined(HAVE_NO_STDINT_H)
-#include <stdint.h>
-#elif defined(HAVE_NO_INTPTR_T)
-typedef unsigned long intptr_t;
-#endif
 #include <sstream>
 #include <string.h>
 #include <FL/Fl.H>
diff --git a/Fltk/gamepadWindow.cpp b/Fltk/gamepadWindow.cpp
index 4c6544ffcb534824e2dd97e41e1408541b235b41..8fae9a6b1e6ede0b162ca1ebd7ac820f2b294aea 100644
--- a/Fltk/gamepadWindow.cpp
+++ b/Fltk/gamepadWindow.cpp
@@ -4,11 +4,6 @@
 // bugs and problems to the public mailing list <gmsh@onelab.info>.
 
 #include "GmshConfig.h"
-#if !defined(HAVE_NO_STDINT_H)
-#include <stdint.h>
-#elif defined(HAVE_NO_INTPTR_T)
-typedef unsigned long intptr_t;
-#endif
 #include <string.h>
 #include <FL/Fl.H>
 #include <algorithm>
@@ -25,8 +20,10 @@ static  void gamepadWindow_handler(void *data)
   if(CTX::instance()->gamepad && CTX::instance()->gamepad->active){
     gamepadWindow* gmpd_win = (gamepadWindow*)data;
     GamePad* pad  = CTX::instance()->gamepad;
-    for (int i=0; i<std::min(13,GP_BUTTONS);i++) gmpd_win->gamepad.butt[i]->value(pad->button[i]);
-    for (int i=0; i<std::min(9,GP_AXES);i++)     gmpd_win->gamepad.axe[i]->value( pad->axe[i]   );
+    for (int i=0; i<std::min(13,GP_BUTTONS);i++)
+      gmpd_win->gamepad.butt[i]->value(pad->button[i]);
+    for (int i=0; i<std::min(9,GP_AXES);i++)
+      gmpd_win->gamepad.axe[i]->value( pad->axe[i]   );
     Fl::add_timeout(gmpd_win->frequency, gamepadWindow_handler, data);
     gmpd_win->gamepad.mapping[16]->value(pad->axe_map[1]);
   }
@@ -36,8 +33,10 @@ static void gamepad_update_cb(Fl_Widget *w)
 {
   gamepadWindow* gmpd_win =  FlGui::instance()->options->gmpdoption;
   GamePad* pad = CTX::instance()->gamepad;
-  for (int i=0; i<std::min(8,GP_BUTTONS) ;i++) pad->button_map[i] = gmpd_win->gamepad.mapping[i]->value();
-  for (int i=0; i<std::min(7,GP_AXES);i++)     pad->axe_map[i] = gmpd_win->gamepad.mapping[10+i]->value();
+  for (int i=0; i<std::min(8,GP_BUTTONS) ;i++)
+    pad->button_map[i] = gmpd_win->gamepad.mapping[i]->value();
+  for (int i=0; i<std::min(7,GP_AXES);i++)
+    pad->axe_map[i] = gmpd_win->gamepad.mapping[10+i]->value();
 }
 
 gamepadWindow::gamepadWindow()
diff --git a/Fltk/onelabGroup.cpp b/Fltk/onelabGroup.cpp
index 2fa71c1acbf5d2747fcdb6b8e2a38d35862fd4f8..fcdbd5eebd0353923550f079daa2c73fb5362dba 100644
--- a/Fltk/onelabGroup.cpp
+++ b/Fltk/onelabGroup.cpp
@@ -10,7 +10,6 @@
 #elif defined(HAVE_NO_INTPTR_T)
 typedef unsigned long intptr_t;
 #endif
-
 #include <ctype.h>
 #include "GmshMessage.h"
 #include "onelab.h"
diff --git a/Fltk/solverButton.cpp b/Fltk/solverButton.cpp
index bf2f7474b2068be57ebc6d8987e703c24d77f42f..718d59d3f424ed511466bcf6fab0f562ad78a3e6 100644
--- a/Fltk/solverButton.cpp
+++ b/Fltk/solverButton.cpp
@@ -3,6 +3,12 @@
 // 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_NO_STDINT_H)
+#include <stdint.h>
+#elif defined(HAVE_NO_INTPTR_T)
+typedef unsigned long intptr_t;
+#endif
 #include "GmshMessage.h"
 #include "FlGui.h"
 #include "Options.h"
diff --git a/Fltk/viewButton.cpp b/Fltk/viewButton.cpp
index 2ce22356954b0ecd6c93cc4bcb389afd69fb932e..b4aeaaed1ef720f698e8bbe7280acaa0fc4a4f38 100644
--- a/Fltk/viewButton.cpp
+++ b/Fltk/viewButton.cpp
@@ -3,6 +3,12 @@
 // 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_NO_STDINT_H)
+#include <stdint.h>
+#elif defined(HAVE_NO_INTPTR_T)
+typedef unsigned long intptr_t;
+#endif
 #include <FL/fl_ask.H>
 #include "FlGui.h"
 #include "drawContext.h"