MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / __boot

Method __boot

src/Math.cpp:199–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197#endif
198
199void 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
236namespace hx
237{

Callers

nothing calls this directly

Calls 3

_hx_RegisterClassFunction · 0.85
srandFunction · 0.85
randFunction · 0.85

Tested by

no test coverage detected