Changeset 18777 for trunk


Ignore:
Timestamp:
Jul 28, 2006, 8:14:12 AM (14 years ago)
Author:
pguyot (Paul Guyot)
Message:

Add sys/paths to configure.ac.
Get darwintrace.c to compile on foreign systems.

Location:
trunk/base
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/configure

    r18776 r18777  
    44794479
    44804480
     4481
    44814482for ac_header in limits.h paths.h sys/file.h crt_externs.h fcntl.h sys/fcntl.h sys/cdefs.h err.h libgen.h sys/socket.h \
    4482         readline/readline.h readline/history.h pwd.h
     4483        readline/readline.h readline/history.h pwd.h sys/paths.h
    44834484do
    44844485as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
  • trunk/base/configure.ac

    r18776 r18777  
    6666AC_HEADER_STAT
    6767AC_CHECK_HEADERS([limits.h paths.h sys/file.h crt_externs.h fcntl.h sys/fcntl.h sys/cdefs.h err.h libgen.h sys/socket.h \
    68         readline/readline.h readline/history.h pwd.h])
     68        readline/readline.h readline/history.h pwd.h sys/paths.h])
    6969
    7070INCLUDES="-I.. -I. $INCLUDES"
  • trunk/base/src/config.h.in

    r18776 r18777  
    183183#undef HAVE_SYS_NDIR_H
    184184
     185/* Define to 1 if you have the <sys/paths.h> header file. */
     186#undef HAVE_SYS_PATHS_H
     187
    185188/* Define to 1 if you have the <sys/socket.h> header file. */
    186189#undef HAVE_SYS_SOCKET_H
  • trunk/base/src/darwintracelib1.0/darwintrace.c

    r18769 r18777  
    44 * All rights reserved.
    55 *
    6  * $Id: darwintrace.c,v 1.17 2006/07/27 22:45:30 pguyot Exp $
     6 * $Id: darwintrace.c,v 1.18 2006/07/28 08:14:12 pguyot Exp $
    77 *
    88 * @APPLE_BSD_LICENSE_HEADER_START@
     
    4343#endif
    4444
     45#ifdef HAVE_SYS_PATHS_H
     46#include <sys/paths.h>
     47#endif
     48
    4549#include <fcntl.h>
    4650#include <stdarg.h>
     
    5256#include <sys/param.h>
    5357#include <sys/syscall.h>
    54 #include <sys/paths.h>
    5558#include <errno.h>
    56 #include <sys/cdefs.h>
     59
     60#ifndef HAVE_STRLCPY
     61/* Define strlcpy if it's not available. */
     62size_t strlcpy(char* dst, const char* src, size_t size);
     63size_t strlcpy(char* dst, const char* src, size_t size)
     64{
     65        size_t result = strlen(src);
     66        if (size > 0)
     67        {
     68                size_t copylen = size - 1;
     69                if (copylen > result)
     70                {
     71                        copylen = result;
     72                }
     73                memcpy(dst, src, copylen);
     74                dst[copylen] = 0;
     75        }
     76        return result;
     77}
     78#endif
    5779
    5880/*
     
    294316 */
    295317inline void __darwintrace_cleanup_path(char *path) {
    296   size_t pathlen, rsrclen;
     318  size_t pathlen;
     319#ifdef __APPLE__
     320  size_t rsrclen;
     321#endif
    297322  size_t i, shiftamount;
    298323  enum { SAWSLASH, NOTHING } state = NOTHING;
     
    300325  /* if this is a foo/..namedfork/rsrc, strip it off */
    301326  pathlen = strlen(path);
     327  /* ..namedfork/rsrc is only on OS X */
     328#ifdef __APPLE__
    302329  rsrclen = strlen(_PATH_RSRCFORKSPEC);
    303330  if(pathlen > rsrclen
     
    307334    pathlen -= rsrclen;
    308335  }
     336#endif
    309337
    310338  /* for each position in string (including
Note: See TracChangeset for help on using the changeset viewer.