about summary refs log tree commit diff
path: root/pm_config.in.h
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-08-13 01:26:41 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-08-13 01:26:41 +0000
commit06010325d67ea23c9ce71438a967fd3b20ecbfc0 (patch)
tree8472f947c60ae5af19e2730eaf27014c9f9a9dc6 /pm_config.in.h
parentfbb8842275994610cdf02145def296e9f3f94abd (diff)
downloadnetpbm-mirror-06010325d67ea23c9ce71438a967fd3b20ecbfc0.tar.gz
netpbm-mirror-06010325d67ea23c9ce71438a967fd3b20ecbfc0.tar.xz
netpbm-mirror-06010325d67ea23c9ce71438a967fd3b20ecbfc0.zip
Don't do attempt unaligned memory access on machine that can't do that
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2809 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'pm_config.in.h')
-rw-r--r--pm_config.in.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/pm_config.in.h b/pm_config.in.h
index 72cb477e..d156127e 100644
--- a/pm_config.in.h
+++ b/pm_config.in.h
@@ -257,12 +257,17 @@
 /* UNALIGNED_OK means it's OK to do unaligned memory access, e.g.
    loading an 8-byte word from an address that is not a multiple of 8.
    On some systems, such an access causes a trap and a signal.
+
+   This determination is conservative - There may be cases where unaligned
+   access is OK and we say here it isn't.
+
+   We know unaligned access is _not_ OK on at least SPARC and some ARM.
 */
 
-#if defined(__sparc__)
-# define UNALIGNED_OK 0
-#else
+#if defined(__x86_64__) | defined(__i486__) | defined(__vax__)
 # define UNALIGNED_OK 1
+#else
+# define UNALIGNED_OK 0
 #endif