HP aC++ A.03.85 Release Notes

HP aC++ Release Notes
New Features in Version A.03.33
Chapter 140
4. The compiler defines macro __HP_WINDLL whenever -Bhidden or
-Bhidden_def options are used. This macro can be used for conditional
compilation. For example,
#ifdef __HP_WINDLL
#define DLLEXPORT __declspec(dllexport)
#define DLLIMPORT __declspec(dllimport)
#else
#define DLLEXPORT
#define DLLIMPORT
#endif
5. If an inline member function of a class is called from outside the shared
library where the class is defined and that function happens to reference
another member of the same class, you should make sure that the
referenced member also is exported. Otherwise the linker will fail to
resolve.
6. Ensure that the virtual member functions of a class defined in a shared
library are exported as needed. If virtual member functions are not
exported and another class derives from this class but does not override
these virtual functions, then there will be link-time errors. See example 8
below for an example scenario.
Examples
1. In the following program, global variable glob is imported:
class Hello
{
public:
int x;
};
__declspec(dllimport) extern Hello glob;
int main() { glob.x = 10; return 0;}
2. In the following program, symbols export_me and export_me_func() will be exported;
the rest of the symbols are hidden:
__declspec(dllexport) int export_me;
int iam_hidden;
__declspec(dllexport) int export_me_func() { }
void iam_hidden_func() { }