source: webkit/trunk/JavaScriptCore/JavaScriptCorePrefix.h@ 10178

Last change on this file since 10178 was 6051, checked in by darin, 21 years ago

Reviewed by Dave.

  • fixed things seen in the profile, for a total speedup of 4% on cvs-base (including changes across all projects)
  • JavaScriptCorePrefix.h: Add a workaround for a bug in our system headers that prevents the <ctype.h> macros from working right in C++ code that uses the <cctype> header.
  • kjs/ustring.cpp: (KJS::inlineUTF8SequenceLengthNonASCII): Added. (KJS::UTF8SequenceLengthNonASCII): Added. (KJS::inlineUTF8SequenceLength): Added. (KJS::UTF8SequenceLength): Calls inlineUTF8SequenceLengthNonASCII now. (KJS::decodeUTF8Sequence): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII. (KJS::createSortedOffsetsArray): Add special case for 1, 2, and 3 offsets, so we don't do qsort for those. (KJS::convertUTF16OffsetsToUTF8Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII. (KJS::convertUTF8OffsetsToUTF16Offsets): Use new inlineUTF8SequenceLengthNonASCII; faster for ASCII.
  • fixed the test program so it won't hit the interpreter lock assertion
  • kjs/testkjs.cpp: (main): Just lock around the whole thing, since the test is singly threaded.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.2 KB
Line 
1#ifdef __cplusplus
2#define NULL __null
3#else
4#define NULL ((void *)0)
5#endif
6
7#include <config.h>
8
9#include <assert.h>
10#include <ctype.h>
11#include <float.h>
12#include <locale.h>
13#include <math.h>
14#include <stdio.h>
15#include <stdlib.h>
16#include <string.h>
17#include <strings.h>
18#include <time.h>
19#include <sys/param.h>
20#include <sys/time.h>
21#include <sys/timeb.h>
22#include <sys/types.h>
23
24#ifdef __cplusplus
25
26// Work around bug 3553309 by re-including <ctype.h>.
27#include <cctype>
28#define isalnum(c) __istype((c), (_CTYPE_A|_CTYPE_D))
29#define isalpha(c) __istype((c), _CTYPE_A)
30#define iscntrl(c) __istype((c), _CTYPE_C)
31#define isdigit(c) __isctype((c), _CTYPE_D) /* ANSI -- locale independent */
32#define isgraph(c) __istype((c), _CTYPE_G)
33#define islower(c) __istype((c), _CTYPE_L)
34#define isprint(c) __istype((c), _CTYPE_R)
35#define ispunct(c) __istype((c), _CTYPE_P)
36#define isspace(c) __istype((c), _CTYPE_S)
37#define isupper(c) __istype((c), _CTYPE_U)
38#define isxdigit(c) __isctype((c), _CTYPE_X) /* ANSI -- locale independent */
39#define tolower(c) __tolower(c)
40#define toupper(c) __toupper(c)
41
42#include <list>
43#include <typeinfo>
44
45#endif
Note: See TracBrowser for help on using the repository browser.