1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-26 12:14:49 +00:00

Port net code to windows.

Use winsock2 and WSAPoll. Not the most high performance
solution but should work well.
This commit is contained in:
Calvin Rose
2020-04-18 19:14:38 -04:00
parent 0745c15d7b
commit 4a693222b4
4 changed files with 145 additions and 11 deletions

View File

@@ -35,7 +35,7 @@
#ifndef janet_exit
#include <stdio.h>
#define janet_exit(m) do { \
printf("C runtime error at line %d in file %s: %s\n",\
fprintf(stderr, "C runtime error at line %d in file %s: %s\n",\
__LINE__,\
__FILE__,\
(m));\
@@ -50,7 +50,7 @@
/* What to do when out of memory */
#ifndef JANET_OUT_OF_MEMORY
#include <stdio.h>
#define JANET_OUT_OF_MEMORY do { printf("janet out of memory\n"); exit(1); } while (0)
#define JANET_OUT_OF_MEMORY do { fprintf(stderr, "janet out of memory\n"); exit(1); } while (0)
#endif
/* Omit docstrings in some builds */
@@ -128,6 +128,7 @@ void janet_lib_thread(JanetTable *env);
#endif
#ifdef JANET_NET
void janet_lib_net(JanetTable *env);
void janet_net_deinit(void);
void janet_net_markloop(void);
#endif