update get_nhuuid() for libnhmain
Try using emscripten_run_script_string("crypto.randomUUID()");
I need to commit this to the repository to test it elsewhere.
If there isn't a revert shortly after this, it must have at least
built without issue.
This commit is contained in:
@@ -800,6 +800,7 @@ after_opt_showpaths(const char *dir)
|
|||||||
void
|
void
|
||||||
get_nhuuid(void)
|
get_nhuuid(void)
|
||||||
{
|
{
|
||||||
|
char *uuid = NULL;
|
||||||
unsigned char stmp[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
unsigned char stmp[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||||
@@ -807,8 +808,11 @@ get_nhuuid(void)
|
|||||||
if (svn.nhuuid[0])
|
if (svn.nhuuid[0])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* FIXME: fill in a useful valid UUID somehow */
|
uuid = emscripten_run_script_string("crypto.randomUUID()");
|
||||||
Snprintf(svn.nhuuid, sizeof svn.nhuuid, "%s", (char *) stmp);
|
if (!uuid) {
|
||||||
|
uuid = (char *) &stmp[0];
|
||||||
|
}
|
||||||
|
Snprintf(svn.nhuuid, sizeof svn.nhuuid, "%s", uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user