Ah, if you mean that SIGDN is defined as a DWord in its C headers but as a LongInt in FPC, then I think it's due to backwards compatibility back when Turbo Pascal and Delphi didn't have an unsigned 32-bit integer type (LongWord), and so such a hexadecimal constant would default to LongInt.

Gareth aka. Kit

On 24/06/2026 23:51, Mattias Gaertner via fpc-devel wrote:


On 6/24/26 22:54, J. Gareth "Kit" Moreton via fpc-devel wrote:
Hmmm, that's a little bit difficult.  What happens if you define the constants as, say, "SIGDN_FILESYSPATH = longint($80058000);"?

Then it would compile.

But it seems the C code uses DWord, so why should FPC use longint?

Mattias


Gareth aka. Kit

On 24/06/2026 21:44, Mattias Gaertner via fpc-devel wrote:


On 6/24/26 22:35, J. Gareth "Kit" Moreton via fpc-devel wrote:
I think it's deliberately designed that way so such codes are negative numbers in signed 32-bit.

I spotted it because code fails to compile with a range check error.

Windows docs says these constants are from an enumeration.

Mattias


Gareth aka. Kit

On 24/06/2026 20:51, Mattias Gaertner via fpc-devel wrote:
Hi,

Unit shlobj has:

      SIGDN      = longint;

But the constants are for example:

SIGDN_FILESYSPATH               = $80058000;


Maybe SIGDN must be DWord?

Mattias

_______________________________________________
fpc-devel maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

_______________________________________________
fpc-devel maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

_______________________________________________
fpc-devel maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

_______________________________________________
fpc-devel maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

_______________________________________________
fpc-devel maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

_______________________________________________
fpc-devel maillist  -  [email protected]
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to