Changes for clean compilation with ZDS

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1610 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2009-03-14 21:58:48 +00:00
parent 4d962b8a60
commit 3a1f4ecbe0
5 changed files with 34 additions and 15 deletions

View File

@ -1,7 +1,7 @@
############################################################################
# examples/poll/Makefile.host
#
# Copyright (C) 2008 Gregory Nutt. All rights reserved.
# Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
#
# Redistribution and use in source and binary forms, with or without
@ -41,9 +41,9 @@ BIN = host
DEFINES = -DTARGETIP=\"$(TARGETIP)\"
all: $(BIN)$(EXEEXT)
all: $(BIN)
$(BIN)$(EXEEXT): $(SRC)
$(BIN): $(SRC)
$(HOSTCC) $(HOSTCFLAGS) $(DEFINES) $^ -o $@
clean:

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/poll/net_listener.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -52,7 +52,9 @@
#include <errno.h>
#include <debug.h>
#include <net/if.h>
#include <net/uip/uip-lib.h>
#include "poll_internal.h"
/****************************************************************************
@ -165,6 +167,7 @@ static inline boolean net_incomingdata(struct net_listener_s *nls, int sd)
}
}
}
return 0;
}
/****************************************************************************
@ -207,6 +210,7 @@ static inline boolean net_connection(struct net_listener_s *nls)
return TRUE;
}
}
return FALSE;
}
/****************************************************************************
@ -367,7 +371,7 @@ void *net_listener(pthread_addr_t pvarg)
message("net_listener: Calling select(), listener sd=%d\n", nls.listensd);
memcpy(&nls.working, &nls.master, sizeof(fd_set));
ret = select(nls.mxsd + 1, &nls.working, NULL, NULL, &timeout);
ret = select(nls.mxsd + 1, (FAR fd_set*)&nls.working, (FAR fd_set*)NULL, (FAR fd_set*)NULL, &timeout);
if (ret < 0)
{
message("net_listener: select failed: %d\n", errno);

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/poll/net_reader.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -52,7 +52,9 @@
#include <errno.h>
#include <debug.h>
#include <net/if.h>
#include <net/uip/uip-lib.h>
#include "poll_internal.h"
/****************************************************************************
@ -141,7 +143,7 @@ static void net_receive(int sd)
{
FD_ZERO(&readset);
FD_SET(sd, &readset);
ret = select(sd + 1, &readset, NULL, NULL, &timeout);
ret = select(sd + 1, (FAR fd_set*)&readset, (FAR fd_set*)NULL, (FAR fd_set*)NULL, &timeout);
}
while (ret < 0 && errno == EINTR);

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/poll/poll_internal.h
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -73,14 +73,27 @@
/* If debug is enabled, then use lib_rawprintf so that OS debug output and
* the test output are synchronized.
*
* These macros will differ depending upon if the toolchain supports
* macros with a variable number of arguments or not.
*/
#ifdef CONFIG_DEBUG
# define message(...) lib_rawprintf(__VA_ARGS__)
# define msgflush()
#ifdef CONFIG_CPP_HAVE_VARARGS
# ifdef CONFIG_DEBUG
# define message(...) lib_rawprintf(__VA_ARGS__)
# define msgflush()
# else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# endif
#else
# define message(...) printf(__VA_ARGS__)
# define msgflush() fflush(stdout)
# ifdef CONFIG_DEBUG
# define message lib_rawprintf
# define msgflush()
# else
# define message printf
# define msgflush() fflush(stdout)
# endif
#endif
#define FIFO_PATH1 "/dev/fifo0"

View File

@ -1,7 +1,7 @@
/****************************************************************************
* examples/poll/select_listener.c
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@ -115,7 +115,7 @@ void *select_listener(pthread_addr_t pvarg)
timeout = FALSE;
ready = FALSE;
ret = select(fd+1, &rfds, NULL, NULL, &tv);
ret = select(fd+1, (FAR fd_set*)&rfds, (FAR fd_set*)NULL, (FAR fd_set*)NULL, &tv);
message("\nselect_listener: select returned: %d\n", ret);
if (ret < 0)