summaryrefslogtreecommitdiff
path: root/nuttx/include/sys
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-08-12 17:49:35 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-08-12 17:49:35 +0000
commit232f7fb68c216804ab0b9621e5c4c19465704a0d (patch)
treeee4c5ecda27f6056ff610a8637166628a4c6b0e5 /nuttx/include/sys
parent4d7cbe088ed6ea14adc0672b339f1e0df4650f00 (diff)
downloadnuttx-232f7fb68c216804ab0b9621e5c4c19465704a0d.tar.gz
nuttx-232f7fb68c216804ab0b9621e5c4c19465704a0d.tar.bz2
nuttx-232f7fb68c216804ab0b9621e5c4c19465704a0d.zip
Define NULL to be (0) for C++
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5023 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/sys')
-rw-r--r--nuttx/include/sys/types.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/nuttx/include/sys/types.h b/nuttx/include/sys/types.h
index 6014b9b74..2ae69d4a7 100644
--- a/nuttx/include/sys/types.h
+++ b/nuttx/include/sys/types.h
@@ -1,7 +1,7 @@
/****************************************************************************
* include/sys/types.h
*
- * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -63,8 +63,11 @@
/* NULL is usually defined in stddef.h (which includes this file) */
#ifndef NULL
- /* SDCC is sensitive to NULL pointer type conversions */
-# ifdef SDCC
+ /* SDCC is sensitive to NULL pointer type conversions, and C++ defines
+ * NULL as zero
+ */
+
+# if defined(SDCC) || defined(__cplusplus)
# define NULL (0)
# else
# define NULL ((void*)0)