improving sockets, fixed some bugs

This commit is contained in:
Daniel Ledda
2025-11-28 15:29:24 +01:00
parent 9b772e2046
commit 45d3f28546
5 changed files with 225 additions and 81 deletions

9
core.h
View File

@@ -16,6 +16,9 @@
#define function static
#define global static
#define local_persist static
#define forever for (;;)
#define DeferLoop(begin_stmnt, end_stmnt) for(int __defer_i = ((begin_stmnt), 0); __defer_i < 1; (++__defer_i, (end_stmnt)))
// ### Types ###
typedef int8_t int8;
@@ -26,7 +29,7 @@ typedef uint8_t uint8;
typedef uint16_t uint16;
typedef uint32_t uint32;
typedef uint64_t uint64;
typedef uint8_t byte;
typedef char byte;
typedef float real32;
typedef double real64;
typedef struct string string;
@@ -76,6 +79,7 @@ void scratchEnd(Scratch scratch);
#define PushArrayZero(arena, type, size) (type *)pushSizeFill(arena, sizeof(type) * (size), 0)
#define PushStruct(arena, type) (type *)pushSize(arena, sizeof(type))
#define PushStructZero(arena, type) (type *)pushSizeFill(arena, sizeof(type), 0)
#define WithScratch(scratchName) Scratch scratchName; DeferLoop(scratchName = scratchStart(0, 0), scratchEnd(scratchName))
// ### Vectors ###
typedef union Vec2 Vec2;
@@ -300,7 +304,10 @@ typedef enum {
DefineList(int, Int);
void printIntList(IntList l);
void printStrList(StringList l);
void setStdout();
void setStderr();
extern void (*print)(const char *fmt, ...);
extern void (*println)(const char *fmt, ...);
// ### Loops ###
#define EachIn(list, it) size_t it = 0; it < (list).length; it++