mirror of
https://github.com/cathugger/mkp224o.git
synced 2025-12-05 21:27:13 -06:00
attempt to support windows #2
This commit is contained in:
@@ -396,7 +396,7 @@ static void filters_add(const char *filter)
|
|||||||
if (!re) {
|
if (!re) {
|
||||||
PCRE2_UCHAR buffer[1024];
|
PCRE2_UCHAR buffer[1024];
|
||||||
pcre2_get_error_message(errornum,buffer,sizeof(buffer));
|
pcre2_get_error_message(errornum,buffer,sizeof(buffer));
|
||||||
fprintf(stderr,"PCRE2 compilation failed at offset %zu: %s\n",
|
fprintf(stderr,"PCRE2 compilation failed at offset " FSZ ": %s\n",
|
||||||
(size_t)erroroffset,buffer);
|
(size_t)erroroffset,buffer);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -640,7 +640,7 @@ static void filters_print()
|
|||||||
|
|
||||||
if (i >= 20) {
|
if (i >= 20) {
|
||||||
size_t notshown = l - i;
|
size_t notshown = l - i;
|
||||||
fprintf(stderr,"[another %zu %s not shown]\n",
|
fprintf(stderr,"[another " FSZ " %s not shown]\n",
|
||||||
notshown,notshown == 1 ? "filter" : "filters");
|
notshown,notshown == 1 ? "filter" : "filters");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -679,5 +679,5 @@ static void filters_print()
|
|||||||
fprintf(stderr,"\t%s\n",VEC_BUF(filters,i).str);
|
fprintf(stderr,"\t%s\n",VEC_BUF(filters,i).str);
|
||||||
#endif // PCRE2FILTER
|
#endif // PCRE2FILTER
|
||||||
}
|
}
|
||||||
fprintf(stderr,"in total, %zu %s\n",l,l == 1 ? "filter" : "filters");
|
fprintf(stderr,"in total, " FSZ " %s\n",l,l == 1 ? "filter" : "filters");
|
||||||
}
|
}
|
||||||
|
|||||||
8
main.c
8
main.c
@@ -20,6 +20,12 @@
|
|||||||
#include "ed25519/ed25519.h"
|
#include "ed25519/ed25519.h"
|
||||||
#include "ioutil.h"
|
#include "ioutil.h"
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
#define FSZ "%zu"
|
||||||
|
#else
|
||||||
|
#define FSZ "%Iu"
|
||||||
|
#endif
|
||||||
|
|
||||||
// additional 0 terminator is added by C
|
// additional 0 terminator is added by C
|
||||||
static const char * const pkprefix = "== ed25519v1-public: type0 ==\0\0";
|
static const char * const pkprefix = "== ed25519v1-public: type0 ==\0\0";
|
||||||
#define pkprefixlen (29 + 3)
|
#define pkprefixlen (29 + 3)
|
||||||
@@ -664,7 +670,7 @@ int main(int argc,char **argv)
|
|||||||
#endif
|
#endif
|
||||||
tret = pthread_create(&VEC_BUF(threads,i),0,fastkeygen ? dofastwork : dowork,tp);
|
tret = pthread_create(&VEC_BUF(threads,i),0,fastkeygen ? dofastwork : dowork,tp);
|
||||||
if (tret) {
|
if (tret) {
|
||||||
fprintf(stderr,"error while making %zuth thread: %d\n",i,tret);
|
fprintf(stderr,"error while making " FSZ "th thread: %d\n",i,tret);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user