diff options
author | José Fonseca <[email protected]> | 2008-07-26 09:17:10 +0900 |
---|---|---|
committer | José Fonseca <[email protected]> | 2008-07-26 09:18:07 +0900 |
commit | ff7a7031caa0ac592f210aca696a20c9de6dc0d4 (patch) | |
tree | 39f9cbd6193555005a720c7e934ba56f03444a88 /src/gallium/auxiliary/util/u_snprintf.c | |
parent | 40acf8cce24afe80388639b804f9ae8c0b779d81 (diff) |
gallium: Windows miniport portability fixes.
Diffstat (limited to 'src/gallium/auxiliary/util/u_snprintf.c')
-rw-r--r-- | src/gallium/auxiliary/util/u_snprintf.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_snprintf.c b/src/gallium/auxiliary/util/u_snprintf.c index c4f4bbd30c2..7fa84d8bec6 100644 --- a/src/gallium/auxiliary/util/u_snprintf.c +++ b/src/gallium/auxiliary/util/u_snprintf.c @@ -162,6 +162,8 @@ * <http://www.jhweiss.de/software/snprintf.html>. */ +#include "pipe/p_config.h" + #if HAVE_CONFIG_H #include <config.h> #else @@ -1102,7 +1104,11 @@ again: * Factor of ten with the number of digits needed for the fractional * part. For example, if the precision is 3, the mask will be 1000. */ +#if defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT) + mask = (unsigned long)mypow10(precision); +#else mask = (UINTMAX_T)mypow10(precision); +#endif /* * We "cheat" by converting the fractional part to integer by * multiplying by a factor of ten. @@ -1354,7 +1360,11 @@ cast(LDOUBLE value) if (value >= UINTMAX_MAX) return UINTMAX_MAX; +#if defined(PIPE_SUBSYSTEM_WINDOWS_MINIPORT) + result = (unsigned long)value; +#else result = (UINTMAX_T)value; +#endif /* * At least on NetBSD/sparc64 3.0.2 and 4.99.30, casting long double to * an integer type converts e.g. 1.9 to 2 instead of 1 (which violates |