Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Changeset 637:29dc68c949b0

Show
Ignore:
Timestamp:
10/01/08 21:25:46 (2 months ago)
Author:
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
branch:
default
Message:

Applied the FreeBSD patch from Ralith, closes ticket #95 , slightly changed but basically the same. Thanx Ralith :)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dmd/constfold.c

    r336 r637  
    488488#elif defined(IN_GCC) 
    489489        c = complex_t(e1->toReal() % r2, e1->toImaginary() % r2); 
     490#elif defined(__FreeBSD__) && __FreeBSD_version < 800000 
     491        // freebsd is kinda messed up. the STABLE branch doesn't support C99's fmodl !?! 
     492        c = complex_t(fmod(e1->toReal(), r2), fmod(e1->toImaginary(), r2)); 
    490493#else 
    491494        c = complex_t(fmodl(e1->toReal(), r2), fmodl(e1->toImaginary(), r2)); 
     
    499502#elif defined(IN_GCC) 
    500503        c = complex_t(e1->toReal() % i2, e1->toImaginary() % i2); 
     504#elif defined(__FreeBSD__) && __FreeBSD_version < 800000 
     505        // freebsd is kinda messed up. the STABLE branch doesn't support C99's fmodl !?! 
     506        c = complex_t(fmod(e1->toReal(), i2), fmod(e1->toImaginary(), i2)); 
    501507#else 
    502508        c = complex_t(fmodl(e1->toReal(), i2), fmodl(e1->toImaginary(), i2)); 
  • dmd/mars.c

    r583 r637  
    331331#elif __APPLE__ 
    332332    global.params.os = OSMacOSX; 
     333#elif __FreeBSD__ 
     334    global.params.os = OSFreeBSD; 
    333335#else 
    334 #error 
     336#error Unsupported OS 
    335337#endif /* linux */ 
    336338 
     
    844846    break; 
    845847 
     848    case OSFreeBSD: 
     849    VersionCondition::addPredefinedGlobalIdent("freebsd"); 
     850    VersionCondition::addPredefinedGlobalIdent("Posix"); 
     851    break; 
     852 
    846853    default: 
    847854    assert(false && "Target OS not supported"); 
  • dmd/mars.h

    r580 r637  
    5353    OSLinux, 
    5454    OSWindows, 
    55     OSMacOSX 
     55    OSMacOSX, 
     56    OSFreeBSD 
    5657}; 
    5758 
  • gen/linker.cpp

    r567 r637  
    152152 
    153153    // default libs 
    154     if(global.params.os == OSLinux || global.params.os == OSMacOSX) 
    155     { 
     154    switch(global.params.os) { 
     155    case OSLinux: 
     156    case OSMacOSX: 
     157        args.push_back("-ldl"); 
     158    case OSFreeBSD: 
    156159        args.push_back("-lpthread"); 
    157         args.push_back("-ldl"); 
    158160        args.push_back("-lm"); 
    159     } 
    160     else if (global.params.os == OSWindows) 
    161     { 
     161        break; 
     162 
     163    case OSWindows: 
    162164        // FIXME: I'd assume kernel32 etc 
     165        break; 
    163166    } 
    164167 
  • gen/tollvm.cpp

    r632 r637  
    705705    } 
    706706 
     707    // FreeBSD 
     708    else if (global.params.os == OSFreeBSD) { 
     709        // Just a pointer 
     710        return LLStructType::get(DtoSize_t(), 0); 
     711    } 
     712 
    707713    // pthread_fastlock 
    708714    std::vector<const LLType*> types2; 
  • runtime/internal/critical.c

    r563 r637  
    7676/* ================================= linux ============================ */ 
    7777 
    78 #if linux || __APPLE__ 
     78#if linux || __APPLE__ || __FreeBSD__ 
    7979 
    8080#include    <stdio.h> 
  • tests/runtest

    r385 r637  
    1 #!/bin/bash 
     1#!/bin/sh 
    22 
    33# check for command line arguments 
Copyright © 2008, LDC Development Team.