diff options
author | Chris Sutcliffe <ir0nh34d@users.sourceforge.net> | 2010-12-28 00:01:13 +0300 |
---|---|---|
committer | Chris Sutcliffe <ir0nh34d@users.sourceforge.net> | 2010-12-28 00:01:13 +0300 |
commit | c3abd2abe882abf26001254c0a00307489941e93 (patch) | |
tree | 4cd3d3360ab7100a6366b50f5a17e4ee736d2a27 /winsup/mingw | |
parent | 8eb8d2727457ece6bac9d69750baf7cb1251cef8 (diff) |
2010-11-08 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
* tlssup.c (__dyn_tls_init): Use an integer variable to iterate between
__xd_a and __xd_z.
Diffstat (limited to 'winsup/mingw')
-rw-r--r-- | winsup/mingw/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/mingw/tlssup.c | 21 |
2 files changed, 17 insertions, 9 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index e90df7c54..bc65b26cf 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,3 +1,8 @@ +2010-11-08 Rodrigo Rivas Costa <rodrigorivascosta@gmail.com> + + * tlssup.c (__dyn_tls_init): Use an integer variable to iterate between + __xd_a and __xd_z. + 2010-08-17 Keith Marshall <keithmarshall@users.sourceforge.net> * include/limits.h (PATH_MAX): Make it agree with Microsoft's diff --git a/winsup/mingw/tlssup.c b/winsup/mingw/tlssup.c index b101d1124..660d09800 100644 --- a/winsup/mingw/tlssup.c +++ b/winsup/mingw/tlssup.c @@ -94,6 +94,7 @@ BOOL WINAPI __dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) { _PVFV *pfunc; + int nfuncs, ifunc; #ifndef _WIN64 if (_winmajor < 4) @@ -107,13 +108,13 @@ __dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) } if (__mingw_mthread_hdll == NULL || !__mingw_gMTRemoveKeyDtor || !__mingw_gMTKeyDtor) { - __mingw_gMTKeyDtor = NULL; - __mingw_gMTRemoveKeyDtor = NULL; - if (__mingw_mthread_hdll) - FreeLibrary (__mingw_mthread_hdll); - __mingw_mthread_hdll = NULL; - _CRT_MT = 0; - return TRUE; + __mingw_gMTKeyDtor = NULL; + __mingw_gMTRemoveKeyDtor = NULL; + if (__mingw_mthread_hdll) + FreeLibrary (__mingw_mthread_hdll); + __mingw_mthread_hdll = NULL; + _CRT_MT = 0; + return TRUE; } _CRT_MT = 1; return TRUE; @@ -130,10 +131,12 @@ __dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved) return TRUE; } - for (pfunc = &__xd_a + 1; pfunc != &__xd_z; ++pfunc) + nfuncs = &__xd_z - (&__xd_a + 1); + for (ifunc = 0; ifunc < nfuncs; ++ifunc) { + pfunc = (&__xd_a + 1) + ifunc; if (*pfunc != NULL) - (*pfunc)(); + (*pfunc)(); } return TRUE; } |