-1. switch.h: Find a good home for the SWITCH_DECLARE stuff for win32\r
-2. MOD_WOOMERACHAN: #if 1==0 sectiton, convert to use switch_now instead of gettimeof day \r
- SWITCH_SLEEP (should I be using switch_sleep or switch_yield where I changed from sleep and usleep)\r
-3. if we don't need the timeval stuff let's get rid of it... it doesn't appear to be used.\r
+1. MOD_WOOMERACHAN: #if 1==0 sectiton, convert to use switch_now instead of gettimeof day \r
+2. switch_version.h. Change both msvc and unix scripts to create this to look for a VERSION file to generate this for tarball releases.
\ No newline at end of file
#define vsnprintf apr_vsnprintf
#endif
-#ifdef HAVE_TIMEVAL_STRUCT
-extern struct timeval tv;
-#ifdef WIN32
-typedef long switch_timeval_t;
-typedef long switch_suseconds_t;
-#else
-typedef typeof(tv.tv_sec) switch_timeval_t;
-typedef typeof(tv.tv_usec) switch_suseconds_t;
-#endif
-#endif
-
/*!
\brief Duplicate a string
*/
SWITCH_DECLARE(char *) switch_cut_path(char *in);
-
-/* stuff below will probably be tossed soon */
-
-#if !defined(switch_strdupa) && defined(__GNUC__)
-# define switch_strdupa(s) \
- (__extension__ \
- ({ \
- __const char *__old = (s); \
- size_t __len = strlen (__old) + 1; \
- char *__new = (char *) __builtin_alloca (__len); \
- (char *) memcpy (__new, __old, __len); \
- }))
-#endif
-
-
-#ifdef HAVE_TIMEVAL_STRUCT
-struct timeval switch_tvadd(struct timeval a, struct timeval b);
-struct timeval switch_tvsub(struct timeval a, struct timeval b);
-
-
-/*static struct timeval switch_tvnow(void)
-{
- struct timeval t;
- gettimeofday(&t, NULL);
- return t;
-}
-*/
-
-static struct timeval switch_tv(switch_timeval_t sec, switch_suseconds_t usec)
-{
- struct timeval t;
- t.tv_sec = sec;
- t.tv_usec = usec;
- return t;
-
-}
-
-static int switch_tvdiff_ms(struct timeval end, struct timeval start)
-{
- /* the offset by 1,000,000 below is intentional...
- it avoids differences in the way that division
- is handled for positive and negative numbers, by ensuring
- that the divisor is always positive
- */
- return ((end.tv_sec - start.tv_sec) * 1000) +
- (((1000000 + end.tv_usec - start.tv_usec) / 1000) - 1000);
-}
-
-#endif
-
#ifdef __cplusplus
}
-
#endif
#endif