diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2024-08-30 15:59:07 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2024-08-30 15:59:07 +0200 |
| commit | 7ecdced4860d12b8f484e0b222d08192be4a56eb (patch) | |
| tree | 99bc64ddda5255926398855eebf8ce248913296b /src/libtools/threads32.c | |
| parent | 13b72df762476b13a6bc6e1cb1e7fa622068224d (diff) | |
| download | box64-7ecdced4860d12b8f484e0b222d08192be4a56eb.tar.gz box64-7ecdced4860d12b8f484e0b222d08192be4a56eb.zip | |
[BOX32] Added more 32bits wrapped function and fixes
Diffstat (limited to 'src/libtools/threads32.c')
| -rwxr-xr-x | src/libtools/threads32.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libtools/threads32.c b/src/libtools/threads32.c index 72229d70..d99a085e 100755 --- a/src/libtools/threads32.c +++ b/src/libtools/threads32.c @@ -816,6 +816,15 @@ EXPORT int my32_pthread_mutex_destroy(pthread_mutex_t *m) } #define getAlignedMutexWithInit(A, B) getAlignedMutex(A) +EXPORT int my32_pthread_mutexattr_init(x64emu_t* emu, pthread_mutexattr_t* att) +{ + // mutexattr is 4 bytes on x86, but 8 on 64bits platforms... + uint32_t save = att?(((uint32_t*)att)[1]):0; + int ret = pthread_mutexattr_init(att); + if(att) ((uint32_t*)att)[1] = save; + return ret; +} + EXPORT int my32___pthread_mutex_destroy(pthread_mutex_t *m) __attribute__((alias("my32_pthread_mutex_destroy"))); EXPORT int my32_pthread_mutex_init(pthread_mutex_t *m, pthread_mutexattr_t *att) |