]> git.ipfire.org Git - people/ms/dma.git/commitdiff
flip the polarity of the compatibility macros to HAVE_*
authorSimon Schubert <2@0x2c.org>
Fri, 16 Apr 2010 18:02:59 +0000 (20:02 +0200)
committerSimon Schubert <2@0x2c.org>
Fri, 16 Apr 2010 18:21:36 +0000 (20:21 +0200)
BSDmakefile
Makefile
dfcompat.c
dfcompat.h

index 6e99f6dda15e196324466196bf5900a7761e7043..051f5642d7c01c4dd31abf3ec209e25087159a4e 100644 (file)
@@ -2,6 +2,7 @@
 #
 
 CFLAGS+= -I${.CURDIR}
+CFLAGS+= -DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME
 
 DPADD=  ${LIBSSL} ${LIBCRYPTO}
 LDADD=  -lssl -lcrypto
index 89db7aa8bb4d94775a7c4ab8e2670471fd785a55..0fa9a8e1626bb8c1b12b6ea81bc0ee2944ba2bbf 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,11 @@
 #
-# If you want to compile dma for Linux, you probably have to do:
-# make -f Makefile.plain CPPFLAGS="-DNEED_REALLOCF -DNEED_STRLCPY \
-#      -DNEED_GETPROGNAME"
+# Depending on your operating system, you might want to influence
+# the conditional inclusion of some helper functions:
+#
+# Define HAVE_* (in caps) if your system already provides:
+#   reallocf
+#   strlcpy
+#   getprogname
 #
 
 CC?=           gcc
index b5c9010002d9e49259e914117ece4548c2f6f15c..1f4a38a88227d0b5e844d72b2269063d39345f65 100644 (file)
@@ -1,4 +1,4 @@
-#ifdef NEED_STRLCPY
+#ifndef HAVE_STRLCPY
 
 /*
  * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -54,9 +54,9 @@ strlcpy(char *dst, const char *src, size_t siz)
        return(s - src - 1);    /* count does not include NUL */
 }
 
-#endif /* NEED_STRLCPY */
+#endif /* !HAVE_STRLCPY */
 
-#ifdef NEED_REALLOCF
+#ifndef HAVE_REALLOCF
 
 /*-
  * Copyright (c) 1998, M. Warner Losh <imp@freebsd.org>
@@ -99,9 +99,9 @@ reallocf(void *ptr, size_t size)
        return (nptr);
 }
 
-#endif /* NEED_REALLOCF */
+#endif /* !HAVE_REALLOCF */
 
-#ifdef NEED_GETPROGNAME
+#ifndef HAVE_GETPROGNAME
 
 #ifdef __GLIBC__
 
@@ -118,4 +118,4 @@ getprogname(void)
 #error "no getprogname implementation available"
 #endif
 
-#endif /* NEED_GETPROGNAME */
+#endif /* !HAVE_GETPROGNAME */
index fc962d15e66c2033e768dd3d42b5099cff371563..ea2363d970e642b2a10a9eef601c31945e06a39d 100644 (file)
@@ -7,15 +7,15 @@
 #define __DECONST(type, var)    ((type)(uintptr_t)(const void *)(var))
 #endif
 
-#ifdef NEED_STRLCPY
+#ifndef HAVE_STRLCPY
 size_t strlcpy(char *, const char *, size_t);
 #endif
 
-#ifdef NEED_REALLOCF
+#ifndef HAVE_REALLOCF
 void *reallocf(void *, size_t);
 #endif
 
-#ifdef NEED_GETPROGNAME
+#ifndef HAVE_GETPROGNAME
 const char *getprogname(void);
 #endif