pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/print/mupdf
Module Name: pkgsrc
Committed By: adam
Date: Wed Aug 14 05:55:33 UTC 2024
Modified Files:
pkgsrc/print/mupdf: buildlink3.mk distinfo options.mk
Added Files:
pkgsrc/print/mupdf/patches: patch-Makefile patch-Makerules
patch-source_fitz_crypt-sha2.c
Removed Files:
pkgsrc/print/mupdf/patches: patch-ab patch-ac patch-ae
Log Message:
mupdf: really disable FreeGLUT when not enabled as an option
To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 pkgsrc/print/mupdf/buildlink3.mk
cvs rdiff -u -r1.75 -r1.76 pkgsrc/print/mupdf/distinfo
cvs rdiff -u -r1.13 -r1.14 pkgsrc/print/mupdf/options.mk
cvs rdiff -u -r0 -r1.1 pkgsrc/print/mupdf/patches/patch-Makefile \
pkgsrc/print/mupdf/patches/patch-Makerules \
pkgsrc/print/mupdf/patches/patch-source_fitz_crypt-sha2.c
cvs rdiff -u -r1.29 -r0 pkgsrc/print/mupdf/patches/patch-ab
cvs rdiff -u -r1.32 -r0 pkgsrc/print/mupdf/patches/patch-ac
cvs rdiff -u -r1.5 -r0 pkgsrc/print/mupdf/patches/patch-ae
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/print/mupdf/buildlink3.mk
diff -u pkgsrc/print/mupdf/buildlink3.mk:1.55 pkgsrc/print/mupdf/buildlink3.mk:1.56
--- pkgsrc/print/mupdf/buildlink3.mk:1.55 Thu May 16 06:15:28 2024
+++ pkgsrc/print/mupdf/buildlink3.mk Wed Aug 14 05:55:32 2024
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.55 2024/05/16 06:15:28 wiz Exp $
+# $NetBSD: buildlink3.mk,v 1.56 2024/08/14 05:55:32 adam Exp $
BUILDLINK_TREE+= mupdf
@@ -6,7 +6,7 @@ BUILDLINK_TREE+= mupdf
MUPDF_BUILDLINK3_MK:=
BUILDLINK_API_DEPENDS.mupdf+= mupdf>=1.14.0
-BUILDLINK_ABI_DEPENDS.mupdf?= mupdf>=1.24.0nb1
+BUILDLINK_ABI_DEPENDS.mupdf+= mupdf>=1.24.0nb1
BUILDLINK_PKGSRCDIR.mupdf?= ../../print/mupdf
BUILDLINK_DEPMETHOD.mupdf?= build
Index: pkgsrc/print/mupdf/distinfo
diff -u pkgsrc/print/mupdf/distinfo:1.75 pkgsrc/print/mupdf/distinfo:1.76
--- pkgsrc/print/mupdf/distinfo:1.75 Wed May 15 21:00:43 2024
+++ pkgsrc/print/mupdf/distinfo Wed Aug 14 05:55:32 2024
@@ -1,15 +1,15 @@
-$NetBSD: distinfo,v 1.75 2024/05/15 21:00:43 wiz Exp $
+$NetBSD: distinfo,v 1.76 2024/08/14 05:55:32 adam Exp $
BLAKE2s (mupdf-1.24.0-source.tar.gz) = 03ff1288498b566ca601680786b435252e7d164d367ac5889429500d4a020f62
SHA512 (mupdf-1.24.0-source.tar.gz) = cb3b70341a924b524ddd20d5af00249a48bf79d9e05031648f95dd4121e1f125eb85ca70168b34db9fcf5251db705df599e327afde14549ee8627efe1d866811
Size (mupdf-1.24.0-source.tar.gz) = 55310611 bytes
+SHA1 (patch-Makefile) = bf98e521c067ba49ebc3e94894270bb76fa3f80c
SHA1 (patch-Makelists) = 714157e21b2b609ac4f0adacc73c3e3a2156640a
-SHA1 (patch-ab) = 3b299b39058897d4aeb51e6123a59f28841d7459
-SHA1 (patch-ac) = bf98e521c067ba49ebc3e94894270bb76fa3f80c
-SHA1 (patch-ae) = c6b113818b32cb4470e8549c00a16e0b2f364ede
+SHA1 (patch-Makerules) = 8308d5a6467abdad9d9fe0ad96aaeb4693f0a5cd
SHA1 (patch-docs_man_mupdf.1) = c2a2c1ad283428168a714adb634aa50cdd6a4aba
SHA1 (patch-platform_gl_gl-app.h) = 1e915249010acd3ff1343f0607e785d06577fe78
SHA1 (patch-platform_x11_curl__stream.c) = ccabcd665359ae00b76230a4ced22f360a0989e5
SHA1 (patch-platform_x11_pdfapp.c) = 33b53c845c6778614e4384a783a34d00b6814e74
+SHA1 (patch-source_fitz_crypt-sha2.c) = c6b113818b32cb4470e8549c00a16e0b2f364ede
SHA1 (patch-source_fitz_load-jpx.c) = 8d7f58168c8429a82127b821387298341a1fcbfb
SHA1 (patch-source_helpers_pkcs7_pkcs7-openssl.c) = f3e949de8bdfc55e2da402a5bc59b4baf04b0d55
Index: pkgsrc/print/mupdf/options.mk
diff -u pkgsrc/print/mupdf/options.mk:1.13 pkgsrc/print/mupdf/options.mk:1.14
--- pkgsrc/print/mupdf/options.mk:1.13 Thu Sep 7 14:36:54 2023
+++ pkgsrc/print/mupdf/options.mk Wed Aug 14 05:55:32 2024
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.13 2023/09/07 14:36:54 vins Exp $
+# $NetBSD: options.mk,v 1.14 2024/08/14 05:55:32 adam Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.mupdf
PKG_SUPPORTED_OPTIONS= curl opengl
@@ -30,6 +30,7 @@ PLIST.opengl= yes
.include "../../graphics/MesaLib/buildlink3.mk"
.include "../../graphics/freeglut/buildlink3.mk"
LDFLAGS+= -lGL # for glCallList
+MAKE_ENV+= HAVE_GLUT=yes
.else
MAKE_ENV+= HAVE_GLUT=no
.endif
Added files:
Index: pkgsrc/print/mupdf/patches/patch-Makefile
diff -u /dev/null pkgsrc/print/mupdf/patches/patch-Makefile:1.1
--- /dev/null Wed Aug 14 05:55:33 2024
+++ pkgsrc/print/mupdf/patches/patch-Makefile Wed Aug 14 05:55:32 2024
@@ -0,0 +1,146 @@
+$NetBSD: patch-Makefile,v 1.1 2024/08/14 05:55:32 adam Exp $
+
+- Install target cleanup
+- Also install muthreads and mupkcs7 libraries (needed by various tools)
+- Use sh instead of bash
+
+--- Makefile.orig 2024-03-19 15:31:58.000000000 +0000
++++ Makefile
+@@ -237,10 +237,10 @@ endif
+
+ FONT_GEN := $(FONT_BIN:%=generated/%.c)
+
+-generated/%.cff.c : %.cff $(HEXDUMP_SH) ; $(QUIET_GEN) $(MKTGTDIR) ; bash $(HEXDUMP_SH) > $@ $<
+-generated/%.otf.c : %.otf $(HEXDUMP_SH) ; $(QUIET_GEN) $(MKTGTDIR) ; bash $(HEXDUMP_SH) > $@ $<
+-generated/%.ttf.c : %.ttf $(HEXDUMP_SH) ; $(QUIET_GEN) $(MKTGTDIR) ; bash $(HEXDUMP_SH) > $@ $<
+-generated/%.ttc.c : %.ttc $(HEXDUMP_SH) ; $(QUIET_GEN) $(MKTGTDIR) ; bash $(HEXDUMP_SH) > $@ $<
++generated/%.cff.c : %.cff $(HEXDUMP_SH) ; $(QUIET_GEN) $(MKTGTDIR) ; sh $(HEXDUMP_SH) > $@ $<
++generated/%.otf.c : %.otf $(HEXDUMP_SH) ; $(QUIET_GEN) $(MKTGTDIR) ; sh $(HEXDUMP_SH) > $@ $<
++generated/%.ttf.c : %.ttf $(HEXDUMP_SH) ; $(QUIET_GEN) $(MKTGTDIR) ; sh $(HEXDUMP_SH) > $@ $<
++generated/%.ttc.c : %.ttc $(HEXDUMP_SH) ; $(QUIET_GEN) $(MKTGTDIR) ; sh $(HEXDUMP_SH) > $@ $<
+
+ ifeq ($(HAVE_OBJCOPY),yes)
+ MUPDF_OBJ += $(FONT_BIN:%=$(OUT)/%.o)
+@@ -465,55 +465,59 @@ tools: $(TOOL_APPS)
+ apps: $(TOOL_APPS) $(VIEW_APPS)
+
+ install-headers:
+- install -d $(DESTDIR)$(incdir)/mupdf
+- install -d $(DESTDIR)$(incdir)/mupdf/fitz
+- install -d $(DESTDIR)$(incdir)/mupdf/pdf
+- install -m 644 include/mupdf/*.h $(DESTDIR)$(incdir)/mupdf
+- install -m 644 include/mupdf/fitz/*.h $(DESTDIR)$(incdir)/mupdf/fitz
+- install -m 644 include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(incdir)/mupdf
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(incdir)/mupdf/fitz
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(incdir)/mupdf/pdf
++ ${BSD_INSTALL_DATA} include/mupdf/*.h $(DESTDIR)$(incdir)/mupdf
++ ${BSD_INSTALL_DATA} include/mupdf/fitz/*.h $(DESTDIR)$(incdir)/mupdf/fitz
++ ${BSD_INSTALL_DATA} include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf
+
+ install-libs: libs install-headers
+ ifneq ($(LIBS_TO_INSTALL_IN_LIB),)
+- install -d $(DESTDIR)$(libdir)
+- install -m 644 $(LIBS_TO_INSTALL_IN_LIB) $(DESTDIR)$(libdir)
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(libdir)
++ for f in $(LIBS_TO_INSTALL_IN_LIB); do \
++ ${BSD_INSTALL_LIB} $$f $(DESTDIR)$(libdir); \
++ done
+ endif
+
+ install-apps: apps
+- install -d $(DESTDIR)$(bindir)
+- install -m 755 $(LIBS_TO_INSTALL_IN_BIN) $(TOOL_APPS) $(VIEW_APPS) $(DESTDIR)$(bindir)
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(bindir)
++ for f in $(LIBS_TO_INSTALL_IN_BIN) $(TOOL_APPS) $(VIEW_APPS); do \
++ ${BSD_INSTALL_LIB} $$f $(DESTDIR)$(bindir); \
++ done
+
+ install-docs:
+- install -d $(DESTDIR)$(mandir)/man1
+- install -m 644 docs/man/*.1 $(DESTDIR)$(mandir)/man1
++ ${BSD_INSTALL_MAN_DIR} $(DESTDIR)$(mandir)/man1
++ ${BSD_INSTALL_MAN} docs/man/*.1 $(DESTDIR)$(mandir)/man1
+
+- install -d $(DESTDIR)$(docdir)
+- install -d $(DESTDIR)$(docdir)/examples
+- install -m 644 README CHANGES $(DESTDIR)$(docdir)
+- install -m 644 $(wildcard COPYING LICENSE) $(DESTDIR)$(docdir)
+- install -m 644 docs/examples/* $(DESTDIR)$(docdir)/examples
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(docdir)
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(docdir)/examples
++ ${BSD_INSTALL_DATA} README CHANGES $(DESTDIR)$(docdir)
++ ${BSD_INSTALL_DATA} $(wildcard COPYING LICENSE) $(DESTDIR)$(docdir)
++ ${BSD_INSTALL_DATA} docs/examples/* $(DESTDIR)$(docdir)/examples
+
+ install: install-libs install-apps install-docs
+
+ install-docs-html:
+ python3 scripts/build-docs.py
+- install -d $(DESTDIR)$(docdir)
+- install -d $(DESTDIR)$(docdir)/_images
+- install -d $(DESTDIR)$(docdir)/_static
+- install -d $(DESTDIR)$(docdir)/_static/js
+- install -d $(DESTDIR)$(docdir)/_static/css
+- install -d $(DESTDIR)$(docdir)/_static/css/fonts
+- install -m 644 build/docs/html/*.html $(DESTDIR)$(docdir)
+- install -m 644 build/docs/html/*.inv $(DESTDIR)$(docdir)
+- install -m 644 build/docs/html/*.js $(DESTDIR)$(docdir)
+- install -m 644 build/docs/html/_images/* $(DESTDIR)$(docdir)/_images
+- install -m 644 build/docs/html/_static/*.css $(DESTDIR)$(docdir)/_static
+- install -m 644 build/docs/html/_static/*.ico $(DESTDIR)$(docdir)/_static
+- install -m 644 build/docs/html/_static/*.js $(DESTDIR)$(docdir)/_static
+- install -m 644 build/docs/html/_static/*.png $(DESTDIR)$(docdir)/_static
+- install -m 644 build/docs/html/_static/*.svg $(DESTDIR)$(docdir)/_static
+- install -m 644 build/docs/html/_static/js/* $(DESTDIR)$(docdir)/_static/js
+- install -m 644 build/docs/html/_static/css/*.css $(DESTDIR)$(docdir)/_static/css
+- install -m 644 build/docs/html/_static/css/fonts/* $(DESTDIR)$(docdir)/_static/css/fonts
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(docdir)
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(docdir)/_images
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(docdir)/_static
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(docdir)/_static/js
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(docdir)/_static/css
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(docdir)/_static/css/fonts
++ ${BSD_INSTALL_DATA} build/docs/html/*.html $(DESTDIR)$(docdir)
++ ${BSD_INSTALL_DATA} build/docs/html/*.inv $(DESTDIR)$(docdir)
++ ${BSD_INSTALL_DATA} build/docs/html/*.js $(DESTDIR)$(docdir)
++ ${BSD_INSTALL_DATA} build/docs/html/_images/* $(DESTDIR)$(docdir)/_images
++ ${BSD_INSTALL_DATA} build/docs/html/_static/*.css $(DESTDIR)$(docdir)/_static
++ ${BSD_INSTALL_DATA} build/docs/html/_static/*.ico $(DESTDIR)$(docdir)/_static
++ ${BSD_INSTALL_DATA} build/docs/html/_static/*.js $(DESTDIR)$(docdir)/_static
++ ${BSD_INSTALL_DATA} build/docs/html/_static/*.png $(DESTDIR)$(docdir)/_static
++ ${BSD_INSTALL_DATA} build/docs/html/_static/*.svg $(DESTDIR)$(docdir)/_static
++ ${BSD_INSTALL_DATA} build/docs/html/_static/js/* $(DESTDIR)$(docdir)/_static/js
++ ${BSD_INSTALL_DATA} build/docs/html/_static/css/*.css $(DESTDIR)$(docdir)/_static/css
++ ${BSD_INSTALL_DATA} build/docs/html/_static/css/fonts/* $(DESTDIR)$(docdir)/_static/css/fonts
+
+ tarball:
+ bash scripts/archive.sh
+@@ -638,23 +642,23 @@ ifneq ($(USE_SYSTEM_LIBS),yes)
+ endif
+
+ install-shared-c: install-shared-check shared install-headers
+- install -d $(DESTDIR)$(libdir)
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(libdir)
+ install -m $(SO_INSTALL_MODE) $(OUT)/libmupdf.$(SO)$(SO_VERSION) $(DESTDIR)$(libdir)/
+ ifneq ($(OS),OpenBSD)
+ ln -sf libmupdf.$(SO)$(SO_VERSION) $(DESTDIR)$(libdir)/libmupdf.$(SO)
+ endif
+
+ install-shared-c++: install-shared-c c++
+- install -m 644 platform/c++/include/mupdf/*.h $(DESTDIR)$(incdir)/mupdf
++ ${BSD_INSTALL_DATA} platform/c++/include/mupdf/*.h $(DESTDIR)$(incdir)/mupdf
+ install -m $(SO_INSTALL_MODE) $(OUT)/libmupdfcpp.$(SO)$(SO_VERSION) $(DESTDIR)$(libdir)/
+ ifneq ($(OS),OpenBSD)
+ ln -sf libmupdfcpp.$(SO)$(SO_VERSION) $(DESTDIR)$(libdir)/libmupdfcpp.$(SO)
+ endif
+
+ install-shared-python: install-shared-c++ python
+- install -d $(DESTDIR)$(pydir)/mupdf
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(pydir)/mupdf
+ install -m $(SO_INSTALL_MODE) $(OUT)/_mupdf.$(SO) $(DESTDIR)$(pydir)/mupdf
+- install -m 644 $(OUT)/mupdf.py $(DESTDIR)$(pydir)/mupdf/__init__.py
++ ${BSD_INSTALL_DATA} $(OUT)/mupdf.py $(DESTDIR)$(pydir)/mupdf/__init__.py
+
+ else
+
Index: pkgsrc/print/mupdf/patches/patch-Makerules
diff -u /dev/null pkgsrc/print/mupdf/patches/patch-Makerules:1.1
--- /dev/null Wed Aug 14 05:55:33 2024
+++ pkgsrc/print/mupdf/patches/patch-Makerules Wed Aug 14 05:55:32 2024
@@ -0,0 +1,109 @@
+$NetBSD: patch-Makerules,v 1.1 2024/08/14 05:55:32 adam Exp $
+
+- Handle the various operating systems in the same way avoiding hardcoding
+- Avoid to use objcopy by setting HAVE_OBJCOPY to no (if `yes', and with
+ `USE_TOOLS+= objcopy' the objcopy-ing fails as follow:
+ OBJCOPY build/release/resources/fonts/urw/Dingbats.cff.o
+ build/release/resources/fonts/urw/Dingbats.cff.o:1: warning: NUL character seen; rest of line ignored
+ build/release/resources/fonts/urw/Dingbats.cff.o:1: *** missing separator. Stop.
+ (also for other fonts)). This needs to be investigated further.
+- Avoid internal version of freeglut and try to pick it up via pkg-config and
+ set SYS_GLUT_{CFLAGS,LIBS} accordingly.
+
+--- Makerules.orig 2024-03-19 15:31:58.000000000 +0000
++++ Makerules
+@@ -48,30 +48,6 @@ endif
+
+ # System specific features
+
+-ifeq ($(findstring -fembed-bitcode,$(XCFLAGS)),)
+- # clang does not support these in combination with -fembed-bitcode
+- CFLAGS += -ffunction-sections -fdata-sections
+-endif
+-
+-ifeq ($(OS),MACOS)
+- LDREMOVEUNREACH := -Wl,-dead_strip
+- SO := dylib
+-else
+- LDREMOVEUNREACH := -Wl,--gc-sections
+- ifeq ($(OS),MINGW)
+- SO := dll
+- EXE := .exe
+- else
+- SO := so
+- endif
+-endif
+-
+-ifeq "$(OS)" "ios"
+- NEONFLAGS =
+-else
+- NEONFLAGS = -mneon
+-endif
+-
+ SANITIZE_FLAGS += -fsanitize=address
+ SANITIZE_FLAGS += -fsanitize=leak
+
+@@ -178,37 +154,7 @@ ifeq ($(OS),OpenBSD)
+ LINUX_OR_OPENBSD := yes
+ endif
+
+-ifeq ($(OS),MINGW)
+- WINDRES := windres
+- HAVE_WIN32 := yes
+-
+-else ifeq ($(OS),MACOS)
+- HAVE_GLUT := yes
+- SYS_GLUT_CFLAGS := -Wno-deprecated-declarations
+- SYS_GLUT_LIBS := -framework GLUT -framework OpenGL
+- CC = xcrun cc
+- AR = xcrun ar
+- LD = xcrun ld
+- RANLIB = xcrun ranlib
+-
+- ifneq ($(ARCHFLAGS),)
+- $(warning "MacOS with ARCHFLAGS set. Assuming we are building for arm64, and setting HAVE_LIBCRYPTO to no.")
+- HAVE_LIBCRYPTO := no
+- else ifeq (, $(shell command -v pkg-config))
+- $(warning "No pkg-config found, install it for proper integration of libcrypto")
+- else
+- HAVE_LIBCRYPTO := $(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)
+- ifeq ($(HAVE_LIBCRYPTO),yes)
+- LIBCRYPTO_CFLAGS := $(shell pkg-config --cflags libcrypto) -DHAVE_LIBCRYPTO
+- LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
+- endif
+- endif
+-
+-else ifeq ($(LINUX_OR_OPENBSD),yes)
+-
+- ifeq ($(OS),Linux)
+- HAVE_OBJCOPY := yes
+- endif
++HAVE_OBJCOPY := no
+
+ ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
+ SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
+@@ -263,15 +209,9 @@ else ifeq ($(LINUX_OR_OPENBSD),yes)
+ SYS_CURL_LIBS := $(shell pkg-config --libs libcurl)
+ endif
+
+- HAVE_GLUT := yes
+ ifeq ($(HAVE_GLUT),yes)
+- ifeq ($(OS),OpenBSD)
+ SYS_GLUT_CFLAGS := $(shell pkg-config --cflags glut gl)
+ SYS_GLUT_LIBS := $(shell pkg-config --libs glut gl)
+- else
+- SYS_GLUT_CFLAGS :=
+- SYS_GLUT_LIBS := -lglut -lGL
+- endif
+ endif
+
+ HAVE_X11 := $(shell pkg-config --exists x11 xext && echo yes)
+@@ -294,8 +234,6 @@ else ifeq ($(LINUX_OR_OPENBSD),yes)
+ PTHREAD_LIBS := -lpthread
+ endif
+
+-endif
+-
+ # The following section has various cross compilation configurations.
+ #
+ # Invoke these as:
Index: pkgsrc/print/mupdf/patches/patch-source_fitz_crypt-sha2.c
diff -u /dev/null pkgsrc/print/mupdf/patches/patch-source_fitz_crypt-sha2.c:1.1
--- /dev/null Wed Aug 14 05:55:33 2024
+++ pkgsrc/print/mupdf/patches/patch-source_fitz_crypt-sha2.c Wed Aug 14 05:55:33 2024
@@ -0,0 +1,82 @@
+$NetBSD: patch-source_fitz_crypt-sha2.c,v 1.1 2024/08/14 05:55:33 adam Exp $
+
+Avoid namespace conflicts with bswap(3).
+
+--- source/fitz/crypt-sha2.c.orig 2015-11-10 16:19:51.000000000 +0000
++++ source/fitz/crypt-sha2.c
+@@ -17,7 +17,7 @@ static inline int isbigendian(void)
+ return *(char*)&one == 0;
+ }
+
+-static inline unsigned int bswap32(unsigned int num)
++static inline unsigned int mup_bswap32(unsigned int num)
+ {
+ return ( (((num) << 24))
+ | (((num) << 8) & 0x00FF0000)
+@@ -25,7 +25,7 @@ static inline unsigned int bswap32(unsig
+ | (((num) >> 24)) );
+ }
+
+-static inline uint64_t bswap64(uint64_t num)
++static inline uint64_t mup_bswap64(uint64_t num)
+ {
+ return ( (((num) << 56))
+ | (((num) << 40) & 0x00FF000000000000ULL)
+@@ -99,7 +99,7 @@ transform256(unsigned int state[8], unsi
+ /* ensure big-endian integers */
+ if (!isbigendian())
+ for (j = 0; j < 16; j++)
+- data[j] = bswap32(data[j]);
++ data[j] = mup_bswap32(data[j]);
+
+ /* Copy state[] to working vars. */
+ memcpy(T, state, sizeof(T));
+@@ -192,8 +192,8 @@ void fz_sha256_final(fz_sha256 *context,
+
+ if (!isbigendian())
+ {
+- context->buffer.u32[14] = bswap32(context->count[1]);
+- context->buffer.u32[15] = bswap32(context->count[0]);
++ context->buffer.u32[14] = mup_bswap32(context->count[1]);
++ context->buffer.u32[15] = mup_bswap32(context->count[0]);
+ }
+ else
+ {
+@@ -204,7 +204,7 @@ void fz_sha256_final(fz_sha256 *context,
+
+ if (!isbigendian())
+ for (j = 0; j < 8; j++)
+- context->state[j] = bswap32(context->state[j]);
++ context->state[j] = mup_bswap32(context->state[j]);
+
+ memcpy(digest, &context->state[0], 32);
+ memset(context, 0, sizeof(fz_sha256));
+@@ -271,7 +271,7 @@ transform512(uint64_t state[8], uint64_t
+ /* ensure big-endian integers */
+ if (!isbigendian())
+ for (j = 0; j < 16; j++)
+- data[j] = bswap64(data[j]);
++ data[j] = mup_bswap64(data[j]);
+
+ /* Copy state[] to working vars. */
+ memcpy(T, state, sizeof(T));
+@@ -364,8 +364,8 @@ void fz_sha512_final(fz_sha512 *context,
+
+ if (!isbigendian())
+ {
+- context->buffer.u64[14] = bswap64(context->count[1]);
+- context->buffer.u64[15] = bswap64(context->count[0]);
++ context->buffer.u64[14] = mup_bswap64(context->count[1]);
++ context->buffer.u64[15] = mup_bswap64(context->count[0]);
+ }
+ else
+ {
+@@ -376,7 +376,7 @@ void fz_sha512_final(fz_sha512 *context,
+
+ if (!isbigendian())
+ for (j = 0; j < 8; j++)
+- context->state[j] = bswap64(context->state[j]);
++ context->state[j] = mup_bswap64(context->state[j]);
+
+ memcpy(digest, &context->state[0], 64);
+ memset(context, 0, sizeof(fz_sha512));
Home |
Main Index |
Thread Index |
Old Index