source: webkit/trunk/JavaScriptCore/kjs/operations.h@ 16608

Last change on this file since 16608 was 14004, checked in by darin, 19 years ago

JavaScriptCore:

Reviewed by Darin.

  • kjs/operations.h:
  • kxmlcore/Assertions.cpp:
  • kxmlcore/FastMalloc.cpp: Added necessary headers to resolve compilation issues when not using precompiled headers.


  • kjs/value.h: Declare the JSCell class before friend declaration to resolve compilation issues with gcc 4.0.2.


  • kxmlcore/Platform.h: Set Unicode support to use ICU on platforms other than KDE (previously only defined for Win and Mac OS)

WebCore:

Reviewed by Darin.

  • platform/Cursor.h: Created a fallback case that typedefs PlatformCursor to void * if it isn't defined to anything else. (Useful to help get new ports initially compiling.)


  • bindings/js/kjs_window.cpp:
  • rendering/RenderTextField.cpp:
  • rendering/RenderBox.cpp: Add missing headers to resolve issues when compiling without precompiled headers.


  • rendering/RenderText.h: Declare the InlineTextBox class before friend declaration to resolve compilation issues with gcc 4.0.2.
  • Property svn:eol-style set to native
File size: 2.6 KB
Line 
1// -*- c-basic-offset: 2 -*-
2/*
3 * This file is part of the KDE libraries
4 * Copyright (C) 1999-2000 Harri Porten ([email protected])
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20 *
21 */
22
23#ifndef _KJS_OPERATIONS_H_
24#define _KJS_OPERATIONS_H_
25
26#include <math.h>
27
28namespace KJS {
29
30 class ExecState;
31 class JSValue;
32
33#if PLATFORM(DARWIN)
34 inline bool isNaN(double d) { return isnan(d); }
35 inline bool isInf(double d) { return isinf(d); }
36 inline bool isPosInf(double d) { return isinf(d) && d > 0; }
37 inline bool isNegInf(double d) { return isinf(d) && d < 0; }
38#else
39 bool isNaN(double d);
40 bool isInf(double d);
41 bool isPosInf(double d);
42 bool isNegInf(double d);
43#endif
44
45 bool equal(ExecState *exec, JSValue *v1, JSValue *v2);
46 bool strictEqual(ExecState *exec, JSValue *v1, JSValue *v2);
47 /**
48 * This operator performs an abstract relational comparison of the two
49 * arguments that can be of arbitrary type. If possible, conversions to the
50 * string or number type will take place before the comparison.
51 *
52 * @return 1 if v1 is "less-than" v2, 0 if the relation is "greater-than-or-
53 * equal". -1 if the result is undefined.
54 */
55 int relation(ExecState *exec, JSValue *v1, JSValue *v2);
56 int maxInt(int d1, int d2);
57 int minInt(int d1, int d2);
58 /**
59 * Additive operator. Either performs an addition or substraction of v1
60 * and v2.
61 * @param oper '+' or '-' for an addition or substraction, respectively.
62 * @return The result of the operation.
63 */
64 JSValue *add(ExecState *exec, JSValue *v1, JSValue *v2, char oper);
65 /**
66 * Multiplicative operator. Either multiplies/divides v1 and v2 or
67 * calculates the remainder from an division.
68 * @param oper '*', '/' or '%' for a multiplication, division or
69 * modulo operation.
70 * @return The result of the operation.
71 */
72 JSValue *mult(ExecState *exec, JSValue *v1, JSValue *v2, char oper);
73
74}
75
76#endif
Note: See TracBrowser for help on using the repository browser.