} while (0)
# define MS_TIME_DIFF(a,b) ((unsigned long)((long)(a.tv_sec-b.tv_sec) * 1000 \
+ (long)(a.tv_usec-b.tv_usec) / 1000))
+ /* "a" time is expected to be not earlier than */
+ /* "b" one; the result has unsigned long type. */
#elif defined(MSWIN32) || defined(MSWINCE)
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN 1
# else
# define GET_TIME(x) (void)(x = GetTickCount())
# endif
-# define MS_TIME_DIFF(a,b) ((long)((a)-(b)))
+# define MS_TIME_DIFF(a,b) ((unsigned long)((a)-(b)))
#elif defined(NN_PLATFORM_CTR)
# define CLOCK_TYPE long long
EXTERN_C_BEGIN
CLOCK_TYPE n3ds_convert_tick_to_ms(CLOCK_TYPE tick);
EXTERN_C_END
# define GET_TIME(x) (void)(x = n3ds_get_system_tick())
-# define MS_TIME_DIFF(a,b) ((long)n3ds_convert_tick_to_ms((a)-(b)))
+# define MS_TIME_DIFF(a,b) ((unsigned long)n3ds_convert_tick_to_ms((a)-(b)))
#else /* !BSD_TIME && !NN_PLATFORM_CTR && !MSWIN32 && !MSWINCE */
# include <time.h>
# if defined(FREEBSD) && !defined(CLOCKS_PER_SEC)