Skip to content

Commit

Permalink
fix: ssize_t on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
nalgeon committed Jun 14, 2023
1 parent c0d5ab3 commit 7770d3a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/fileio/legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@

#else

#if !defined(_MSC_VER)
#define _MSC_VER 1929
#endif
#define FILEIO_WIN32_DLL
#include <direct.h>
#include <io.h>
Expand Down
9 changes: 8 additions & 1 deletion src/fileio/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
#include <stdlib.h>
#include <string.h>

#if defined(_MSC_VER)
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#else
#include <sys/types.h>
#endif

#include "sqlite3ext.h"
SQLITE_EXTENSION_INIT3

Expand All @@ -22,7 +29,7 @@ SQLITE_EXTENSION_INIT3
* `lineptr` points to the first character read.
* `n` equals the current buffer size.
*/
static size_t readline(char** lineptr, size_t* n, FILE* stream) {
static ssize_t readline(char** lineptr, size_t* n, FILE* stream) {
char* bufptr = NULL;
char* p = bufptr;
size_t size;
Expand Down

0 comments on commit 7770d3a

Please sign in to comment.