You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2012/02/17 23:21:24 UTC
git commit: TS-1102 This fixes (I think) the build issues on Solaris
/ non-gcc compilers, as long as they support __VA_ARGS__. Uri,
if this is too ugly,
please provide a better diff. I didn't want to #ifdef on e.g. gcc for this,
didn't seem worth it, but
Updated Branches:
refs/heads/master a4db15bdc -> 95000615e
TS-1102 This fixes (I think) the build issues on Solaris / non-gcc compilers,
as long as they support __VA_ARGS__. Uri, if this is too ugly, please provide
a better diff. I didn't want to #ifdef on e.g. gcc for this, didn't seem worth
it, but if you feel it's worth preserving fmt when building with gcc, feel
free to submit a patch :).
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/95000615
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/95000615
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/95000615
Branch: refs/heads/master
Commit: 95000615e0d941e5954aa49b5a5a9c94a7b21887
Parents: a4db15b
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Feb 17 15:17:30 2012 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Feb 17 15:17:30 2012 -0700
----------------------------------------------------------------------
lib/ts/Diags.h | 24 +++++++++++++-----------
lib/ts/ink_cap.cc | 36 +++++++++++++++++-------------------
mgmt/cli/cliAppInit.cc | 1 +
3 files changed, 31 insertions(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/95000615/lib/ts/Diags.h
----------------------------------------------------------------------
diff --git a/lib/ts/Diags.h b/lib/ts/Diags.h
index c4b56bd..98a43ea 100644
--- a/lib/ts/Diags.h
+++ b/lib/ts/Diags.h
@@ -272,17 +272,19 @@ dummy_debug(const char *tag, const char *fmt, ...)
(void)fmt;
}
-#define Diag(tag, fmt, ...) diags->log(tag, DTA(DL_Diag), fmt, ##__VA_ARGS__)
-#define Debug(tag, fmt, ...) diags->log(tag, DTA(DL_Debug), fmt, ##__VA_ARGS__)
-#define DebugOn(tag, fmt, ...) diags->log(tag, DTA(DL_Debug), fmt, ##__VA_ARGS__)
-
-#define Status(fmt, ...) diags->error(DTA(DL_Status), fmt, ##__VA_ARGS__)
-#define Note(fmt, ...) diags->error(DTA(DL_Note), fmt, ##__VA_ARGS__)
-#define Warning(fmt, ...) diags->error(DTA(DL_Warning), fmt, ##__VA_ARGS__)
-#define Error(fmt, ...) diags->error(DTA(DL_Error), fmt, ##__VA_ARGS__)
-#define Fatal(fmt, ...) diags->error(DTA(DL_Fatal), fmt, ##__VA_ARGS__)
-#define Alert(fmt, ...) diags->error(DTA(DL_Alert), fmt, ##__VA_ARGS__)
-#define Emergency(fmt, ...) diags->error(DTA(DL_Emergency), fmt, ##__VA_ARGS__)
+
+#define Diag(tag, ...) diags->log(tag, DTA(DL_Diag), __VA_ARGS__)
+#define Debug(tag, ...) diags->log(tag, DTA(DL_Debug), __VA_ARGS__)
+#define Debug(tag, ...) diags->log(tag, DTA(DL_Debug), __VA_ARGS__)
+#define DebugOn(tag, ...) diags->log(tag, DTA(DL_Debug), __VA_ARGS__)
+
+#define Status(...) diags->error(DTA(DL_Status), __VA_ARGS__)
+#define Note(...) diags->error(DTA(DL_Note), __VA_ARGS__)
+#define Warning(...) diags->error(DTA(DL_Warning), __VA_ARGS__)
+#define Error(...) diags->error(DTA(DL_Error), __VA_ARGS__)
+#define Fatal(...) diags->error(DTA(DL_Fatal), __VA_ARGS__)
+#define Alert(...) diags->error(DTA(DL_Alert), __VA_ARGS__)
+#define Emergency(...) diags->error(DTA(DL_Emergency), __VA_ARGS__)
#define is_debug_tag_set(_t) diags->on(_t,DiagsTagType_Debug)
#define is_action_tag_set(_t) diags->on(_t,DiagsTagType_Action)
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/95000615/lib/ts/ink_cap.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_cap.cc b/lib/ts/ink_cap.cc
index 91005a1..038fc2e 100644
--- a/lib/ts/ink_cap.cc
+++ b/lib/ts/ink_cap.cc
@@ -38,26 +38,24 @@ DebugCapabilities(char const* tag) {
char* caps_text = cap_to_text(caps, 0);
# endif
- Debug(tag,
- "uid=%u, gid=%u, euid=%u, egid=%u"
# if TS_USE_POSIX_CAP
- ", caps %s core=%s thread=0x%llx"
-# endif
- ,static_cast<unsigned int>(getuid())
- ,static_cast<unsigned int>(getgid())
- ,static_cast<unsigned int>(geteuid())
- ,static_cast<unsigned int>(getegid())
-# if TS_USE_POSIX_CAP
- ,caps_text
- ,prctl(PR_GET_DUMPABLE) != 1 ? "disabled" : "enabled"
- ,(unsigned long long)pthread_self()
-# endif
- );
-
-# if TS_USE_POSIX_CAP
- cap_free(caps_text);
- cap_free(caps);
-# endif
+ Debug(tag, "uid=%u, gid=%u, euid=%u, egid=%u, caps %s core=%s thread=0x%llx",
+ static_cast<unsigned int>(getuid()),
+ static_cast<unsigned int>(getgid()),
+ static_cast<unsigned int>(geteuid()),
+ static_cast<unsigned int>(getegid()),
+ caps_text,
+ prctl(PR_GET_DUMPABLE) != 1 ? "disabled" : "enabled",
+ (unsigned long long)pthread_self() );
+ cap_free(caps_text);
+ cap_free(caps);
+#else
+ Debug(tag, "uid=%u, gid=%u, euid=%u, egid=%u",
+ static_cast<unsigned int>(getuid()),
+ static_cast<unsigned int>(getgid()),
+ static_cast<unsigned int>(geteuid()),
+ static_cast<unsigned int>(getegid()) );
+#endif
}
}
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/95000615/mgmt/cli/cliAppInit.cc
----------------------------------------------------------------------
diff --git a/mgmt/cli/cliAppInit.cc b/mgmt/cli/cliAppInit.cc
index 6ce5b5e..506a402 100644
--- a/mgmt/cli/cliAppInit.cc
+++ b/mgmt/cli/cliAppInit.cc
@@ -34,6 +34,7 @@
*/
#include <stdlib.h>
#include <string.h>
+#include <stdio.h>
// Not sure if we need to worry about old gcc compilers any more, but ... /leif
#if (__GNUC__ >= 3)
#include <iostream>