#58

API calling convention and pack

    • Created on: Fri, Sep 07 2007 (over 4 years ago)
    • Reported by: Anonymous
    • Assigned to: -
    • Milestone: V19-M2
    • Keywords: LIST-REVIEW IN-REVIEW
    • Status: New
    • Priority: High (2)
    • Component: public-api
    • Estimate: None/Small/Medium/Large None
    [Trac: Originally reported by jf_menard on 2007-09-07 04:33:35]

    [Trac: Originally assigned to jf_menard]

    Use a define for API calling convention. This is required if static-linked with another calling convention.

    Declare a struct packing in public headers. Required to ensure consistent packing across projects (in VS2005).

    We are reviewing this ticket on the mailing list. A summary of discussions is here:
    http://www.portaudio.com/trac/wiki/StructPackingAndApiCallingConvention
  • Followers
     
    Ico-users 
     
    Attachments
    Fico_general
    26.8 KB Added by rbencina on 26 Jan 22:52 UTC
    Associations
     
    No associations
    Activity
     
    User picture

          on Nov 15, 2007 @ 03:40am UTC * By Anonymous

    [Trac: Originally commented by jf_menard on 2007-09-07 04:33:35]

    Someone should commit this patch to SVN.
    User picture

          on Feb 04, 2011 @ 03:07pm UTC * By rbencina

    I'm not sure the PA_API_CC macro format used here is sufficent to cover calling conventions on all platforms. I've seen other calling convention macros that take the return types as parameters. Also need to resolve how this interacts with doxygen.

    The question is not so much with whether we need what this patch does -- it's whether this patch does it the best way for all platforms.

    Should review other code bases for guidance. (python libs?)
    User picture

          on Feb 05, 2011 @ 08:36pm UTC * By rbencina

    The patch included a number of unrelated doc comment typo corrections. These have now been committed as r1594.
    User picture

          on Feb 06, 2011 @ 01:52pm UTC * By rbencina

    Recent list discussion have identified the following issues and open questions (not sure this is exhaustive yet):
    - how to wrap calling conventions? (need to accomodate {{{__declspec(import)}}} and calling convention). Python uses macros like PA_API_FUNC(RETURNTYPE) that can insert code before and after the return type.
    - which calling convention to use on Windows? {{{__stdcall}}} is the defacto standard but we will need to explore name mangling issues.
    - what amount of packing to use? (4 byte packing is standard for say VB, but we have 8-byte doubles in some structs so perhaps we want to combine manual padding and pragmas to give both 8 byte natural alignment and compatibility with 4 byte packing schemes)
    User picture

          on Jan 26, 2012 @ 08:14pm UTC * By rbencina

    TRAC migration: propagating ticket status from TRAC
    User picture

          on Jan 26, 2012 @ 10:52pm UTC * By rbencina

    Attachment Ticket58.patch added
    file:bFPVPssjOr4zieacwqjQWU

    Ticket58.patch (26.8 KB) - added to Trac by jf_menard 4 years ago:
    SVN patch for ticket #58
    Time Expenditure
    Loading