瀏覽代碼

libdpkg: Always use C99 variadic macros

As the build requires them anyway, we avoid exposing the configure
variable HAVE_C99, which was never defined for the installed headers.
Guillem Jover 16 年之前
父節點
當前提交
6fdc753382
共有 4 個文件被更改,包括 2 次插入46 次删除
  1. 2 0
      debian/changelog
  2. 0 37
      lib/dpkg/buffer.h
  3. 0 4
      lib/dpkg/dpkg.h
  4. 0 5
      utils/install-info.c

+ 2 - 0
debian/changelog

@@ -1,6 +1,8 @@
 dpkg (1.15.6.1) UNRELEASED; urgency=low
 dpkg (1.15.6.1) UNRELEASED; urgency=low
 
 
   * Fix two memory leaks introduced in 1.15.6.
   * Fix two memory leaks introduced in 1.15.6.
+  * Always use C99 variadic macros, as the build requires them anyway, we
+    avoid exposing the configure variable HAVE_C99 on installed headers.
 
 
  -- Guillem Jover <guillem@debian.org>  Sat, 13 Mar 2010 05:23:34 +0100
  -- Guillem Jover <guillem@debian.org>  Sat, 13 Mar 2010 05:23:34 +0100
 
 

+ 0 - 37
lib/dpkg/buffer.h

@@ -51,7 +51,6 @@ struct buffer_data {
 # define buffer_md5(buf, hash, limit) \
 # define buffer_md5(buf, hash, limit) \
 	buffer_hash(buf, hash, BUFFER_WRITE_MD5, limit)
 	buffer_hash(buf, hash, BUFFER_WRITE_MD5, limit)
 
 
-#if HAVE_C99
 # define fd_md5(fd, hash, limit, ...) \
 # define fd_md5(fd, hash, limit, ...) \
 	buffer_copy_IntPtr(fd, BUFFER_READ_FD, hash, BUFFER_WRITE_MD5, \
 	buffer_copy_IntPtr(fd, BUFFER_READ_FD, hash, BUFFER_WRITE_MD5, \
 	                   limit, __VA_ARGS__)
 	                   limit, __VA_ARGS__)
@@ -86,42 +85,6 @@ struct buffer_data {
 # define stream_fd_copy(file, fd, limit, ...) \
 # define stream_fd_copy(file, fd, limit, ...) \
 	buffer_copy_PtrInt(file, BUFFER_READ_STREAM, fd, BUFFER_WRITE_FD, \
 	buffer_copy_PtrInt(file, BUFFER_READ_STREAM, fd, BUFFER_WRITE_FD, \
 	                   limit, __VA_ARGS__)
 	                   limit, __VA_ARGS__)
-#else /* HAVE_C99 */
-# define fd_md5(fd, hash, limit, desc...) \
-	buffer_copy_IntPtr(fd, BUFFER_READ_FD, hash, BUFFER_WRITE_MD5, \
-	                   limit, desc)
-# define stream_md5(file, hash, limit, desc...) \
-	buffer_copy_PtrPtr(file, BUFFER_READ_STREAM, hash, BUFFER_WRITE_MD5, \
-	                   limit, desc)
-# define fd_fd_copy(fd1, fd2, limit, desc...) \
-	buffer_copy_IntInt(fd1, BUFFER_READ_FD, fd2, BUFFER_WRITE_FD, \
-	                   limit, desc)
-# define fd_buf_copy(fd, buf, limit, desc...) \
-	buffer_copy_IntPtr(fd, BUFFER_READ_FD, buf, BUFFER_WRITE_BUF, \
-	                   limit, desc)
-# define fd_vbuf_copy(fd, buf, limit, desc...) \
-	buffer_copy_IntPtr(fd, BUFFER_READ_FD, buf, BUFFER_WRITE_VBUF, \
-	                   limit, desc)
-# define fd_null_copy(fd, limit, desc...) \
-	if (lseek(fd, limit, SEEK_CUR) == -1) { \
-		if (errno != ESPIPE) \
-			ohshite(desc); \
-		buffer_copy_IntPtr(fd, BUFFER_READ_FD, \
-		                   NULL, BUFFER_WRITE_NULL, \
-		                   limit, desc); \
-	}
-# define stream_null_copy(file, limit, desc...) \
-	if (fseek(file, limit, SEEK_CUR) == -1) { \
-		if (errno != EBADF) \
-			ohshite(desc); \
-		buffer_copy_PtrPtr(file, BUFFER_READ_STREAM, \
-		                   NULL, BUFFER_WRITE_NULL, \
-		                   limit, desc); \
-	}
-# define stream_fd_copy(file, fd, limit, desc...)\
-	buffer_copy_PtrInt(file, BUFFER_READ_STREAM, fd, BUFFER_WRITE_FD, \
-	                   limit, desc)
-#endif /* HAVE_C99 */
 
 
 off_t buffer_copy_PtrInt(void *p, int typeIn, int i, int typeOut,
 off_t buffer_copy_PtrInt(void *p, int typeIn, int i, int typeOut,
                          off_t limit, const char *desc,
                          off_t limit, const char *desc,

+ 0 - 4
lib/dpkg/dpkg.h

@@ -140,11 +140,7 @@ enum { ehflag_normaltidy=01, ehflag_bombout=02, ehflag_recursiveerror=04 };
 
 
 void do_internerr(const char *file, int line, const char *fmt, ...)
 void do_internerr(const char *file, int line, const char *fmt, ...)
 	DPKG_ATTR_NORET DPKG_ATTR_PRINTF(3);
 	DPKG_ATTR_NORET DPKG_ATTR_PRINTF(3);
-#if HAVE_C99
 #define internerr(...) do_internerr(__FILE__, __LINE__, __VA_ARGS__)
 #define internerr(...) do_internerr(__FILE__, __LINE__, __VA_ARGS__)
-#else
-#define internerr(args...) do_internerr(__FILE__, __LINE__, args)
-#endif
 
 
 void ohshit(const char *fmt, ...) DPKG_ATTR_NORET DPKG_ATTR_PRINTF(1);
 void ohshit(const char *fmt, ...) DPKG_ATTR_NORET DPKG_ATTR_PRINTF(1);
 void ohshitv(const char *fmt, va_list al) DPKG_ATTR_NORET DPKG_ATTR_VPRINTF(1);
 void ohshitv(const char *fmt, va_list al) DPKG_ATTR_NORET DPKG_ATTR_VPRINTF(1);

+ 0 - 5
utils/install-info.c

@@ -29,13 +29,8 @@
 #define SELF "/usr/sbin/install-info"
 #define SELF "/usr/sbin/install-info"
 #define WRAPPED "/usr/bin/install-info"
 #define WRAPPED "/usr/bin/install-info"
 
 
-#if HAVE_C99
 #define warn(...) fprintf(stderr, "install-info: warning: " __VA_ARGS__)
 #define warn(...) fprintf(stderr, "install-info: warning: " __VA_ARGS__)
 #define error(...) fprintf(stderr, "install-info: error: " __VA_ARGS__)
 #define error(...) fprintf(stderr, "install-info: error: " __VA_ARGS__)
-#else
-#define warn(msg...) fprintf(stderr, "install-info: warning: " msg)
-#define error(msg...) fprintf(stderr, "install-info: error: " msg)
-#endif
 
 
 int
 int
 main(int argc, char **argv)
 main(int argc, char **argv)