Changeset 1647

Show
Ignore:
Timestamp:
07/08/08 16:21:27 (2 months ago)
Author:
till
Message:

nebula
- *BSD compatibililty changes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nebula/trunk/client/util.c

    r1571 r1647  
    2020 
    2121#include <dirent.h> 
     22#include <errno.h> 
    2223#include <fcntl.h> 
    2324#include <signal.h> 
     
    7475 
    7576 
     77#if defined(OS_BSD) || defined (OS_DARWIN) 
     78int regular_file(struct dirent *e) { 
     79#else 
    7680int regular_file(const struct dirent *e) { 
     81#endif  
    7782        struct stat sta; 
    7883        memset(&sta, 0, sizeof(struct stat)); 
  • nebula/trunk/client/util.h

    r1571 r1647  
    3636bstring bstr_map(const char* filename); 
    3737void bstr_unmap(bstring bstr); 
     38 
     39#if defined(OS_BSD) || defined (OS_DARWIN) 
     40int regular_file(struct dirent *e); 
     41#else 
    3842int regular_file(const struct dirent *e); 
     43#endif  
     44 
    3945int timesort(const void *a, const void *b); 
    4046 
  • nebula/trunk/configure.in

    r1623 r1647  
    66 
    77AC_PROG_CC 
     8 
     9AC_CANONICAL_HOST 
     10 
     11AH_TEMPLATE(OS_LINUX, [compiling under linux])     
     12AH_TEMPLATE(OS_BSD, [compiling under bsd]) 
     13AH_TEMPLATE(OS_BSD_FREE, [compiling under free bsd]) 
     14AH_TEMPLATE(OS_BSD_OPEN, [compiling under open bsd]) 
     15AH_TEMPLATE(OS_BSD_NET, [compiling under net bsd]) 
     16AH_TEMPLATE(OS_DARWIN, [compiling under macosx]) 
     17 
     18AM_CONDITIONAL(LINUX, false) 
     19AM_CONDITIONAL(BSD, false) 
     20AM_CONDITIONAL(DARWIN, false) 
     21 
     22case "$host_os" in 
     23*linux*) 
     24   AC_DEFINE(OS_LINUX) 
     25   AM_CONDITIONAL(LINUX, true) 
     26   OS="LINUX" 
     27   ;; 
     28*freebsd*) 
     29   AC_DEFINE(OS_BSD) 
     30   AC_DEFINE(OS_BSD_FREE) 
     31   AM_CONDITIONAL(BSD, true) 
     32   OS="FREEBSD" 
     33   ;; 
     34*openbsd*) 
     35   AC_DEFINE(OS_BSD) 
     36   AC_DEFINE(OS_BSD_OPEN) 
     37   AM_CONDITIONAL(BSD, true) 
     38   OS="OPENBSD" 
     39   ;; 
     40*netbsd*) 
     41   AC_DEFINE(OS_BSD) 
     42   AC_DEFINE(OS_BSD_NET) 
     43   AM_CONDITIONAL(BSD, true) 
     44   OS="NETBSD" 
     45   ;; 
     46*darwin*) 
     47   AC_DEFINE(OS_DARWIN) 
     48   AM_CONDITIONAL(DARWIN, true) 
     49   OS="DARWIN" 
     50   ;; 
     51*) 
     52   echo 
     53   echo "Error: Platform unknown." 
     54   echo 
     55   exit 1 
     56   ;; 
     57esac 
     58 
    859 
    960AC_ARG_ENABLE(debug,