source: webkit/trunk/JavaScriptCore/os-win32/stdint.h@ 28106

Last change on this file since 28106 was 16780, checked in by kmccullo, 19 years ago

Reviewed by GGaren

  • This is a big makeover for our Date implemenetation. This solves many platform specific issues, specifically dates before 1970, and simplifies some ugly code. The purpose of this was to get us to pass many of the JavaScriptCore tests on windows.
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • kjs/DateMath.cpp: Added. (KJS::): (KJS::daysInYear): (KJS::daysFrom1970ToYear): (KJS::msFrom1970ToYear): (KJS::msToDays): (KJS::msToYear): (KJS::isLeapYear): (KJS::isInLeapYear): (KJS::dayInYear): (KJS::msToMilliseconds): (KJS::msToWeekDay): (KJS::msToSeconds): (KJS::msToMinutes): (KJS::msToHours): (KJS::msToMonth): (KJS::msToDayInMonth): (KJS::monthToDayInYear): (KJS::timeToMseconds): (KJS::dateToDayInYear): (KJS::equivalentYearForDST): (KJS::getUTCOffset): (KJS::getDSTOffsetSimple): (KJS::getDSTOffset): (KJS::localTimeToUTC): (KJS::UTCToLocalTime): (KJS::dateToMseconds): (KJS::msToTM): (KJS::isDST):
  • kjs/DateMath.h: Added. (KJS::):
  • kjs/date_object.cpp: (KJS::gmtoffset): (KJS::formatTime): (KJS::DateInstance::getTime): (KJS::DateInstance::getUTCTime): (KJS::DateProtoFunc::callAsFunction): (KJS::DateObjectImp::construct): (KJS::DateObjectFuncImp::callAsFunction): (KJS::parseDate):
  • kjs/testkjs.cpp:
  • os-win32/stdint.h:
  • Property svn:eol-style set to native
File size: 1.8 KB
Line 
1/*
2 * Copyright (C) 2005, 2006 Apple Computer, Inc.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 *
19 */
20
21#ifndef STDINT_WIN32_H
22#define STDINT_WIN32_H
23
24#include <wtf/Platform.h>
25
26/* This file emulates enough of stdint.h on Windows to make JavaScriptCore and WebCore compile. */
27
28#if !PLATFORM(WIN_OS)
29#error "This stdint.h file should only be compiled under Windows"
30#endif
31
32typedef unsigned char uint8_t;
33typedef signed char int8_t;
34typedef unsigned short uint16_t;
35typedef short int16_t;
36typedef unsigned int uint32_t;
37typedef int int32_t;
38typedef __int64 int64_t;
39typedef unsigned __int64 uint64_t;
40
41#ifndef CASSERT
42#define CASSERT(exp, name) typedef int dummy##name [(exp) ? 1 : -1];
43#endif
44
45CASSERT(sizeof(int8_t) == 1, int8_t_is_one_byte)
46CASSERT(sizeof(uint8_t) == 1, uint8_t_is_one_byte)
47CASSERT(sizeof(int16_t) == 2, int16_t_is_two_bytes)
48CASSERT(sizeof(uint16_t) == 2, uint16_t_is_two_bytes)
49CASSERT(sizeof(int32_t) == 4, int32_t_is_four_bytes)
50CASSERT(sizeof(uint32_t) == 4, uint32_t_is_four_bytes)
51CASSERT(sizeof(int64_t) == 8, int64_t_is_four_bytes)
52CASSERT(sizeof(uint64_t) == 8, uint64_t_is_four_bytes)
53
54#endif
Note: See TracBrowser for help on using the repository browser.