mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-16 10:39:49 +00:00
fix build for Windows
(read from stdin does not work)
This commit is contained in:
1 parent
5b46986628
commit
9b94b4da26
1 file changed
+7
@@ -34,7 +34,9 @@ void config_write(struct mg_str config);
|
||||
#else
|
||||
void uart_init(int tx, int rx, int baud) {
|
||||
// We use stdin/stdout as UART. Make stdin non-blocking
|
||||
#if MG_ARCH != MG_ARCH_WIN32
|
||||
fcntl(0, F_SETFL, fcntl(0, F_GETFL) | O_NONBLOCK);
|
||||
#endif
|
||||
(void) tx, (void) rx, (void) baud;
|
||||
}
|
||||
|
||||
@@ -44,7 +46,12 @@ void uart_write(const void *buf, size_t len) {
|
||||
}
|
||||
|
||||
int uart_read(void *buf, size_t len) {
|
||||
#if MG_ARCH == MG_ARCH_WIN32
|
||||
(void) buf, (void) len;
|
||||
return 0;
|
||||
#else
|
||||
return read(0, buf, len); // Read from stdin
|
||||
#endif
|
||||
}
|
||||
|
||||
char *config_read(void) {
|
||||
|
||||
Reference in new issue
Block a user