summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-09-22 15:00:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-09-22 15:01:05 +0100
commit871426533f7afe31bc451fa6b407b83db8e52827 (patch)
treeed60cee61ebee91994eaffc9c9a3638836ed2ab4 /sal
parent5a849bb5317ad73bb43b2b618b14bc0e8751fff6 (diff)
just silence the auto_ptr deprecations in isolation
Diffstat (limited to 'sal')
-rw-r--r--sal/inc/osl/diagnose.h8
-rw-r--r--sal/inc/sal/macros.h5
-rw-r--r--sal/inc/sal/precppunit.hxx13
-rw-r--r--sal/inc/sal/types.h19
-rw-r--r--sal/qa/osl/condition/osl_Condition.cxx20
-rw-r--r--sal/qa/rtl/alloc/rtl_alloc.cxx8
6 files changed, 50 insertions, 23 deletions
diff --git a/sal/inc/osl/diagnose.h b/sal/inc/osl/diagnose.h
index fa722d3ef1e2..ab5243fe94d5 100644
--- a/sal/inc/osl/diagnose.h
+++ b/sal/inc/osl/diagnose.h
@@ -122,14 +122,8 @@ pfunc_osl_printDetailedDebugMessage SAL_CALL osl_setDetailedDebugMessageFunc( pf
#define OSL_THIS_FILE __FILE__
-/* the macro OSL_TO_STRING is intended to be an office internal macro for now */
-#define OSL_TO_STRING( x ) #x
-
-/* the macro OSL_MACRO_VALUE_TO_STRING is intended to be an office internal macro for now */
-#define OSL_MACRO_VALUE_TO_STRING( x ) OSL_TO_STRING( x )
-
/* the macro OSL_LOG_PREFIX is intended to be an office internal macro for now */
-#define OSL_LOG_PREFIX OSL_THIS_FILE ":" OSL_MACRO_VALUE_TO_STRING( __LINE__ ) "; "
+#define OSL_LOG_PREFIX OSL_THIS_FILE ":" SAL_STRINGIFY( __LINE__ ) "; "
#define OSL_DEBUG_ONLY(s) _OSL_DEBUG_ONLY(s)
#define OSL_TRACE _OSL_TRACE
diff --git a/sal/inc/sal/macros.h b/sal/inc/sal/macros.h
index e4c35138266d..b002248d221a 100644
--- a/sal/inc/sal/macros.h
+++ b/sal/inc/sal/macros.h
@@ -77,6 +77,11 @@
# define SAL_ABS(a) (((a) < 0) ? (-(a)) : (a))
#endif
+#ifndef SAL_STRINGIFY
+# define SAL_STRINGIFY_ARG(x) #x
+# define SAL_STRINGIFY(x) SAL_STRINGIFY_ARG(x)
+#endif
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/inc/sal/precppunit.hxx b/sal/inc/sal/precppunit.hxx
index a0f7c942f27c..31536c30df7e 100644
--- a/sal/inc/sal/precppunit.hxx
+++ b/sal/inc/sal/precppunit.hxx
@@ -29,11 +29,22 @@
#define INCLUDED_SAL_PRECPPUNIT_HXX
#include "sal/config.h"
-
#include "sal/types.h"
// Overwrite the way CppUnit test plug-ins export the test function, adapting it
// to OOo's symbol visibility framework:
#define CPPUNIT_PLUGIN_EXPORT extern "C" SAL_DLLPUBLIC_EXPORT
+//std::auto_ptr is deprecated in c++0x, but we're stuck with them in cppunit
+//So push and pop -Wdeprecated-declarations for gcc
+#define SAL_CPPUNIT_TEST_SUITE(X) \
+SAL_WNODEPRECATED_DECLARATIONS_PUSH \
+CPPUNIT_TEST_SUITE(X)
+
+#define SAL_CPPUNIT_TEST_SUITE_END(X) \
+CPPUNIT_TEST_SUITE_END(X) \
+; \
+SAL_WNODEPRECATED_DECLARATIONS_POP \
+typedef int SalCppUnitDummyTypedefForSemiColonEnding__ \
+
#endif
diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h
index d6cf9b0eacbb..22bad17fee16 100644
--- a/sal/inc/sal/types.h
+++ b/sal/inc/sal/types.h
@@ -447,7 +447,6 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) {
/**
Use as follows:
SAL_DEPRECATED("Dont use, its evil.") void doit(int nPara);
- note that currently a c++0x compatible gcc disables deprecation warnings
*/
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
@@ -460,6 +459,24 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) {
# define SAL_DEPRECATED(message)
#endif
+/**
+ Use as follows:
+ SAL_WNODEPRECATED_DECLARATIONS_PUSH
+ ::std::auto_ptr<X> ...
+ SAL_WNODEPRECATED_DECLARATIONS_POP
+*/
+
+#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
+#define SAL_WNODEPRECATED_DECLARATIONS_PUSH \
+ _Pragma(SAL_STRINGIFY_ARG(GCC diagnostic push)) \
+ _Pragma(SAL_STRINGIFY_ARG(GCC diagnostic ignored "-Wdeprecated-declarations"))
+#define SAL_WNODEPRECATED_DECLARATIONS_POP \
+ _Pragma(SAL_STRINGIFY_ARG(GCC diagnostic pop))
+#else
+# define SAL_WNODEPRECATED_DECLARATIONS_PUSH
+# define SAL_WNODEPRECATED_DECLARATIONS_POP
+#endif
+
#endif /*_SAL_TYPES_H_ */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/qa/osl/condition/osl_Condition.cxx b/sal/qa/osl/condition/osl_Condition.cxx
index 415f17f6a881..2a16243342d2 100644
--- a/sal/qa/osl/condition/osl_Condition.cxx
+++ b/sal/qa/osl/condition/osl_Condition.cxx
@@ -138,10 +138,10 @@ namespace osl_Condition
sal_True == bRes );
}
- CPPUNIT_TEST_SUITE( ctors );
+ SAL_CPPUNIT_TEST_SUITE( ctors );
CPPUNIT_TEST( ctors_001 );
CPPUNIT_TEST( ctors_002 );
- CPPUNIT_TEST_SUITE_END( );
+ SAL_CPPUNIT_TEST_SUITE_END( );
}; // class ctors
@@ -183,10 +183,10 @@ namespace osl_Condition
}
- CPPUNIT_TEST_SUITE( set );
+ SAL_CPPUNIT_TEST_SUITE( set );
CPPUNIT_TEST( set_001 );
CPPUNIT_TEST( set_002 );
- CPPUNIT_TEST_SUITE_END( );
+ SAL_CPPUNIT_TEST_SUITE_END( );
}; // class set
@@ -228,10 +228,10 @@ namespace osl_Condition
( sal_False == bRes && sal_True == bRes1 ) );
}
- CPPUNIT_TEST_SUITE( reset );
+ SAL_CPPUNIT_TEST_SUITE( reset );
CPPUNIT_TEST( reset_001 );
CPPUNIT_TEST( reset_002 );
- CPPUNIT_TEST_SUITE_END( );
+ SAL_CPPUNIT_TEST_SUITE_END( );
}; // class reset
@@ -296,10 +296,10 @@ namespace osl_Condition
( ::osl::Condition::result_ok == wRes1 ) );
}
- CPPUNIT_TEST_SUITE( wait );
+ SAL_CPPUNIT_TEST_SUITE( wait );
CPPUNIT_TEST( wait_001 );
CPPUNIT_TEST( wait_002 );
- CPPUNIT_TEST_SUITE_END( );
+ SAL_CPPUNIT_TEST_SUITE_END( );
}; // class wait
@@ -343,10 +343,10 @@ namespace osl_Condition
( sal_True == bRes && sal_False == bRes1 ) );
}
- CPPUNIT_TEST_SUITE( check );
+ SAL_CPPUNIT_TEST_SUITE( check );
CPPUNIT_TEST( check_001 );
CPPUNIT_TEST( check_002 );
- CPPUNIT_TEST_SUITE_END( );
+ SAL_CPPUNIT_TEST_SUITE_END( );
}; // class check
diff --git a/sal/qa/rtl/alloc/rtl_alloc.cxx b/sal/qa/rtl/alloc/rtl_alloc.cxx
index 5523af2cf8f0..0e6da162cb52 100644
--- a/sal/qa/rtl/alloc/rtl_alloc.cxx
+++ b/sal/qa/rtl/alloc/rtl_alloc.cxx
@@ -99,10 +99,10 @@ public:
CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pMemory, nSize, 2) == true);
}
- CPPUNIT_TEST_SUITE(Memory);
+ SAL_CPPUNIT_TEST_SUITE(Memory);
CPPUNIT_TEST(rtl_allocateMemory_001);
CPPUNIT_TEST(rtl_reallocateMemory_001);
- CPPUNIT_TEST_SUITE_END();
+ SAL_CPPUNIT_TEST_SUITE_END();
}; // class test
class ZeroMemory : public CppUnit::TestFixture
@@ -142,9 +142,9 @@ public:
CPPUNIT_ASSERT_MESSAGE( "memory contains wrong value.", checkMemory(m_pZeroMemory, m_nSizeOfZeroMemory, 3) == true);
}
- CPPUNIT_TEST_SUITE(ZeroMemory);
+ SAL_CPPUNIT_TEST_SUITE(ZeroMemory);
CPPUNIT_TEST(rtl_allocateZeroMemory_001);
- CPPUNIT_TEST_SUITE_END();
+ SAL_CPPUNIT_TEST_SUITE_END();
};
// -----------------------------------------------------------------------------