summaryrefslogtreecommitdiff
path: root/nuttx/lib
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-06-09 19:11:00 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-06-09 19:11:00 +0000
commitcf0426d5964d50da8b21db6549ed19a987ee85e2 (patch)
treebfbdb400743a05f683c58cc1d8217d2f1d6ce8b9 /nuttx/lib
parent05dd8c79b40af0221973ba0ee19ee0066c3a8dde (diff)
downloadpx4-nuttx-cf0426d5964d50da8b21db6549ed19a987ee85e2.tar.gz
px4-nuttx-cf0426d5964d50da8b21db6549ed19a987ee85e2.tar.bz2
px4-nuttx-cf0426d5964d50da8b21db6549ed19a987ee85e2.zip
Simply conditional build; fix conditional compilation
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@275 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib')
-rw-r--r--nuttx/lib/Makefile30
-rw-r--r--nuttx/lib/lib_fclose.c3
-rw-r--r--nuttx/lib/lib_fflush.c3
-rw-r--r--nuttx/lib/lib_fgets.c3
-rw-r--r--nuttx/lib/lib_fopen.c8
-rw-r--r--nuttx/lib/lib_fread.c3
-rw-r--r--nuttx/lib/lib_gets.c3
-rw-r--r--nuttx/lib/lib_libfread.c3
-rw-r--r--nuttx/lib/lib_libfwrite.c3
-rw-r--r--nuttx/lib/lib_puts.c3
-rw-r--r--nuttx/lib/lib_rawprintf.c2
-rw-r--r--nuttx/lib/lib_rawstream.c5
-rw-r--r--nuttx/lib/lib_streamsem.c3
-rw-r--r--nuttx/lib/lib_ungetc.c3
-rw-r--r--nuttx/lib/lib_vprintf.c4
15 files changed, 24 insertions, 55 deletions
diff --git a/nuttx/lib/Makefile b/nuttx/lib/Makefile
index a01dbcb91..d13cc7b1e 100644
--- a/nuttx/lib/Makefile
+++ b/nuttx/lib/Makefile
@@ -40,27 +40,43 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh
ASRCS =
AOBJS = $(ASRCS:.S=$(OBJEXT))
-MISC_SRCS = lib_init.c lib_streamsem.c lib_filesem.c
+MISC_SRCS = lib_init.c lib_filesem.c
+ifneq ($(CONFIG_NFILE_STREAMS),0)
+MISC_SRCS += lib_streamsem.c
+endif
+
STRING_SRCS = lib_memset.c lib_memcpy.c lib_memcmp.c lib_memmove.c \
lib_strcpy.c lib_strncpy.c lib_strcmp.c \
lib_strlen.c lib_strdup.c lib_strtol.c lib_strchr.c \
lib_strspn.c lib_strcspn.c \
lib_strtok.c lib_strtokr.c lib_strerror.c
+
CTYPE_SRCS =
-STDIO_SRCS = lib_fopen.c lib_fclose.c \
+
+STDIO_SRCS = lib_printf.c lib_rawprintf.c lib_lowprintf.c \
+ lib_sprintf.c lib_libsprintf.c lib_vsprintf.c lib_libvsprintf.c \
+ lib_memstream.c lib_lowstream.c lib_nullstream.c \
+ lib_sscanf.c
+ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
+STDIO_SRCS += lib_rawstream.c
+ifneq ($(CONFIG_NFILE_STREAMS),0)
+STDIO_SRCS += lib_fopen.c lib_fclose.c \
lib_fread.c lib_libfread.c lib_fgetc.c lib_fgets.c lib_gets.c \
lib_fwrite.c lib_libfwrite.c lib_fflush.c \
lib_fputc.c lib_puts.c lib_fputs.c \
lib_ungetc.c \
- lib_printf.c lib_vprintf.c lib_fprintf.c lib_rawprintf.c lib_lowprintf.c \
- lib_vfprintf.c lib_sprintf.c lib_libsprintf.c lib_vsprintf.c \
- lib_libvsprintf.c lib_stdstream.c lib_memstream.c \
- lib_rawstream.c lib_lowstream.c lib_nullstream.c \
- lib_sscanf.c
+ lib_vprintf.c lib_fprintf.c lib_vfprintf.c \
+ lib_stdstream.c
+endif
+endif
+
STDLIB_SRCS = lib_getenv.c lib_rand.c
+
MATH_SRCS = lib_rint.c
+
SQ_SRCS = sq_addlast.c sq_addfirst.c sq_addafter.c \
sq_rem.c sq_remlast.c sq_remfirst.c sq_remafter.c
+
DQ_SRCS = dq_addlast.c dq_addfirst.c dq_addafter.c dq_addbefore.c \
dq_rem.c dq_remlast.c dq_remfirst.c
diff --git a/nuttx/lib/lib_fclose.c b/nuttx/lib/lib_fclose.c
index a7960e823..f6271e18c 100644
--- a/nuttx/lib/lib_fclose.c
+++ b/nuttx/lib/lib_fclose.c
@@ -53,8 +53,6 @@
* Global Functions
************************************************************/
-#if CONFIG_NFILE_STREAMS > 0
-
int fclose(FILE *stream)
{
int ret = OK;
@@ -95,4 +93,3 @@ int fclose(FILE *stream)
return ret;
}
-#endif /* CONFIG_NFILE_STREAMS */
diff --git a/nuttx/lib/lib_fflush.c b/nuttx/lib/lib_fflush.c
index 12dfd8b12..1af9305fb 100644
--- a/nuttx/lib/lib_fflush.c
+++ b/nuttx/lib/lib_fflush.c
@@ -88,8 +88,6 @@
* Called by the OS when a task exits
************************************************************/
-#if CONFIG_NFILE_STREAMS > 0
-
void lib_flushall(FAR struct streamlist *list)
{
/* Make sure that there are streams associated with this thread */
@@ -181,4 +179,3 @@ int fflush(FILE *stream)
#endif
}
-#endif /* CONFIG_NFILE_STREAMS */
diff --git a/nuttx/lib/lib_fgets.c b/nuttx/lib/lib_fgets.c
index 561d4a85e..613314191 100644
--- a/nuttx/lib/lib_fgets.c
+++ b/nuttx/lib/lib_fgets.c
@@ -44,8 +44,6 @@
#include <ctype.h>
#include <debug.h>
-#if CONFIG_NFILE_STREAMS > 0
-
/************************************************************
* Definitions
************************************************************/
@@ -322,4 +320,3 @@ char *fgets(FAR char *s, int n, FILE *stream)
}
-#endif /* CONFIG_NFILE_STREAMS */
diff --git a/nuttx/lib/lib_fopen.c b/nuttx/lib/lib_fopen.c
index ec699c340..d5c6bdf6f 100644
--- a/nuttx/lib/lib_fopen.c
+++ b/nuttx/lib/lib_fopen.c
@@ -55,8 +55,6 @@
* Private Functions
************************************************************/
-#if CONFIG_NFILE_STREAMS > 0
-
static int lib_mode2oflags(const char *mode)
{
int oflags = 0;
@@ -126,14 +124,10 @@ static int lib_mode2oflags(const char *mode)
return oflags;
}
-#endif /* CONFIG_NFILE_STREAMS */
-
/************************************************************
* Public Functions
************************************************************/
-#if CONFIG_NFILE_STREAMS > 0
-
FAR struct file_struct *lib_fdopen(int fd, const char *mode,
FAR struct filelist *flist,
FAR struct streamlist *slist)
@@ -232,5 +226,3 @@ FILE *fopen(const char *path, const char *mode)
}
return ret;
}
-
-#endif /* CONFIG_NFILE_STREAMS */
diff --git a/nuttx/lib/lib_fread.c b/nuttx/lib/lib_fread.c
index 25461545e..61e3daa5f 100644
--- a/nuttx/lib/lib_fread.c
+++ b/nuttx/lib/lib_fread.c
@@ -79,8 +79,6 @@
* fwrite
************************************************************/
-#if CONFIG_NFILE_STREAMS > 0
-
size_t fread(void *ptr, size_t size, size_t n_items, FILE *stream)
{
size_t full_size = n_items * (size_t)size;
@@ -99,5 +97,4 @@ size_t fread(void *ptr, size_t size, size_t n_items, FILE *stream)
return items_read;
}
-#endif /* CONFIG_NFILE_STREAMS */
diff --git a/nuttx/lib/lib_gets.c b/nuttx/lib/lib_gets.c
index db2145cfa..944e5266d 100644
--- a/nuttx/lib/lib_gets.c
+++ b/nuttx/lib/lib_gets.c
@@ -41,8 +41,6 @@
#include <limits.h>
#include <string.h>
-#if CONFIG_NFILE_STREAMS > 0
-
/************************************************************
* Definitions
************************************************************/
@@ -123,4 +121,3 @@ char *gets(char *s)
return ret;
}
-#endif /* CONFIG_NFILE_STREAMS */
diff --git a/nuttx/lib/lib_libfread.c b/nuttx/lib/lib_libfread.c
index 92e53025d..6607b55cc 100644
--- a/nuttx/lib/lib_libfread.c
+++ b/nuttx/lib/lib_libfread.c
@@ -85,8 +85,6 @@
* lib_fread
************************************************************/
-#if CONFIG_NFILE_STREAMS > 0
-
ssize_t lib_fread(void *ptr, size_t count, FILE *stream)
{
unsigned char *dest = (unsigned char*)ptr;
@@ -260,4 +258,3 @@ ssize_t lib_fread(void *ptr, size_t count, FILE *stream)
return bytes_read;
}
-#endif /* CONFIG_NFILE_STREAMS */
diff --git a/nuttx/lib/lib_libfwrite.c b/nuttx/lib/lib_libfwrite.c
index f62e8ddb9..20accc9e9 100644
--- a/nuttx/lib/lib_libfwrite.c
+++ b/nuttx/lib/lib_libfwrite.c
@@ -83,8 +83,6 @@
* lib_fwrite
************************************************************/
-#if CONFIG_NFILE_STREAMS > 0
-
ssize_t lib_fwrite(const void *ptr, size_t count, FILE *stream)
#if CONFIG_STDIO_BUFFER_SIZE > 0
{
@@ -164,4 +162,3 @@ ssize_t lib_fwrite(const void *ptr, size_t count, FILE *stream)
}
#endif /* CONFIG_STDIO_BUFFER_SIZE */
-#endif /* CONFIG_NFILE_STREAMS */
diff --git a/nuttx/lib/lib_puts.c b/nuttx/lib/lib_puts.c
index 365f726d6..ad9a4061f 100644
--- a/nuttx/lib/lib_puts.c
+++ b/nuttx/lib/lib_puts.c
@@ -88,8 +88,6 @@
* stdout.
************************************************************/
-#if CONFIG_NFILE_STREAMS > 0
-
int puts(const char *s)
{
int nwritten;
@@ -115,4 +113,3 @@ int puts(const char *s)
return nput;
}
-#endif /* CONFIG_NFILE_STREAMS */
diff --git a/nuttx/lib/lib_rawprintf.c b/nuttx/lib/lib_rawprintf.c
index fa2f5a63e..7748fb14e 100644
--- a/nuttx/lib/lib_rawprintf.c
+++ b/nuttx/lib/lib_rawprintf.c
@@ -98,7 +98,7 @@ int lib_rawvprintf(const char *fmt, va_list ap)
struct lib_stream_s stream;
- /* Wrap the stdout in a stream object and let lib_vsprintf
+ /* Wrap the low-level output in a stream object and let lib_vsprintf
* do the work.
*/
diff --git a/nuttx/lib/lib_rawstream.c b/nuttx/lib/lib_rawstream.c
index 8ec80bacd..899175620 100644
--- a/nuttx/lib/lib_rawstream.c
+++ b/nuttx/lib/lib_rawstream.c
@@ -45,8 +45,6 @@
* Private Functions
************************************************************/
-#if CONFIG_NFILE_DESCRIPTORS > 0
-
static void rawstream_putc(struct lib_stream_s *this, int ch)
{
struct lib_rawstream_s *rthis = (struct lib_rawstream_s *)this;
@@ -77,6 +75,3 @@ void lib_rawstream(struct lib_rawstream_s *rawstream, int fd)
rawstream->fd = fd;
}
-#endif /* CONFIG_NFILE_DESCRIPTORS */
-
-
diff --git a/nuttx/lib/lib_streamsem.c b/nuttx/lib/lib_streamsem.c
index 4f349c90b..1394a5501 100644
--- a/nuttx/lib/lib_streamsem.c
+++ b/nuttx/lib/lib_streamsem.c
@@ -71,8 +71,6 @@
* Public Functions
************************************************************/
-#if CONFIG_NFILE_STREAMS > 0
-
void stream_semtake(FAR struct streamlist *list)
{
/* Take the semaphore (perhaps waiting) */
@@ -92,5 +90,4 @@ void stream_semgive(FAR struct streamlist *list)
sem_post(&list->sl_sem);
}
-#endif /* CONFIG_NFILE_STREAMS */
diff --git a/nuttx/lib/lib_ungetc.c b/nuttx/lib/lib_ungetc.c
index fe333344c..34f760aa2 100644
--- a/nuttx/lib/lib_ungetc.c
+++ b/nuttx/lib/lib_ungetc.c
@@ -88,8 +88,6 @@
* fgetc
**********************************************************/
-#if CONFIG_NFILE_STREAMS > 0
-
int ungetc(int c, FILE *stream)
{
#if CONFIG_NUNGET_CHARS > 0
@@ -121,4 +119,3 @@ int ungetc(int c, FILE *stream)
}
}
-#endif /* CONFIG_NFILE_STREAMS */
diff --git a/nuttx/lib/lib_vprintf.c b/nuttx/lib/lib_vprintf.c
index 1507851f7..2d345ec6f 100644
--- a/nuttx/lib/lib_vprintf.c
+++ b/nuttx/lib/lib_vprintf.c
@@ -83,8 +83,6 @@
* vprintf
**********************************************************/
-#if CONFIG_NFILE_STREAMS > 0
-
int vprintf(const char *fmt, va_list ap)
{
/* vfprintf into stdout */
@@ -92,5 +90,3 @@ int vprintf(const char *fmt, va_list ap)
return vfprintf(stdout, fmt, ap);
}
-#endif /* CONFIG_NFILE_STREAMS */
-