Issue #73 Merge gflags_config.h into gflags_declare.h. Configuration of gflags.h...
authorAndreas Schuh <andreas.schuh.84@gmail.com>
Fri, 14 Mar 2014 16:29:51 +0000 (16:29 +0000)
committerAndreas Schuh <andreas.schuh.84@gmail.com>
Fri, 14 Mar 2014 16:29:51 +0000 (16:29 +0000)
CMakeLists.txt
src/config.h.in
src/gflags.h [moved from src/gflags.h.in with 99% similarity]
src/gflags_config.h.in [deleted file]
src/gflags_declare.h.in
src/windows_port.h

index a3b405b..a67a325 100644 (file)
@@ -94,7 +94,6 @@ endif ()
 # source files - excluding root subdirectory and/or .in suffix
 set (PUBLIC_HDRS
   "gflags.h"
-  "gflags_config.h"
   "gflags_declare.h"
   "gflags_completions.h"
 )
index fc2cf85..33987f9 100644 (file)
@@ -2,8 +2,6 @@
 
 // Note: This header file is only used internally. It is not part of public interface!
 
-#include "gflags_config.h"
-
 // ---------------------------------------------------------------------------
 // Additional meta-information
 
similarity index 99%
rename from src/gflags.h.in
rename to src/gflags.h
index 6ca0a4b..3a16777 100644 (file)
@@ -81,7 +81,6 @@
 #include <string>
 #include <vector>
 
-#include "gflags_config.h"
 #include "gflags_declare.h" // IWYU pragma: export
 
 
diff --git a/src/gflags_config.h.in b/src/gflags_config.h.in
deleted file mode 100644 (file)
index 6fa1289..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Generated from gflags_config.h.in during build configuration using CMake. */
-
-#ifndef GFLAGS_GFLAGS_CONFIG_H_
-#define GFLAGS_GFLAGS_CONFIG_H_
-
-// ---------------------------------------------------------------------------
-// Meta-information
-
-// Version number of gflags library.
-#define GFLAGS_VERSION_STRING "@PACKAGE_VERSION@"
-
-#define GFLAGS_VERSION_MAJOR @PACKAGE_VERSION_MAJOR@ ///< Major version number.
-#define GFLAGS_VERSION_MINOR @PACKAGE_VERSION_MINOR@ ///< Minor version number.
-#define GFLAGS_VERSION_PATCH @PACKAGE_VERSION_PATCH@ ///< Version patch number.
-
-// Whether gflags library is shared. Used for DLL import declaration.
-#cmakedefine GFLAGS_SHARED_LIBS
-
-// ---------------------------------------------------------------------------
-// Namespace for gflags symbols.
-#define GFLAGS_NAMESPACE @GFLAGS_NAMESPACE@
-
-// ---------------------------------------------------------------------------
-// Unused attribute declaration for GNU GCC.
-#define GFLAGS__ATTRIBUTE__UNUSED @GFLAGS__ATTRIBUTE_UNUSED@
-
-// ---------------------------------------------------------------------------
-// Windows DLL import/export.
-#if defined(_MSC_VER) && defined(GFLAGS_SHARED_LIBS)
-#  ifdef GFLAGS_DLL_EXPORT
-#    define GFLAGS_DLL_DECL __declspec(dllexport)
-#  else
-#    define GFLAGS_DLL_DECL __declspec(dllimport)
-#  endif
-#else
-#  define GFLAGS_DLL_DECL
-#endif
-
-// We always want to export defined variables, dll or no
-#if defined(_MSC_VER)
-#  define GFLAGS_DLL_DEFINE_FLAG __declspec(dllexport)
-#else
-#  define GFLAGS_DLL_DEFINE_FLAG
-#endif
-
-// Export/import of STL class instantiations
-// \sa http://support.microsoft.com/default.aspx?scid=KB;EN-US;168958
-#if defined(GFLAGS_SHARED_LIBS) && defined(_MSC_VER) && _MSC_VER >= 1100
-#  ifdef GFLAGS_DLL_EXPORT
-#    define GFLAGS_EXTERN_STL
-#  else
-#    define GFLAGS_EXTERN_STL extern
-#  endif
-#endif
-
-
-#endif // GFLAGS_GFLAGS_CONFIG_H_
\ No newline at end of file
index 3caf0db..7141e99 100644 (file)
 #ifndef GFLAGS_DECLARE_H_
 #define GFLAGS_DECLARE_H_
 
+// ---------------------------------------------------------------------------
+// Meta-information
 
-#if !defined(GFLAGS_DLL_DECL)
-#  if defined(_MSC_VER)
-#    if defined(GFLAGS_DLL_EXPORT)
+// Version number of gflags library.
+#define GFLAGS_VERSION_STRING "@PACKAGE_VERSION@"
+
+#define GFLAGS_VERSION_MAJOR @PACKAGE_VERSION_MAJOR@ ///< Major version number.
+#define GFLAGS_VERSION_MINOR @PACKAGE_VERSION_MINOR@ ///< Minor version number.
+#define GFLAGS_VERSION_PATCH @PACKAGE_VERSION_PATCH@ ///< Version patch number.
+
+// Whether gflags library is shared. Used for DLL import declaration.
+#cmakedefine GFLAGS_SHARED_LIBS
+
+// ---------------------------------------------------------------------------
+// Namespace for gflags symbols.
+#define GFLAGS_NAMESPACE @GFLAGS_NAMESPACE@
+
+// ---------------------------------------------------------------------------
+// Unused attribute declaration for GNU GCC.
+#define GFLAGS__ATTRIBUTE__UNUSED @GFLAGS__ATTRIBUTE_UNUSED@
+
+// ---------------------------------------------------------------------------
+// Windows DLL import/export.
+#ifndef GFLAGS_DLL_DECL
+#  if defined(_MSC_VER) && defined(GFLAGS_SHARED_LIBS)
+#    ifdef GFLAGS_DLL_EXPORT
 #      define GFLAGS_DLL_DECL __declspec(dllexport)
 #    else
 #      define GFLAGS_DLL_DECL __declspec(dllimport)
 #  endif
 #endif
 
+// We always want to export defined variables, dll or no
+#if defined(_MSC_VER)
+#  define GFLAGS_DLL_DEFINE_FLAG __declspec(dllexport)
+#else
+#  define GFLAGS_DLL_DEFINE_FLAG
+#endif
+
 // We always want to import declared variables, dll or no
-#if !defined(GFLAGS_DLL_DECLARE_FLAG)
-#  if defined(_MSC_VER)
-#    define GFLAGS_DLL_DECLARE_FLAG __declspec(dllimport)
+#if defined(_MSC_VER)
+#  define GFLAGS_DLL_DECLARE_FLAG __declspec(dllimport)
+#else
+#  define GFLAGS_DLL_DECLARE_FLAG
+#endif
+
+// Export/import of STL class instantiations
+// \sa http://support.microsoft.com/default.aspx?scid=KB;EN-US;168958
+#if defined(GFLAGS_SHARED_LIBS) && defined(_MSC_VER) && _MSC_VER >= 1100
+#  ifdef GFLAGS_DLL_EXPORT
+#    define GFLAGS_EXTERN_STL
 #  else
-#    define GFLAGS_DLL_DECLARE_FLAG
+#    define GFLAGS_EXTERN_STL extern
 #  endif
 #endif
 
-
+// ---------------------------------------------------------------------------
+// Types
 #include <string>
 #if @HAVE_STDINT_H@
-#include <stdint.h>         // the normal place uint16_t is defined
+#  include <stdint.h>         // the normal place uint16_t is defined
 #endif
 #if @HAVE_SYS_TYPES_H@
-#include <sys/types.h>      // the normal place u_int16_t is defined
+#  include <sys/types.h>      // the normal place u_int16_t is defined
 #endif
 #if @HAVE_INTTYPES_H@
-#include <inttypes.h>       // a third place for uint16_t or u_int16_t
+#  include <inttypes.h>       // a third place for uint16_t or u_int16_t
 #endif
 
 
-namespace @GFLAGS_NAMESPACE@ {
+namespace GFLAGS_NAMESPACE {
 
 #if @HAVE_uint16_t@         // the C99 format
 typedef int32_t  int32;
@@ -93,7 +131,7 @@ typedef unsigned __int64 uint64;
 #  error Do not know how to define a 32-bit integer quantity on your system
 #endif
 
-} // namespace @GFLAGS_NAMESPACE@
+} // namespace GFLAGS_NAMESPACE
 
 
 namespace fLS {
index 31643a4..8a0e49b 100644 (file)
 #ifndef GFLAGS_WINDOWS_PORT_H_
 #define GFLAGS_WINDOWS_PORT_H_
 
+#ifndef GFLAGS_DLL_DECL
+#  if defined(_MSC_VER) && defined(GFLAGS_SHARED_LIBS)
+#    ifdef GFLAGS_DLL_EXPORT
+#      define GFLAGS_DLL_DECL __declspec(dllexport)
+#    else
+#      define GFLAGS_DLL_DECL __declspec(dllimport)
+#    endif
+#  else
+#    define GFLAGS_DLL_DECL
+#  endif
+#endif
+
+
 #ifndef WIN32_LEAN_AND_MEAN
 #  define WIN32_LEAN_AND_MEAN  /* We always want minimal includes */
 #endif