Fix a C++ link issue: If constant strings used only in constructor, the don't get linked into the final executable

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4743 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2012-05-17 16:55:13 +00:00
parent 7a79d40ef6
commit d4822f6b95
4 changed files with 21 additions and 12 deletions
+1 -1
View File
@@ -78,7 +78,7 @@ static void syslogstream_putc(FAR struct lib_outstream_s *this, int ch)
* Name: lib_syslogstream * Name: lib_syslogstream
* *
* Description: * Description:
* Initializes a stream for use with the coinfigured syslog interface. * Initializes a stream for use with the configured syslog interface.
* *
* Input parameters: * Input parameters:
* lowoutstream - User allocated, uninitialized instance of struct * lowoutstream - User allocated, uninitialized instance of struct
+13 -9
View File
@@ -1,8 +1,8 @@
/**************************************************************************** /****************************************************************************
* sched/mq_rcvinternal.c * sched/mq_rcvinternal.c
* *
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Copyright (C) 2007, 2008, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * 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
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@@ -37,15 +37,19 @@
* Included Files * Included Files
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> /* O_NONBLOCK */ #include <fcntl.h>
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <mqueue.h> #include <mqueue.h>
#include <sched.h> #include <sched.h>
#include <debug.h> #include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include "os_internal.h" #include "os_internal.h"
#include "mq_internal.h" #include "mq_internal.h"
@@ -105,19 +109,19 @@ int mq_verifyreceive(mqd_t mqdes, void *msg, size_t msglen)
if (!msg || !mqdes) if (!msg || !mqdes)
{ {
*get_errno_ptr() = EINVAL; set_errno(EINVAL);
return ERROR; return ERROR;
} }
if ((mqdes->oflags & O_RDOK) == 0) if ((mqdes->oflags & O_RDOK) == 0)
{ {
*get_errno_ptr() = EPERM; set_errno(EPERM);
return ERROR; return ERROR;
} }
if (msglen < (size_t)mqdes->msgq->maxmsgsize) if (msglen < (size_t)mqdes->msgq->maxmsgsize)
{ {
*get_errno_ptr() = EMSGSIZE; set_errno(EMSGSIZE);
return ERROR; return ERROR;
} }
@@ -178,7 +182,7 @@ FAR mqmsg_t *mq_waitreceive(mqd_t mqdes)
rtcb->msgwaitq = msgq; rtcb->msgwaitq = msgq;
msgq->nwaitnotempty++; msgq->nwaitnotempty++;
*get_errno_ptr() = OK; set_errno(OK);
up_block_task(rtcb, TSTATE_WAIT_MQNOTEMPTY); up_block_task(rtcb, TSTATE_WAIT_MQNOTEMPTY);
/* When we resume at this point, either (1) the message queue /* When we resume at this point, either (1) the message queue
@@ -187,7 +191,7 @@ FAR mqmsg_t *mq_waitreceive(mqd_t mqdes)
* errno value (should be either EINTR or ETIMEDOUT). * errno value (should be either EINTR or ETIMEDOUT).
*/ */
if (*get_errno_ptr() != OK) if (get_errno() != OK)
{ {
break; break;
} }
@@ -198,7 +202,7 @@ FAR mqmsg_t *mq_waitreceive(mqd_t mqdes)
* message queue description referred to by 'mqdes'. * message queue description referred to by 'mqdes'.
*/ */
*get_errno_ptr() = EAGAIN; set_errno(EAGAIN);
break; break;
} }
} }
+4 -1
View File
@@ -2,7 +2,7 @@
* sched/mq_send.c * sched/mq_send.c
* *
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * 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
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@@ -38,11 +38,14 @@
****************************************************************************/ ****************************************************************************/
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/types.h> #include <sys/types.h>
#include <mqueue.h> #include <mqueue.h>
#include <errno.h> #include <errno.h>
#include <debug.h> #include <debug.h>
#include <nuttx/arch.h> #include <nuttx/arch.h>
#include "os_internal.h" #include "os_internal.h"
#include "mq_internal.h" #include "mq_internal.h"
+3 -1
View File
@@ -2,7 +2,7 @@
* sched/mq_send.c * sched/mq_send.c
* *
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr> * 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
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@@ -417,6 +417,7 @@ int mq_dosend(mqd_t mqdes, FAR mqmsg_t *mqmsg, const void *msg, size_t msglen, i
#endif #endif
} }
#endif #endif
/* Check if any tasks are waiting for the MQ not empty event. */ /* Check if any tasks are waiting for the MQ not empty event. */
saved_state = irqsave(); saved_state = irqsave();
@@ -445,6 +446,7 @@ int mq_dosend(mqd_t mqdes, FAR mqmsg_t *mqmsg, const void *msg, size_t msglen, i
up_unblock_task(btcb); up_unblock_task(btcb);
} }
} }
irqrestore(saved_state); irqrestore(saved_state);
sched_unlock(); sched_unlock();
return OK; return OK;