This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Tests compilation errors if CYGPKG_NET_TFTP or CYGPKG_NET_DHCP are undefined


Hello all,
Just a minor issue , some network tests (tftp_server_test.c, 
tftp_client_test.c, dhcp_test.c ) are failling to compile if DHCP or TFTP 
support is disabled.

Here are the patches :

--- 1.1/dhcp_test.c	2004-03-12 11:05:27.000000000 +0100
+++ dhcp_test.c	2004-03-02 17:26:31.000000000 +0100
@@ -79,7 +79,9 @@
 #define PACKET_ADD  ((MAX_SEND - MIN_PACKET)/NUM_PINGS)
 #define nPACKET_ADD  1

+#ifdef CYGPKG_NET_DHCP
 static unsigned char pkt1[MAX_PACKET], pkt2[MAX_PACKET];
+#endif

 #define UNIQUEID 0x1234

@@ -125,6 +127,7 @@
     return (answer);
 }

+#ifdef CYGPKG_NET_DHCP
 static int
 show_icmp(unsigned char *pkt, int len,
           struct sockaddr_in *from, struct sockaddr_in *to)
@@ -244,6 +247,7 @@
     ping_host(s, &host);
     close(s);
 }
+#endif

 void
 net_test(cyg_addrword_t p)




--- 1.2/tftp_server_test.c	2004-03-12 11:04:43.000000000 +0100
+++ tftp_server_test.c	2004-03-02 16:04:09.000000000 +0100
@@ -30,6 +30,7 @@
 //==========================================================================
 // TFTP test code

+#ifdef CYGPKG_NET_TFTP
 #include <pkgconf/system.h>
 #include <pkgconf/net.h>

@@ -177,5 +178,13 @@
     cyg_thread_resume(thread_handle);  // Start it
     cyg_scheduler_start();
 }
+#else // CYGPKG_NET_TFTP
+#include <stdio.h>
+void
+cyg_start(void) {
+    printf("No tftp support available\n");
+}
+#endif
+

 // EOF tftp_server_test.c



--- 1.2/tftp_client_test.c	2004-03-12 11:04:19.000000000 +0100
+++ tftp_client_test.c	2004-03-02 16:03:01.000000000 +0100
@@ -30,6 +30,8 @@
 //==========================================================================
 // TFTP test code

+
+#ifdef CYGPKG_NET_TFTP
 #include <network.h>
 #include <tftp_support.h>

@@ -145,4 +147,10 @@
     cyg_scheduler_start();
 }

-
+#else // CYGPKG_NET_TFTP
+#include <stdio.h>
+void
+cyg_start(void) {
+    printf("No tftp support available\n");
+}
+#endif


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]