diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index fc19a55b9..de0f8872f 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -2222,3 +2222,6 @@ STM32F50xxx family of MCUs. * configs/stm3240g-eval: Add framework for the STMicro STM3240G-EVAL board. + * include/sys/types.h: wchar_t is a builtin type in C++ and its + declaration can cause errors with certain C++ compilers. + diff --git a/nuttx/Documentation/NuttxUserGuide.html b/nuttx/Documentation/NuttxUserGuide.html index 60c63f181..a5997f972 100644 --- a/nuttx/Documentation/NuttxUserGuide.html +++ b/nuttx/Documentation/NuttxUserGuide.html @@ -1260,6 +1260,9 @@ interface of the same name. If the message queue is full and NON_BLOCK is set, the message is not queued and ERROR is returned.

+

+NOTE: mq_send() may be called from an interrupt handler. +

Input Parameters:

@@ -2236,7 +2239,7 @@ If the value of the semaphore resulting from this operation is zero, then on of the tasks blocked waiting for the semaphore will be allowed to return successfully from its call to sem_wait().

-NOTE: sem_post() may be called from an interrupt handler. +NOTE: sem_post() may be called from an interrupt handler.

Input Parameters:

-Assumptions/Limitations: This function cannot be called -from an interrupt handler. It assumes the currently executing -task is the one that is performing the unlock. +Assumptions/Limitations:. +When called from an interrupt handler, it will appear as though the +interrupt task is the one that is performing the unlock.

POSIX Compatibility: Comparable to the POSIX interface of the same name. diff --git a/nuttx/configs/sim/nsh2/Make.defs b/nuttx/configs/sim/nsh2/Make.defs index b127e0a20..39b33dc7d 100644 --- a/nuttx/configs/sim/nsh2/Make.defs +++ b/nuttx/configs/sim/nsh2/Make.defs @@ -49,6 +49,7 @@ ARCHPICFLAGS = -fpic ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow ARCHWARNINGSXX = -Wall -Wshadow ARCHDEFINES = +ARCHDEFINESXX = -DCONFIG_WCHAR_BUILTIN ARCHINCLUDES = -I. -isystem $(TOPDIR)/include ARCHINCLUDESXX = -I. -isystem $(TOPDIR)/include -isystem $(TOPDIR)/include/cxx ARCHSCRIPT = @@ -66,7 +67,7 @@ OBJDUMP = $(CROSSDEV)objdump CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \ $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe CXXFLAGS = $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINES) $(EXTRADEFINES) -pipe + $(ARCHCPUFLAGSXX) $(ARCHINCLUDESXX) $(ARCHDEFINESXX) $(EXTRADEFINES) -pipe CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ diff --git a/nuttx/include/sys/types.h b/nuttx/include/sys/types.h index f505c6afa..0c6f72394 100644 --- a/nuttx/include/sys/types.h +++ b/nuttx/include/sys/types.h @@ -165,9 +165,14 @@ typedef unsigned int id_t; typedef intptr_t ptrdiff_t; -/* Wide, 16-bit character types */ +/* Wide, 16-bit character types. wchar_t is a built-in type in C++ and + * its declaration here may cause compilation errors on some compilers + * if -DCONFIG_WCHAR_BUILTIN is not included in the CXXFLAGS. + */ +#ifndef CONFIG_WCHAR_BUILTIN typedef uint16_t wchar_t; +#endif /* blkcnt_t and off_t are signed integer types. *