mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 707130 - Fix GCC 4.6 warnings coming from callgrind macros. r=jorendorff
This commit is contained in:
parent
659a71d040
commit
139ec9d5c0
@ -1489,18 +1489,36 @@ JS_DefineProfilingFunctions(JSContext *cx, JSObject *obj)
|
||||
|
||||
#include <valgrind/callgrind.h>
|
||||
|
||||
/*
|
||||
* Wrapper for callgrind macros to stop warnings coming from their expansions.
|
||||
*/
|
||||
#if (__GNUC__ >= 5) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
|
||||
# define WRAP_CALLGRIND(call) \
|
||||
JS_BEGIN_MACRO \
|
||||
_Pragma("GCC diagnostic push") \
|
||||
_Pragma("GCC diagnostic ignored \"-Wunused-but-set-variable\"") \
|
||||
call; \
|
||||
_Pragma("GCC diagnostic pop") \
|
||||
JS_END_MACRO
|
||||
#else
|
||||
# define WRAP_CALLGRIND(call) \
|
||||
JS_BEGIN_MACRO \
|
||||
call; \
|
||||
JS_END_MACRO
|
||||
#endif
|
||||
|
||||
JS_FRIEND_API(JSBool)
|
||||
js_StartCallgrind()
|
||||
{
|
||||
CALLGRIND_START_INSTRUMENTATION;
|
||||
CALLGRIND_ZERO_STATS;
|
||||
WRAP_CALLGRIND(CALLGRIND_START_INSTRUMENTATION);
|
||||
WRAP_CALLGRIND(CALLGRIND_ZERO_STATS);
|
||||
return true;
|
||||
}
|
||||
|
||||
JS_FRIEND_API(JSBool)
|
||||
js_StopCallgrind()
|
||||
{
|
||||
CALLGRIND_STOP_INSTRUMENTATION;
|
||||
WRAP_CALLGRIND(CALLGRIND_STOP_INSTRUMENTATION);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1508,9 +1526,9 @@ JS_FRIEND_API(JSBool)
|
||||
js_DumpCallgrind(const char *outfile)
|
||||
{
|
||||
if (outfile) {
|
||||
CALLGRIND_DUMP_STATS_AT(outfile);
|
||||
WRAP_CALLGRIND(CALLGRIND_DUMP_STATS_AT(outfile));
|
||||
} else {
|
||||
CALLGRIND_DUMP_STATS;
|
||||
WRAP_CALLGRIND(CALLGRIND_DUMP_STATS);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user