* win32_slim.h: includes the minimal version of windows.h
modified:
 * cthread: added lock_t c++ class
 * os: added getUserName()
 * socket: modified socket_len_t to sk_len_t to better follow naming convetions in file
 * str: added operator std::string() to str_t
This commit is contained in:
alessandrobason 2021-11-24 10:15:47 +00:00
parent 7fdc8b5301
commit bce93361b1
16 changed files with 187 additions and 70 deletions

6
file.c
View file

@ -3,8 +3,8 @@
#include "tracelog.h"
#ifdef _WIN32
#define VC_EXTRALEAN
#include <windows.h>
#include "win32_slim.h"
#include <stdlib.h>
static DWORD _toWin32Access(int mode) {
if(mode & FILE_READ) return GENERIC_READ;
@ -209,7 +209,7 @@ fread_buf_t fileReadWholeFP(file_t *ctx) {
str_t fileReadWholeText(const char *fname) {
file_t fp = fileOpen(fname, FILE_READ);
if(!fileIsValid(&fp)) {
err("couldn't open file %s -> %d", fname);
err("couldn't open file %s", fname);
return strInit();
}
str_t contents = fileReadWholeFPText(&fp);