mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 17:48:54 +08:00
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
This commit is contained in:
@@ -3158,3 +3158,5 @@
|
|||||||
abort return EINTR (or a short transfer size) if a signal is received
|
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
|
while waiting to receive or send serial data. This behavior is required
|
||||||
by POSIX.
|
by POSIX.
|
||||||
|
* include/sys/types.h: Define NULL to be (0) if __cplusplus is defined.
|
||||||
|
(contributed by Mike Smith)
|
||||||
|
|||||||
+6
-3
@@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* include/sys/types.h
|
* 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>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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) */
|
/* NULL is usually defined in stddef.h (which includes this file) */
|
||||||
|
|
||||||
#ifndef NULL
|
#ifndef NULL
|
||||||
/* SDCC is sensitive to NULL pointer type conversions */
|
/* SDCC is sensitive to NULL pointer type conversions, and C++ defines
|
||||||
# ifdef SDCC
|
* NULL as zero
|
||||||
|
*/
|
||||||
|
|
||||||
|
# if defined(SDCC) || defined(__cplusplus)
|
||||||
# define NULL (0)
|
# define NULL (0)
|
||||||
# else
|
# else
|
||||||
# define NULL ((void*)0)
|
# define NULL ((void*)0)
|
||||||
|
|||||||
Reference in New Issue
Block a user