Changeset 29454 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Jan 13, 2008, 11:47:56 AM (17 years ago)
Author:
Darin Adler
Message:

Contributions and review by Adriaan de Groot,
Simon Hausmann, Eric Seidel, and Darin Adler.

  • kjs/DateMath.h: (KJS::GregorianDateTime::GregorianDateTime): Use the WIN_OS code path for SOLARIS too, presumably because Solaris also lacks the tm_gtoff and tm_zone fields. (KJS::GregorianDateTime::operator tm): Ditto.
  • kjs/collector.cpp: (KJS::currentThreadStackBase): Use thr_stksegment on Solaris.
  • wtf/MathExtras.h: (isfinite): Implement for Solaris. (isinf): Ditto. (signbit): Ditto. But this one is wrong, so I added a FIXME.
  • wtf/Platform.h: Define PLATFORM(SOLARIS) when "sun" or "sun" is defined.
Location:
trunk/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r29447 r29454  
     12008-01-13  Marius Bugge Monsen  <[email protected]>
     2
     3        Contributions and review by Adriaan de Groot,
     4        Simon Hausmann, Eric Seidel, and Darin Adler.
     5
     6        - http://bugs.webkit.org/show_bug.cgi?id=16590
     7          Compilation fixes for Solaris.
     8
     9        * kjs/DateMath.h:
     10        (KJS::GregorianDateTime::GregorianDateTime): Use the WIN_OS code path
     11        for SOLARIS too, presumably because Solaris also lacks the tm_gtoff and tm_zone
     12        fields.
     13        (KJS::GregorianDateTime::operator tm): Ditto.
     14
     15        * kjs/collector.cpp:
     16        (KJS::currentThreadStackBase): Use thr_stksegment on Solaris.
     17
     18        * wtf/MathExtras.h:
     19        (isfinite): Implement for Solaris.
     20        (isinf): Ditto.
     21        (signbit): Ditto. But this one is wrong, so I added a FIXME.
     22
     23        * wtf/Platform.h: Define PLATFORM(SOLARIS) when "sun" or "__sun" is defined.
     24
    1252008-01-13  Michael Goddard  <[email protected]>
    226
  • trunk/JavaScriptCore/kjs/DateMath.h

    r20203 r29454  
    6969
    7070// Intentionally overridding the default tm of the system
    71 // Not all OS' have the same members of their tm's
     71// Tee members of tm differ on various operating systems.
    7272struct GregorianDateTime : Noncopyable {
    7373    GregorianDateTime()
     
    102102        , isDST(inTm.tm_isdst)
    103103    {
    104 #if !PLATFORM(WIN_OS)
     104#if !PLATFORM(WIN_OS) && !PLATFORM(SOLARIS)
    105105        utcOffset = static_cast<int>(inTm.tm_gmtoff);
    106106
     
    129129        ret.tm_isdst =  isDST;
    130130
    131 #if !PLATFORM(WIN_OS)
     131#if !PLATFORM(WIN_OS) && !PLATFORM(SOLARIS)
    132132        ret.tm_gmtoff = static_cast<long>(utcOffset);
    133133        ret.tm_zone = timeZone;
  • trunk/JavaScriptCore/kjs/collector.cpp

    r29396 r29454  
    11// -*- mode: c++; c-basic-offset: 4 -*-
    22/*
    3  *  This file is part of the KDE libraries
    43 *  Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
    54 *  Copyright (C) 2007 Eric Seidel <[email protected]>
     
    5958#include <sys/mman.h>
    6059#include <unistd.h>
     60
     61#if PLATFORM(SOLARIS)
     62#include <thread.h>
     63#endif
    6164
    6265#if HAVE(PTHREAD_NP_H)
     
    334337        );
    335338    return (void*)pTib->StackBase;
     339#elif PLATFORM(SOLARIS)
     340    stack_t s;
     341    thr_stksegment(&s);
     342    return s.ss_sp;
    336343#elif PLATFORM(UNIX)
    337     static void *stackBase = 0;
     344    static void* stackBase = 0;
    338345    static size_t stackSize = 0;
    339346    static pthread_t stackThread;
     
    350357#endif
    351358        int rc = pthread_attr_getstack(&sattr, &stackBase, &stackSize);
    352         (void)rc; // FIXME: deal with error code somehow?  seems fatal...
     359        (void)rc; // FIXME: Deal with error code somehow? Seems fatal.
    353360        ASSERT(stackBase);
    354361        pthread_attr_destroy(&sattr);
    355362        stackThread = thread;
    356363    }
    357     return (void*)(size_t(stackBase) + stackSize);
     364    return static_cast<char*>(stackBase) + stackSize;
    358365#else
    359366#error Need a way to get the stack base on this platform
  • trunk/JavaScriptCore/wtf/MathExtras.h

    r27994 r29454  
    11/*
    2  * Copyright (C) 2006, 2007 Apple Inc.  All rights reserved.
     2 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3131#include <time.h>
    3232
     33#if PLATFORM(SOLARIS) && COMPILER(GCC)
     34#include <ieeefp.h>
     35#endif
     36
    3337#if COMPILER(MSVC)
    3438
     
    5660const double piOverFourDouble = M_PI_4;
    5761const float piOverFourFloat = static_cast<float>(M_PI_4);
     62#endif
     63
     64#if PLATFORM(SOLARIS) && COMPILER(GCC)
     65
     66#ifndef isfinite
     67inline bool isfinite(double x) { return finite(x) && !isnand(x); }
     68#endif
     69#ifndef isinf
     70inline bool isinf(double x) { return !finite(x) && !isnand(x); }
     71#endif
     72#ifndef signbit
     73inline bool signbit(double x) { return x < 0.0; } // FIXME: Wrong for negative 0.
     74#endif
     75
    5876#endif
    5977
  • trunk/JavaScriptCore/wtf/Platform.h

    r27187 r29454  
    5858#endif
    5959
     60/* PLATFORM(SOLARIS) */
     61/* Operating system level dependencies for Solaris that should be used */
     62/* regardless of operating environment */
     63#if defined(sun) || defined(__sun)
     64#define WTF_PLATFORM_SOLARIS 1
     65#endif
     66
    6067/* PLATFORM(UNIX) */
    6168/* Operating system level dependencies for Unix-like systems that */
Note: See TracChangeset for help on using the changeset viewer.