digitalmars.D.bugs - Name mangling and extern (x)
- Andy Friesen (15/15) Jul 25 2004 The program:
- Andy Friesen (4/24) Jul 25 2004 err....
- Walter (10/24) Jul 26 2004 The name mangling must be done when within a scope, or the names will
- John Reimer (5/17) Jul 27 2004 So what you're saying is that I'd have to use a huge list of aliases to
- Walter (5/23) Jul 29 2004 Why does DWT need to do this?
- Andy Friesen (6/11) Jul 29 2004 It's basically another case of SWT going through contortions brought
- Andy Friesen (5/18) Jul 29 2004 errrr, brain-typo. That should read:
The program: final class Win32 { private this() { } static extern(Windows) void* GetProcAddress(void* p); } int main() { printf("gpa: %p\n", Win32.GetProcAddress(null)); return 0; } Produces a link error: test.obj(test) Error 42: Symbol Undefined __D4test5Win3214GetProcAddressWPvZPv 4 (presumably because the name mangling is being done despite the non-D linkage) -- andy
Jul 25 2004
Andy Friesen wrote:The program: final class Win32 { private this() { } static extern(Windows) void* GetProcAddress(void* p); } int main() { printf("gpa: %p\n", Win32.GetProcAddress(null)); return 0; } Produces a link error: test.obj(test) Error 42: Symbol Undefined __D4test5Win3214GetProcAddressWPvZPv 4 (presumably because the name mangling is being done despite the non-D linkage)err.... It still breaks even if you get the argument count right. :) -- andy
Jul 25 2004
"Andy Friesen" <andy ikagames.com> wrote in message news:ce0qef$2fmn$1 digitaldaemon.com...The program: final class Win32 { private this() { } static extern(Windows) void* GetProcAddress(void* p); } int main() { printf("gpa: %p\n", Win32.GetProcAddress(null)); return 0; } Produces a link error: test.obj(test) Error 42: Symbol Undefined __D4test5Win3214GetProcAddressWPvZPv 4 (presumably because the name mangling is being done despite the non-D linkage)The name mangling must be done when within a scope, or the names will conflict from one class to the next. Having Windows calling convention supported for member functions is necessary for supporting COM. I suggest instead using an alias: private import std.c.windows.windows; class Win32 { alias std.c.windows.windows.GetProcAddress GetProcAddress; }
Jul 26 2004
The name mangling must be done when within a scope, or the names will conflict from one class to the next. Having Windows calling convention supported for member functions is necessary for supporting COM. I suggest instead using an alias: private import std.c.windows.windows; class Win32 { alias std.c.windows.windows.GetProcAddress GetProcAddress; }So what you're saying is that I'd have to use a huge list of aliases to import 400+ extern (Windows) functions from the module into the class. (this is what DWT needs to do). Too bad an internal class import is deprecated. It sure would make the job a lot easier. :-(
Jul 27 2004
"John Reimer" <brk_6502 NOSP_AM.yahoo.com> wrote in message news:ce57bk$21a8$1 digitaldaemon.com...Why does DWT need to do this?The name mangling must be done when within a scope, or the names will conflict from one class to the next. Having Windows calling convention supported for member functions is necessary for supporting COM. I suggest instead using an alias: private import std.c.windows.windows; class Win32 { alias std.c.windows.windows.GetProcAddress GetProcAddress; }So what you're saying is that I'd have to use a huge list of aliases to import 400+ extern (Windows) functions from the module into the class. (this is what DWT needs to do).Too bad an internal class import is deprecated.It isn't deprecated, I just don't see why it is used (beyond the forward reference issues, which have been slayed one by one).It sure would make the job a lot easier. :-(
Jul 29 2004
Walter wrote:It's basically another case of SWT going through contortions brought around by its inability to be flexible. DWT is, at present, following those contortions. sed is your friend. ;) -- andySo what you're saying is that I'd have to use a huge list of aliases to import 400+ extern (Windows) functions from the module into the class. (this is what DWT needs to do).Why does DWT need to do this?
Jul 29 2004
Andy Friesen wrote:Walter wrote:errrr, brain-typo. That should read: "It's basically another case of SWT going through contortions brought around by /Java's/ inability to be flexible." -- andyIt's basically another case of SWT going through contortions brought around by its inability to be flexible. DWT is, at present, following those contortions.So what you're saying is that I'd have to use a huge list of aliases to import 400+ extern (Windows) functions from the module into the class. (this is what DWT needs to do).Why does DWT need to do this?
Jul 29 2004