Browse Source

Define NULL to be (0) for C++

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5023 7fd9a85b-ad96-42d3-883c-3090e2eb8679
sbg
patacongo 13 years ago
parent
commit
18669722d8
  1. 2
      nuttx/ChangeLog
  2. 9
      nuttx/include/sys/types.h

2
nuttx/ChangeLog

@ -3158,3 +3158,5 @@ @@ -3158,3 +3158,5 @@
abort return EINTR (or a short transfer size) if a signal is received
while waiting to receive or send serial data. This behavior is required
by POSIX.
* include/sys/types.h: Define NULL to be (0) if __cplusplus is defined.
(contributed by Mike Smith)

9
nuttx/include/sys/types.h

@ -1,7 +1,7 @@ @@ -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 @@ @@ -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)

Loading…
Cancel
Save