Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
1bea8247
Commit
1bea8247
authored
Mar 13, 2022
by
Rob Swindell
💬
Browse files
Create *nix wrapper for MSVC's _i64toa()
parent
d855e164
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
src/xpdev/genwrap.c
src/xpdev/genwrap.c
+19
-0
src/xpdev/genwrap.h
src/xpdev/genwrap.h
+1
-0
No files found.
src/xpdev/genwrap.c
View file @
1bea8247
...
...
@@ -601,6 +601,25 @@ char* ultoa(ulong val, char* str, int radix)
}
return
(
str
);
}
char
*
_i64toa
(
int64_t
val
,
char
*
str
,
int
radix
)
{
switch
(
radix
)
{
case
8
:
sprintf
(
str
,
"%"
PRIo64
,
val
);
break
;
case
10
:
sprintf
(
str
,
"%"
PRId64
,
val
);
break
;
case
16
:
sprintf
(
str
,
"%"
PRIx64
,
val
);
break
;
default:
sprintf
(
str
,
"bad radix: %d"
,
radix
);
break
;
}
return
str
;
}
#endif
/****************************************************************************/
...
...
src/xpdev/genwrap.h
View file @
1bea8247
...
...
@@ -228,6 +228,7 @@ extern "C" {
#if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__WATCOMC__)
DLLEXPORT
char
*
ultoa
(
ulong
,
char
*
,
int
radix
);
DLLEXPORT
char
*
_i64toa
(
int64_t
,
char
*
,
int
radix
);
#endif
#if defined(__unix__)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment