- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see in a lot of commercial applications when they provide a module
source containing interfaces for their C library what appear to me to
be incomplete definitions.
For example:
!C
__declspec(dllimport) unsigned short OutPortB(unsigned long Port, unsigned char Value);
When they include the attributes, they only include the following:
!DEC ATTRIBUTES C,ALIAS: "__OutPortB" :: OutPortB
I want to include:
!DEC ATTRIBUTES VALUE :: Port
!DEC ATTRIBUTES VALUE :: Value
Do I need those, or does the ATTRIBUTES C take care of that (as an assumed C default)? I prefer to be complete and clear in the definition.
Or am I completely confused?
For example:
!C
__declspec(dllimport) unsigned short OutPortB(unsigned long Port, unsigned char Value);
When they include the attributes, they only include the following:
!DEC ATTRIBUTES C,ALIAS: "__OutPortB" :: OutPortB
I want to include:
!DEC ATTRIBUTES VALUE :: Port
!DEC ATTRIBUTES VALUE :: Value
Do I need those, or does the ATTRIBUTES C take care of that (as an assumed C default)? I prefer to be complete and clear in the definition.
Or am I completely confused?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ATTRIBUTES C implies pass-by-value - mostly. There is a table in the documentation that gives the details - some of them are not obvious. Building Applications > Programming with Mixed Languages > Adjusting Calling Conventions > ATTRIBUTES Properties and Calling Conventions. Study it carefully. Some of the attribute effects may seem nonsensical, but they were brought over from Microsoft Fortran PowerStation.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page