From: Andreas Schuh Date: Fri, 14 Mar 2014 16:29:51 +0000 (+0000) Subject: Issue #73 Merge gflags_config.h into gflags_declare.h. Configuration of gflags.h... X-Git-Tag: accepted/tizen/5.0/unified/20181102.024438~134^2~11^2~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=15bc2d6c15f9609caa5aa4ee0b06965d9a815a84;p=platform%2Fupstream%2Fgflags.git Issue #73 Merge gflags_config.h into gflags_declare.h. Configuration of gflags.h no longer needed. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a3b405b..a67a325 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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" ) diff --git a/src/config.h.in b/src/config.h.in index fc2cf85..33987f9 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -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 diff --git a/src/gflags.h.in b/src/gflags.h similarity index 99% rename from src/gflags.h.in rename to src/gflags.h index 6ca0a4b..3a16777 100644 --- a/src/gflags.h.in +++ b/src/gflags.h @@ -81,7 +81,6 @@ #include #include -#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 index 6fa1289..0000000 --- a/src/gflags_config.h.in +++ /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 diff --git a/src/gflags_declare.h.in b/src/gflags_declare.h.in index 3caf0db..7141e99 100644 --- a/src/gflags_declare.h.in +++ b/src/gflags_declare.h.in @@ -37,10 +37,32 @@ #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) @@ -50,29 +72,45 @@ # 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 #if @HAVE_STDINT_H@ -#include // the normal place uint16_t is defined +# include // the normal place uint16_t is defined #endif #if @HAVE_SYS_TYPES_H@ -#include // the normal place u_int16_t is defined +# include // the normal place u_int16_t is defined #endif #if @HAVE_INTTYPES_H@ -#include // a third place for uint16_t or u_int16_t +# include // 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 { diff --git a/src/windows_port.h b/src/windows_port.h index 31643a4..8a0e49b 100644 --- a/src/windows_port.h +++ b/src/windows_port.h @@ -40,6 +40,19 @@ #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