[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/mysqlnd/ mysqlnd_debug.h
andrey Wed, 01 Dec 2010 10:16:51 + Revision: http://svn.php.net/viewvc?view=revision&revision=305878 Log: add a comment Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h2010-12-01 09:52:26 UTC (rev 305877) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h2010-12-01 10:16:51 UTC (rev 305878) @@ -135,7 +135,7 @@ #define DBG_RETURN_EX(dbg_obj, value) return (value) #define DBG_VOID_RETURN_EX(dbg_obj) return -#endif +#endif /* defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 1400)) */ #if MYSQLND_DBG_ENABLED == 1 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h trunk/ext/mysqlnd/mysqlnd_debug.h
andrey Wed, 04 May 2011 19:09:12 + Revision: http://svn.php.net/viewvc?view=revision&revision=310768 Log: add the BLOCK_LEAVE macro for non-gcc and non-win Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h2011-05-04 19:05:19 UTC (rev 310767) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h2011-05-04 19:09:12 UTC (rev 310768) @@ -136,9 +136,10 @@ static inline void DBG_INF_FMT_EX(MYSQLND_DEBUG * dbg_obj, ...) {} static inline void DBG_ERR_FMT_EX(MYSQLND_DEBUG * dbg_obj, ...) {} static inline void DBG_ENTER_EX(MYSQLND_DEBUG * dbg_obj, const char * const func_name) {} -#define DBG_RETURN_EX(dbg_obj, value) return (value) -#define DBG_VOID_RETURN_EX(dbg_obj) return -#define DBG_BLOCK_LEAVE_EX(dbg_obj) ; +#define DBG_BLOCK_ENTER(bname) { +#define DBG_RETURN_EX(dbg_obj, value) return (value) +#define DBG_VOID_RETURN_EX(dbg_obj)return +#define DBG_BLOCK_LEAVE_EX(dbg_obj)} #endif /* defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 1400)) */ Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h 2011-05-04 19:05:19 UTC (rev 310767) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h 2011-05-04 19:09:12 UTC (rev 310768) @@ -147,9 +147,10 @@ static inline void DBG_INF_FMT_EX(MYSQLND_DEBUG * dbg_obj, ...) {} static inline void DBG_ERR_FMT_EX(MYSQLND_DEBUG * dbg_obj, ...) {} static inline void DBG_ENTER_EX(MYSQLND_DEBUG * dbg_obj, const char * const func_name) {} -#define DBG_RETURN_EX(dbg_obj, value) return (value) -#define DBG_VOID_RETURN_EX(dbg_obj) return -#define DBG_BLOCK_LEAVE_EX(dbg_obj) ; +#define DBG_BLOCK_ENTER(bname) { +#define DBG_RETURN_EX(dbg_obj, value) return (value) +#define DBG_VOID_RETURN_EX(dbg_obj)return +#define DBG_BLOCK_LEAVE_EX(dbg_obj)} #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h trunk/ext/mysqlnd/mysqlnd_debug.h
andrey Wed, 04 May 2011 19:05:19 + Revision: http://svn.php.net/viewvc?view=revision&revision=310767 Log: reorganize the DBG_ macros, add DBG_BLOCK_XXX Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h2011-05-04 18:14:25 UTC (rev 310766) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h2011-05-04 19:05:19 UTC (rev 310767) @@ -90,6 +90,15 @@ #define DBG_INF_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "info : ", __VA_ARGS__); } while (0) #define DBG_ERR_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "error: ", __VA_ARGS__); } while (0) +#define DBG_BLOCK_ENTER_EX(dbg_obj, block_name) \ + { \ + DBG_ENTER_EX(dbg_obj, (block_name)); + +#define DBG_BLOCK_LEAVE_EX(dbg_obj) \ + DBG_LEAVE_EX((dbg_obj), ;) \ + } \ + + #define DBG_ENTER_EX(dbg_obj, func_name) \ struct timeval __dbg_prof_tp = {0}; \ uint64_t __dbg_prof_start = 0; /* initialization is needed */ \ @@ -103,7 +112,7 @@ } \ } while (0); -#define DBG_RETURN_EX(dbg_obj, value) \ +#define DBG_LEAVE_EX(dbg_obj, leave) \ do {\ if ((dbg_obj)) { \ uint64_t this_call_duration = 0; \ @@ -112,20 +121,15 @@ } \ (dbg_obj)->m->func_leave((dbg_obj), __LINE__, __FILE__, this_call_duration); \ } \ - return (value);\ - } while (0) -#define DBG_VOID_RETURN_EX(dbg_obj)\ - do {\ - if ((dbg_obj)) { \ - uint64_t this_call_duration = 0; \ - if ((dbg_obj)->flags & MYSQLND_DEBUG_PROFILE_CALLS) { \ - DBG_PROFILE_END_TIME(this_call_duration); \ - } \ - (dbg_obj)->m->func_leave((dbg_obj), __LINE__, __FILE__, this_call_duration); \ - } \ - return;\ - } while (0) + leave \ + } while (0); +#define DBG_RETURN_EX(dbg_obj, value) DBG_LEAVE_EX(dbg_obj, return (value);) + +#define DBG_VOID_RETURN_EX(dbg_obj) DBG_LEAVE_EX(dbg_obj, return;) + + + #else static inline void DBG_INF_EX(MYSQLND_DEBUG * dbg_obj, const char * const msg) {} static inline void DBG_ERR_EX(MYSQLND_DEBUG * dbg_obj, const char * const msg) {} @@ -134,6 +138,7 @@ static inline void DBG_ENTER_EX(MYSQLND_DEBUG * dbg_obj, const char * const func_name) {} #define DBG_RETURN_EX(dbg_obj, value) return (value) #define DBG_VOID_RETURN_EX(dbg_obj) return +#define DBG_BLOCK_LEAVE_EX(dbg_obj) ; #endif /* defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 1400)) */ @@ -145,8 +150,10 @@ #define DBG_ERR_FMT(...) DBG_ERR_FMT_EX(MYSQLND_G(dbg), __VA_ARGS__) #define DBG_ENTER(func_name) DBG_ENTER_EX(MYSQLND_G(dbg), (func_name)) +#define DBG_BLOCK_ENTER(bname) DBG_BLOCK_ENTER_EX(MYSQLND_G(dbg), (bname)) #define DBG_RETURN(value) DBG_RETURN_EX(MYSQLND_G(dbg), (value)) #define DBG_VOID_RETURN DBG_VOID_RETURN_EX(MYSQLND_G(dbg)) +#define DBG_BLOCK_LEAVE DBG_BLOCK_LEAVE_EX(MYSQLND_G(dbg)) #elif MYSQLND_DBG_ENABLED == 0 @@ -157,8 +164,10 @@ static inline void DBG_INF_FMT(const char * const format, ...) {} static inline void DBG_ERR_FMT(const char * const format, ...) {} static inline void DBG_ENTER(const char * const func_name) {} -#define DBG_RETURN(value) return (value) -#define DBG_VOID_RETURNreturn +#define DBG_BLOCK_ENTER(bname) { +#define DBG_RETURN(value) return (value) +#define DBG_VOID_RETURNreturn +#define DBG_BLOCK_LEAVE} #endif Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h 2011-05-04 18:14:25 UTC (rev 310766) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h 2011-05-04 19:05:19 UTC (rev 310767) @@ -101,6 +101,15 @@ #define DBG_INF_FMT_EX(dbg_obj, ...) do {
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h trunk/ext/mysqlnd/mysqlnd_debug.h
andrey Tue, 19 Jan 2010 11:44:43 + Revision: http://svn.php.net/viewvc?view=revision&revision=293723 Log: fix windows Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h2010-01-19 10:47:51 UTC (rev 293722) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h2010-01-19 11:44:43 UTC (rev 293723) @@ -80,6 +80,7 @@ PHPAPI char * mysqlnd_get_backtrace(TSRMLS_D); +#if !defined(PHP_WIN32) #define DBG_INF_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "info : ", (msg)); } while (0) #define DBG_ERR_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "error: ", (msg)); } while (0) #define DBG_INF_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "info : ", __VA_ARGS__); } while (0) @@ -89,7 +90,17 @@ #define DBG_RETURN_EX(dbg_obj, value) do { if ((dbg_obj)) (dbg_obj)->m->func_leave((dbg_obj), __LINE__, __FILE__); return (value); } while (0) #define DBG_VOID_RETURN_EX(dbg_obj)do { if ((dbg_obj)) (dbg_obj)->m->func_leave((dbg_obj), __LINE__, __FILE__); return; } while (0) +#else +static inline void DBG_INF_EX(MYSQLND_DEBUG * dbg_obj, const char * const msg) {} +static inline void DBG_ERR_EX(MYSQLND_DEBUG * dbg_obj, const char * const msg) {} +static inline void DBG_INF_FMT_EX(MYSQLND_DEBUG * dbg_obj, ...) {} +static inline void DBG_ERR_FMT_EX(MYSQLND_DEBUG * dbg_obj, ...) {} +static inline void DBG_ENTER_EX(MYSQLND_DEBUG * dbg_obj, const char * const func_name) {} +#define DBG_RETURN_EX(dbg_obj, value) return (value) +#define DBG_VOID_RETURN_EX(dbg_obj) return +#endif + #if MYSQLND_DBG_ENABLED == 1 #define DBG_INF(msg) DBG_INF_EX(MYSQLND_G(dbg), (msg)) @@ -103,6 +114,8 @@ #elif MYSQLND_DBG_ENABLED == 0 + + static inline void DBG_INF(const char * const msg) {} static inline void DBG_ERR(const char * const msg) {} static inline void DBG_INF_FMT(const char * const format, ...) {} Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h 2010-01-19 10:47:51 UTC (rev 293722) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h 2010-01-19 11:44:43 UTC (rev 293723) @@ -80,6 +80,7 @@ PHPAPI char * mysqlnd_get_backtrace(TSRMLS_D); +#if !defined(PHP_WIN32) #define DBG_INF_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "info : ", (msg)); } while (0) #define DBG_ERR_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "error: ", (msg)); } while (0) #define DBG_INF_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "info : ", __VA_ARGS__); } while (0) @@ -89,7 +90,17 @@ #define DBG_RETURN_EX(dbg_obj, value) do { if ((dbg_obj)) (dbg_obj)->m->func_leave((dbg_obj), __LINE__, __FILE__); return (value); } while (0) #define DBG_VOID_RETURN_EX(dbg_obj)do { if ((dbg_obj)) (dbg_obj)->m->func_leave((dbg_obj), __LINE__, __FILE__); return; } while (0) +#else +static inline void DBG_INF_EX(MYSQLND_DEBUG * dbg_obj, const char * const msg) {} +static inline void DBG_ERR_EX(MYSQLND_DEBUG * dbg_obj, const char * const msg) {} +static inline void DBG_INF_FMT_EX(MYSQLND_DEBUG * dbg_obj, ...) {} +static inline void DBG_ERR_FMT_EX(MYSQLND_DEBUG * dbg_obj, ...) {} +static inline void DBG_ENTER_EX(MYSQLND_DEBUG * dbg_obj, const char * const func_name) {} +#define DBG_RETURN_EX(dbg_obj, value) return (value) +#define DBG_VOID_RETURN_EX(dbg_obj) return +#endif + #if MYSQLND_DBG_ENABLED == 1 #define DBG_INF(msg) DBG_INF_EX(MYSQLND_G(dbg), (msg)) @@ -103,6 +114,8 @@ #elif MYSQLND_DBG_ENABLED == 0 + + static inline void DBG_INF(const char * const msg) {} static inline void DBG_ERR(const char * const msg) {} static inline void DBG_INF_FMT(const char * const format, ...) {} -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h trunk/ext/mysqlnd/mysqlnd_debug.h
andrey Tue, 19 Jan 2010 12:13:06 + Revision: http://svn.php.net/viewvc?view=revision&revision=293725 Log: Make it GCC only feature (tracing). VC7 and up do the work too and it might be tweaked later. Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h2010-01-19 12:03:07 UTC (rev 293724) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h2010-01-19 12:13:06 UTC (rev 293725) @@ -80,7 +80,7 @@ PHPAPI char * mysqlnd_get_backtrace(TSRMLS_D); -#if !defined(PHP_WIN32) +#if defined(__GNUC__) #define DBG_INF_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "info : ", (msg)); } while (0) #define DBG_ERR_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "error: ", (msg)); } while (0) #define DBG_INF_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "info : ", __VA_ARGS__); } while (0) Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h 2010-01-19 12:03:07 UTC (rev 293724) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h 2010-01-19 12:13:06 UTC (rev 293725) @@ -80,7 +80,7 @@ PHPAPI char * mysqlnd_get_backtrace(TSRMLS_D); -#if !defined(PHP_WIN32) +#if defined(__GNUC__) #define DBG_INF_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "info : ", (msg)); } while (0) #define DBG_ERR_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "error: ", (msg)); } while (0) #define DBG_INF_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "info : ", __VA_ARGS__); } while (0) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h trunk/ext/mysqlnd/mysqlnd_debug.h
andrey Fri, 22 Oct 2010 14:12:45 + Revision: http://svn.php.net/viewvc?view=revision&revision=304622 Log: enable debug logging on windows, in debug builds, of course Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h2010-10-22 14:08:30 UTC (rev 304621) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h2010-10-22 14:12:45 UTC (rev 304622) @@ -63,7 +63,8 @@ PHPAPI char * mysqlnd_get_backtrace(uint max_levels, size_t * length TSRMLS_DC); -#if defined(__GNUC__) +/* Variadic Macros were introduced in VC 2005, which is _MSC_VER 1400 */ +#if defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER >= 1400) #define DBG_INF_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "info : ", (msg)); } while (0) #define DBG_ERR_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "error: ", (msg)); } while (0) #define DBG_INF_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "info : ", __VA_ARGS__); } while (0) Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h 2010-10-22 14:08:30 UTC (rev 304621) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h 2010-10-22 14:12:45 UTC (rev 304622) @@ -63,7 +63,8 @@ PHPAPI char * mysqlnd_get_backtrace(uint max_levels, size_t * length TSRMLS_DC); -#if defined(__GNUC__) +/* Variadic Macros were introduced in VC 2005, which is _MSC_VER 1400 */ +#if defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER >= 1400) #define DBG_INF_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "info : ", (msg)); } while (0) #define DBG_ERR_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "error: ", (msg)); } while (0) #define DBG_INF_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "info : ", __VA_ARGS__); } while (0) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h trunk/ext/mysqlnd/mysqlnd_debug.h
andrey Thu, 28 Oct 2010 14:14:06 + Revision: http://svn.php.net/viewvc?view=revision&revision=304975 Log: gettimeofday for windows Changed paths: U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h U php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h === --- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h2010-10-28 14:07:36 UTC (rev 304974) +++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_debug.h2010-10-28 14:14:06 UTC (rev 304975) @@ -65,16 +65,19 @@ PHPAPI char * mysqlnd_get_backtrace(uint max_levels, size_t * length TSRMLS_DC); #if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 1400)) +#ifdef PHP_WIN32 +#include "win32/time.h" +#elif defined(NETWARE) +#include +#include +#else +#include +#endif + #define DBG_PROFILE_TIMEVAL_TO_DOUBLE(tp) ((tp.tv_sec * 100LL)+ tp.tv_usec) -#ifndef _MSC_VER #define DBG_PROFILE_START_TIME() gettimeofday(&__dbg_prof_tp, NULL); __dbg_prof_start = DBG_PROFILE_TIMEVAL_TO_DOUBLE(__dbg_prof_tp); #define DBG_PROFILE_END_TIME(duration) gettimeofday(&__dbg_prof_tp, NULL); (duration) = (DBG_PROFILE_TIMEVAL_TO_DOUBLE(__dbg_prof_tp) - __dbg_prof_start); -#else -#define DBG_PROFILE_START_TIME() __dbg_prof_start = 0; /* no gettimeofday on Windows */ -#define DBG_PROFILE_END_TIME(duration) (duration) = 0; /* no gettimeofday on Windows */ -#endif - #define DBG_INF_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "info : ", (msg)); } while (0) #define DBG_ERR_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "error: ", (msg)); } while (0) #define DBG_INF_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "info : ", __VA_ARGS__); } while (0) Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h === --- php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h 2010-10-28 14:07:36 UTC (rev 304974) +++ php/php-src/trunk/ext/mysqlnd/mysqlnd_debug.h 2010-10-28 14:14:06 UTC (rev 304975) @@ -65,16 +65,19 @@ PHPAPI char * mysqlnd_get_backtrace(uint max_levels, size_t * length TSRMLS_DC); #if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 1400)) +#ifdef PHP_WIN32 +#include "win32/time.h" +#elif defined(NETWARE) +#include +#include +#else +#include +#endif + #define DBG_PROFILE_TIMEVAL_TO_DOUBLE(tp) ((tp.tv_sec * 100LL)+ tp.tv_usec) -#ifndef _MSC_VER #define DBG_PROFILE_START_TIME() gettimeofday(&__dbg_prof_tp, NULL); __dbg_prof_start = DBG_PROFILE_TIMEVAL_TO_DOUBLE(__dbg_prof_tp); #define DBG_PROFILE_END_TIME(duration) gettimeofday(&__dbg_prof_tp, NULL); (duration) = (DBG_PROFILE_TIMEVAL_TO_DOUBLE(__dbg_prof_tp) - __dbg_prof_start); -#else -#define DBG_PROFILE_START_TIME() __dbg_prof_start = 0; /* no gettimeofday on Windows */ -#define DBG_PROFILE_END_TIME(duration) (duration) = 0; /* no gettimeofday on Windows */ -#endif - #define DBG_INF_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "info : ", (msg)); } while (0) #define DBG_ERR_EX(dbg_obj, msg) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log((dbg_obj), __LINE__, __FILE__, -1, "error: ", (msg)); } while (0) #define DBG_INF_FMT_EX(dbg_obj, ...) do { if (dbg_skip_trace == FALSE) (dbg_obj)->m->log_va((dbg_obj), __LINE__, __FILE__, -1, "info : ", __VA_ARGS__); } while (0) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php