Changeset 2322


Ignore:
Timestamp:
Jul 10, 2007, 11:30:11 AM (15 years ago)
Author:
titer
Message:

Adds basename/dirname implementation for platforms that lack it (BeOS...)

Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r2307 r2322  
    14761476                                        "-DHAVE_STRLCPY",
    14771477                                        "-DHAVE_STRLCAT",
     1478                                        "-DHAVE_LIBGEN",
    14781479                                );
    14791480                                PRODUCT_NAME = transmission;
  • trunk/configure

    r1750 r2322  
    177177  then
    178178    CFLAGS="$CFLAGS -DHAVE_STRLCAT"
     179  fi
     180  rm -f testconf*
     181}
     182
     183libgen_test()
     184{
     185  verbose libgen_test
     186  cat > testconf.c << EOF
     187#include <libgen.h>
     188int main()
     189{
     190  return 0;
     191}
     192EOF
     193  if runcmd $CC -o testconf testconf.c
     194  then
     195    CFLAGS="$CFLAGS -DHAVE_LIBGEN"
    179196  fi
    180197  rm -f testconf*
     
    451468strlcpy_test
    452469strlcat_test
     470libgen_test
    453471
    454472#
  • trunk/libtransmission/makemeta.c

    r2311 r2322  
    1313#include <sys/stat.h>
    1414#include <unistd.h>
    15 #include <libgen.h>
    1615#include <dirent.h>
    1716#include <stdio.h> /* FILE, snprintf, stderr */
  • trunk/libtransmission/trcompat.h

    r2311 r2322  
    3737#endif
    3838
     39#ifdef HAVE_LIBGEN
     40# include <libgen.h>
     41#else
     42char *
     43dirname(const char *path);
     44char *
     45basename(const char *path);
     46#endif
     47
    3948#endif /* TRCOMPAT_H */
  • trunk/mk/lib.mk

    r2306 r2322  
    77       http.c inout.c ipcparse.c list.c makemeta.c metainfo.c natpmp.c \
    88       net.c peer.c platform.c ratecontrol.c sha1.c shared.c strlcat.c \
    9        strlcpy.c torrent.c tracker.c transmission.c upnp.c utils.c xml.c
     9       strlcpy.c torrent.c tracker.c transmission.c upnp.c utils.c xml.c \
     10       basename.c dirname.c
    1011
    1112OBJS = $(SRCS:%.c=%.o)
Note: See TracChangeset for help on using the changeset viewer.