summaryrefslogtreecommitdiffstats
path: root/sal/osl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-11-23 15:45:43 +0100
committerStephan Bergmann <sbergman@redhat.com>2011-11-23 15:50:58 +0100
commit0c7bff02710f8ad7915e215f723b6abad0079221 (patch)
tree30ddfb6fedcd954f91bfa24f36df1dd7413804c4 /sal/osl
parentFix bug in build.pl option parser (diff)
downloadcore-0c7bff02710f8ad7915e215f723b6abad0079221.tar.gz
core-0c7bff02710f8ad7915e215f723b6abad0079221.zip
Changed sal/log.h -> sal/log.hxx, drop _S from C++ streaming log macros.
A compile time check ensures the common case of streaming just a plain C-style string literal still produces reasonably compact call-site code. The format-string variants are still available in sal/detail/log.h, but only to be used in obsolete osl/diagnose.h etc., and going to be removed again eventually.
Diffstat (limited to 'sal/osl')
-rw-r--r--sal/osl/all/log.cxx3
-rw-r--r--sal/osl/all/logformat.hxx2
-rw-r--r--sal/osl/all/trace.cxx3
-rw-r--r--sal/osl/unx/conditn.cxx (renamed from sal/osl/unx/conditn.c)87
4 files changed, 55 insertions, 40 deletions
diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx
index be45cf629b81..a43964436842 100644
--- a/sal/osl/all/log.cxx
+++ b/sal/osl/all/log.cxx
@@ -42,7 +42,8 @@
#include "osl/thread.hxx"
#include "rtl/string.h"
-#include "sal/log.h"
+#include "sal/detail/log.h"
+#include "sal/log.hxx"
#include "sal/types.h"
#include "logformat.hxx"
diff --git a/sal/osl/all/logformat.hxx b/sal/osl/all/logformat.hxx
index f4589a7b9f94..bb6ea4cc6bdd 100644
--- a/sal/osl/all/logformat.hxx
+++ b/sal/osl/all/logformat.hxx
@@ -34,7 +34,7 @@
#include <cstdarg>
-#include "sal/log.h"
+#include "sal/detail/log.h"
namespace osl { namespace detail {
diff --git a/sal/osl/all/trace.cxx b/sal/osl/all/trace.cxx
index 835704779452..8fccb44b68d0 100644
--- a/sal/osl/all/trace.cxx
+++ b/sal/osl/all/trace.cxx
@@ -33,7 +33,8 @@
#include <cstdarg>
#include "osl/diagnose.h"
-#include "sal/log.h"
+#include "sal/detail/log.h"
+#include "sal/log.hxx"
#include "logformat.hxx"
diff --git a/sal/osl/unx/conditn.c b/sal/osl/unx/conditn.cxx
index d7ab7131938c..c6417bfb2f7a 100644
--- a/sal/osl/unx/conditn.c
+++ b/sal/osl/unx/conditn.cxx
@@ -31,7 +31,7 @@
#include <assert.h>
#include "system.h"
-#include <sal/log.h>
+#include <sal/log.hxx>
#include <sal/types.h>
#include <osl/conditn.h>
@@ -69,8 +69,9 @@ oslCondition SAL_CALL osl_createCondition()
if ( nRet != 0 )
{
SAL_WARN(
- "sal", "pthread_cond_init failed, errno %d, \"%s\"", nRet,
- strerror(nRet));
+ "sal",
+ "pthread_cond_init failed, errno " << nRet << ", \""
+ << strerror(nRet) << '"');
free(pCond);
return 0;
@@ -80,13 +81,15 @@ oslCondition SAL_CALL osl_createCondition()
if ( nRet != 0 )
{
SAL_WARN(
- "sal", "pthread_mutex_init failed, errno %d, \"%s\"", nRet,
- strerror(nRet));
+ "sal",
+ "pthread_mutex_init failed, errno " << nRet << ", \""
+ << strerror(nRet) << '"');
nRet = pthread_cond_destroy(&pCond->m_Condition);
SAL_WARN_IF(
- nRet != 0, "sal", "pthread_cond_destroy failed, errno %d, \"%s\"",
- nRet, strerror(nRet));
+ nRet != 0, "sal",
+ "pthread_cond_destroy failed, errno " << nRet << ", \""
+ << strerror(nRet) << '"');
free(pCond);
pCond = 0;
@@ -109,12 +112,14 @@ void SAL_CALL osl_destroyCondition(oslCondition Condition)
nRet = pthread_cond_destroy(&pCond->m_Condition);
SAL_WARN_IF(
- nRet != 0, "sal", "pthread_cond_destroy failed, errno %d, \"%s\"",
- nRet, strerror(nRet));
+ nRet != 0, "sal",
+ "pthread_cond_destroy failed, errno " << nRet << ", \""
+ << strerror(nRet) << '"');
nRet = pthread_mutex_destroy(&pCond->m_Lock);
SAL_WARN_IF(
- nRet != 0, "sal", "pthread_mutex_destroy failed, errno %d, \"%s\"",
- nRet, strerror(nRet));
+ nRet != 0, "sal",
+ "pthread_mutex_destroy failed, errno " << nRet << ", \""
+ << strerror(nRet) << '"');
free(Condition);
}
@@ -142,8 +147,9 @@ sal_Bool SAL_CALL osl_setCondition(oslCondition Condition)
if ( nRet != 0 )
{
SAL_WARN(
- "sal", "pthread_mutex_lock failed, errno %d, \"%s\"", nRet,
- strerror(nRet));
+ "sal",
+ "pthread_mutex_lock failed, errno " << nRet << ", \""
+ << strerror(nRet) << '"');
return sal_False;
}
@@ -152,8 +158,9 @@ sal_Bool SAL_CALL osl_setCondition(oslCondition Condition)
if ( nRet != 0 )
{
SAL_WARN(
- "sal", "pthread_cond_broadcast failed, errno %d, \"%s\"", nRet,
- strerror(nRet));
+ "sal",
+ "pthread_cond_broadcast failed, errno " << nRet << ", \""
+ << strerror(nRet) << '"');
return sal_False;
}
@@ -161,8 +168,9 @@ sal_Bool SAL_CALL osl_setCondition(oslCondition Condition)
if ( nRet != 0 )
{
SAL_WARN(
- "sal", "pthread_mutex_unlock failed, errno %d, \"%s\"", nRet,
- strerror(nRet));
+ "sal",
+ "pthread_mutex_unlock failed, errno " << nRet << ", \""
+ << strerror(nRet) << '"');
return sal_False;
}
@@ -191,8 +199,9 @@ sal_Bool SAL_CALL osl_resetCondition(oslCondition Condition)
if ( nRet != 0 )
{
SAL_WARN(
- "sal", "pthread_mutex_lock failed, errno %d, \"%s\"", nRet,
- strerror(nRet));
+ "sal",
+ "pthread_mutex_lock failed, errno " << nRet << ", \""
+ << strerror(nRet) << '"');
return sal_False;
}
@@ -202,8 +211,8 @@ sal_Bool SAL_CALL osl_resetCondition(oslCondition Condition)
if ( nRet != 0 )
{
SAL_WARN(
- "sal", "pthread_mutex_unlock failed, errno %d, \"%s\"", nRet,
- strerror(nRet));
+ "sal", "pthread_mutex_unlock failed, errno " << nRet <<", \""
+ << strerror(nRet) << '"');
return sal_False;
}
@@ -231,8 +240,8 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time
if ( nRet != 0 )
{
SAL_WARN(
- "sal", "pthread_mutex_lock failed, errno %d, \"%s\"", nRet,
- strerror(nRet));
+ "sal", "pthread_mutex_lock failed, errno " << nRet <<", \""
+ << strerror(nRet) << '"');
return osl_cond_result_error;
}
@@ -261,8 +270,8 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time
nRet = pthread_mutex_unlock(&pCond->m_Lock);
SAL_WARN_IF(
nRet != 0, "sal",
- "pthread_mutex_unlock failed, errno %d, \"%s\"",
- nRet, strerror(nRet));
+ "pthread_mutex_unlock failed, errno " << nRet
+ << ", \"" << strerror(nRet) << '"');
return Result;
}
@@ -272,8 +281,8 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time
nRet = pthread_mutex_unlock(&pCond->m_Lock);
SAL_WARN_IF(
nRet != 0, "sal",
- "pthread_mutex_unlock failed, errno %d, \"%s\"",
- nRet, strerror(nRet));
+ "pthread_mutex_unlock failed, errno " << nRet
+ << ", \"" << strerror(nRet) << '"');
return Result;
}
}
@@ -289,14 +298,15 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time
if ( nRet != 0 )
{
SAL_WARN(
- "sal", "pthread_cond_wait failed, errno %d, \"%s\"", nRet,
- strerror(nRet));
+ "sal",
+ "pthread_cond_wait failed, errno " << nRet << ", \""
+ << strerror(nRet) << '"');
Result = osl_cond_result_error;
nRet = pthread_mutex_unlock(&pCond->m_Lock);
SAL_WARN_IF(
nRet != 0, "sal",
- "pthread_mutex_unlock failed, errno %d, \"%s\"", nRet,
- strerror(nRet));
+ "pthread_mutex_unlock failed, errno " << nRet << ", \""
+ << strerror(nRet) << '"');
return Result;
}
@@ -305,8 +315,9 @@ oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const Time
nRet = pthread_mutex_unlock(&pCond->m_Lock);
SAL_WARN_IF(
- nRet != 0, "sal", "pthread_mutex_unlock failed, errno %d, \"%s\"", nRet,
- strerror(nRet));
+ nRet != 0, "sal",
+ "pthread_mutex_unlock failed, errno " << nRet << ", \""
+ << strerror(nRet) << '"');
return Result;
}
@@ -330,15 +341,17 @@ sal_Bool SAL_CALL osl_checkCondition(oslCondition Condition)
nRet = pthread_mutex_lock(&pCond->m_Lock);
SAL_WARN_IF(
- nRet != 0, "sal", "pthread_mutex_lock failed, errno %d, \"%s\"", nRet,
- strerror(nRet));
+ nRet != 0, "sal",
+ "pthread_mutex_lock failed, errno " << nRet << ", \"" << strerror(nRet)
+ << '"');
State = pCond->m_State;
nRet = pthread_mutex_unlock(&pCond->m_Lock);
SAL_WARN_IF(
- nRet != 0, "sal", "pthread_mutex_unlock failed, errno %d, \"%s\"", nRet,
- strerror(nRet));
+ nRet != 0, "sal",
+ "pthread_mutex_unlock failed, errno " << nRet << ", \""
+ << strerror(nRet) << '"');
return State;
}