Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Richard Gobeille
EDuke32
Commits
fbb13303
Commit
fbb13303
authored
Dec 10, 2020
by
Evan Ramos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid error with some toolchains where klabs(int16_t) turns into abs(double)
parent
3ad3d65f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
source/build/include/pragmas.h
source/build/include/pragmas.h
+6
-1
No files found.
source/build/include/pragmas.h
View file @
fbb13303
...
...
@@ -264,7 +264,12 @@ static FORCE_INLINE int32_t klabs(int32_t const a)
return (a ^ m) - m;
}
#else
#define klabs(x) abs(x)
# ifdef __cplusplus
// some toolchains use the double version of abs for small int types, so avoid that
static
FORCE_INLINE
CONSTEXPR
int32_t
klabs
(
int32_t
const
a
)
{
return
abs
(
a
);
}
# else
# define klabs(x) abs(x)
# endif
#endif
#endif
#ifndef pragmas_have_ksgn
...
...
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