diff options
author | David Allsopp <david.allsopp@metastack.com> | 2020-04-23 11:12:00 +0100 |
---|---|---|
committer | Enguerrand Decorne <decorne.en@gmail.com> | 2020-04-30 10:31:30 +0200 |
commit | a9f7d74bcf332ffc18d394b5c6af30a1a74d01ab (patch) | |
tree | 879e4516b83ed9f98492f360b7cb31ad3a445d8c /runtime/caml/misc.h | |
parent | 2e30946419bd22cd6dfd69ea5066b96ce9aab9b8 (diff) | |
download | ocaml-a9f7d74bcf332ffc18d394b5c6af30a1a74d01ab.tar.gz |
Add snprintf_os
Diffstat (limited to 'runtime/caml/misc.h')
-rw-r--r-- | runtime/caml/misc.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/runtime/caml/misc.h b/runtime/caml/misc.h index e7b08515e5..a140109211 100644 --- a/runtime/caml/misc.h +++ b/runtime/caml/misc.h @@ -401,7 +401,8 @@ extern void caml_set_fields (intnat v, uintnat, uintnat); /* snprintf emulation for Win32 */ -#if defined(_WIN32) && !defined(_UCRT) +#ifdef _WIN32 +#ifndef _UCRT extern int caml_snprintf(char * buf, size_t size, const char * format, ...); #define snprintf caml_snprintf #endif @@ -503,6 +504,14 @@ extern void caml_instr_atexit (void); #endif /* CAML_INSTR */ +extern int caml_snwprintf(wchar_t * buf, + size_t size, + const wchar_t * format, ...); +#define snprintf_os caml_snwprintf +#else +#define snprintf_os snprintf +#endif + /* Macro used to deactivate thread and address sanitizers on some functions. */ #define CAMLno_tsan |