* 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
str.h
View file

@ -2,6 +2,7 @@
#ifdef __cplusplus
extern "C" {
#include <string>
#endif
#include <stdint.h>
@ -9,13 +10,17 @@ extern "C" {
#include <stddef.h>
#include <limits.h>
#include <wchar.h>
// #include "strview.h"
#define STRV_NOT_FOUND SIZE_MAX
typedef struct {
typedef struct str_t {
char *buf;
size_t len;
#ifdef __cplusplus
inline operator std::string() const {
return std::string(buf, len);
}
#endif
} str_t;
typedef struct {