Clean up the 'GFLAGS_DLL_DECL' stuff better: reduce use outside of windows/ directory.

R=jyrki
DELTA=33  (0 added, 27 deleted, 6 changed)


Revision created by MOE tool push_codebase.
MOE_MIGRATION=3016


git-svn-id: http://gflags.googlecode.com/svn/trunk/src@60 6586e3c6-dcc4-952a-343f-ff74eb82781d
diff --git a/gflags/gflags.h.in b/gflags/gflags.h.in
index 154ae82..3b1aef7 100644
--- a/gflags/gflags.h.in
+++ b/gflags/gflags.h.in
@@ -88,9 +88,9 @@
 // them.  Our automated opensourcing tools use this as a signal to do
 // appropriate munging for windows, which needs to add GFLAGS_DLL_DECL.
 //
-#ifdef SWIG  // it apparently can't see the define in gflags_declare.h
-# define GFLAGS_DLL_DECL  /**/
-#endif
+#define GFLAGS_DLL_DECL  /* rewritten to be non-empty in windows dir */
+#define GFLAGS_DLL_DEFINE_FLAG  /* rewritten to be non-empty in windows dir */
+
 
 // --------------------------------------------------------------------
 // To actually define a flag in a file, use DEFINE_bool,
diff --git a/gflags/gflags_completions.h.in b/gflags/gflags_completions.h.in
index 7d6e8f0..8d6a84c 100644
--- a/gflags/gflags_completions.h.in
+++ b/gflags/gflags_completions.h.in
@@ -118,13 +118,8 @@
 // them.  Our automated opensourcing tools use this as a signal to do
 // appropriate munging for windows, which needs to add GFLAGS_DLL_DECL.
 //
-#ifndef GFLAGS_DLL_DECL
-# ifdef _MSC_VER
-#   define GFLAGS_DLL_DECL  __declspec(dllimport)
-# else
-#   define GFLAGS_DLL_DECL  /**/
-# endif
-#endif
+#define GFLAGS_DLL_DECL  /* rewritten to be non-empty in windows dir */
+
 
 @ac_google_start_namespace@
 
diff --git a/gflags/gflags_declare.h.in b/gflags/gflags_declare.h.in
index 75bf9a2..893c881 100644
--- a/gflags/gflags_declare.h.in
+++ b/gflags/gflags_declare.h.in
@@ -70,29 +70,7 @@
 @ac_google_end_namespace@
 
 
-// Annoying stuff for windows -- makes sure clients can import these functions
-// TODO(csilvers): add this only for the windows version of the file.
-#if defined(_MSC_VER)
-# ifndef GFLAGS_DLL_DECL
-#   define GFLAGS_DLL_DECL  __declspec(dllimport)
-# endif
-# ifndef GFLAGS_DLL_DECLARE_FLAG
-#   define GFLAGS_DLL_DECLARE_FLAG  __declspec(dllimport)
-# endif
-# ifndef GFLAGS_DLL_DEFINE_FLAG
-#   define GFLAGS_DLL_DEFINE_FLAG   __declspec(dllexport)
-# endif
-#else
-# ifndef GFLAGS_DLL_DECL
-#   define GFLAGS_DLL_DECL  /**/
-# endif
-# ifndef GFLAGS_DLL_DECLARE_FLAG
-#   define GFLAGS_DLL_DECLARE_FLAG  /**/
-# endif
-# ifndef GFLAGS_DLL_DEFINE_FLAG
-#   define GFLAGS_DLL_DEFINE_FLAG  /**/
-# endif
-#endif
+#define GFLAGS_DLL_DECLARE_FLAG  /* rewritten to be non-empty in windows dir */
 
 namespace fLS {
 
diff --git a/windows/gflags/gflags.h b/windows/gflags/gflags.h
index 0e9cc76..c2827d8 100644
--- a/windows/gflags/gflags.h
+++ b/windows/gflags/gflags.h
@@ -88,9 +88,13 @@
 // them.  Our automated opensourcing tools use this as a signal to do
 // appropriate munging for windows, which needs to add GFLAGS_DLL_DECL.
 //
-#ifdef SWIG  // it apparently can't see the define in gflags_declare.h
-# define GFLAGS_DLL_DECL  /**/
+#if defined(_MSC_VER) && !defined(GFLAGS_DLL_DECL)
+# define GFLAGS_DLL_DECL  __declspec(dllimport)
 #endif
+#if defined(_MSC_VER) && !defined(GFLAGS_DLL_DEFINE_FLAG)
+# define GFLAGS_DLL_DEFINE_FLAG  __declspec(dllexport)
+#endif
+
 
 // --------------------------------------------------------------------
 // To actually define a flag in a file, use DEFINE_bool,
diff --git a/windows/gflags/gflags_completions.h b/windows/gflags/gflags_completions.h
index 903c9e0..bf049fe 100644
--- a/windows/gflags/gflags_completions.h
+++ b/windows/gflags/gflags_completions.h
@@ -118,14 +118,11 @@
 // them.  Our automated opensourcing tools use this as a signal to do
 // appropriate munging for windows, which needs to add GFLAGS_DLL_DECL.
 //
-#ifndef GFLAGS_DLL_DECL
-# ifdef _MSC_VER
-#   define GFLAGS_DLL_DECL  __declspec(dllimport)
-# else
-#   define GFLAGS_DLL_DECL  /**/
-# endif
+#if defined(_MSC_VER) && !defined(GFLAGS_DLL_DECL)
+# define GFLAGS_DLL_DECL  __declspec(dllimport)
 #endif
 
+
 namespace google {
 
 extern GFLAGS_DLL_DECL void HandleCommandLineCompletions(void);
diff --git a/windows/gflags/gflags_declare.h b/windows/gflags/gflags_declare.h
index e7e5a2d..5fca1e4 100644
--- a/windows/gflags/gflags_declare.h
+++ b/windows/gflags/gflags_declare.h
@@ -70,28 +70,8 @@
 }
 
 
-// Annoying stuff for windows -- makes sure clients can import these functions
-// TODO(csilvers): add this only for the windows version of the file.
-#if defined(_MSC_VER)
-# ifndef GFLAGS_DLL_DECL
-#   define GFLAGS_DLL_DECL  __declspec(dllimport)
-# endif
-# ifndef GFLAGS_DLL_DECLARE_FLAG
-#   define GFLAGS_DLL_DECLARE_FLAG  __declspec(dllimport)
-# endif
-# ifndef GFLAGS_DLL_DEFINE_FLAG
-#   define GFLAGS_DLL_DEFINE_FLAG   __declspec(dllexport)
-# endif
-#else
-# ifndef GFLAGS_DLL_DECL
-#   define GFLAGS_DLL_DECL  /**/
-# endif
-# ifndef GFLAGS_DLL_DECLARE_FLAG
-#   define GFLAGS_DLL_DECLARE_FLAG  /**/
-# endif
-# ifndef GFLAGS_DLL_DEFINE_FLAG
-#   define GFLAGS_DLL_DEFINE_FLAG  /**/
-# endif
+#if defined(_MSC_VER) && !defined(GFLAGS_DLL_DECLARE_FLAG)
+# define GFLAGS_DLL_DECLARE_FLAG  __declspec(dllimport)
 #endif
 
 namespace fLS {