Changeset 36146

Show
Ignore:
Timestamp:
12/16/09 03:22:32 (3 years ago)
Author:
saturday06
Message:

ajiodf

Location:
lang/objective-cplusplus/i3/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • lang/objective-cplusplus/i3/trunk/configure.ac

    r36145 r36146  
    2424AC_PROG_CXXCPP # for cygwin 
    2525AC_PROG_CXX 
     26AC_PROG_CPP_WERROR 
    2627#AC_PROG_OBJC 
    2728AC_LANG([C++]) 
     
    103104 
    104105        #AC_CHECK_PROG(GNUSTEP_CONFIG, gnustep-config) 
    105         which gnustep-config > /dev/null 
    106         if test $? -eq 0; then 
    107             GNUSTEP_CONFIG="gnustep-config" 
     106 
     107        for command in \ 
     108            "$GNUSTEP_CONFIG" \ 
     109            gnustep-config \ 
     110            ~/GNUstep/System/Tools/gnustep-config \ 
     111            /usr/local/GNUstep/System/Tools/gnustep-config \ 
     112            /usr/GNUstep/System/Tools/gnustep-config \ 
     113            ; do 
     114            which $command > /dev/null 
     115            if test $? -eq 0; then 
     116                GNUSTEP_CONFIG=$command 
     117                break 
     118            fi 
     119        done          
     120 
     121        if test "$GNUSTEP_CONFIG" != ""; then 
    108122            if test "$enable_debug" = "yes"; then 
    109123                debug_arg="--debug" 
     
    132146if test "$with_gui" != "windows"; then 
    133147    AC_MSG_CHECKING([for Objective C++]) 
    134     prologue="class Foo {}; @interface Bar {} @end @implementation Bar @end" 
    135148    body="Foo foo; Bar* bar;" 
    136149    LDFLAGS_ORIG="$LDFLAGS" 
    137150    LDFLAGS="$LDFLAGS -xobjective-c++" 
    138151    AC_LINK_IFELSE( 
    139         [AC_LANG_PROGRAM([[$prologue]], [[$body]])], 
     152        [AC_LANG_PROGRAM( 
     153            [[ 
     154#import <Cocoa/Cocoa.h> 
     155class Foo {}; 
     156@interface Bar {} 
     157@end 
     158@implementation Bar 
     159@end  
     160            ]], 
     161            [[$body]])], 
    140162        [AC_MSG_RESULT([yes])], 
    141163        [AC_MSG_FAILURE([Objective C++ compiler/linker does not work])]) 
     
    143165fi 
    144166 
    145 AC_PROG_CPP_WERROR 
    146167AC_CHECK_HEADERS([__NON__EXISTANT__HEADER__FILE__], 
    147168                 [AC_MSG_FAILURE([no error when include file is not found])]) 
     
    217238 
    218239AC_MSG_CHECKING([for unnamed semaphore]) 
    219 prog="sem_t sem; return (sem_init(&sem, 0, 0) == 0) ? EXIT_SUCCESS : EXIT_FAILURE;" 
     240prologue="#include <semaphore.h>" 
     241body="sem_t sem; return (sem_init(&sem, 0, 0) == 0) ? EXIT_SUCCESS : EXIT_FAILURE;" 
    220242AC_LINK_IFELSE( 
    221243    [AC_LANG_PROGRAM([[]], [[$prog]])], 
     
    239261CXXFLAGS_ORIG="$CXXFLAGS" 
    240262AC_MSG_CHECKING([for __sync_bool_compare_and_swap]) 
    241 prog="int data = 0;  __sync_bool_compare_and_swap(&data, 0, 1);" 
    242263 
    243264gcc_atomic_operations_found() { 
     
    246267} 
    247268 
     269body="int data = 0;  __sync_bool_compare_and_swap(&data, 0, 1);" 
     270 
    248271AC_LINK_IFELSE( 
    249     [AC_LANG_PROGRAM([[]], [[$prog]])], 
     272    [AC_LANG_PROGRAM([[]], [[$body]])], 
    250273    [gcc_atomic_operations_found], 
    251274    [ 
    252275        CXXFLAGS="$CXXFLAGS -march=$host_cpu" 
    253276        AC_LINK_IFELSE( 
    254             [AC_LANG_PROGRAM([[]], [[$prog]])], 
     277            [AC_LANG_PROGRAM([[]], [[$body]])], 
    255278            [gcc_atomic_operations_found], 
    256279            [AC_MSG_RESULT([no]); CXXFLAGS="$CXXFLAGS_ORIG"])]) 
  • lang/objective-cplusplus/i3/trunk/scripts/ac_init_version.sh

    r36132 r36146  
    1818fi 
    1919 
    20 REVISION=`LC_ALL=en svn info | grep "Last Changed Rev:" | head -n 1 | cut -d ' ' -f 4` 
     20REVISION=`LC_ALL=en svn info 2> /dev/null | grep "Last Changed Rev:" | head -n 1 | cut -d ' ' -f 4` 
    2121UPDATES=`svn status | grep -v "^\?"` 
    2222if [ "${UPDATES}" != "" ]; then 
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/PrecompiledHeaders.h

    r34863 r36146  
    3939 
    4040#if defined(MIL_GUI_COCOA) 
     41 
     42//#define class MIL_REPLACE_class 
     43//#import <AppKit/NSObjectController.h> 
     44//#undef class 
     45 
    4146#import <Foundation/Foundation.h> 
    4247#import <AppKit/AppKit.h> 
     
    4449#include "gui-cocoa/PrecompiledHeaders.h" 
    4550 
    46 //#define Object MIL_BOOST_replace_Object 
     51//#define Object MIL_REPLACE_Object 
    4752//#include <boost/lambda/lambda.hpp> 
    4853//#undef Object 
     
    5055#ifdef __APPLE__ 
    5156#ifdef HAVE_BOOST_DETAIL_IS_INCREMENTABLE_HPP 
    52 #define check MIL_BOOST_replace_check 
     57#define check MIL_REPLACE_check 
    5358#include <boost/ptr_container/detail/static_move_ptr.hpp> 
    5459#undef check 
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/Synchronize.h

    r36145 r36146  
    99#include <unistd.h> 
    1010#include <sched.h> 
     11#include <boost/cstdint.hpp> 
    1112 
    1213/** 
     
    6162}; 
    6263 
    63 #ifdef __APPLE__ 
    6464class Semaphore { 
    65     Mutex mutex; 
    66     unsigned int value; 
    67 public: 
    68     Semaphore() : value(0) { 
     65    sem_t unnamed_sem; 
     66    sem_t* psem; 
     67public: 
     68    Semaphore() { 
     69 
     70#ifdef HAVE_UNNAMED_SEMAPHOREfoo 
     71        if (sem_init(&unnamed_sem, 0, 0) == -1) { 
     72            halt << "sem_init() failed"; 
     73        } 
     74        psem = &unnamed_sem; 
     75#else 
     76        std::stringstream name; 
     77        name << "/" PACKAGE_NAME PACKAGE_VERSION "-pid" << getpid(); 
     78        psem = sem_open(name.str().c_str(), O_CREAT | O_EXCL, S_IRUSR | S_IWUSR | S_IXUSR, 0); 
     79        if (reinterpret_cast<intptr_t>(psem) == 
     80            reinterpret_cast<intptr_t>(-1)) { 
     81            halt << "sem_open() failed"; 
     82        } 
     83#endif 
     84 
    6985    } 
    7086 
    7187    void passeren() { 
     88        sem_post(psem); 
    7289    } 
    7390 
     
    7794 
    7895    void verhoog() { 
     96        sem_wait(psem); 
    7997    } 
    8098 
     
    84102 
    85103    ~Semaphore() { 
    86     } 
    87 }; 
    88 #else 
    89 class Semaphore { 
    90     sem_t sem; 
    91 public: 
    92     Semaphore() { 
    93         if (sem_init(&sem, 0, 0) == -1) { 
    94             halt << "Semaphore(): failed"; 
    95         } 
    96     } 
    97  
    98     void passeren() { 
    99         sem_post(&sem); 
    100     } 
    101  
    102     void p() { 
    103104        passeren(); 
    104     } 
    105  
    106     void verhoog() { 
    107         sem_wait(&sem); 
    108     } 
    109  
    110     void v() { 
    111         verhoog(); 
    112     } 
    113  
    114     ~Semaphore() { 
    115         passeren(); 
    116         for (size_t retry = 500; sem_destroy(&sem) == -1; retry--) { 
     105        for (size_t retry = 500; sem_destroy(psem) == -1; retry--) { 
    117106            if (!retry) { 
    118107                halt << "~Semaphore(): failed."; 
     
    123112    } 
    124113}; 
    125 #endif 
    126114 
    127115}