On 29.02.2016 12:06, Suliman wrote:
On Windows next code work fine:
int len = fullimgurl.length;

On Linux DMD get error that:
Error: cannot implicitly convert expression (fullimgurl.length) of type
ulong to int

Why on every OS length have different size?

On Windows, the compiler flag -m32 is the default, regardless of dmd's bitness [1]; on Linux it's -m64 for 64 bit dmd [2]. That's what causes the different sizes. Use size_t for lengths, not int or ulong or any other specifically sized type.

By the way, with -m32, size_t is uint, not int.


[1] http://dlang.org/dmd-windows.html#switch-m32
[2] http://dlang.org/dmd-linux.html#switch-m64

Reply via email to