fix on LP64 + gcc4

This commit is contained in:
espie 2010-06-06 20:10:21 +00:00
parent 9dbe725bcb
commit 2e368da839
2 changed files with 60 additions and 6 deletions

View File

@ -1,6 +1,51 @@
$OpenBSD: patch-common_ECLogger_cpp,v 1.5 2010/04/22 10:06:18 ajacoutot Exp $
--- common/ECLogger.cpp.orig Wed Apr 14 13:39:51 2010
+++ common/ECLogger.cpp Thu Apr 22 10:28:51 2010
$OpenBSD: patch-common_ECLogger_cpp,v 1.6 2010/06/06 20:10:21 espie Exp $
--- common/ECLogger.cpp.orig Tue Apr 27 21:07:02 2010
+++ common/ECLogger.cpp Sun Jun 6 21:23:41 2010
@@ -135,7 +135,7 @@ ECLogger_File::~ECLogger_File() {
if (timestamp)
fprintf(log, "%s: ", MakeTimestamp());
if (prefix == LP_TID)
- fprintf(log, "[0x%08x] ", (unsigned int)pthread_self());
+ fprintf(log, "[0x%08lx] ", (unsigned long)pthread_self());
else if (prefix == LP_PID)
fprintf(log, "[%5d] ", getpid());
fprintf(log, "Previous message logged %d times\n", prevcount);
@@ -172,7 +172,7 @@ bool ECLogger_File::DupFilter(const std::string &messa
if (timestamp)
fprintf(log, "%s: ", MakeTimestamp());
if (prefix == LP_TID)
- fprintf(log, "[0x%08x] ", (unsigned int)pthread_self());
+ fprintf(log, "[0x%08lx] ", (unsigned long)pthread_self());
else if (prefix == LP_PID)
fprintf(log, "[%5d] ", getpid());
fprintf(log, "Previous message logged %d times\n", prevcount);
@@ -216,7 +216,7 @@ void ECLogger_File::Log(int loglevel, const char *form
if (timestamp)
fprintf(log, "%s: ", MakeTimestamp());
if (prefix == LP_TID)
- fprintf(log, "[0x%08x] ", (unsigned int)pthread_self());
+ fprintf(log, "[0x%08lx] ", (unsigned long)pthread_self());
else if (prefix == LP_PID)
fprintf(log, "[%5d] ", getpid());
fprintf(log, "%s\n", msgbuffer);
@@ -284,7 +284,7 @@ void ECLogger_Pipe::Log(int loglevel, const std::strin
off += 1;
if (prefix == LP_TID)
- len = snprintf(msgbuffer+off, _LOG_BUFSIZE -off, "[0x%08x] ", (unsigned int)pthread_self());
+ len = snprintf(msgbuffer+off, _LOG_BUFSIZE -off, "[0x%08lx] ", (unsigned long)pthread_self());
else if (prefix == LP_PID)
len = snprintf(msgbuffer+off, _LOG_BUFSIZE -off, "[%5d] ", getpid());
off += len;
@@ -311,7 +311,7 @@ void ECLogger_Pipe::Log(int loglevel, const char *form
off += 1;
if (prefix == LP_TID)
- len = snprintf(msgbuffer+off, _LOG_BUFSIZE -off, "[0x%08x] ", (unsigned int)pthread_self());
+ len = snprintf(msgbuffer+off, _LOG_BUFSIZE -off, "[0x%08lx] ", (unsigned long)pthread_self());
else if (prefix == LP_PID)
len = snprintf(msgbuffer+off, _LOG_BUFSIZE -off, "[%5d] ", getpid());
off += len;
@@ -523,8 +523,8 @@ ECLogger* CreateLogger(ECConfig *lpConfig, char *argv0
lpLogger = new ECLogger_File(atoi(lpConfig->GetSetting("log_level")), atoi(lpConfig->GetSetting("log_timestamp")), lpConfig->GetSetting("log_file"));
// chown file

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-common_platform_linux_h,v 1.5 2010/04/22 10:06:18 ajacoutot Exp $
--- common/platform.linux.h.orig Wed Apr 14 13:39:51 2010
+++ common/platform.linux.h Thu Apr 22 10:57:22 2010
$OpenBSD: patch-common_platform_linux_h,v 1.6 2010/06/06 20:10:21 espie Exp $
--- common/platform.linux.h.orig Tue Apr 27 21:07:02 2010
+++ common/platform.linux.h Sun Jun 6 21:25:25 2010
@@ -63,8 +63,15 @@
#include <dlfcn.h>
#include <stddef.h>
@ -17,3 +17,12 @@ $OpenBSD: patch-common_platform_linux_h,v 1.5 2010/04/22 10:06:18 ajacoutot Exp
#include <errno.h>
#ifdef HAVE_UNISTD_H
@@ -669,7 +676,7 @@ time_t GetProcessTime();
#endif
#define OutputDebugString(dstr) fprintf(stderr,"%s",dstr)
-#define GetCurrentThreadId() (int)pthread_self()
+#define GetCurrentThreadId() (long)pthread_self()
#define GetTickCount() 0L
#define TICKS_PER_SEC (sysconf(_SC_CLK_TCK))