Browse Source

win32 port: added example for LWIP_PLATFORM_DIAG()

master
goldsimon 8 years ago
parent
commit
d020746be9
  1. 7
      ports/win32/include/arch/cc.h
  2. 17
      ports/win32/sys_arch.c

7
ports/win32/include/arch/cc.h

@ -83,6 +83,13 @@ typedef int sys_prot_t;
#define strdup _strdup
#endif
/* Define an example for LWIP_PLATFORM_DIAG: since this uses varargs and the old
* C standard lwIP targets does not support this in macros, we have extra brackets
* around the arguments, which are left out in the following macro definition:
*/
void lwip_win32_platform_diag(const char *format, ...);
#define LWIP_PLATFORM_DIAG(x) lwip_win32_platform_diag x
#ifndef LWIP_NORAND
extern unsigned int sys_win_rand(void);
#define LWIP_RAND() (sys_win_rand())

17
ports/win32/sys_arch.c

@ -752,3 +752,20 @@ lwip_win32_keypressed(char *key)
}
return 0;
}
#include <stdarg.h>
/* This is an example implementation for LWIP_PLATFORM_DIAG:
* format a string and pass it to your output function.
*/
void
lwip_win32_platform_diag(const char *format, ...)
{
va_list ap;
/* get the varargs */
va_start(ap, format);
/* print via varargs; to use another output function, you could use
vsnprintf here */
vprintf(format, ap);
va_end(ap);
}

Loading…
Cancel
Save