diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2013-09-29 23:28:48 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2013-09-29 23:28:48 +0000 |
commit | cde8f6b7ca9fda1ff1dd42ae380fd54abc81d8eb (patch) | |
tree | 34fa0f1fdf4bc3a95297e4fe6ae6f613eba7e42f | |
parent | 5cd33719f3f2d7d7ceb9a649ed5dc80ab339ed6a (diff) | |
download | mandoc-cde8f6b7ca9fda1ff1dd42ae380fd54abc81d8eb.tar.gz mandoc-cde8f6b7ca9fda1ff1dd42ae380fd54abc81d8eb.tar.zst mandoc-cde8f6b7ca9fda1ff1dd42ae380fd54abc81d8eb.zip |
Final tweaks for the release candidate:
* Test for betoh64(), otherwise use be64toh().
* In the Makefile, improve the explanation of STATIC.
* Update VERSION and VDATE.
-rw-r--r-- | Makefile | 16 | ||||
-rw-r--r-- | config.h.post | 3 | ||||
-rw-r--r-- | test-betoh64.c | 16 |
3 files changed, 30 insertions, 5 deletions
@@ -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 <sys/types.h> + +#if defined(__linux__) +# include <endian.h> +#elif defined(__APPLE__) +# include <libkern/OSByteOrder.h> +#endif + +int +main(int argc, char **argv) +{ + u_int64_t hostorder; + u_int64_t bigendian = 1; + hostorder = betoh64(bigendian); + return 0; +} |