Ticket #514: loader_darwin.patch

File loader_darwin.patch, 43.2 KB (added by stephane.lapie@…, 13 years ago)

Win32 loader full diff between 1.0pre8 and my test version on Macbook. This finally enables the playback of WMV9 files using the DLL support. Bugs left : unknown as of now.

  • loader/ext.c

    diff -ru /Users/stranche/Documents/devel/MPlayer-1.0pre8/loader/ext.c loader/ext.c
    old new  
    233233
    234234//#define MAP_PRIVATE
    235235//#define MAP_SHARED
    236 #undef MAP_ANON
    237236LPVOID FILE_dommap( int unix_handle, LPVOID start,
    238237                    DWORD size_high, DWORD size_low,
    239238                    DWORD offset_high, DWORD offset_low,
     
    248247
    249248    if (unix_handle == -1)
    250249    {
    251 #ifdef MAP_ANON
     250#ifdef CONFIG_DARWIN
    252251//      printf("Anonymous\n");
    253252        flags |= MAP_ANON;
     253        fd = -1;
    254254#else
    255255        static int fdzero = -1;
    256256
     
    263263            }
    264264        }
    265265        fd = fdzero;
    266 #endif  /* MAP_ANON */
     266#endif  /* CONFIG_DARWIN */
    267267        /* Linux EINVAL's on us if we don't pass MAP_PRIVATE to an anon mmap */
    268268#ifdef MAP_SHARED
    269269        flags &= ~MAP_SHARED;
     
    276276//    printf("fd %x, start %x, size %x, pos %x, prot %x\n",fd,start,size_low, offset_low, prot);
    277277//    if ((ret = mmap( start, size_low, prot,
    278278//                     flags, fd, offset_low )) != (LPVOID)-1)
     279#ifndef CONFIG_DARWIN
    279280    if ((ret = mmap( start, size_low, prot,
    280281                     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 */
    281285    {
    282286//          printf("address %08x\n", *(int*)ret);
    283287//      printf("%x\n", ret);
     
    471475
    472476    if ((type&(MEM_RESERVE|MEM_COMMIT)) == 0) return NULL;
    473477
     478#ifndef CONFIG_DARWIN
    474479    fd=open("/dev/zero", O_RDWR);
    475480    if(fd<0){
    476481        perror( "Cannot open /dev/zero for READ+WRITE. Check permissions! error: " );
    477482        return NULL;
    478483    }
     484#endif /* CONFIG_DARWIN */
    479485
    480486    if (type&MEM_RESERVE && (unsigned)address&0xffff) {
    481487        size += (unsigned)address&0xffff;
     
    513519                   && ((unsigned)address+size<=(unsigned)str->address+str->mapping_size)
    514520                   && (type & MEM_COMMIT))
    515521                {
     522#ifndef CONFIG_DARWIN
    516523                    close(fd);
     524#endif /* !CONFIG_DARWIN */
    517525                    return address; //returning previously reserved memory
    518526                }
    519527                //printf(" VirtualAlloc(...) does not commit or not entirely within reserved, and\n");
     
    525533        }
    526534    }
    527535
     536#ifndef CONFIG_DARWIN
    528537    answer=mmap(address, size, PROT_READ | PROT_WRITE | PROT_EXEC,
    529538                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 */
    530543//    answer=FILE_dommap(-1, address, 0, size, 0, 0,
    531544//      PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE);
     545#ifndef CONFIG_DARWIN
    532546    close(fd);
     547#endif /* !CONFIG_DARWIN */
    533548    if (answer != (void *)-1 && address && answer != address) {
    534549        /* It is dangerous to try mmap() with MAP_FIXED since it does not
    535550           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  
    102102#define       LDT_SEL(idx) ((idx) << 3 | 1 << 2 | 3)
    103103
    104104/* 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)
    106106#define       TEB_SEL_IDX     LDT_AUTO_ALLOC
    107107#endif
    108108
     
    167167#endif
    168168#endif
    169169
    170 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
     170#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(CONFIG_DARWIN) || defined(__OpenBSD__) || defined(__DragonFly__)
    171171static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt_s *content )
    172172{
    173173    *buffer++ = ((content->base_addr & 0x0000ffff) << 16) |
     
    193193
    194194    if (!ldt_fs)
    195195        return NULL;
    196 
     196#ifndef CONFIG_DARWIN
    197197    ldt_fs->fd = open("/dev/zero", O_RDWR);
    198198    if(ldt_fs->fd<0){
    199199        perror( "Cannot open /dev/zero for READ+WRITE. Check permissions! error: ");
     
    202202    fs_seg=
    203203    ldt_fs->fs_seg = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE, MAP_PRIVATE,
    204204                          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 */
    205209    if (ldt_fs->fs_seg == (void*)-1)
    206210    {
    207211        perror("ERROR: Couldn't allocate memory for fs segment");
     
    229233    }
    230234#endif /*linux*/
    231235
    232 #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
     236#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(CONFIG_DARWIN) || defined(__OpenBSD__) || defined(__DragonFly__)
    233237    {
    234238        unsigned long d[2];
    235239
    236240        LDT_EntryToBytes( d, &array );
    237 #if defined(__FreeBSD__) && defined(LDT_AUTO_ALLOC)
     241#if (defined(__FreeBSD__) || defined(CONFIG_DARWIN)) && defined(LDT_AUTO_ALLOC)
    238242        ret = i386_set_ldt(LDT_AUTO_ALLOC, (union descriptor *)d, 1);
    239243        array.entry_number = ret;
    240244        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  
    2424//#undef TRACE
    2525//#define TRACE printf
    2626
     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
    2747extern char *get_path ( char * );
    2848
    2949// ...can be set before init_registry() call
     
    5878static void save_registry(void);
    5979static void init_registry(void);
    6080
     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
     90static 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
     104static 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
     116static 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}
    61126
    62127static void create_registry(void){
    63128    if(regs)
     
    69134    regs=(struct reg_value*)malloc(3*sizeof(struct reg_value));
    70135    regs[0].type=regs[1].type=DIR;
    71136    regs[0].name=(char*)malloc(5);
    72     strcpy(regs[0].name, "HKLM");
     137    my_strcpy(regs[0].name, "HKLM");
    73138    regs[1].name=(char*)malloc(5);
    74     strcpy(regs[1].name, "HKCU");
     139    my_strcpy(regs[1].name, "HKCU");
    75140    regs[0].value=regs[1].value=NULL;
    76141    regs[0].len=regs[1].len=0;
    77142    reg_size=2;
     
    142207        write(fd, &reg_size, 4);
    143208        for(i=0; i<reg_size; i++)
    144209        {
    145                 unsigned len=strlen(regs[i].name);
     210                unsigned len=my_strlen(regs[i].name);
    146211                write(fd, &regs[i].type, 4);
    147212                write(fd, &len, 4);
    148213                write(fd, regs[i].name, len);
     
    237302                t->prev=head;
    238303        }
    239304        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);
    242307        t->handle=handle;
    243308        head=t;
    244309        return t;
     
    254319        }
    255320        if(subkey==NULL)
    256321                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);
    261326        return full_name;
    262327}
    263328static struct reg_value* insert_reg_value(int handle, const char* name, int type, const void* value, int len)
    264329{
     330        STACK_CLEANER_PREFIX;
    265331        reg_handle_t* t;
    266332        struct reg_value* v;
    267333        char* fullname;
     
    287353            free(v->value);
    288354            free(v->name);
    289355        }
     356        STACK_CLEANER_SUFFIX;
    290357        TRACE("RegInsert '%s'  %p  v:%d  len:%d\n", name, value, *(int*)value, len);
    291358        v->type=type;
    292359        v->len=len;
    293360        v->value=(char*)malloc(len);
    294361        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;
    297365        free(fullname);
    298366        save_registry();
     367        STACK_CLEANER_SUFFIX;
    299368        return v;
    300369}
    301370
     
    325394                pthn = pwent->pw_dir;
    326395            }
    327396
    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");
    331400        }
    332401#endif
    333402
     
    347416        }
    348417        if(subkey==NULL)
    349418                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);
    354423        t=find_handle_by_name(full_name);
    355424        free(full_name);
    356425        return t;
     
    512581{
    513582    struct reg_value* t;
    514583    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);
    516585    if(!regs)
    517586        init_registry();
    518587
  • loader/stubs.s

    diff -ru /Users/stranche/Documents/devel/MPlayer-1.0pre8/loader/stubs.s loader/stubs.s
    old new  
    11        .data
    2 .LC0:   .string "Called unk_%s\n"
    3        .balign 4
     2.LC0:   .asciz  "Called unk_%s\n"
     3       .p2align 2
    44.globl unk_exp1
    55unk_exp1:
    66        pushl %ebp
     
    1414        subl %eax,%edx
    1515        leal 0(,%edx,2),%eax
    1616        movl %eax,%edx
    17         addl $export_names,%edx
     17        addl $_export_names,%edx
    1818        pushl %edx
    1919        pushl $.LC0
    20         call printf
     20        call _printf
    2121        addl $8,%esp
    2222        xorl %eax,%eax
    2323        leave
    2424        ret
    25 .globl exp_EH_prolog
    26 exp_EH_prolog:
     25.globl _exp_EH_prolog
     26_exp_EH_prolog:
    2727        pushl $0xff
    2828        pushl %eax
    2929        pushl %fs:0
  • loader/win32.c

    diff -ru /Users/stranche/Documents/devel/MPlayer-1.0pre8/loader/win32.c loader/win32.c
    old new  
    1919
    2020#include "config.h"
    2121
     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
    2243#ifdef MPLAYER
    2344#ifdef USE_QTX_CODECS
    2445#define QTX
     
    193214#endif
    194215int LOADER_DEBUG=1; // active only if compiled with -DDETAILED_OUT
    195216//#define DETAILED_OUT
    196 static inline void dbgprintf(char* fmt, ...)
     217static void dbgprintf(char* fmt, ...)
    197218{
     219#ifndef CONFIG_DARWIN
    198220#ifdef DETAILED_OUT
    199221    if(LOADER_DEBUG)
    200222    {
     223STACK_CLEANER_PREFIX;
    201224        FILE* f;
    202225        va_list va;
    203226        va_start(va, fmt);
     
    211234            fclose(f);
    212235        }
    213236        va_end(va);
     237STACK_CLEANER_SUFFIX;
    214238    }
    215239#endif
    216240#ifdef MPLAYER
     
    223247//      mp_dbg(MSGT_WIN32, MSGL_DBG3, fmt, va);
    224248        va_end(va);
    225249    }
     250STACK_CLEANER_PREFIX;
    226251  fflush(stdout);
     252STACK_CLEANER_SUFFIX;
     253#endif
    227254#endif
    228255}
    229256
     
    404431#ifdef GARBAGE
    405432    alloc_header* prevmem;
    406433    alloc_header* nextmem;
     434    void*         darwin_mem_temp = memory; // Used to store the memory argument
    407435
    408436    if (memory == 0)
    409437        return 0;
     
    416444
    417445    pthread_mutex_lock(&memmut);
    418446
     447    STACK_CLEANER_PREFIX;
    419448    switch(header->type)
    420449    {
    421450    case AREATYPE_EVENT:
    422         destroy_event(memory);
     451        destroy_event(darwin_mem_temp);
    423452        break;
    424453    case AREATYPE_COND:
    425         pthread_cond_destroy((pthread_cond_t*)memory);
     454        pthread_cond_destroy((pthread_cond_t*)darwin_mem_temp);
    426455        break;
    427456    case AREATYPE_MUTEX:
    428         pthread_mutex_destroy((pthread_mutex_t*)memory);
     457        pthread_mutex_destroy((pthread_mutex_t*)darwin_mem_temp);
    429458        break;
    430459    case AREATYPE_CRITSECT:
    431         pthread_mutex_destroy(&((struct CRITSECT*)memory)->mutex);
     460        pthread_mutex_destroy(&((struct CRITSECT*)darwin_mem_temp)->mutex);
    432461        break;
    433462    default:
    434         //memset(memory, 0xcc, header->size);
     463        //memset(darwin_mem_temp, 0xcc, header->size);
    435464        ;
    436465    }
     466    STACK_CLEANER_SUFFIX;
    437467
    438468    header->deadbeef = 0;
    439469    prevmem = header->prev;
     
    465495}
    466496#endif
    467497
     498#ifndef MEMORY_DEBUG
    468499static inline void* my_mreq(int size, int to_zero)
    469500{
    470501    return mreq_private(size, to_zero, AREATYPE_CLIENT);
    471502}
     503#endif
    472504
    473505static int my_size(void* memory)
    474506{
     
    24792511
    24802512static void* WINAPI expSleep(int time)
    24812513{
     2514STACK_CLEANER_PREFIX;
    24822515#if HAVE_NANOSLEEP
    24832516    /* solaris doesn't have thread safe usleep */
    24842517    struct timespec tsp;
     
    24892522    usleep(time);
    24902523#endif
    24912524    dbgprintf("Sleep(%d) => 0\n", time);
     2525STACK_CLEANER_SUFFIX;
    24922526    return 0;
    24932527}
    24942528
     
    31703204#define SECS_1601_TO_1970  ((369 * 365 + 89) * 86400ULL)
    31713205static void WINAPI expGetSystemTimeAsFileTime(FILETIME* systime)
    31723206{
     3207    STACK_CLEANER_PREFIX;
    31733208    struct tm *local_tm;
    31743209    struct timeval tv;
    31753210    unsigned long long secs;
    31763211
     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.
    31773215    dbgprintf("GetSystemTime(0x%x)\n", systime);
     3216//#endif /* !CONFIG_DARWIN */
    31783217    gettimeofday(&tv, NULL);
    31793218    secs = (tv.tv_sec + SECS_1601_TO_1970) * 10000000;
    31803219    secs += tv.tv_usec * 10;
    31813220    systime->dwLowDateTime = secs & 0xffffffff;
    31823221    systime->dwHighDateTime = (secs >> 32);
     3222    STACK_CLEANER_SUFFIX;
    31833223}
    31843224
    31853225static int WINAPI expGetEnvironmentVariableA(const char* name, char* field, int size)
     
    38863926 */
    38873927static void* expmalloc(int size)
    38883928{
     3929    STACK_CLEANER_PREFIX;
    38893930    //printf("malloc");
    38903931    //    return malloc(size);
    38913932    void* result=my_mreq(size,0);
    38923933    dbgprintf("malloc(0x%x) => 0x%x\n", size,result);
    38933934    if(result==0)
    3894         printf("WARNING: malloc() failed\n");
     3935        printf("WARNING: malloc(%d) failed\n", size);
     3936    STACK_CLEANER_SUFFIX;
    38953937    return result;
    38963938}
    38973939static void expfree(void* mem)
    38983940{
     3941    STACK_CLEANER_PREFIX;
    38993942    //    return free(mem);
    39003943    dbgprintf("free(%p)\n", mem);
    39013944    my_release(mem);
     3945    STACK_CLEANER_SUFFIX;
    39023946}
    39033947/* needed by atrac3.acm */
    39043948static void *expcalloc(int num, int size)
    39053949{
     3950    STACK_CLEANER_PREFIX;
    39063951    void* result=my_mreq(num*size,1);
    39073952    dbgprintf("calloc(%d,%d) => %p\n", num,size,result);
    39083953    if(result==0)
    39093954        printf("WARNING: calloc() failed\n");
     3955    STACK_CLEANER_SUFFIX;
    39103956    return result;
    39113957}
    39123958static void* expnew(int size)
    39133959{
     3960    STACK_CLEANER_PREFIX;
    39143961    //    printf("NEW:: Call from address %08x\n STACK DUMP:\n", *(-1+(int*)&size));
    39153962    //    printf("%08x %08x %08x %08x\n",
    39163963    //    size, *(1+(int*)&size),
     
    39223969    dbgprintf("new(%d) => %p\n", size, result);
    39233970    if (result==0)
    39243971        printf("WARNING: new() failed\n");
     3972    STACK_CLEANER_SUFFIX;
    39253973    return result;
    39263974
    39273975}
    39283976static int expdelete(void* memory)
    39293977{
     3978    STACK_CLEANER_PREFIX;
    39303979    dbgprintf("delete(%p)\n", memory);
    39313980    my_release(memory);
     3981    STACK_CLEANER_SUFFIX;
    39323982    return 0;
    39333983}
    39343984
     
    40184068#if 0
    40194069static int exp_initterm(int v1, int v2)
    40204070{
     4071    STACK_CLEANER_PREFIX;
    40214072    dbgprintf("_initterm(0x%x, 0x%x) => 0\n", v1, v2);
    40224073    return 0;
     4074    STACK_CLEANER_SUFFIX;
    40234075}
    40244076#else
    40254077/* merged from wine - 2002.04.21 */
     
    40374089            void* p = *start;
    40384090            __asm__ __volatile__
    40394091                (
     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                (
    40404098                 "pushl %%ebx           \n\t"
    40414099                 "pushl %%ecx           \n\t"
    40424100                 "pushl %%edx           \n\t"
     
    40484106                 "popl  %%edx           \n\t"
    40494107                 "popl  %%ecx           \n\t"
    40504108                 "popl  %%ebx           \n\t"
     4109                 "leave                 \n\t"
    40514110                 :
    40524111                 : "a"(p)
    40534112                 : "memory"
     
    40684127
    40694128static int expwsprintfA(char* string, const char* format, ...)
    40704129{
     4130    STACK_CLEANER_PREFIX;
    40714131    va_list va;
    40724132    int result;
    40734133    va_start(va, format);
    40744134    result = vsprintf(string, format, va);
    40754135    dbgprintf("wsprintfA(0x%x, '%s', ...) => %d\n", string, format, result);
    40764136    va_end(va);
     4137    STACK_CLEANER_SUFFIX;
    40774138    return result;
    40784139}
    40794140
    40804141static int expsprintf(char* str, const char* format, ...)
    40814142{
     4143    STACK_CLEANER_PREFIX;
    40824144    va_list args;
    40834145    int r;
    40844146    dbgprintf("sprintf(0x%x, %s)\n", str, format);
    40854147    va_start(args, format);
    40864148    r = vsprintf(str, format, args);
    40874149    va_end(args);
     4150    STACK_CLEANER_SUFFIX;
    40884151    return r;
    40894152}
    40904153static int expsscanf(const char* str, const char* format, ...)
    40914154{
     4155    STACK_CLEANER_PREFIX;
    40924156    va_list args;
    40934157    int r;
    40944158    dbgprintf("sscanf(%s, %s)\n", str, format);
    40954159    va_start(args, format);
    40964160    r = vsscanf(str, format, args);
    40974161    va_end(args);
     4162    STACK_CLEANER_SUFFIX;
    40984163    return r;
    40994164}
    41004165static void* expfopen(const char* path, const char* mode)
     
    41054170}
    41064171static int expfprintf(void* stream, const char* format, ...)
    41074172{
     4173    STACK_CLEANER_PREFIX;
    41084174    va_list args;
    41094175    int r = 0;
    41104176    dbgprintf("fprintf(%p, %s, ...)\n", stream, format);
     
    41134179    r = vfprintf((FILE*) stream, format, args);
    41144180    va_end(args);
    41154181#endif
     4182    STACK_CLEANER_SUFFIX;
    41164183    return r;
    41174184}
    41184185
    41194186static int expprintf(const char* format, ...)
    41204187{
     4188    STACK_CLEANER_PREFIX;
    41214189    va_list args;
    41224190    int r;
    41234191    dbgprintf("printf(%s, ...)\n", format);
    41244192    va_start(args, format);
    41254193    r = vprintf(format, args);
    41264194    va_end(args);
     4195    STACK_CLEANER_SUFFIX;
    41274196    return r;
    41284197}
    41294198
    41304199static char* expgetenv(const char* varname)
    41314200{
     4201    STACK_CLEANER_PREFIX;
    41324202    char* v = getenv(varname);
    41334203    dbgprintf("getenv(%s) => %s\n", varname, v);
     4204    STACK_CLEANER_SUFFIX;
    41344205    return v;
    41354206}
    41364207
  • 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 */
    318
    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 ! */
    12258
    13 #else /* defined(__WINE_PSHPACK_H) */
    14259#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 */
    318
    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)
    1320
     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 */
    318
    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 */
    318
    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)
    1520
     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 */
    318
    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 .data
     1.data
    22.globl caller_return
    33caller_return:
    44        .long 0
    5 .globl report_entry
    6 report_entry:
     5.globl _report_entry
     6_report_entry:
    77        .long null_call
    8 .globl report_ret
    9 report_ret:     
     8.globl _report_ret
     9_report_ret:   
    1010        .long null_call
    11 .global wrapper_target
    12 wrapper_target:
     11.globl _wrapper_target
     12_wrapper_target:       
    1313        .long null_call
    1414
    15 .section .text
     15.text
    1616.globl null_call
    17         .type null_call, @function
    18         .balign 16,0x90
     17#       .type null_call, @function
     18        .p2align 4,0x90
    1919null_call:
    2020        ret
    21 .globl wrapper
    22         .type wrapper, @function
    23         .balign 16,0x90
    24 wrapper:
     21.globl _wrapper
     22#       .type wrapper, @function
     23        .p2align 4,0x90
     24_wrapper:
    2525        pusha                   # store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI)
    2626        pushf                   # store flags
    2727       
     
    3939        push %eax
    4040        push %edx
    4141       
    42         call *report_entry      # report entry
     42        call *_report_entry     # report entry
    4343       
    4444        test %eax, %eax
    4545        jnz .Ldone
     
    5151        popl caller_return      # switch return addresses
    5252        pushl $.Lwrapper_return
    5353       
    54         jmp *wrapper_target     # wrapper_target should return at .Lwrapper_return
     54        jmp *_wrapper_target    # wrapper_target should return at .Lwrapper_return
    5555
    56         .balign 16, 0x90
     56        .p2align 4, 0x90
    5757.Lwrapper_return:       
    5858        pushl caller_return     # restore the original return address
    5959        pusha                   # more for reference sake here
     
    7373        push %eax
    7474        push %edx
    7575
    76         call *report_ret        # report the return information (same args)
     76        call *_report_ret       # report the return information (same args)
    7777.Ldone:
    7878
    7979        leave