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:
parent
4d962b8a60
commit
3a1f4ecbe0
@ -1,7 +1,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
# examples/poll/Makefile.host
|
# 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>
|
# Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -41,9 +41,9 @@ BIN = host
|
|||||||
|
|
||||||
DEFINES = -DTARGETIP=\"$(TARGETIP)\"
|
DEFINES = -DTARGETIP=\"$(TARGETIP)\"
|
||||||
|
|
||||||
all: $(BIN)$(EXEEXT)
|
all: $(BIN)
|
||||||
|
|
||||||
$(BIN)$(EXEEXT): $(SRC)
|
$(BIN): $(SRC)
|
||||||
$(HOSTCC) $(HOSTCFLAGS) $(DEFINES) $^ -o $@
|
$(HOSTCC) $(HOSTCFLAGS) $(DEFINES) $^ -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/poll/net_listener.c
|
* 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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -52,7 +52,9 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include <net/if.h>
|
||||||
#include <net/uip/uip-lib.h>
|
#include <net/uip/uip-lib.h>
|
||||||
|
|
||||||
#include "poll_internal.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 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);
|
message("net_listener: Calling select(), listener sd=%d\n", nls.listensd);
|
||||||
memcpy(&nls.working, &nls.master, sizeof(fd_set));
|
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)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
message("net_listener: select failed: %d\n", errno);
|
message("net_listener: select failed: %d\n", errno);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/poll/net_reader.c
|
* 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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -52,7 +52,9 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include <net/if.h>
|
||||||
#include <net/uip/uip-lib.h>
|
#include <net/uip/uip-lib.h>
|
||||||
|
|
||||||
#include "poll_internal.h"
|
#include "poll_internal.h"
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -141,7 +143,7 @@ static void net_receive(int sd)
|
|||||||
{
|
{
|
||||||
FD_ZERO(&readset);
|
FD_ZERO(&readset);
|
||||||
FD_SET(sd, &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);
|
while (ret < 0 && errno == EINTR);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/poll/poll_internal.h
|
* 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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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
|
/* If debug is enabled, then use lib_rawprintf so that OS debug output and
|
||||||
* the test output are synchronized.
|
* 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
|
#ifdef CONFIG_CPP_HAVE_VARARGS
|
||||||
|
# ifdef CONFIG_DEBUG
|
||||||
# define message(...) lib_rawprintf(__VA_ARGS__)
|
# define message(...) lib_rawprintf(__VA_ARGS__)
|
||||||
# define msgflush()
|
# define msgflush()
|
||||||
#else
|
# else
|
||||||
# define message(...) printf(__VA_ARGS__)
|
# define message(...) printf(__VA_ARGS__)
|
||||||
# define msgflush() fflush(stdout)
|
# define msgflush() fflush(stdout)
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# ifdef CONFIG_DEBUG
|
||||||
|
# define message lib_rawprintf
|
||||||
|
# define msgflush()
|
||||||
|
# else
|
||||||
|
# define message printf
|
||||||
|
# define msgflush() fflush(stdout)
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FIFO_PATH1 "/dev/fifo0"
|
#define FIFO_PATH1 "/dev/fifo0"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/poll/select_listener.c
|
* 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>
|
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -115,7 +115,7 @@ void *select_listener(pthread_addr_t pvarg)
|
|||||||
timeout = FALSE;
|
timeout = FALSE;
|
||||||
ready = 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);
|
message("\nselect_listener: select returned: %d\n", ret);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user