Ticket #514: loader_darwin.patch
| File loader_darwin.patch, 43.2 KB (added by , 20 years ago) |
|---|
-
loader/ext.c
diff -ru /Users/stranche/Documents/devel/MPlayer-1.0pre8/loader/ext.c loader/ext.c
old new 233 233 234 234 //#define MAP_PRIVATE 235 235 //#define MAP_SHARED 236 #undef MAP_ANON237 236 LPVOID FILE_dommap( int unix_handle, LPVOID start, 238 237 DWORD size_high, DWORD size_low, 239 238 DWORD offset_high, DWORD offset_low, … … 248 247 249 248 if (unix_handle == -1) 250 249 { 251 #ifdef MAP_ANON250 #ifdef CONFIG_DARWIN 252 251 // printf("Anonymous\n"); 253 252 flags |= MAP_ANON; 253 fd = -1; 254 254 #else 255 255 static int fdzero = -1; 256 256 … … 263 263 } 264 264 } 265 265 fd = fdzero; 266 #endif /* MAP_ANON */266 #endif /* CONFIG_DARWIN */ 267 267 /* Linux EINVAL's on us if we don't pass MAP_PRIVATE to an anon mmap */ 268 268 #ifdef MAP_SHARED 269 269 flags &= ~MAP_SHARED; … … 276 276 // printf("fd %x, start %x, size %x, pos %x, prot %x\n",fd,start,size_low, offset_low, prot); 277 277 // if ((ret = mmap( start, size_low, prot, 278 278 // flags, fd, offset_low )) != (LPVOID)-1) 279 #ifndef CONFIG_DARWIN 279 280 if ((ret = mmap( start, size_low, prot, 280 281 MAP_PRIVATE | MAP_FIXED, fd, offset_low )) != (LPVOID)-1) 282 #else 283 if ((ret = mmap( start, size_low, prot, MAP_PRIVATE | MAP_FIXED | MAP_ANON, fd, offset_low )) != (LPVOID)-1) 284 #endif /* CONFIG_DARWIN */ 281 285 { 282 286 // printf("address %08x\n", *(int*)ret); 283 287 // printf("%x\n", ret); … … 471 475 472 476 if ((type&(MEM_RESERVE|MEM_COMMIT)) == 0) return NULL; 473 477 478 #ifndef CONFIG_DARWIN 474 479 fd=open("/dev/zero", O_RDWR); 475 480 if(fd<0){ 476 481 perror( "Cannot open /dev/zero for READ+WRITE. Check permissions! error: " ); 477 482 return NULL; 478 483 } 484 #endif /* CONFIG_DARWIN */ 479 485 480 486 if (type&MEM_RESERVE && (unsigned)address&0xffff) { 481 487 size += (unsigned)address&0xffff; … … 513 519 && ((unsigned)address+size<=(unsigned)str->address+str->mapping_size) 514 520 && (type & MEM_COMMIT)) 515 521 { 522 #ifndef CONFIG_DARWIN 516 523 close(fd); 524 #endif /* !CONFIG_DARWIN */ 517 525 return address; //returning previously reserved memory 518 526 } 519 527 //printf(" VirtualAlloc(...) does not commit or not entirely within reserved, and\n"); … … 525 533 } 526 534 } 527 535 536 #ifndef CONFIG_DARWIN 528 537 answer=mmap(address, size, PROT_READ | PROT_WRITE | PROT_EXEC, 529 538 MAP_PRIVATE, fd, 0); 539 #else 540 /* mmap feeding from fd from /dev/zero doesn't work on darwin ! */ 541 answer=mmap(address, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0); 542 #endif /* CONFIG_DARWIN */ 530 543 // answer=FILE_dommap(-1, address, 0, size, 0, 0, 531 544 // PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE); 545 #ifndef CONFIG_DARWIN 532 546 close(fd); 547 #endif /* !CONFIG_DARWIN */ 533 548 if (answer != (void *)-1 && address && answer != address) { 534 549 /* It is dangerous to try mmap() with MAP_FIXED since it does not 535 550 always detect conflicts or non-allocation and chaos ensues after -
loader/ldt_keeper.c
Only in loader: ext.c.old Only in loader: ext_darwin.patch2 diff -ru /Users/stranche/Documents/devel/MPlayer-1.0pre8/loader/ldt_keeper.c loader/ldt_keeper.c
old new 102 102 #define LDT_SEL(idx) ((idx) << 3 | 1 << 2 | 3) 103 103 104 104 /* i got this value from wine sources, it's the first free LDT entry */ 105 #if defined(__FreeBSD__) && defined(LDT_AUTO_ALLOC)105 #if (defined(__FreeBSD__) || defined(CONFIG_DARWIN)) && defined(LDT_AUTO_ALLOC) 106 106 #define TEB_SEL_IDX LDT_AUTO_ALLOC 107 107 #endif 108 108 … … 167 167 #endif 168 168 #endif 169 169 170 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined( __OpenBSD__) || defined(__DragonFly__)170 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(CONFIG_DARWIN) || defined(__OpenBSD__) || defined(__DragonFly__) 171 171 static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt_s *content ) 172 172 { 173 173 *buffer++ = ((content->base_addr & 0x0000ffff) << 16) | … … 193 193 194 194 if (!ldt_fs) 195 195 return NULL; 196 196 #ifndef CONFIG_DARWIN 197 197 ldt_fs->fd = open("/dev/zero", O_RDWR); 198 198 if(ldt_fs->fd<0){ 199 199 perror( "Cannot open /dev/zero for READ+WRITE. Check permissions! error: "); … … 202 202 fs_seg= 203 203 ldt_fs->fs_seg = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE, 204 204 ldt_fs->fd, 0); 205 #else 206 fs_seg= 207 ldt_fs->fs_seg = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); 208 #endif /* CONFIG_DARWIN */ 205 209 if (ldt_fs->fs_seg == (void*)-1) 206 210 { 207 211 perror("ERROR: Couldn't allocate memory for fs segment"); … … 229 233 } 230 234 #endif /*linux*/ 231 235 232 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined( __OpenBSD__) || defined(__DragonFly__)236 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(CONFIG_DARWIN) || defined(__OpenBSD__) || defined(__DragonFly__) 233 237 { 234 238 unsigned long d[2]; 235 239 236 240 LDT_EntryToBytes( d, &array ); 237 #if defined(__FreeBSD__) && defined(LDT_AUTO_ALLOC)241 #if (defined(__FreeBSD__) || defined(CONFIG_DARWIN)) && defined(LDT_AUTO_ALLOC) 238 242 ret = i386_set_ldt(LDT_AUTO_ALLOC, (union descriptor *)d, 1); 239 243 array.entry_number = ret; 240 244 fs_ldt = ret; -
loader/registry.c
Only in loader: ldt_keeper.c.old diff -ru /Users/stranche/Documents/devel/MPlayer-1.0pre8/loader/registry.c loader/registry.c
old new 24 24 //#undef TRACE 25 25 //#define TRACE printf 26 26 27 /* 28 * Modified by DarkSoul (darksoul@darkbsd.org) 29 * 30 * Added prefixes and suffixes to every non-WINAPI 31 * function. This is for use with ia32/Darwin, in 32 * order to ensure a clean %esp register. 33 */ 34 35 #ifdef CONFIG_DARWIN 36 # define STACK_CLEANER_PREFIX __asm__( "pushl %ebp \n\t" \ 37 "movl %esp, %ebp \n\t" \ 38 "andl $-16, %esp \n\t" \ 39 "subl $16, %esp \n\t" ) 40 # define STACK_CLEANER_SUFFIX __asm__( "leave \n\t" ) 41 #else 42 /* No need for stack cleaner unless for Darwin, is there ? */ 43 # define STACK_CLEANER_PREFIX 44 # define STACK_CLEANER_SUFFIX 45 #endif 46 27 47 extern char *get_path ( char * ); 28 48 29 49 // ...can be set before init_registry() call … … 58 78 static void save_registry(void); 59 79 static void init_registry(void); 60 80 81 /* 82 * Modified by DarkSoul (darksoul@darkbsd.org) 83 * 84 * Added my own strcat/strcpy/strlen implementations 85 * so on Darwin system it doesn't have to resort to 86 * loading it from a dynamic lib, which can crash 87 * MPlayer if %esp register is in a wrong state. 88 */ 89 90 static int my_strlen(char *str) 91 { 92 int i; 93 94 if (str) 95 { 96 i = 0; 97 while ((*str++) != '\0') i++; 98 return i; 99 } 100 else 101 return 0; 102 } 103 104 static char *my_strcat(char *str1, const char *str2) 105 { 106 int len1, len2, i; 107 108 len1 = my_strlen(str1); 109 len2 = my_strlen(str2); 110 for (i = 0; i < len2; i++) 111 str1[i + len1] = str2[i]; 112 str1[len1 + len2] = '\0'; 113 return str1; 114 } 115 116 static char *my_strcpy(char *str1, const char *str2) 117 { 118 int len, i; 119 120 len = my_strlen(str2); 121 for (i = 0; i < len; i++) 122 str1[i] = str2[i]; 123 str1[len] = '\0'; 124 return str1; 125 } 61 126 62 127 static void create_registry(void){ 63 128 if(regs) … … 69 134 regs=(struct reg_value*)malloc(3*sizeof(struct reg_value)); 70 135 regs[0].type=regs[1].type=DIR; 71 136 regs[0].name=(char*)malloc(5); 72 strcpy(regs[0].name, "HKLM");137 my_strcpy(regs[0].name, "HKLM"); 73 138 regs[1].name=(char*)malloc(5); 74 strcpy(regs[1].name, "HKCU");139 my_strcpy(regs[1].name, "HKCU"); 75 140 regs[0].value=regs[1].value=NULL; 76 141 regs[0].len=regs[1].len=0; 77 142 reg_size=2; … … 142 207 write(fd, ®_size, 4); 143 208 for(i=0; i<reg_size; i++) 144 209 { 145 unsigned len= strlen(regs[i].name);210 unsigned len=my_strlen(regs[i].name); 146 211 write(fd, ®s[i].type, 4); 147 212 write(fd, &len, 4); 148 213 write(fd, regs[i].name, len); … … 237 302 t->prev=head; 238 303 } 239 304 t->next=0; 240 t->name=(char*)malloc( strlen(name)+1);241 strcpy(t->name, name);305 t->name=(char*)malloc(my_strlen(name)+1); 306 my_strcpy(t->name, name); 242 307 t->handle=handle; 243 308 head=t; 244 309 return t; … … 254 319 } 255 320 if(subkey==NULL) 256 321 subkey="<default>"; 257 full_name=(char*)malloc( strlen(t->name)+strlen(subkey)+10);258 strcpy(full_name, t->name);259 strcat(full_name, "\\");260 strcat(full_name, subkey);322 full_name=(char*)malloc(my_strlen(t->name)+my_strlen(subkey)+10); 323 my_strcpy(full_name, t->name); 324 my_strcat(full_name, "\\"); 325 my_strcat(full_name, subkey); 261 326 return full_name; 262 327 } 263 328 static struct reg_value* insert_reg_value(int handle, const char* name, int type, const void* value, int len) 264 329 { 330 STACK_CLEANER_PREFIX; 265 331 reg_handle_t* t; 266 332 struct reg_value* v; 267 333 char* fullname; … … 287 353 free(v->value); 288 354 free(v->name); 289 355 } 356 STACK_CLEANER_SUFFIX; 290 357 TRACE("RegInsert '%s' %p v:%d len:%d\n", name, value, *(int*)value, len); 291 358 v->type=type; 292 359 v->len=len; 293 360 v->value=(char*)malloc(len); 294 361 memcpy(v->value, value, len); 295 v->name=(char*)malloc(strlen(fullname)+1); 296 strcpy(v->name, fullname); 362 v->name=(char*)malloc(my_strlen(fullname)+1); 363 my_strcpy(v->name, fullname); 364 STACK_CLEANER_PREFIX; 297 365 free(fullname); 298 366 save_registry(); 367 STACK_CLEANER_SUFFIX; 299 368 return v; 300 369 } 301 370 … … 325 394 pthn = pwent->pw_dir; 326 395 } 327 396 328 localregpathname = (char*)malloc( strlen(pthn)+20);329 strcpy(localregpathname, pthn);330 strcat(localregpathname, "/.registry");397 localregpathname = (char*)malloc(my_strlen(pthn)+20); 398 my_strcpy(localregpathname, pthn); 399 my_strcat(localregpathname, "/.registry"); 331 400 } 332 401 #endif 333 402 … … 347 416 } 348 417 if(subkey==NULL) 349 418 return t; 350 full_name=(char*)malloc( strlen(t->name)+strlen(subkey)+10);351 strcpy(full_name, t->name);352 strcat(full_name, "\\");353 strcat(full_name, subkey);419 full_name=(char*)malloc(my_strlen(t->name)+strlen(subkey)+10); 420 my_strcpy(full_name, t->name); 421 my_strcat(full_name, "\\"); 422 my_strcat(full_name, subkey); 354 423 t=find_handle_by_name(full_name); 355 424 free(full_name); 356 425 return t; … … 512 581 { 513 582 struct reg_value* t; 514 583 char* c; 515 TRACE("Request to set value %s %d\n", name, *(const int*)data);584 // TRACE("Request to set value %s %d\n", name, *(const int*)data); 516 585 if(!regs) 517 586 init_registry(); 518 587 -
loader/stubs.s
diff -ru /Users/stranche/Documents/devel/MPlayer-1.0pre8/loader/stubs.s loader/stubs.s
old new 1 1 .data 2 .LC0: . string"Called unk_%s\n"3 . balign 42 .LC0: .asciz "Called unk_%s\n" 3 .p2align 2 4 4 .globl unk_exp1 5 5 unk_exp1: 6 6 pushl %ebp … … 14 14 subl %eax,%edx 15 15 leal 0(,%edx,2),%eax 16 16 movl %eax,%edx 17 addl $ export_names,%edx17 addl $_export_names,%edx 18 18 pushl %edx 19 19 pushl $.LC0 20 call printf20 call _printf 21 21 addl $8,%esp 22 22 xorl %eax,%eax 23 23 leave 24 24 ret 25 .globl exp_EH_prolog26 exp_EH_prolog:25 .globl _exp_EH_prolog 26 _exp_EH_prolog: 27 27 pushl $0xff 28 28 pushl %eax 29 29 pushl %fs:0 -
loader/win32.c
diff -ru /Users/stranche/Documents/devel/MPlayer-1.0pre8/loader/win32.c loader/win32.c
old new 19 19 20 20 #include "config.h" 21 21 22 23 /* 24 * Modified by DarkSoul (darksoul@darkbsd.org) 25 * 26 * Added prefixes and suffixes to every non-WINAPI 27 * function. This is for use with ia32/Darwin, in 28 * order to ensure a clean %esp register. 29 */ 30 31 #ifdef CONFIG_DARWIN 32 # define STACK_CLEANER_PREFIX __asm__( "pushl %ebp \n\t" \ 33 "movl %esp, %ebp \n\t" \ 34 "andl $-16, %esp \n\t" \ 35 "subl $16, %esp \n\t" ) 36 # define STACK_CLEANER_SUFFIX __asm__( "leave \n\t" ) 37 #else 38 /* No need for stack cleaner unless for Darwin, is there ? */ 39 # define STACK_CLEANER_PREFIX 40 # define STACK_CLEANER_SUFFIX 41 #endif 42 22 43 #ifdef MPLAYER 23 44 #ifdef USE_QTX_CODECS 24 45 #define QTX … … 193 214 #endif 194 215 int LOADER_DEBUG=1; // active only if compiled with -DDETAILED_OUT 195 216 //#define DETAILED_OUT 196 static inlinevoid dbgprintf(char* fmt, ...)217 static void dbgprintf(char* fmt, ...) 197 218 { 219 #ifndef CONFIG_DARWIN 198 220 #ifdef DETAILED_OUT 199 221 if(LOADER_DEBUG) 200 222 { 223 STACK_CLEANER_PREFIX; 201 224 FILE* f; 202 225 va_list va; 203 226 va_start(va, fmt); … … 211 234 fclose(f); 212 235 } 213 236 va_end(va); 237 STACK_CLEANER_SUFFIX; 214 238 } 215 239 #endif 216 240 #ifdef MPLAYER … … 223 247 // mp_dbg(MSGT_WIN32, MSGL_DBG3, fmt, va); 224 248 va_end(va); 225 249 } 250 STACK_CLEANER_PREFIX; 226 251 fflush(stdout); 252 STACK_CLEANER_SUFFIX; 253 #endif 227 254 #endif 228 255 } 229 256 … … 404 431 #ifdef GARBAGE 405 432 alloc_header* prevmem; 406 433 alloc_header* nextmem; 434 void* darwin_mem_temp = memory; // Used to store the memory argument 407 435 408 436 if (memory == 0) 409 437 return 0; … … 416 444 417 445 pthread_mutex_lock(&memmut); 418 446 447 STACK_CLEANER_PREFIX; 419 448 switch(header->type) 420 449 { 421 450 case AREATYPE_EVENT: 422 destroy_event( memory);451 destroy_event(darwin_mem_temp); 423 452 break; 424 453 case AREATYPE_COND: 425 pthread_cond_destroy((pthread_cond_t*) memory);454 pthread_cond_destroy((pthread_cond_t*)darwin_mem_temp); 426 455 break; 427 456 case AREATYPE_MUTEX: 428 pthread_mutex_destroy((pthread_mutex_t*) memory);457 pthread_mutex_destroy((pthread_mutex_t*)darwin_mem_temp); 429 458 break; 430 459 case AREATYPE_CRITSECT: 431 pthread_mutex_destroy(&((struct CRITSECT*) memory)->mutex);460 pthread_mutex_destroy(&((struct CRITSECT*)darwin_mem_temp)->mutex); 432 461 break; 433 462 default: 434 //memset( memory, 0xcc, header->size);463 //memset(darwin_mem_temp, 0xcc, header->size); 435 464 ; 436 465 } 466 STACK_CLEANER_SUFFIX; 437 467 438 468 header->deadbeef = 0; 439 469 prevmem = header->prev; … … 465 495 } 466 496 #endif 467 497 498 #ifndef MEMORY_DEBUG 468 499 static inline void* my_mreq(int size, int to_zero) 469 500 { 470 501 return mreq_private(size, to_zero, AREATYPE_CLIENT); 471 502 } 503 #endif 472 504 473 505 static int my_size(void* memory) 474 506 { … … 2479 2511 2480 2512 static void* WINAPI expSleep(int time) 2481 2513 { 2514 STACK_CLEANER_PREFIX; 2482 2515 #if HAVE_NANOSLEEP 2483 2516 /* solaris doesn't have thread safe usleep */ 2484 2517 struct timespec tsp; … … 2489 2522 usleep(time); 2490 2523 #endif 2491 2524 dbgprintf("Sleep(%d) => 0\n", time); 2525 STACK_CLEANER_SUFFIX; 2492 2526 return 0; 2493 2527 } 2494 2528 … … 3170 3204 #define SECS_1601_TO_1970 ((369 * 365 + 89) * 86400ULL) 3171 3205 static void WINAPI expGetSystemTimeAsFileTime(FILETIME* systime) 3172 3206 { 3207 STACK_CLEANER_PREFIX; 3173 3208 struct tm *local_tm; 3174 3209 struct timeval tv; 3175 3210 unsigned long long secs; 3176 3211 3212 //#ifndef CONFIG_DARWIN 3213 // This calls fflush(), which is not really liked on Darwin() in a DLL-code context 3214 // which maims %esp register. 3177 3215 dbgprintf("GetSystemTime(0x%x)\n", systime); 3216 //#endif /* !CONFIG_DARWIN */ 3178 3217 gettimeofday(&tv, NULL); 3179 3218 secs = (tv.tv_sec + SECS_1601_TO_1970) * 10000000; 3180 3219 secs += tv.tv_usec * 10; 3181 3220 systime->dwLowDateTime = secs & 0xffffffff; 3182 3221 systime->dwHighDateTime = (secs >> 32); 3222 STACK_CLEANER_SUFFIX; 3183 3223 } 3184 3224 3185 3225 static int WINAPI expGetEnvironmentVariableA(const char* name, char* field, int size) … … 3886 3926 */ 3887 3927 static void* expmalloc(int size) 3888 3928 { 3929 STACK_CLEANER_PREFIX; 3889 3930 //printf("malloc"); 3890 3931 // return malloc(size); 3891 3932 void* result=my_mreq(size,0); 3892 3933 dbgprintf("malloc(0x%x) => 0x%x\n", size,result); 3893 3934 if(result==0) 3894 printf("WARNING: malloc() failed\n"); 3935 printf("WARNING: malloc(%d) failed\n", size); 3936 STACK_CLEANER_SUFFIX; 3895 3937 return result; 3896 3938 } 3897 3939 static void expfree(void* mem) 3898 3940 { 3941 STACK_CLEANER_PREFIX; 3899 3942 // return free(mem); 3900 3943 dbgprintf("free(%p)\n", mem); 3901 3944 my_release(mem); 3945 STACK_CLEANER_SUFFIX; 3902 3946 } 3903 3947 /* needed by atrac3.acm */ 3904 3948 static void *expcalloc(int num, int size) 3905 3949 { 3950 STACK_CLEANER_PREFIX; 3906 3951 void* result=my_mreq(num*size,1); 3907 3952 dbgprintf("calloc(%d,%d) => %p\n", num,size,result); 3908 3953 if(result==0) 3909 3954 printf("WARNING: calloc() failed\n"); 3955 STACK_CLEANER_SUFFIX; 3910 3956 return result; 3911 3957 } 3912 3958 static void* expnew(int size) 3913 3959 { 3960 STACK_CLEANER_PREFIX; 3914 3961 // printf("NEW:: Call from address %08x\n STACK DUMP:\n", *(-1+(int*)&size)); 3915 3962 // printf("%08x %08x %08x %08x\n", 3916 3963 // size, *(1+(int*)&size), … … 3922 3969 dbgprintf("new(%d) => %p\n", size, result); 3923 3970 if (result==0) 3924 3971 printf("WARNING: new() failed\n"); 3972 STACK_CLEANER_SUFFIX; 3925 3973 return result; 3926 3974 3927 3975 } 3928 3976 static int expdelete(void* memory) 3929 3977 { 3978 STACK_CLEANER_PREFIX; 3930 3979 dbgprintf("delete(%p)\n", memory); 3931 3980 my_release(memory); 3981 STACK_CLEANER_SUFFIX; 3932 3982 return 0; 3933 3983 } 3934 3984 … … 4018 4068 #if 0 4019 4069 static int exp_initterm(int v1, int v2) 4020 4070 { 4071 STACK_CLEANER_PREFIX; 4021 4072 dbgprintf("_initterm(0x%x, 0x%x) => 0\n", v1, v2); 4022 4073 return 0; 4074 STACK_CLEANER_SUFFIX; 4023 4075 } 4024 4076 #else 4025 4077 /* merged from wine - 2002.04.21 */ … … 4037 4089 void* p = *start; 4038 4090 __asm__ __volatile__ 4039 4091 ( 4092 "pushl %ebp \n\t" 4093 "movl %esp, %ebp \n\t" 4094 "andl $-16, %esp \n\t" 4095 "subl $16, %esp \n\t" ); 4096 __asm__ __volatile__ 4097 ( 4040 4098 "pushl %%ebx \n\t" 4041 4099 "pushl %%ecx \n\t" 4042 4100 "pushl %%edx \n\t" … … 4048 4106 "popl %%edx \n\t" 4049 4107 "popl %%ecx \n\t" 4050 4108 "popl %%ebx \n\t" 4109 "leave \n\t" 4051 4110 : 4052 4111 : "a"(p) 4053 4112 : "memory" … … 4068 4127 4069 4128 static int expwsprintfA(char* string, const char* format, ...) 4070 4129 { 4130 STACK_CLEANER_PREFIX; 4071 4131 va_list va; 4072 4132 int result; 4073 4133 va_start(va, format); 4074 4134 result = vsprintf(string, format, va); 4075 4135 dbgprintf("wsprintfA(0x%x, '%s', ...) => %d\n", string, format, result); 4076 4136 va_end(va); 4137 STACK_CLEANER_SUFFIX; 4077 4138 return result; 4078 4139 } 4079 4140 4080 4141 static int expsprintf(char* str, const char* format, ...) 4081 4142 { 4143 STACK_CLEANER_PREFIX; 4082 4144 va_list args; 4083 4145 int r; 4084 4146 dbgprintf("sprintf(0x%x, %s)\n", str, format); 4085 4147 va_start(args, format); 4086 4148 r = vsprintf(str, format, args); 4087 4149 va_end(args); 4150 STACK_CLEANER_SUFFIX; 4088 4151 return r; 4089 4152 } 4090 4153 static int expsscanf(const char* str, const char* format, ...) 4091 4154 { 4155 STACK_CLEANER_PREFIX; 4092 4156 va_list args; 4093 4157 int r; 4094 4158 dbgprintf("sscanf(%s, %s)\n", str, format); 4095 4159 va_start(args, format); 4096 4160 r = vsscanf(str, format, args); 4097 4161 va_end(args); 4162 STACK_CLEANER_SUFFIX; 4098 4163 return r; 4099 4164 } 4100 4165 static void* expfopen(const char* path, const char* mode) … … 4105 4170 } 4106 4171 static int expfprintf(void* stream, const char* format, ...) 4107 4172 { 4173 STACK_CLEANER_PREFIX; 4108 4174 va_list args; 4109 4175 int r = 0; 4110 4176 dbgprintf("fprintf(%p, %s, ...)\n", stream, format); … … 4113 4179 r = vfprintf((FILE*) stream, format, args); 4114 4180 va_end(args); 4115 4181 #endif 4182 STACK_CLEANER_SUFFIX; 4116 4183 return r; 4117 4184 } 4118 4185 4119 4186 static int expprintf(const char* format, ...) 4120 4187 { 4188 STACK_CLEANER_PREFIX; 4121 4189 va_list args; 4122 4190 int r; 4123 4191 dbgprintf("printf(%s, ...)\n", format); 4124 4192 va_start(args, format); 4125 4193 r = vprintf(format, args); 4126 4194 va_end(args); 4195 STACK_CLEANER_SUFFIX; 4127 4196 return r; 4128 4197 } 4129 4198 4130 4199 static char* expgetenv(const char* varname) 4131 4200 { 4201 STACK_CLEANER_PREFIX; 4132 4202 char* v = getenv(varname); 4133 4203 dbgprintf("getenv(%s) => %s\n", varname, v); 4204 STACK_CLEANER_SUFFIX; 4134 4205 return v; 4135 4206 } 4136 4207 -
loader/wine/poppack.h
Only in loader/wine: libloader.a diff -ru /Users/stranche/Documents/devel/MPlayer-1.0pre8/loader/wine/poppack.h loader/wine/poppack.h
old new 1 #ifdef __WINE_PSHPACK_H 2 #undef __WINE_PSHPACK_H 1 /* 2 * Copyright (C) 1999 Patrik Stridvall 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 17 */ 3 18 4 #if defined(__GNUC__) || defined(__SUNPRO_C) 5 #pragma pack() 6 #elif defined(__SUNPRO_CC) 7 #warning "Assumes default alignment is 4" 8 #pragma pack(4) 9 #elif !defined(RC_INVOKED) 10 #error "Restoration of the previous alignment isn't supported by the compiler" 11 #endif /* defined(__GNUC__) || defined(__SUNPRO_C) ; !defined(RC_INVOKED) */ 19 #if defined(__WINE_PSHPACK_H15) 20 # ifndef __WINE_INTERNAL_POPPACK 21 # undef __WINE_PSHPACK_H15 22 # endif 23 /* Depth == 15 */ 24 25 # if __WINE_PSHPACK_H14 == 1 26 # pragma pack(1) 27 # elif __WINE_PSHPACK_H14 == 2 28 # pragma pack(2) 29 # elif __WINE_PSHPACK_H14 == 8 30 # pragma pack(8) 31 # else 32 # pragma pack(4) 33 # endif 34 35 #elif defined(__WINE_PSHPACK_H14) 36 # ifndef __WINE_INTERNAL_POPPACK 37 # undef __WINE_PSHPACK_H14 38 # endif 39 /* Depth == 14 */ 40 41 # if __WINE_PSHPACK_H13 == 1 42 # pragma pack(1) 43 # elif __WINE_PSHPACK_H13 == 2 44 # pragma pack(2) 45 # elif __WINE_PSHPACK_H13 == 8 46 # pragma pack(8) 47 # else 48 # pragma pack(4) 49 # endif 50 51 #elif defined(__WINE_PSHPACK_H13) 52 # ifndef __WINE_INTERNAL_POPPACK 53 # undef __WINE_PSHPACK_H13 54 # endif 55 /* Depth == 13 */ 56 57 # if __WINE_PSHPACK_H12 == 1 58 # pragma pack(1) 59 # elif __WINE_PSHPACK_H12 == 2 60 # pragma pack(2) 61 # elif __WINE_PSHPACK_H12 == 8 62 # pragma pack(8) 63 # else 64 # pragma pack(4) 65 # endif 66 67 #elif defined(__WINE_PSHPACK_H12) 68 # ifndef __WINE_INTERNAL_POPPACK 69 # undef __WINE_PSHPACK_H12 70 # endif 71 /* Depth == 12 */ 72 73 # if __WINE_PSHPACK_H11 == 1 74 # pragma pack(1) 75 # elif __WINE_PSHPACK_H11 == 2 76 # pragma pack(2) 77 # elif __WINE_PSHPACK_H11 == 8 78 # pragma pack(8) 79 # else 80 # pragma pack(4) 81 # endif 82 83 #elif defined(__WINE_PSHPACK_H11) 84 # ifndef __WINE_INTERNAL_POPPACK 85 # undef __WINE_PSHPACK_H11 86 # endif 87 /* Depth == 11 */ 88 89 # if __WINE_PSHPACK_H10 == 1 90 # pragma pack(1) 91 # elif __WINE_PSHPACK_H10 == 2 92 # pragma pack(2) 93 # elif __WINE_PSHPACK_H10 == 8 94 # pragma pack(8) 95 # else 96 # pragma pack(4) 97 # endif 98 99 #elif defined(__WINE_PSHPACK_H10) 100 # ifndef __WINE_INTERNAL_POPPACK 101 # undef __WINE_PSHPACK_H10 102 # endif 103 /* Depth == 10 */ 104 105 # if __WINE_PSHPACK_H9 == 1 106 # pragma pack(1) 107 # elif __WINE_PSHPACK_H9 == 2 108 # pragma pack(2) 109 # elif __WINE_PSHPACK_H9 == 8 110 # pragma pack(8) 111 # else 112 # pragma pack(4) 113 # endif 114 115 #elif defined(__WINE_PSHPACK_H9) 116 # ifndef __WINE_INTERNAL_POPPACK 117 # undef __WINE_PSHPACK_H9 118 # endif 119 /* Depth == 9 */ 120 121 # if __WINE_PSHPACK_H8 == 1 122 # pragma pack(1) 123 # elif __WINE_PSHPACK_H8 == 2 124 # pragma pack(2) 125 # elif __WINE_PSHPACK_H8 == 8 126 # pragma pack(8) 127 # else 128 # pragma pack(4) 129 # endif 130 131 #elif defined(__WINE_PSHPACK_H8) 132 # ifndef __WINE_INTERNAL_POPPACK 133 # undef __WINE_PSHPACK_H8 134 # endif 135 /* Depth == 8 */ 136 137 # if __WINE_PSHPACK_H7 == 1 138 # pragma pack(1) 139 # elif __WINE_PSHPACK_H7 == 2 140 # pragma pack(2) 141 # elif __WINE_PSHPACK_H7 == 8 142 # pragma pack(8) 143 # else 144 # pragma pack(4) 145 # endif 146 147 #elif defined(__WINE_PSHPACK_H7) 148 # ifndef __WINE_INTERNAL_POPPACK 149 # undef __WINE_PSHPACK_H7 150 # endif 151 /* Depth == 7 */ 152 153 # if __WINE_PSHPACK_H6 == 1 154 # pragma pack(1) 155 # elif __WINE_PSHPACK_H6 == 2 156 # pragma pack(2) 157 # elif __WINE_PSHPACK_H6 == 8 158 # pragma pack(8) 159 # else 160 # pragma pack(4) 161 # endif 162 163 #elif defined(__WINE_PSHPACK_H6) 164 # ifndef __WINE_INTERNAL_POPPACK 165 # undef __WINE_PSHPACK_H6 166 # endif 167 /* Depth == 6 */ 168 169 # if __WINE_PSHPACK_H5 == 1 170 # pragma pack(1) 171 # elif __WINE_PSHPACK_H5 == 2 172 # pragma pack(2) 173 # elif __WINE_PSHPACK_H5 == 8 174 # pragma pack(8) 175 # else 176 # pragma pack(4) 177 # endif 178 179 #elif defined(__WINE_PSHPACK_H5) 180 # ifndef __WINE_INTERNAL_POPPACK 181 # undef __WINE_PSHPACK_H5 182 # endif 183 /* Depth == 5 */ 184 185 # if __WINE_PSHPACK_H4 == 1 186 # pragma pack(1) 187 # elif __WINE_PSHPACK_H4 == 2 188 # pragma pack(2) 189 # elif __WINE_PSHPACK_H4 == 8 190 # pragma pack(8) 191 # else 192 # pragma pack(4) 193 # endif 194 195 #elif defined(__WINE_PSHPACK_H4) 196 # ifndef __WINE_INTERNAL_POPPACK 197 # undef __WINE_PSHPACK_H4 198 # endif 199 /* Depth == 4 */ 200 201 # if __WINE_PSHPACK_H3 == 1 202 # pragma pack(1) 203 # elif __WINE_PSHPACK_H3 == 2 204 # pragma pack(2) 205 # elif __WINE_PSHPACK_H3 == 8 206 # pragma pack(8) 207 # else 208 # pragma pack(4) 209 # endif 210 211 #elif defined(__WINE_PSHPACK_H3) 212 # ifndef __WINE_INTERNAL_POPPACK 213 # undef __WINE_PSHPACK_H3 214 # endif 215 /* Depth == 3 */ 216 217 # if __WINE_PSHPACK_H2 == 1 218 # pragma pack(1) 219 # elif __WINE_PSHPACK_H2 == 2 220 # pragma pack(2) 221 # elif __WINE_PSHPACK_H2 == 8 222 # pragma pack(8) 223 # else 224 # pragma pack(4) 225 # endif 226 227 #elif defined(__WINE_PSHPACK_H2) 228 # ifndef __WINE_INTERNAL_POPPACK 229 # undef __WINE_PSHPACK_H2 230 # endif 231 /* Depth == 2 */ 232 233 # if __WINE_PSHPACK_H == 1 234 # pragma pack(1) 235 # elif __WINE_PSHPACK_H == 2 236 # pragma pack(2) 237 # elif __WINE_PSHPACK_H == 8 238 # pragma pack(8) 239 # else 240 # pragma pack(4) 241 # endif 242 243 #elif defined(__WINE_PSHPACK_H) 244 # ifndef __WINE_INTERNAL_POPPACK 245 # undef __WINE_PSHPACK_H 246 # endif 247 /* Depth == 1 */ 248 249 # if defined(__SUNPRO_CC) 250 # warning "Assuming a default alignment of 4" 251 # pragma pack(4) 252 # else 253 # pragma pack() 254 # endif 255 256 #else 257 /* Depth == 0 ! */ 12 258 13 #else /* defined(__WINE_PSHPACK_H) */14 259 #error "Popping alignment isn't possible since no alignment has been pushed" 15 #endif /* defined(__WINE_PSHPACK_H) */ 260 261 #endif 262 263 #undef __WINE_INTERNAL_POPPACK -
loader/wine/pshpack1.h
Only in loader/wine: poppack.h.old diff -ru /Users/stranche/Documents/devel/MPlayer-1.0pre8/loader/wine/pshpack1.h loader/wine/pshpack1.h
old new 1 #ifndef __WINE_PSHPACK_H 2 #define __WINE_PSHPACK_H 1 1 /* 2 * Copyright (C) 1999 Patrik Stridvall 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 17 */ 3 18 4 #if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) 5 //#pragma pack(1) 6 #elif !defined(RC_INVOKED) 7 #error "1 as alignment isn't supported by the compiler" 8 #endif /* defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) ; !defined(RC_INVOKED) */ 9 10 #else /* !defined(__WINE_PSHPACK_H) */ 11 #error "Nested pushing of alignment isn't supported by the compiler" 12 #endif /* !defined(__WINE_PSHPACK_H) */ 19 #if defined(__WINE_PSHPACK_H15) 13 20 21 /* Depth > 15 */ 22 # error "Alignment nesting > 15 is not supported" 23 24 #else 25 26 # if !defined(__WINE_PSHPACK_H) 27 # define __WINE_PSHPACK_H 1 28 /* Depth == 1 */ 29 # elif !defined(__WINE_PSHPACK_H2) 30 # define __WINE_PSHPACK_H2 1 31 /* Depth == 2 */ 32 # define __WINE_INTERNAL_POPPACK 33 # include <poppack.h> 34 # elif !defined(__WINE_PSHPACK_H3) 35 # define __WINE_PSHPACK_H3 1 36 /* Depth == 3 */ 37 # define __WINE_INTERNAL_POPPACK 38 # include <poppack.h> 39 # elif !defined(__WINE_PSHPACK_H4) 40 # define __WINE_PSHPACK_H4 1 41 /* Depth == 4 */ 42 # define __WINE_INTERNAL_POPPACK 43 # include <poppack.h> 44 # elif !defined(__WINE_PSHPACK_H5) 45 # define __WINE_PSHPACK_H5 1 46 /* Depth == 5 */ 47 # define __WINE_INTERNAL_POPPACK 48 # include <poppack.h> 49 # elif !defined(__WINE_PSHPACK_H6) 50 # define __WINE_PSHPACK_H6 1 51 /* Depth == 6 */ 52 # define __WINE_INTERNAL_POPPACK 53 # include <poppack.h> 54 # elif !defined(__WINE_PSHPACK_H7) 55 # define __WINE_PSHPACK_H7 1 56 /* Depth == 7 */ 57 # define __WINE_INTERNAL_POPPACK 58 # include <poppack.h> 59 # elif !defined(__WINE_PSHPACK_H8) 60 # define __WINE_PSHPACK_H8 1 61 /* Depth == 8 */ 62 # define __WINE_INTERNAL_POPPACK 63 # include <poppack.h> 64 # elif !defined(__WINE_PSHPACK_H9) 65 # define __WINE_PSHPACK_H9 1 66 /* Depth == 9 */ 67 # define __WINE_INTERNAL_POPPACK 68 # include <poppack.h> 69 # elif !defined(__WINE_PSHPACK_H10) 70 # define __WINE_PSHPACK_H10 1 71 /* Depth == 10 */ 72 # define __WINE_INTERNAL_POPPACK 73 # include <poppack.h> 74 # elif !defined(__WINE_PSHPACK_H11) 75 # define __WINE_PSHPACK_H11 1 76 /* Depth == 11 */ 77 # define __WINE_INTERNAL_POPPACK 78 # include <poppack.h> 79 # elif !defined(__WINE_PSHPACK_H12) 80 # define __WINE_PSHPACK_H12 1 81 /* Depth == 12 */ 82 # define __WINE_INTERNAL_POPPACK 83 # include <poppack.h> 84 # elif !defined(__WINE_PSHPACK_H13) 85 # define __WINE_PSHPACK_H13 1 86 /* Depth == 13 */ 87 # define __WINE_INTERNAL_POPPACK 88 # include <poppack.h> 89 # elif !defined(__WINE_PSHPACK_H14) 90 # define __WINE_PSHPACK_H14 1 91 /* Depth == 14 */ 92 # define __WINE_INTERNAL_POPPACK 93 # include <poppack.h> 94 # elif !defined(__WINE_PSHPACK_H15) 95 # define __WINE_PSHPACK_H15 1 96 /* Depth == 15 */ 97 # define __WINE_INTERNAL_POPPACK 98 # include <poppack.h> 99 # endif 100 101 # if defined(_MSC_VER) && (_MSC_VER >= 800) 102 # pragma warning(disable:4103) 103 # endif 104 105 # pragma pack(1) 106 107 #endif -
loader/wine/pshpack2.h
Only in loader/wine: pshpack1.h.old diff -ru /Users/stranche/Documents/devel/MPlayer-1.0pre8/loader/wine/pshpack2.h loader/wine/pshpack2.h
old new 1 #ifndef __WINE_PSHPACK_H 2 #define __WINE_PSHPACK_H 2 1 /* 2 * Copyright (C) 1999 Patrik Stridvall 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 17 */ 3 18 4 #if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) 5 //#pragma pack(2) 6 #elif !defined(RC_INVOKED) 7 #error "2 as alignment isn't supported by the compiler" 8 #endif /* defined(__GNUC__) || defined(__SUNPRO_CC) ; !defined(RC_INVOKED) */ 9 10 #else /* !defined(__WINE_PSHPACK_H) */ 11 #error "Nested pushing of alignment isn't supported by the compiler" 12 #endif /* !defined(__WINE_PSHPACK_H) */ 19 #if defined(__WINE_PSHPACK_H15) 20 21 /* Depth > 15 */ 22 # error "Alignment nesting > 15 is not supported" 23 24 #else 25 26 # if !defined(__WINE_PSHPACK_H) 27 # define __WINE_PSHPACK_H 2 28 /* Depth == 1 */ 29 # elif !defined(__WINE_PSHPACK_H2) 30 # define __WINE_PSHPACK_H2 2 31 /* Depth == 2 */ 32 # define __WINE_INTERNAL_POPPACK 33 # include <poppack.h> 34 # elif !defined(__WINE_PSHPACK_H3) 35 # define __WINE_PSHPACK_H3 2 36 /* Depth == 3 */ 37 # define __WINE_INTERNAL_POPPACK 38 # include <poppack.h> 39 # elif !defined(__WINE_PSHPACK_H4) 40 # define __WINE_PSHPACK_H4 2 41 /* Depth == 4 */ 42 # define __WINE_INTERNAL_POPPACK 43 # include <poppack.h> 44 # elif !defined(__WINE_PSHPACK_H5) 45 # define __WINE_PSHPACK_H5 2 46 /* Depth == 5 */ 47 # define __WINE_INTERNAL_POPPACK 48 # include <poppack.h> 49 # elif !defined(__WINE_PSHPACK_H6) 50 # define __WINE_PSHPACK_H6 2 51 /* Depth == 6 */ 52 # define __WINE_INTERNAL_POPPACK 53 # include <poppack.h> 54 # elif !defined(__WINE_PSHPACK_H7) 55 # define __WINE_PSHPACK_H7 2 56 /* Depth == 7 */ 57 # define __WINE_INTERNAL_POPPACK 58 # include <poppack.h> 59 # elif !defined(__WINE_PSHPACK_H8) 60 # define __WINE_PSHPACK_H8 2 61 /* Depth == 8 */ 62 # define __WINE_INTERNAL_POPPACK 63 # include <poppack.h> 64 # elif !defined(__WINE_PSHPACK_H9) 65 # define __WINE_PSHPACK_H9 2 66 /* Depth == 9 */ 67 # define __WINE_INTERNAL_POPPACK 68 # include <poppack.h> 69 # elif !defined(__WINE_PSHPACK_H10) 70 # define __WINE_PSHPACK_H10 2 71 /* Depth == 10 */ 72 # define __WINE_INTERNAL_POPPACK 73 # include <poppack.h> 74 # elif !defined(__WINE_PSHPACK_H11) 75 # define __WINE_PSHPACK_H11 2 76 /* Depth == 11 */ 77 # define __WINE_INTERNAL_POPPACK 78 # include <poppack.h> 79 # elif !defined(__WINE_PSHPACK_H12) 80 # define __WINE_PSHPACK_H12 2 81 /* Depth == 12 */ 82 # define __WINE_INTERNAL_POPPACK 83 # include <poppack.h> 84 # elif !defined(__WINE_PSHPACK_H13) 85 # define __WINE_PSHPACK_H13 2 86 /* Depth == 13 */ 87 # define __WINE_INTERNAL_POPPACK 88 # include <poppack.h> 89 # elif !defined(__WINE_PSHPACK_H14) 90 # define __WINE_PSHPACK_H14 2 91 /* Depth == 14 */ 92 # define __WINE_INTERNAL_POPPACK 93 # include <poppack.h> 94 # elif !defined(__WINE_PSHPACK_H15) 95 # define __WINE_PSHPACK_H15 2 96 /* Depth == 15 */ 97 # define __WINE_INTERNAL_POPPACK 98 # include <poppack.h> 99 # endif 100 101 # if defined(_MSC_VER) && (_MSC_VER >= 800) 102 # pragma warning(disable:4103) 103 # endif 104 105 # pragma pack(2) 106 107 #endif -
loader/wine/pshpack4.h
Only in loader/wine: pshpack2.h.old diff -ru /Users/stranche/Documents/devel/MPlayer-1.0pre8/loader/wine/pshpack4.h loader/wine/pshpack4.h
old new 1 #ifndef __WINE_PSHPACK_H 2 #define __WINE_PSHPACK_H 4 1 /* 2 * Copyright (C) 1999 Patrik Stridvall 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 17 */ 3 18 4 #if defined(__GNUC__) || defined(__SUNPRO_CC) 5 //#pragma pack(4) 6 #elif defined(__SUNPRO_C) 7 //#pragma pack() 8 #elif !defined(RC_INVOKED) 9 #error "4 as alignment isn't supported by the compiler" 10 #endif /* defined(__GNUC__) || defined(__SUNPRO_CC) ; !defined(RC_INVOKED) */ 11 12 #else /* !defined(__WINE_PSHPACK_H) */ 13 #error "Nested pushing of alignment isn't supported by the compiler" 14 #endif /* !defined(__WINE_PSHPACK_H) */ 19 #if defined(__WINE_PSHPACK_H15) 15 20 21 /* Depth > 15 */ 22 # error "Alignment nesting > 15 is not supported" 23 24 #else 25 26 # if !defined(__WINE_PSHPACK_H) 27 # define __WINE_PSHPACK_H 4 28 /* Depth == 1 */ 29 # elif !defined(__WINE_PSHPACK_H2) 30 # define __WINE_PSHPACK_H2 4 31 /* Depth == 2 */ 32 # define __WINE_INTERNAL_POPPACK 33 # include <poppack.h> 34 # elif !defined(__WINE_PSHPACK_H3) 35 # define __WINE_PSHPACK_H3 4 36 /* Depth == 3 */ 37 # define __WINE_INTERNAL_POPPACK 38 # include <poppack.h> 39 # elif !defined(__WINE_PSHPACK_H4) 40 # define __WINE_PSHPACK_H4 4 41 /* Depth == 4 */ 42 # define __WINE_INTERNAL_POPPACK 43 # include <poppack.h> 44 # elif !defined(__WINE_PSHPACK_H5) 45 # define __WINE_PSHPACK_H5 4 46 /* Depth == 5 */ 47 # define __WINE_INTERNAL_POPPACK 48 # include <poppack.h> 49 # elif !defined(__WINE_PSHPACK_H6) 50 # define __WINE_PSHPACK_H6 4 51 /* Depth == 6 */ 52 # define __WINE_INTERNAL_POPPACK 53 # include <poppack.h> 54 # elif !defined(__WINE_PSHPACK_H7) 55 # define __WINE_PSHPACK_H7 4 56 /* Depth == 7 */ 57 # define __WINE_INTERNAL_POPPACK 58 # include <poppack.h> 59 # elif !defined(__WINE_PSHPACK_H8) 60 # define __WINE_PSHPACK_H8 4 61 /* Depth == 8 */ 62 # define __WINE_INTERNAL_POPPACK 63 # include <poppack.h> 64 # elif !defined(__WINE_PSHPACK_H9) 65 # define __WINE_PSHPACK_H9 4 66 /* Depth == 9 */ 67 # define __WINE_INTERNAL_POPPACK 68 # include <poppack.h> 69 # elif !defined(__WINE_PSHPACK_H10) 70 # define __WINE_PSHPACK_H10 4 71 /* Depth == 10 */ 72 # define __WINE_INTERNAL_POPPACK 73 # include <poppack.h> 74 # elif !defined(__WINE_PSHPACK_H11) 75 # define __WINE_PSHPACK_H11 4 76 /* Depth == 11 */ 77 # define __WINE_INTERNAL_POPPACK 78 # include <poppack.h> 79 # elif !defined(__WINE_PSHPACK_H12) 80 # define __WINE_PSHPACK_H12 4 81 /* Depth == 12 */ 82 # define __WINE_INTERNAL_POPPACK 83 # include <poppack.h> 84 # elif !defined(__WINE_PSHPACK_H13) 85 # define __WINE_PSHPACK_H13 4 86 /* Depth == 13 */ 87 # define __WINE_INTERNAL_POPPACK 88 # include <poppack.h> 89 # elif !defined(__WINE_PSHPACK_H14) 90 # define __WINE_PSHPACK_H14 4 91 /* Depth == 14 */ 92 # define __WINE_INTERNAL_POPPACK 93 # include <poppack.h> 94 # elif !defined(__WINE_PSHPACK_H15) 95 # define __WINE_PSHPACK_H15 4 96 /* Depth == 15 */ 97 # define __WINE_INTERNAL_POPPACK 98 # include <poppack.h> 99 # endif 100 101 # if defined(_MSC_VER) && (_MSC_VER >= 800) 102 # pragma warning(disable:4103) 103 # endif 104 105 # pragma pack(4) 106 107 #endif -
loader/wine/pshpack8.h
Only in loader/wine: pshpack4.h.old diff -ru /Users/stranche/Documents/devel/MPlayer-1.0pre8/loader/wine/pshpack8.h loader/wine/pshpack8.h
old new 1 #ifndef __WINE_PSHPACK_H 2 #define __WINE_PSHPACK_H 8 1 /* 2 * Copyright (C) 1999 Patrik Stridvall 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 17 */ 3 18 4 #if 0 5 //#pragma pack(8) 6 #elif !defined(RC_INVOKED) 7 #error "8 as alignment is not supported" 8 #endif /* 0 ; !defined(RC_INVOKED) */ 9 10 #else /* !defined(__WINE_PSHPACK_H) */ 11 #error "Nested pushing of alignment isn't supported by the compiler" 12 #endif /* !defined(__WINE_PSHPACK_H) */ 19 #if defined(__WINE_PSHPACK_H15) 20 21 /* Depth > 15 */ 22 # error "Alignment nesting > 15 is not supported" 23 24 #else 25 26 # if !defined(__WINE_PSHPACK_H) 27 # define __WINE_PSHPACK_H 8 28 /* Depth == 1 */ 29 # elif !defined(__WINE_PSHPACK_H2) 30 # define __WINE_PSHPACK_H2 8 31 /* Depth == 2 */ 32 # define __WINE_INTERNAL_POPPACK 33 # include <poppack.h> 34 # elif !defined(__WINE_PSHPACK_H3) 35 # define __WINE_PSHPACK_H3 8 36 /* Depth == 3 */ 37 # define __WINE_INTERNAL_POPPACK 38 # include <poppack.h> 39 # elif !defined(__WINE_PSHPACK_H4) 40 # define __WINE_PSHPACK_H4 8 41 /* Depth == 4 */ 42 # define __WINE_INTERNAL_POPPACK 43 # include <poppack.h> 44 # elif !defined(__WINE_PSHPACK_H5) 45 # define __WINE_PSHPACK_H5 8 46 /* Depth == 5 */ 47 # define __WINE_INTERNAL_POPPACK 48 # include <poppack.h> 49 # elif !defined(__WINE_PSHPACK_H6) 50 # define __WINE_PSHPACK_H6 8 51 /* Depth == 6 */ 52 # define __WINE_INTERNAL_POPPACK 53 # include <poppack.h> 54 # elif !defined(__WINE_PSHPACK_H7) 55 # define __WINE_PSHPACK_H7 8 56 /* Depth == 7 */ 57 # define __WINE_INTERNAL_POPPACK 58 # include <poppack.h> 59 # elif !defined(__WINE_PSHPACK_H8) 60 # define __WINE_PSHPACK_H8 8 61 /* Depth == 8 */ 62 # define __WINE_INTERNAL_POPPACK 63 # include <poppack.h> 64 # elif !defined(__WINE_PSHPACK_H9) 65 # define __WINE_PSHPACK_H9 8 66 /* Depth == 9 */ 67 # define __WINE_INTERNAL_POPPACK 68 # include <poppack.h> 69 # elif !defined(__WINE_PSHPACK_H10) 70 # define __WINE_PSHPACK_H10 8 71 /* Depth == 10 */ 72 # define __WINE_INTERNAL_POPPACK 73 # include <poppack.h> 74 # elif !defined(__WINE_PSHPACK_H11) 75 # define __WINE_PSHPACK_H11 8 76 /* Depth == 11 */ 77 # define __WINE_INTERNAL_POPPACK 78 # include <poppack.h> 79 # elif !defined(__WINE_PSHPACK_H12) 80 # define __WINE_PSHPACK_H12 8 81 /* Depth == 12 */ 82 # define __WINE_INTERNAL_POPPACK 83 # include <poppack.h> 84 # elif !defined(__WINE_PSHPACK_H13) 85 # define __WINE_PSHPACK_H13 8 86 /* Depth == 13 */ 87 # define __WINE_INTERNAL_POPPACK 88 # include <poppack.h> 89 # elif !defined(__WINE_PSHPACK_H14) 90 # define __WINE_PSHPACK_H14 8 91 /* Depth == 14 */ 92 # define __WINE_INTERNAL_POPPACK 93 # include <poppack.h> 94 # elif !defined(__WINE_PSHPACK_H15) 95 # define __WINE_PSHPACK_H15 8 96 /* Depth == 15 */ 97 # define __WINE_INTERNAL_POPPACK 98 # include <poppack.h> 99 # endif 100 101 # if defined(_MSC_VER) && (_MSC_VER >= 800) 102 # pragma warning(disable:4103) 103 # endif 104 105 # pragma pack(8) 106 107 #endif -
loader/wrapper.S
Only in loader/wine: pshpack8.h.old diff -ru /Users/stranche/Documents/devel/MPlayer-1.0pre8/loader/wrapper.S loader/wrapper.S
old new 1 . section .data1 .data 2 2 .globl caller_return 3 3 caller_return: 4 4 .long 0 5 .globl report_entry6 report_entry:5 .globl _report_entry 6 _report_entry: 7 7 .long null_call 8 .globl report_ret9 report_ret:8 .globl _report_ret 9 _report_ret: 10 10 .long null_call 11 .glob alwrapper_target12 wrapper_target:11 .globl _wrapper_target 12 _wrapper_target: 13 13 .long null_call 14 14 15 . section .text15 .text 16 16 .globl null_call 17 .type null_call, @function18 . balign 16,0x9017 # .type null_call, @function 18 .p2align 4,0x90 19 19 null_call: 20 20 ret 21 .globl wrapper22 .type wrapper, @function23 . balign 16,0x9024 wrapper:21 .globl _wrapper 22 # .type wrapper, @function 23 .p2align 4,0x90 24 _wrapper: 25 25 pusha # store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI) 26 26 pushf # store flags 27 27 … … 39 39 push %eax 40 40 push %edx 41 41 42 call * report_entry # report entry42 call *_report_entry # report entry 43 43 44 44 test %eax, %eax 45 45 jnz .Ldone … … 51 51 popl caller_return # switch return addresses 52 52 pushl $.Lwrapper_return 53 53 54 jmp * wrapper_target # wrapper_target should return at .Lwrapper_return54 jmp *_wrapper_target # wrapper_target should return at .Lwrapper_return 55 55 56 . balign 16, 0x9056 .p2align 4, 0x90 57 57 .Lwrapper_return: 58 58 pushl caller_return # restore the original return address 59 59 pusha # more for reference sake here … … 73 73 push %eax 74 74 push %edx 75 75 76 call * report_ret # report the return information (same args)76 call *_report_ret # report the return information (same args) 77 77 .Ldone: 78 78 79 79 leave
