From 0d3649e30daa809ba2ed56508db98188797ad1c4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 18 May 2005 19:28:21 +0000 Subject: Include canonicalize.h first, to test interface. Include unconditionally, since we assume C89 now. All uses of PTR_INT_TYPE replaced by ptrdiff_t. --- lib/canonicalize.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'lib') diff --git a/lib/canonicalize.c b/lib/canonicalize.c index ba60248d9..822fe6f75 100644 --- a/lib/canonicalize.c +++ b/lib/canonicalize.c @@ -20,6 +20,8 @@ # include #endif +#include "canonicalize.h" + #ifdef STDC_HEADERS # include #else @@ -43,6 +45,7 @@ void free (); #endif #include +#include #include "cycle-check.h" #include "path-concat.h" @@ -54,24 +57,6 @@ void free (); # define __set_errno(Val) errno = (Val) #endif -/* If __PTRDIFF_TYPE__ is - defined, as with GNU C, use that; that way we don't pollute the - namespace with 's symbols. Otherwise, if is - available, include it and use ptrdiff_t. In traditional C, long is - the best that we can do. */ - -#ifdef __PTRDIFF_TYPE__ -# define PTR_INT_TYPE __PTRDIFF_TYPE__ -#else -# ifdef HAVE_STDDEF_H -# include -# define PTR_INT_TYPE ptrdiff_t -# else -# define PTR_INT_TYPE long -# endif -#endif - -#include "canonicalize.h" #include "pathmax.h" #include "xreadlink.h" @@ -230,7 +215,7 @@ canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode) if (dest + (end - start) >= rpath_limit) { - PTR_INT_TYPE dest_offset = dest - rpath; + ptrdiff_t dest_offset = dest - rpath; size_t new_size = rpath_limit - rpath; if (end - start + 1 > PATH_MAX) -- cgit v1.2.3-54-g00ecf