- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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?
링크가 복사됨
1 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.