summaryrefslogtreecommitdiff
path: root/print/ghostscript7-x11/files/patch-src-gxfixed.h
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2015-08-22 17:48:35 +0000
committerHiroki Sato <hrs@FreeBSD.org>2015-08-22 17:48:35 +0000
commit27470e1676e69455acf06ae25ebd42ebd5bdecdb (patch)
tree445c3e315f03aa972de87391f921c655e4634f60 /print/ghostscript7-x11/files/patch-src-gxfixed.h
parentRemove textproc/prosper. The latest version is included in (diff)
- Split ghostscript into X11-independent and -dependent parts:
* print/ghostscript{7,8,9,9-agpl}-base Installs Ghostscript binary, libgs, and related files. These ports do not depend on X11 libraries (i.e. x11* devices are not available). USES=ghostscript will set dependency on one of them depending on GHOSTSCRIPT_DEFAULT. The default device is set to "display" or "bbox". * print/ghostscript{7,8,9,9-agpl}-x11 Installs a shared library which provides X11 support to the installed Ghostscript binaries. x11* devices will be enabled when the library is available. This depends on *-base (RUN_DEPENDS). USES=ghostscript:x11 will set dependency on one of them. - Fix integer overflow reported as CVE-2015-3228. - Update Uses/ghostscript.mk: * Add x11 keyword. nox11 keyword is now obsolete. * Use packagename in *_DEPENDS line to prevent relationship between -base and -x11 packages from being broken. - Fix x11/nox11 keyword and bump PORTREVISION in ports using USES=ghostscript to update dependency of pre-compiled packages.
Diffstat (limited to '')
-rw-r--r--print/ghostscript7-x11/files/patch-src-gxfixed.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/print/ghostscript7-x11/files/patch-src-gxfixed.h b/print/ghostscript7-x11/files/patch-src-gxfixed.h
new file mode 100644
index 000000000000..0988ca612c9b
--- /dev/null
+++ b/print/ghostscript7-x11/files/patch-src-gxfixed.h
@@ -0,0 +1,46 @@
+--- src/gxfixed.h.orig 2013-04-30 11:29:39.000000000 +0900
++++ src/gxfixed.h 2013-04-30 11:31:03.000000000 +0900
+@@ -27,12 +27,22 @@
+ * quantities: integers lose accuracy in crucial places,
+ * and floating point arithmetic is slow.
+ */
+-typedef long fixed;
+-typedef ulong ufixed; /* only used in a very few places */
+-#define ARCH_SIZEOF_FIXED ARCH_SIZEOF_LONG
++#if ARCH_SIZEOF_INT == 4
++typedef int fixed;
++typedef uint ufixed; /* only used in a very few places */
++# define ARCH_SIZEOF_FIXED ARCH_SIZEOF_INT
++# define max_fixed max_int
++# define min_fixed min_int
++#else
++# if ARCH_SIZEOF_LONG == 4
++ typedef long fixed;
++ typedef ulong ufixed; /* only used in a very few places */
++# define ARCH_SIZEOF_FIXED ARCH_SIZEOF_LONG
++# define max_fixed max_long
++# define min_fixed min_long
++# endif
++#endif
+
+-#define max_fixed max_long
+-#define min_fixed min_long
+ #define fixed_0 0L
+ #define fixed_epsilon 1L
+ /*
+@@ -120,13 +130,8 @@
+ #define fixed_truncated(x) ((x) < 0 ? fixed_ceiling(x) : fixed_floor(x))
+
+ /* Define the largest and smallest integer values that fit in a fixed. */
+-#if arch_sizeof_int == arch_sizeof_long
+-# define max_int_in_fixed fixed2int(max_fixed)
+-# define min_int_in_fixed fixed2int(min_fixed)
+-#else
+-# define max_int_in_fixed max_int
+-# define min_int_in_fixed min_int
+-#endif
++#define max_int_in_fixed fixed2int(max_fixed)
++#define min_int_in_fixed fixed2int(min_fixed)
+
+ #ifdef USE_FPU
+ # define USE_FPU_FIXED (USE_FPU < 0 && arch_floats_are_IEEE && arch_sizeof_long == 4)