Changeset 1232


Ignore:
Timestamp:
Feb 12, 2004, 4:21:45 PM (22 years ago)
Author:
bird
Message:

Extended to third calling convention syntax.

Location:
trunk/testcase
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/testcase/572c.c

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1231 r1232  
    3737typedef int     (_Optlink   Typedef2Int)(int a, int b, int c, int d);
    3838typedef PTYPE   (_Optlink   Typedef2PType)(int a, int b, int c, int d);
     39#ifdef __EMX__
     40typedef void    _Optlink   (Typedef3Void)(int a, int b, int c, int d);
     41typedef void *  _Optlink   (Typedef3PVoid)(int a, int b, int c, int d);
     42typedef int     _Optlink   (Typedef3Int)(int a, int b, int c, int d);
     43typedef PTYPE   _Optlink   (Typedef3PType)(int a, int b, int c, int d);
     44#endif
    3945
    4046typedef void    (* _Optlink PTypedef1Void)(int a, int b, int c, int d);
     
    4854typedef int     (_Optlink * PTypedef2Int)(int a, int b, int c, int d);
    4955typedef PTYPE   (_Optlink * PTypedef2PType)(int a, int b, int c, int d);
    50 
     56#ifdef __EMX__
     57/* Alternate writing which should have the same effect I think... */
     58typedef void    _Optlink (* PTypedef3Void)(int a, int b, int c, int d);
     59typedef void *  _Optlink (* PTypedef3PVoid)(int a, int b, int c, int d);
     60typedef int     _Optlink (* PTypedef3Int)(int a, int b, int c, int d);
     61typedef PTYPE   _Optlink (* PTypedef3PType)(int a, int b, int c, int d);
     62#endif
    5163
    5264/*
     
    6678    PTYPE   (_Optlink * PStructMember2PType)(int a, int b, int c, int d);
    6779
     80#ifdef __EMX__
     81    /* Alternate writing which should have the same effect I think... */
     82    void    _Optlink (* PStructMember3Void)(int a, int b, int c, int d);
     83    void *  _Optlink (* PStructMember3PVoid)(int a, int b, int c, int d);
     84    int     _Optlink (* PStructMember3Int)(int a, int b, int c, int d);
     85    PTYPE   _Optlink (* PStructMember3PType)(int a, int b, int c, int d);
     86#endif
    6887} VFT, *PVFT;
    6988
     
    82101int     (_Optlink * PVar2Int)(int a, int b, int c, int d);
    83102PTYPE   (_Optlink * PVar2PType)(int a, int b, int c, int d);
     103
     104#ifdef __EMX__
     105void    _Optlink (* PVar3Void)(int a, int b, int c, int d);
     106void *  _Optlink (* PVar3PVoid)(int a, int b, int c, int d);
     107int     _Optlink (* PVar3Int)(int a, int b, int c, int d);
     108PTYPE   _Optlink (* PVar3PType)(int a, int b, int c, int d);
     109#endif
    84110
    85111
     
    96122    int     (_Optlink * pfn2Int)(int a, int b, int c, int d),
    97123    PTYPE   (_Optlink * pfn2PType)(int a, int b, int c, int d)
     124#ifdef __EMX__
     125    ,
     126    void    _Optlink (* pfn3Void)(int a, int b, int c, int d),
     127    void *  _Optlink (* pfn3PVoid)(int a, int b, int c, int d),
     128    int     _Optlink (* pfn3Int)(int a, int b, int c, int d),
     129    PTYPE   _Optlink (* pfn3PType)(int a, int b, int c, int d)
     130#endif
    98131    )
    99132{
     
    107140    pfn2Int(1,2,3,4);
    108141    pfn2PType(1,2,3,4);
     142
     143#ifdef __EMX__
     144    pfn3Void(1,2,3,4);
     145    pfn3PVoid(1,2,3,4);
     146    pfn3Int(1,2,3,4);
     147    pfn3PType(1,2,3,4);
     148#endif
    109149    return 0;
    110150}
     151
     152/* @todo: extend and fix this */
     153extern void ParamArgs_1(void (_Optlink *)(void));
     154extern void ParamArgs_2(void (* _Optlink fixme) (void));
     155#ifdef __EMX__
     156extern void ParamArgs_3(void _Optlink (*)(void));
     157#endif
    111158
    112159
     
    114161{
    115162    static VFT vft = {CVoid, CPVoid, CInt, CPType,
     163#ifdef __EMX__
     164                      CVoid, CPVoid, CInt, CPType,
     165#endif
    116166                      CVoid, CPVoid, CInt, CPType};
    117167
     
    125175    static Typedef2Int        * pfnTypedef2Int    = CInt;
    126176    static Typedef2PType      * pfnTypedef2PType  = CPType;
     177#ifdef __EMX__
     178    static Typedef3Void       * pfnTypedef3Void   = CVoid;
     179    static Typedef3PVoid      * pfnTypedef3PVoid  = CPVoid;
     180    static Typedef3Int        * pfnTypedef3Int    = CInt;
     181    static Typedef3PType      * pfnTypedef3PType  = CPType;
     182#endif
    127183
    128184    static PTypedef1Void        pfnPTypedef1Void  = CVoid;
     
    136192    static PTypedef2PType       pfnPTypedef2PType = CPType;
    137193
     194#ifdef __EMX__
     195    static PTypedef3Void        pfnPTypedef3Void  = CVoid;
     196    static PTypedef3PVoid       pfnPTypedef3PVoid = CPVoid;
     197    static PTypedef3Int         pfnPTypedef3Int   = CInt;
     198    static PTypedef3PType       pfnPTypedef3PType = CPType;
     199#endif
     200
    138201    PVar1Void   = CVoid;
    139202    PVar1PVoid  = CPVoid;
     
    146209    PVar2PType  = CPType;
    147210
     211#ifdef __EMX__
     212    PVar3Void   = CVoid;
     213    PVar3PVoid  = CPVoid;
     214    PVar3Int    = CInt;
     215    PVar3PType  = CPType;
     216#endif
    148217
    149218    /* extern functions */
     
    164233    pfnTypedef2PType(1,2,3,4);
    165234
     235#ifdef __EMX__
     236    pfnTypedef3Void(1,2,3,4);
     237    pfnTypedef3PVoid(1,2,3,4);
     238    pfnTypedef3Int(1,2,3,4);
     239    pfnTypedef3PType(1,2,3,4);
     240#endif
     241
    166242    pfnPTypedef1Void(1,2,3,4);
    167243    pfnPTypedef1PVoid(1,2,3,4);
     
    174250    pfnPTypedef2PType(1,2,3,4);
    175251
     252#ifdef __EMX__
     253    pfnPTypedef3Void(1,2,3,4);
     254    pfnPTypedef3PVoid(1,2,3,4);
     255    pfnPTypedef3Int(1,2,3,4);
     256    pfnPTypedef3PType(1,2,3,4);
     257#endif
    176258
    177259    /* structs */
     
    186268    vft.PStructMember2PType(1,2,3,4);
    187269
     270#ifdef __EMX__
     271    vft.PStructMember3Void(1,2,3,4);
     272    vft.PStructMember3PVoid(1,2,3,4);
     273    vft.PStructMember3Int(1,2,3,4);
     274    vft.PStructMember3PType(1,2,3,4);
     275#endif
     276
    188277    /* variables */
    189278    PVar1Void(1,2,3,4);
     
    199288    /* parameters */
    200289    ParamArgs(CVoid, CPVoid, CInt, CPType,
     290#ifdef __EMX__
     291              CVoid, CPVoid, CInt, CPType,
     292#endif
    201293              CVoid, CPVoid, CInt, CPType);
    202294
  • trunk/testcase/572main.cpp

    • Property cvs2svn:cvs-rev changed from 1.4 to 1.5
    r1231 r1232  
    7070typedef int     (_Optlink   Typedef2Int)(int a, int b, int c, int d);
    7171typedef PTYPE   (_Optlink   Typedef2PType)(int a, int b, int c, int d);
     72#ifdef __EMX__
     73typedef void    _Optlink   (Typedef3Void)(int a, int b, int c, int d);
     74typedef void *  _Optlink   (Typedef3PVoid)(int a, int b, int c, int d);
     75typedef int     _Optlink   (Typedef3Int)(int a, int b, int c, int d);
     76typedef PTYPE   _Optlink   (Typedef3PType)(int a, int b, int c, int d);
     77#endif
    7278
    7379typedef void    (* _Optlink PTypedef1Void)(int a, int b, int c, int d);
     
    8187typedef int     (_Optlink * PTypedef2Int)(int a, int b, int c, int d);
    8288typedef PTYPE   (_Optlink * PTypedef2PType)(int a, int b, int c, int d);
     89#ifdef __EMX__
     90/* Alternate writing which should have the same effect I think... */
     91typedef void    _Optlink (* PTypedef3Void)(int a, int b, int c, int d);
     92typedef void *  _Optlink (* PTypedef3PVoid)(int a, int b, int c, int d);
     93typedef int     _Optlink (* PTypedef3Int)(int a, int b, int c, int d);
     94typedef PTYPE   _Optlink (* PTypedef3PType)(int a, int b, int c, int d);
     95#endif
    8396
    8497
     
    99112    int     (_Optlink * PStructMember2Int)(int a, int b, int c, int d);
    100113    PTYPE   (_Optlink * PStructMember2PType)(int a, int b, int c, int d);
     114#ifdef __EMX__
     115    /* Alternate writing which should have the same effect I think... */
     116    void    _Optlink (* PStructMember3Void)(int a, int b, int c, int d);
     117    void *  _Optlink (* PStructMember3PVoid)(int a, int b, int c, int d);
     118    int     _Optlink (* PStructMember3Int)(int a, int b, int c, int d);
     119    PTYPE   _Optlink (* PStructMember3PType)(int a, int b, int c, int d);
     120#endif
    101121
    102122} VFT, *PVFT;
     
    116136int     (_Optlink * PVar2Int)(int a, int b, int c, int d);
    117137PTYPE   (_Optlink * PVar2PType)(int a, int b, int c, int d);
     138#ifdef __EMX__
     139void    _Optlink (* PVar3Void)(int a, int b, int c, int d);
     140void *  _Optlink (* PVar3PVoid)(int a, int b, int c, int d);
     141int     _Optlink (* PVar3Int)(int a, int b, int c, int d);
     142PTYPE   _Optlink (* PVar3PType)(int a, int b, int c, int d);
     143#endif
    118144
    119145
     
    130156    int     (_Optlink * pfn2Int)(int a, int b, int c, int d),
    131157    PTYPE   (_Optlink * pfn2PType)(int a, int b, int c, int d)
     158#ifdef __EMX__
     159    ,
     160    void    _Optlink (* pfn3Void)(int a, int b, int c, int d),
     161    void *  _Optlink (* pfn3PVoid)(int a, int b, int c, int d),
     162    int     _Optlink (* pfn3Int)(int a, int b, int c, int d),
     163    PTYPE   _Optlink (* pfn3PType)(int a, int b, int c, int d)
     164#endif
    132165    )
    133166{
     
    141174    pfn2Int(1,2,3,4);
    142175    pfn2PType(1,2,3,4);
     176#ifdef __EMX__
     177    pfn3Void(1,2,3,4);
     178    pfn3PVoid(1,2,3,4);
     179    pfn3Int(1,2,3,4);
     180    pfn3PType(1,2,3,4);
     181#endif
    143182    return 0;
    144183}
     184
     185/* @todo: extend and fix this */
     186extern void ParamArgs_1(void (_Optlink *)(void));
     187extern void ParamArgs_2(void (* _Optlink fixme) (void));
     188#ifdef __EMX__
     189extern void ParamArgs_3(void _Optlink (*)(void));
     190#endif
    145191
    146192
     
    149195{
    150196    static VFT vft = {Void, PVoid, Int, PType,
     197#ifdef __EMX__
     198                      Void, PVoid, Int, PType,
     199#endif
    151200                      Void, PVoid, Int, PType};
    152201
     
    160209    static Typedef2Int        * pfnTypedef2Int    = Int;
    161210    static Typedef2PType      * pfnTypedef2PType  = PType;
     211#ifdef __EMX__
     212    static Typedef3Void       * pfnTypedef3Void   = Void;
     213    static Typedef3PVoid      * pfnTypedef3PVoid  = PVoid;
     214    static Typedef3Int        * pfnTypedef3Int    = Int;
     215    static Typedef3PType      * pfnTypedef3PType  = PType;
     216#endif
    162217
    163218    static PTypedef1Void        pfnPTypedef1Void  = Void;
     
    170225    static PTypedef2Int         pfnPTypedef2Int   = Int;
    171226    static PTypedef2PType       pfnPTypedef2PType = PType;
     227#ifdef __EMX__
     228    static PTypedef3Void        pfnPTypedef3Void  = Void;
     229    static PTypedef3PVoid       pfnPTypedef3PVoid = PVoid;
     230    static PTypedef3Int         pfnPTypedef3Int   = Int;
     231    static PTypedef3PType       pfnPTypedef3PType = PType;
     232#endif
    172233
    173234    PVar1Void   = Void;
     
    180241    PVar2Int    = Int;
    181242    PVar2PType  = PType;
    182 
     243#ifdef __EMX__
     244    PVar3Void   = Void;
     245    PVar3PVoid  = PVoid;
     246    PVar3Int    = Int;
     247    PVar3PType  = PType;
     248#endif
    183249
    184250    /* extern functions */
     
    215281    pfnTypedef2Int(1,2,3,4);
    216282    pfnTypedef2PType(1,2,3,4);
     283#ifdef __EMX__
     284    pfnTypedef3Void(1,2,3,4);
     285    pfnTypedef3PVoid(1,2,3,4);
     286    pfnTypedef3Int(1,2,3,4);
     287    pfnTypedef3PType(1,2,3,4);
     288#endif
    217289
    218290    pfnPTypedef1Void(1,2,3,4);
     
    225297    pfnPTypedef2Int(1,2,3,4);
    226298    pfnPTypedef2PType(1,2,3,4);
     299#ifdef __EMX__
     300    pfnPTypedef3Void(1,2,3,4);
     301    pfnPTypedef3PVoid(1,2,3,4);
     302    pfnPTypedef3Int(1,2,3,4);
     303    pfnPTypedef3PType(1,2,3,4);
     304#endif
    227305
    228306
     
    237315    vft.PStructMember2Int(1,2,3,4);
    238316    vft.PStructMember2PType(1,2,3,4);
     317#ifdef __EMX__
     318    vft.PStructMember3Void(1,2,3,4);
     319    vft.PStructMember3PVoid(1,2,3,4);
     320    vft.PStructMember3Int(1,2,3,4);
     321    vft.PStructMember3PType(1,2,3,4);
     322#endif
    239323
    240324    /* variables */
     
    251335    /* parameters */
    252336    ParamArgs(Void, PVoid, Int, PType,
     337#ifdef __EMX__
     338              Void, PVoid, Int, PType,
     339#endif
    253340              Void, PVoid, Int, PType);
    254341
Note: See TracChangeset for help on using the changeset viewer.