What is the purpose of #pragma aux and how should

2019-03-06 22:53发布

问题:

I'm attempting to delayload a library and use GetProcAddress to get a function from the library to use repeatedly. The project I'm working on has examples of how this being done in other cases, and in the header file that describes typedefs of the function, there is a #pragma aux line. What does this do? Is this always necessary?

EDIT: I'm using the vc11 compiler

回答1:

These are auxiliary pragmas and it is specific feature for Watcom compiler. From below detailed explanation:

http://users.pja.edu.pl/~jms/qnx/help/watcom/compiler-tools/pragma32.html#AuxiliaryPragmas

Auxiliary pragmas are used to describe attributes that affect code generation. Initially, the compiler defines a default set of attributes.

so to convert it to Visual Studio, you would have to find equivalent pragmas/compiler features in VS.



回答2:

#pragma implementations are specific for your actual toolchain.

Looking up #pragma aux indicates that seems to be a specific Watcom C/C++ Compiler specific problem.



标签: c++ pragma