lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] tftp_server.c on Windows


From: Gisle Vanem
Subject: [lwip-devel] tftp_server.c on Windows
Date: Wed, 5 Oct 2016 20:48:39 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

There's some problems compiling tftp_server.c on Windows.
>From MSVC, I got errors like:
  tftp_server.c(72): error C2059: syntax error: 'constant'

because 'ERROR_FILE_NOT_FOUND' is also in <winerror.h>.
Hence I had to patch:

--- a/tftp_server.c 2016-10-05 20:01:54
+++ b/tftp_server.c 2016-10-05 20:43:10
@@ -58,12 +58,21 @@
 #define TFTP_MAX_PAYLOAD_SIZE 512
 #define TFTP_HEADER_LENGTH    4

+#undef ERROR   /* Also in <wingdi.h> */
+
 #define RRQ   1
 #define WRQ   2
 #define DATA  3
 #define ACK   4
 #define ERROR 5

+/* These are also in <winerror.h>
+ */
+#undef ERROR_FILE_NOT_FOUND
+#undef ERROR_DISK_FULL
+#undef ERROR_FILE_EXISTS
+#undef ERROR_NO_SUCH_USER
+
 enum tftp_error {
   ERROR_FILE_NOT_FOUND    = 1,
   ERROR_ACCESS_VIOLATION  = 2,

-- 
--gv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]