[fpc-devel] Re: Changing Windows API A routines in SysUtils to W in Windows NT

Thaddy thaddy at thaddy.com
Mon Feb 6 21:19:15 CET 2012


On 6-2-2012 21:07, Sven Barth wrote:
>
> The check you are talking about in C++ is a compile time define that 
> just switches the defines for e.g. CreateProcess to CreateProcessW or 
> CreateProcessA (depending on whether UNICODE is defined or not when 
> including the Windows headers).
>
> There is no other "magic" in Windows that changes the imports at runtime.
Nope, but a compiler should choose the_optimum_ for the platform. 
Otherwise you can hand-code it.
The A/W versions of the windows API have been in Delphi at least since 
D3, but I can check D2 in a minute.
Of course it's a compile time switch! Point made by me in the first place.

BTW you can even fool delphi and fpc to behave irratically (do what I 
want)  by doing things like -uFPC -Mdelphi -dVER200 in fpc or defining 
-dVER200 when you have a D7 (VER150) .
  Sometimes handy to know the compilers (be it C or FP-C) at least 
understand the programmers meaning.
(Just in case you wonder why I would fool the compiler to be over his 
age: parsing some badly behaving sourcecode)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20120206/eb4aaab8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2768 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20120206/eb4aaab8/attachment.bin>


More information about the fpc-devel mailing list