зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 42608: portability fixes for dec, problems with assert macros r=dbradley, sr=jst, patch by jband
This commit is contained in:
Родитель
1d88f0bc1f
Коммит
440f0ebe55
|
@ -27,7 +27,6 @@
|
|||
#ifndef __xpidl_h
|
||||
#define __xpidl_h
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -38,7 +38,7 @@ xpidl_process_node(TreeState *state)
|
|||
gint type;
|
||||
nodeHandler *dispatch, handler;
|
||||
|
||||
assert(state->tree);
|
||||
XPT_ASSERT(state->tree);
|
||||
type = IDL_NODE_TYPE(state->tree);
|
||||
|
||||
if ((dispatch = state->dispatch) && (handler = dispatch[type]))
|
||||
|
@ -320,7 +320,7 @@ NextIsInclude(input_callback_state *callback_state, char **startp,
|
|||
}
|
||||
|
||||
filename = data->point + 10; /* skip #include " */
|
||||
assert(filename < data->max);
|
||||
XPT_ASSERT(filename < data->max);
|
||||
end = filename;
|
||||
while (end < data->max) {
|
||||
if (*end == '\"' || *end == '\n' || *end == '\r')
|
||||
|
|
|
@ -112,7 +112,7 @@ xpidl_parse_iid(nsID *id, const char *str)
|
|||
PRInt32 n1, n2, n3[8];
|
||||
PRInt32 n0, i;
|
||||
|
||||
assert(str != NULL);
|
||||
XPT_ASSERT(str != NULL);
|
||||
|
||||
if (strlen(str) != 36) {
|
||||
return FALSE;
|
||||
|
@ -342,7 +342,7 @@ check_param_attribute(IDL_tree method_tree, IDL_tree param,
|
|||
attr_name = "size_is";
|
||||
needed_type = "unsigned long (or PRUint32)";
|
||||
} else {
|
||||
assert("asked to check an unknown attribute type!");
|
||||
XPT_ASSERT("asked to check an unknown attribute type!");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#define __xpt_arena_h__
|
||||
|
||||
#include "prtypes.h"
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
|
@ -106,7 +105,14 @@ XPT_ArenaFree(XPTArena *arena, void* block);
|
|||
|
||||
/* --------------------------------------------------------- */
|
||||
|
||||
#define XPT_ASSERT(_expr) assert(_expr)
|
||||
#ifdef DEBUG
|
||||
XPT_PUBLIC_API(void)
|
||||
XPT_AssertFailed(const char *s, const char *file, PRUint32 lineno);
|
||||
#define XPT_ASSERT(_expr) \
|
||||
((_expr)?((void)0):XPT_AssertFailed(# _expr, __FILE__, __LINE__))
|
||||
#else
|
||||
#define XPT_ASSERT(_expr) ((void)0)
|
||||
#endif
|
||||
|
||||
PR_END_EXTERN_C
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "xpt_arena.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*************************/
|
||||
|
@ -313,3 +312,12 @@ static void xpt_DebugPrintArenaStats(XPTArena *arena)
|
|||
|
||||
/***************************************************************************/
|
||||
|
||||
#ifdef DEBUG
|
||||
XPT_PUBLIC_API(void)
|
||||
XPT_AssertFailed(const char *s, const char *file, PRUint32 lineno)
|
||||
{
|
||||
fprintf(stderr, "Assertion failed: %s, file %s, line %d\n",
|
||||
s, file, lineno);
|
||||
abort();
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -423,7 +423,7 @@ XPT_DoCString(XPTArena *arena, XPTCursor *cursor, char **identp)
|
|||
return PR_FALSE;
|
||||
}
|
||||
len = end - start;
|
||||
assert(len > 0);
|
||||
XPT_ASSERT(len > 0);
|
||||
|
||||
ident = XPT_MALLOC(arena, len + 1u);
|
||||
if (!ident)
|
||||
|
|
Загрузка…
Ссылка в новой задаче