From f87520e049535dfa767798dadcb9756d74777fbf Mon Sep 17 00:00:00 2001 From: davidhaas Date: Tue, 18 Feb 2003 19:27:08 +0000 Subject: [PATCH] Allow minimal unix target to build in cygwin (but not necessarily run). Applied a patch from Marc Boucher which has the following changes: 1) Fixed sys_arch.txt documentation to have new return type from sys_thread_new. 2) Removed unnecessary casts on calling sys_timeout() in certain files. 3) Removed some unnecessary break statements after return statements. 4) Changed sys_timeout_remove() to sys_untimeout(). 5) Added some forgotten #ifndef SYS_LIGHTWEIGHT_PROT to memp.c 6) Changed LWIP_DIAG and LWIP_PLATFORM_ASSERT to have do while(). --- ports/coldfire/include/arch/cc.h | 8 ++++---- ports/unix/include/arch/cc.h | 6 +++--- ports/unix/proj/minimal/Makefile | 5 ++++- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ports/coldfire/include/arch/cc.h b/ports/coldfire/include/arch/cc.h index dc9522a..dcb1349 100644 --- a/ports/coldfire/include/arch/cc.h +++ b/ports/coldfire/include/arch/cc.h @@ -30,7 +30,7 @@ * * Author: Adam Dunkels * - * $Id: cc.h,v 1.4 2003/02/12 22:02:02 davidhaas Exp $ + * $Id: cc.h,v 1.5 2003/02/18 19:27:08 davidhaas Exp $ */ #ifndef __CC_H__ #define __CC_H__ @@ -99,12 +99,12 @@ typedef struct _types_fd_set { #include /* Plaform specific diagnostic output */ #ifndef LWIP_PLATFORM_DIAG -#define LWIP_PLATFORM_DIAG(x) {printf x;} +#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0) #endif #ifndef LWIP_PLATFORM_ASSERT -#define LWIP_PLATFORM_ASSERT(x) {printf("Assertion \"%s\" failed at line %d in %s\n", \ - x, __LINE__, __FILE__); fflush(NULL); abort();} +#define LWIP_PLATFORM_ASSERT(x) do {printf("Assertion \"%s\" failed at line %d in %s\n", \ + x, __LINE__, __FILE__); fflush(NULL); abort();} while(0) #endif diff --git a/ports/unix/include/arch/cc.h b/ports/unix/include/arch/cc.h index bc2be41..f44c1b3 100644 --- a/ports/unix/include/arch/cc.h +++ b/ports/unix/include/arch/cc.h @@ -60,8 +60,8 @@ typedef u32_t mem_ptr_t; #include #include /* Plaform specific diagnostic output */ -#define LWIP_PLATFORM_DIAG(x) {printf x;} +#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0) -#define LWIP_PLATFORM_ASSERT(x) {printf("Assertion \"%s\" failed at line %d in %s\n", \ - x, __LINE__, __FILE__); fflush(NULL); abort();} +#define LWIP_PLATFORM_ASSERT(x) do {printf("Assertion \"%s\" failed at line %d in %s\n", \ + x, __LINE__, __FILE__); fflush(NULL); abort();} while(0) #endif /* __ARCH_CC_H__ */ diff --git a/ports/unix/proj/minimal/Makefile b/ports/unix/proj/minimal/Makefile index 334e352..6ddbcbe 100644 --- a/ports/unix/proj/minimal/Makefile +++ b/ports/unix/proj/minimal/Makefile @@ -31,7 +31,10 @@ CCDEP=gcc CC=gcc -CFLAGS=-g -Wall -DIPv4 -Os -fpack-struct +#To Compile for linux: make ARCH=linux +#To Compile for cygwin: make ARCH=cygwin +ARCH=unix +CFLAGS=-g -Wall -D$(ARCH) -DIPv4 -Os -fpack-struct ARFLAGS=rs CONTRIBDIR=../../../..