-#else
-
-#if defined(TARGET_SDL)
-static unsigned int mainCounter(int mode)
-{
- static unsigned int base_ms = 0;
- unsigned int current_ms;
- unsigned int counter_ms;
-
- current_ms = SDL_GetTicks();
-
- /* reset base time in case of counter initializing or wrap-around */
- if (mode == INIT_COUNTER || current_ms < base_ms)
- base_ms = current_ms;
-
- counter_ms = current_ms - base_ms;
-
- return counter_ms; /* return milliseconds since last init */
-}
-
-#else /* !TARGET_SDL */
-
-#if defined(PLATFORM_UNIX)
-static unsigned int mainCounter(int mode)
-{
- static struct timeval base_time = { 0, 0 };
- struct timeval current_time;
- unsigned int counter_ms;
-
- gettimeofday(¤t_time, NULL);
-
- /* reset base time in case of counter initializing or wrap-around */
- if (mode == INIT_COUNTER || current_time.tv_sec < base_time.tv_sec)
- base_time = current_time;
-
- counter_ms = (current_time.tv_sec - base_time.tv_sec) * 1000
- + (current_time.tv_usec - base_time.tv_usec) / 1000;
-
- return counter_ms; /* return milliseconds since last init */
-}
-#endif /* PLATFORM_UNIX */
-#endif /* !TARGET_SDL */
-
-#endif
-