Am 05.09.2011 09:53, schrieb Don Clugston: > On 5 September 2011 09:28, Sönke Ludwig > <[email protected]> wrote: >> Am 05.09.2011 08:31, schrieb Sönke Ludwig: >>> Am 04.09.2011 20:57, schrieb Walter Bright: >>>> >>>> On 9/4/2011 3:44 AM, Sönke Ludwig wrote: >>>>> Just a small thing.. at least TIMERPROC in core.sys.windows.windows is >>>>> declared as extern(Windows) (CALLBACK is defined as __stdcall in C). I was >>>>> getting errors that did not occur before. >>>>> >>>> What should it be declared as? >>>> _______________________________________________ >>>> dmd-beta mailing list >>>> [email protected] >>>> http://lists.puremagic.com/mailman/listinfo/dmd-beta >>> Should be extern(C) >>> _______________________________________________ >>> dmd-beta mailing list >>> [email protected] >>> http://lists.puremagic.com/mailman/listinfo/dmd-beta >> Arrg, sorry I switched the terms! >> >> CALLBACK is actually defined as > __cdecl < in contrast to the other API >> functions which are __stdcall! > Where did you read that? It's __stdcall. > _______________________________________________ > dmd-beta mailing list > [email protected] > http://lists.puremagic.com/mailman/listinfo/dmd-beta I was searching on MSDN, but that one obviously states __stdcall. I think I was somehow falsely reinforced in thinking is is __cdecl because my (buggy) code does not crash. But actually it doesn't crash just because the windows function calls the callback as its last action and then uses EBP to restore the stack pointer...
Many apologies for the confusion! _______________________________________________ dmd-beta mailing list [email protected] http://lists.puremagic.com/mailman/listinfo/dmd-beta
