| 197 | #endif |
| 198 | |
| 199 | void Math_obj::__boot() |
| 200 | { |
| 201 | Static(Math_obj::__mClass) = hx::_hx_RegisterClass(HX_CSTRING("Math"),TCanCast<Math_obj>,sMathFields,sNone, &__CreateEmpty,0 , 0 ); |
| 202 | |
| 203 | #ifdef HXCPP_SCRIPTABLE |
| 204 | Math_obj::__mClass->mStaticStorageInfo = Math_obj_sStaticStorageInfo; |
| 205 | #endif |
| 206 | |
| 207 | #if defined(HX_WINDOWS) || defined(__SNC__) |
| 208 | unsigned int t = clock(); |
| 209 | #else |
| 210 | struct timeval tv; |
| 211 | gettimeofday(&tv,0); |
| 212 | unsigned int t = tv.tv_sec * 1000000 + tv.tv_usec; |
| 213 | #endif |
| 214 | |
| 215 | #if defined(HX_WINDOWS) && !defined(__BORLANDC__) |
| 216 | #if defined(HX_WINRT) |
| 217 | #if defined(__cplusplus_winrt) |
| 218 | int pid = Windows::Security::Cryptography::CryptographicBuffer::GenerateRandomNumber(); |
| 219 | #else |
| 220 | int pid = GetCurrentProcessId(); |
| 221 | #endif |
| 222 | #else |
| 223 | int pid = _getpid(); |
| 224 | #endif |
| 225 | #else |
| 226 | int pid = getpid(); |
| 227 | #endif |
| 228 | |
| 229 | srand(t ^ (pid | (pid << 16))); |
| 230 | #ifdef HX_ANDROID |
| 231 | srand48(t ^ (pid | (pid << 16))); |
| 232 | #endif |
| 233 | rand(); |
| 234 | } |
| 235 | |
| 236 | namespace hx |
| 237 | { |
nothing calls this directly
no test coverage detected