D - user-defined attributes
- Pavel Minayev (19/19) Feb 08 2002 Walter, is it possible to add user-defined attributes to
- Walter (3/22) Feb 08 2002 Why would functions in a DLL need a different calling convention?
- Pavel Minayev (3/4) Feb 08 2002 Because it might be called from languages other than D.
- Walter (3/7) Feb 08 2002 You can always just leave it in the C or Windows calling convention.
Walter, is it possible to add user-defined attributes to the language - something that would conform to this in C: #ifdef DLL #define MYEXPORT __stdcall _export #else #define MYEXPORT __cdecl #endif ... MYEXPORT void foo() { } It could look like this: version (DLL) attribute MyExport = extern(Windows) export; else attribute MyExport = extern(D); ... attribute(MyExport) void foo() { } Could be helpful in writing projects that can be either static libs or DLLs, as well as porting such (zlib!) to D.
Feb 08 2002
"Pavel Minayev" <evilone omen.ru> wrote in message news:a41776$25eb$1 digitaldaemon.com...Walter, is it possible to add user-defined attributes to the language - something that would conform to this in C: #ifdef DLL #define MYEXPORT __stdcall _export #else #define MYEXPORT __cdecl #endif ... MYEXPORT void foo() { } It could look like this: version (DLL) attribute MyExport = extern(Windows) export; else attribute MyExport = extern(D); ... attribute(MyExport) void foo() { } Could be helpful in writing projects that can be either static libs or DLLs, as well as porting such (zlib!) to D.Why would functions in a DLL need a different calling convention?
Feb 08 2002
"Walter" <walter digitalmars.com> wrote in message news:a41imd$2pnk$2 digitaldaemon.com...Why would functions in a DLL need a different calling convention?Because it might be called from languages other than D.
Feb 08 2002
"Pavel Minayev" <evilone omen.ru> wrote in message news:a41jgh$2q47$1 digitaldaemon.com..."Walter" <walter digitalmars.com> wrote in message news:a41imd$2pnk$2 digitaldaemon.com...You can always just leave it in the C or Windows calling convention.Why would functions in a DLL need a different calling convention?Because it might be called from languages other than D.
Feb 08 2002