Skip to content
Snippets Groups Projects
Commit c5508f70 authored by deuce's avatar deuce
Browse files

Rename 'y' variable in SLEEP macro for less collision (Funky things happen

if the passed value contains the y variable)
parent 63c8c8c4
Branches
Tags
No related merge requests found
...@@ -224,12 +224,12 @@ DLLEXPORT int DLLCALL get_errno(void); ...@@ -224,12 +224,12 @@ DLLEXPORT int DLLCALL get_errno(void);
#elif defined(__unix__) || defined(__APPLE__) #elif defined(__unix__) || defined(__APPLE__)
#if defined(_PTH_PTHREAD_H_) #if defined(_PTH_PTHREAD_H_)
#define SLEEP(x) ({ int y=x; struct timeval tv; \ #define SLEEP(x) ({ int sleep_msecs=x; struct timeval tv; \
tv.tv_sec=(y/1000); tv.tv_usec=((y%1000)*1000); \ tv.tv_sec=(sleep_msecs/1000); tv.tv_usec=((sleep_msecs%1000)*1000); \
pth_nap(tv); }) pth_nap(tv); })
#else #else
#define SLEEP(x) ({ int y=x; struct timeval tv; \ #define SLEEP(x) ({ int sleep_msecs=x; struct timeval tv; \
tv.tv_sec=(y/1000); tv.tv_usec=((y%1000)*1000); \ tv.tv_sec=(sleep_msecs/1000); tv.tv_usec=((sleep_msecs%1000)*1000); \
select(0,NULL,NULL,NULL,&tv); }) select(0,NULL,NULL,NULL,&tv); })
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment