From cde8f6b7ca9fda1ff1dd42ae380fd54abc81d8eb Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 29 Sep 2013 23:28:48 +0000 Subject: Final tweaks for the release candidate: * Test for betoh64(), otherwise use be64toh(). * In the Makefile, improve the explanation of STATIC. * Update VERSION and VDATE. --- Makefile | 16 +++++++++++----- config.h.post | 3 +++ test-betoh64.c | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 test-betoh64.c diff --git a/Makefile b/Makefile index 4c710aea..8ddbcc36 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,8 @@ # # CFLAGS += -DOSNAME="\"OpenBSD 5.4\"" -VERSION = 1.12.2 -VDATE = 18 September 2013 +VERSION = 1.12.2beta1 +VDATE = 30 September 2013 # IFF your system supports multi-byte functions (setlocale(), wcwidth(), # putwchar()) AND has __STDC_ISO_10646__ (that is, wchar_t is simply a @@ -25,10 +25,11 @@ CFLAGS += -DUSE_WCHAR # variable. #CFLAGS += -DUSE_MANPATH -# If your system supports static binaries only, uncomment this. This -# appears only to be BSD UNIX systems (Mac OS X has no support and Linux -# requires -pthreads for static libdb). +# If your system does not support static binaries, comment this, +# for example on Mac OS X. STATIC = -static +# Linux requires -pthread to statically link with libdb. +#STATIC += -pthread CFLAGS += -g -DHAVE_CONFIG_H -DVERSION="\"$(VERSION)\"" CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings @@ -156,6 +157,7 @@ SRCS = Makefile \ term.h \ term_ascii.c \ term_ps.c \ + test-betoh64.c \ test-fgetln.c \ test-getsubopt.c \ test-mmap.c \ @@ -411,6 +413,10 @@ config.h: config.h.pre config.h.post echo '#define HAVE_STRLCPY'; \ rm test-strlcpy; \ fi; \ + if $(CC) $(CFLAGS) -Werror -o test-betoh64 test-betoh64.c >> config.log 2>&1; then \ + echo '#define HAVE_BETOH64'; \ + rm test-betoh64; \ + fi; \ echo; \ cat config.h.post \ ) > $@ diff --git a/config.h.post b/config.h.post index d04dac99..81662381 100644 --- a/config.h.post +++ b/config.h.post @@ -15,6 +15,9 @@ # endif #endif +#ifndef HAVE_BETOH64 +#define betoh64(x) be64toh(x) +#endif #ifndef HAVE_STRLCAT extern size_t strlcat(char *, const char *, size_t); #endif diff --git a/test-betoh64.c b/test-betoh64.c new file mode 100644 index 00000000..602b9320 --- /dev/null +++ b/test-betoh64.c @@ -0,0 +1,16 @@ +#include + +#if defined(__linux__) +# include +#elif defined(__APPLE__) +# include +#endif + +int +main(int argc, char **argv) +{ + u_int64_t hostorder; + u_int64_t bigendian = 1; + hostorder = betoh64(bigendian); + return 0; +} -- cgit v1.2.3