* 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

9
dir.c
View file

@ -2,8 +2,7 @@
#include "tracelog.h"
#ifdef _WIN32
#define VC_EXTRALEAN
#include <windows.h>
#include "win32_slim.h"
#include <stdlib.h>
#include <assert.h>
@ -107,10 +106,10 @@ dir_entry_t *dirNext(dir_t ctx) {
// taken from https://sites.uclouvain.be/SystInfo/usr/include/dirent.h.html
// hopefully shouldn't be needed
#ifndef DT_DIR
#define DT_DIR 4
#define DT_DIR 4
#endif
#ifndef DT_REG
#define DT_REG 8
#define DT_REG 8
#endif
typedef struct {
@ -134,7 +133,7 @@ void dirClose(dir_t ctx) {
bool dirValid(dir_t ctx) {
_dir_internal_t *dir = (_dir_internal_t*)ctx;
return dir->handle != NULL;
return dir->dir != NULL;
}
dir_entry_t *dirNext(dir_t ctx) {