void
generate_filename(const char *dirname, const char *prefix, char *filename)
{
- int pid = 0;
+ int pid = 0;
#ifndef WIN32
struct passwd *ptr = 0;
ptr = getpwuid(getuid());
#endif
- pid = _getpid();
+ pid = getpid();
if (dirname == 0 || filename == 0)
return;
LEAVE_MYLOG_CS;
}
+#ifdef LOGGING_PROCESS_TIME
+#include <mmsystem.h>
+ static DWORD start_time = 0;
+#endif /* LOGGING_PROCESS_TIME */
#ifdef MY_LOG
static FILE *MLOGFP = NULL;
void
if (!mylog_on) return;
ENTER_MYLOG_CS;
+#ifdef LOGGING_PROCESS_TIME
+ if (!start_time)
+ start_time = timeGetTime();
+#endif /* LOGGING_PROCESS_TIME */
va_start(args, fmt);
if (!MLOGFP)
#ifdef WIN_MULTITHREAD_SUPPORT
#ifdef WIN32
if (MLOGFP)
- fprintf(MLOGFP, "[%d]", GetCurrentThreadId());
+#ifdef LOGGING_PROCESS_TIME
+ {
+ DWORD proc_time = timeGetTime() - start_time;
+ fprintf(MLOGFP, "[%u-%d.%03d]", GetCurrentThreadId(), proc_time / 1000, proc_time % 1000);
+ }
+#else
+ fprintf(MLOGFP, "[%u]", GetCurrentThreadId());
+#endif /* LOGGING_PROCESS_TIME */
#endif /* WIN32 */
#endif /* WIN_MULTITHREAD_SUPPORT */
#if defined(POSIX_MULTITHREAD_SUPPORT)
if (MLOGFP)
- fprintf(MLOGFP, "[%u]", pthread_self());
+ fprintf(MLOGFP, "[%lu]", pthread_self());
#endif /* POSIX_MULTITHREAD_SUPPORT */
if (MLOGFP)
vfprintf(MLOGFP, fmt, args);
*
* Comments: See "notice.txt" for copyright and license information.
*
- * $Id: psqlodbc.h,v 1.112 2006/10/17 16:18:56 hinoue Exp $
+ * $Id: psqlodbc.h,v 1.113 2006/10/20 12:00:32 hinoue Exp $
*
*/
#define FORMAT_LPTR "%lld" /* LONG_PTR */
#define FORMAT_ULPTR "%llu" /* ULONG_PTR */
#else
-#error neither long nor long long is defined
+#error appropriate long pointer type not found
#endif /* SIZE_OF_VOID_P */
#if (SIZE_OF_VOID_P == 8)
#define FORMAT_INTEGER "%d" /* SQLINTEGER */
#define POSTGRESDRIVERVERSION "08.02.0104"
#define POSTGRES_RESOURCE_VERSION "08.02.0104\0"
-#define PG_DRVFILE_VERSION 8,2,01,04
+#define PG_DRVFILE_VERSION 8,2,01,04
#endif