pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/sysutils/flashrom
Module Name: pkgsrc
Committed By: joerg
Date: Thu Dec 22 21:07:17 UTC 2016
Modified Files:
pkgsrc/sysutils/flashrom: distinfo
Added Files:
pkgsrc/sysutils/flashrom/patches: patch-hwaccess.c
Log Message:
It is UB whether defined() is evaluated in macro expansions, so avoid
it.
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 pkgsrc/sysutils/flashrom/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/sysutils/flashrom/patches/patch-hwaccess.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/sysutils/flashrom/distinfo
diff -u pkgsrc/sysutils/flashrom/distinfo:1.9 pkgsrc/sysutils/flashrom/distinfo:1.10
--- pkgsrc/sysutils/flashrom/distinfo:1.9 Wed Nov 4 01:32:14 2015
+++ pkgsrc/sysutils/flashrom/distinfo Thu Dec 22 21:07:17 2016
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.9 2015/11/04 01:32:14 agc Exp $
+$NetBSD: distinfo,v 1.10 2016/12/22 21:07:17 joerg Exp $
SHA1 (flashrom-0.9.7.tar.bz2) = d08b4073ea3ebf63f03c3e502f4291f50ef348ee
RMD160 (flashrom-0.9.7.tar.bz2) = e160e0ac1e0e138702f3f467707175df96b7e6b1
SHA512 (flashrom-0.9.7.tar.bz2) = a226c1ac3f9c7822b74ca14b7f9b53013110b2cdb66b1f936593c693ee54f19d643cc3a97a9635c05f2c959aca817668006f609ddb503a84d0bf5d510065674e
Size (flashrom-0.9.7.tar.bz2) = 408883 bytes
SHA1 (patch-flashrom.c) = 9867fa7ff7d0a55bff5fc0e6c8c6c901af6211f8
+SHA1 (patch-hwaccess.c) = a76c1def47b8b3a79c8d024c43c510f3989bd6d9
Added files:
Index: pkgsrc/sysutils/flashrom/patches/patch-hwaccess.c
diff -u /dev/null pkgsrc/sysutils/flashrom/patches/patch-hwaccess.c:1.1
--- /dev/null Thu Dec 22 21:07:17 2016
+++ pkgsrc/sysutils/flashrom/patches/patch-hwaccess.c Thu Dec 22 21:07:17 2016
@@ -0,0 +1,72 @@
+$NetBSD: patch-hwaccess.c,v 1.1 2016/12/22 21:07:17 joerg Exp $
+
+It is UB whether define() is not handled inside macro expansions.
+
+--- hwaccess.c.orig 2016-12-22 15:40:41.401773946 +0000
++++ hwaccess.c
+@@ -18,16 +18,40 @@
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+-#define IS_X86 (defined(__i386__) || defined(__x86_64__) || defined(__amd64__))
+-#define IS_MIPS (defined (__mips) || defined (__mips__) || defined (__MIPS__) || defined (mips))
+-#define IS_PPC (defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) || defined(__ppc64__))
+-#define IS_ARM (defined (__arm__) || defined (_ARM))
++#if defined(__i386__) || defined(__x86_64__) || defined(__amd64__)
++#define IS_X86 1
++#else
++#define IS_X86 0
++#endif
++#if defined (__mips) || defined (__mips__) || defined (__MIPS__) || defined (mips)
++#define IS_MIPS 1
++#else
++#define IS_MIPS 0
++#endif
++#if defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) || defined(__ppc64__)
++#define IS_PPC 1
++#else
++#define IS_PPC 0
++#endif
++#if defined (__arm__) || defined (_ARM)
++#define IS_ARM 1
++#else
++#define IS_ARM 0
++#endif
+ #if !(IS_X86 || IS_MIPS || IS_PPC || IS_ARM)
+ #error Unknown architecture
+ #endif
+
+-#define IS_LINUX (defined(__gnu_linux__) || defined(__linux__))
+-#define IS_MACOSX (defined(__APPLE__) && defined(__MACH__))
++#if defined(__gnu_linux__) || defined(__linux__)
++#define IS_LINUX 1
++#else
++#define IS_LINUX 0
++#endif
++#if defined(__APPLE__) && defined(__MACH__)
++#define IS_MACOSX 1
++#else
++#define IS_MACOSX 0
++#endif
+ #if !(IS_LINUX || IS_MACOSX || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__DJGPP__) ||
defined(__LIBPAYLOAD__) || defined(__sun))
+ #error "Unknown operating system"
+ #endif
+@@ -45,8 +69,16 @@
+ #include "flash.h"
+ #include "hwaccess.h"
+
+-#define USE_IOPL (IS_LINUX || IS_MACOSX || defined(__NetBSD__) || defined(__OpenBSD__))
+-#define USE_DEV_IO (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__))
++#if IS_LINUX || IS_MACOSX || defined(__NetBSD__) || defined(__OpenBSD__)
++#define USE_IOPL 1
++#else
++#define USE_IOPL 0
++#endif
++#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__))
++#define USE_DEV_IO 1
++#else
++#define USE_DEV_IO 0
++#endif
+
+ #if IS_X86 && USE_DEV_IO
+ int io_fd;
Home |
Main Index |
Thread Index |
Old Index