[ofa-general] [PATCH] libibcommon: remove static _version_build var from common.h

Sasha Khapyorsky sashak at voltaire.com
Sat Oct 13 14:12:36 PDT 2007


This removes _version_build static variable if __BUILD_VERSION_TAG__ is
not defined. When it is unconditional this variable is just duplicated
over all objects compiled from source files where common.h is included
(explicitly or implicitly).

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 libibcommon/include/infiniband/common.h |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libibcommon/include/infiniband/common.h b/libibcommon/include/infiniband/common.h
index af4ab7a..72147d8 100644
--- a/libibcommon/include/infiniband/common.h
+++ b/libibcommon/include/infiniband/common.h
@@ -143,17 +143,15 @@ uint64_t getcurrenttime(void);
 /* hash.c */
 uint32_t fhash(uint8_t *k, int length, uint32_t initval);
 
+#ifdef __BUILD_VERSION_TAG__
+
 #undef stringify
 #undef tostring
 
 #define stringify(s)    tostring(s)
 #define tostring(s)     #s
 
-#ifdef __BUILD_VERSION_TAG__
 __attribute__((unused)) static char _build_version[] = { "BUILD VERSION: " stringify(__BUILD_VERSION_TAG__) " Build date: " __DATE__ " " __TIME__ };
-#else
-__attribute__((unused)) static char _build_version[] = { __DATE__ " " __TIME__ };
-#endif
 
 __attribute__((unused)) static inline char*
 get_build_version(void)
@@ -161,6 +159,8 @@ get_build_version(void)
 	return _build_version;
 }
 
+#endif
+
 END_C_DECLS
 
 #endif /* __COMMON_H__ */
-- 
1.5.3.4.206.g58ba4




More information about the general mailing list