summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-06-09 21:21:29 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-06-09 21:21:29 +0000
commitd8249796c804f056363cf9dc0fa588a1f718de0b (patch)
tree1b834fef2d7d690ef62b75beb5f9612f26a4744a /nuttx/include
parent0aee551ab2f5762fd5d82c24b548bb5fddb297ff (diff)
downloadpx4-nuttx-d8249796c804f056363cf9dc0fa588a1f718de0b.tar.gz
px4-nuttx-d8249796c804f056363cf9dc0fa588a1f718de0b.tar.bz2
px4-nuttx-d8249796c804f056363cf9dc0fa588a1f718de0b.zip
Fixes most integer overflows for AVR
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3689 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/compiler.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/nuttx/include/nuttx/compiler.h b/nuttx/include/nuttx/compiler.h
index 6fb3e6790..c44ff329e 100644
--- a/nuttx/include/nuttx/compiler.h
+++ b/nuttx/include/nuttx/compiler.h
@@ -99,7 +99,11 @@
# define DSEG
# define CODE
-#if defined(__m32c__)
+/* Handle cases where sizeof(int) is 16-bits, sizeof(long) is 32-bits, and
+ * pointers are 16-bits.
+ */
+
+#if defined(__m32c__) || defined(__AVR__)
/* Select the small, 16-bit addressing model */
# define CONFIG_SMALL_MEMORY 1
@@ -112,6 +116,8 @@
# undef CONFIG_PTR_IS_NOT_INT
+/* Handle cases where sizeof(int) may or may not be 16-bits */
+
#elif defined(__mc68hc1x__)
/* Select the small, 16-bit addressing model */