From 52af72560616b754564ebf3ba8a85ab5849a982d Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 23 Apr 2016 23:00:16 +0000 Subject: [PATCH] Only #include "config.h" when we need something from it. config.h now includes the git hash and so, as long as it's included in solvespace.h, any change of git HEAD will trigger a complete recompilation, which makes bisecting especially annoying. While we're at it, remove HAVE_STDINT_H from it, since we require C++11 and all MSVC versions that include C++11 also include stdint.h. --- CMakeLists.txt | 2 -- src/config.h.in | 3 --- src/graphicswin.cpp | 1 + src/gtk/gtkmain.cpp | 4 +--- src/solvespace.cpp | 1 + src/solvespace.h | 17 +---------------- src/ttf.cpp | 2 -- src/unix/unixutil.cpp | 5 ----- src/win32/w32main.cpp | 3 +-- 9 files changed, 5 insertions(+), 33 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 84fa9db..6dc9962 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,8 +71,6 @@ endif() # dependencies -CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H) - find_package(OpenGL REQUIRED) message(STATUS "Using in-tree libdxfrw") diff --git a/src/config.h.in b/src/config.h.in index 5253d4c..aca7757 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -3,9 +3,6 @@ #define PACKAGE_VERSION "@solvespace_VERSION_MAJOR@.@solvespace_VERSION_MINOR@~@solvespace_GIT_HASH@" -/* MSVC includes a proper stdint.h, but only since VS2008. */ -#cmakedefine HAVE_STDINT_H - /* Do we have the si library on win32, or libspnav on *nix? */ #cmakedefine HAVE_SPACEWARE diff --git a/src/graphicswin.cpp b/src/graphicswin.cpp index c9f2be8..83eeb3b 100644 --- a/src/graphicswin.cpp +++ b/src/graphicswin.cpp @@ -5,6 +5,7 @@ // Copyright 2008-2013 Jonathan Westhues. //----------------------------------------------------------------------------- #include "solvespace.h" +#include "config.h" #define mView (&GraphicsWindow::MenuView) #define mEdit (&GraphicsWindow::MenuEdit) diff --git a/src/gtk/gtkmain.cpp b/src/gtk/gtkmain.cpp index e26a541..3d208ce 100644 --- a/src/gtk/gtkmain.cpp +++ b/src/gtk/gtkmain.cpp @@ -48,12 +48,10 @@ #include #include -#undef HAVE_STDINT_H /* no thanks, we have our own config.h */ - #include -#include #include "solvespace.h" +#include "config.h" #include "../unix/gloffscreen.h" #ifdef HAVE_SPACEWARE diff --git a/src/solvespace.cpp b/src/solvespace.cpp index 4bb634a..60ec68f 100644 --- a/src/solvespace.cpp +++ b/src/solvespace.cpp @@ -5,6 +5,7 @@ // Copyright 2008-2013 Jonathan Westhues. //----------------------------------------------------------------------------- #include "solvespace.h" +#include "config.h" SolveSpaceUI SolveSpace::SS = {}; Sketch SolveSpace::SK = {}; diff --git a/src/solvespace.h b/src/solvespace.h index 6196436..6a12c1f 100644 --- a/src/solvespace.h +++ b/src/solvespace.h @@ -7,7 +7,7 @@ #ifndef __SOLVESPACE_H #define __SOLVESPACE_H -#include +#include #include #include #include @@ -23,9 +23,6 @@ #include #include #include -#ifdef HAVE_STDINT_H -# include -#endif #ifdef WIN32 # include // required by GL headers #endif @@ -112,18 +109,6 @@ inline double ffabs(double v) { return (v > 0) ? v : (-v); } #define isforname(c) (isalnum(c) || (c) == '_' || (c) == '-' || (c) == '#') -#if defined(WIN32) && !defined(HAVE_STDINT_H) -// Define some useful C99 integer types. -typedef UINT64 uint64_t; -typedef INT64 int64_t; -typedef UINT32 uint32_t; -typedef INT32 int32_t; -typedef USHORT uint16_t; -typedef SHORT int16_t; -typedef UCHAR uint8_t; -typedef CHAR int8_t; -#endif - #if defined(WIN32) std::string Narrow(const wchar_t *s); std::wstring Widen(const char *s); diff --git a/src/ttf.cpp b/src/ttf.cpp index 4f7bb75..2de0cad 100644 --- a/src/ttf.cpp +++ b/src/ttf.cpp @@ -39,8 +39,6 @@ extern "C" const char *ft_error_string(int err) { #undef FT_ERROR_START_LIST #undef FT_ERROR_END_LIST -#undef HAVE_STDINT_H /* no thanks, we have our own config.h */ - #include "solvespace.h" //----------------------------------------------------------------------------- diff --git a/src/unix/unixutil.cpp b/src/unix/unixutil.cpp index 4c46ec5..7c1d921 100644 --- a/src/unix/unixutil.cpp +++ b/src/unix/unixutil.cpp @@ -7,11 +7,6 @@ // Copyright 2008-2013 Jonathan Westhues. // Copyright 2013 Daniel Richard G. //----------------------------------------------------------------------------- -#include - -#include -#include -#include #include #include "solvespace.h" diff --git a/src/win32/w32main.cpp b/src/win32/w32main.cpp index dc50253..8f9d551 100644 --- a/src/win32/w32main.cpp +++ b/src/win32/w32main.cpp @@ -11,9 +11,8 @@ #include #include -#include - #include "solvespace.h" +#include "config.h" #ifdef HAVE_SPACEWARE # include