MSVC support, Watcom is still recommended

This commit is contained in:
Nishi 2026-06-20 03:04:36 +09:00
commit c17f7a56cc
10 changed files with 87 additions and 23 deletions

View file

@ -66,7 +66,7 @@ FILE* Fopen(char* filename, char* type) {
fl = (FileList*)Malloc(sizeof(*fl));
len = strlen(filename) + 1;
fl->fname = Malloc(len);
strlcpy(fl->fname, filename, len);
sj4_strlcpy(fl->fname, filename, len);
fl->fp = fp;
fl->next = flist;

View file

@ -59,7 +59,7 @@ char* make_idxlist(char* name) {
i = strlen(name);
p = Zalloc(i + 2);
strlcpy(p, name, i + 2);
sj4_strlcpy(p, name, i + 2);
return p;
}
char* get_idxlist(char* name) {
@ -180,7 +180,7 @@ void mark_file(FILE* out) {
fputc('\n', out);
Fclose(fp);
} else {
strlcpy(pathname, idxtop, sizeof(pathname));
sj4_strlcpy(pathname, idxtop, sizeof(pathname));
pos = infp ? Ftell(infp) : 0;
}
}

View file

@ -430,7 +430,7 @@ void makehead(u_char* dict_name) {
put4byte(header + VERSIONPOS, DICTVERSION);
time(&i);
p = header + COMMENTPOS;
snprintf((char*)p, sizeof(header) - COMMENTPOS, "%s : %s", dict_name, ctime(&i));
sj4_snprintf((char*)p, sizeof(header) - COMMENTPOS, "%s : %s", dict_name, ctime(&i));
while(*p) {
if(*p == '\n') {
*p = 0;

View file

@ -26,6 +26,7 @@
#include <sys/stat.h>
#include "sj4_dict_struct.h"
#include "sj_compat.h"
/* char.c */
int cnvyomi(int);