today i wanted to use some #Min.../#Max... constants and found out that they are not defined equally on Windows and Linux. A few are defined on Windows, on Linux they are all missing. Some values have - from my opinion - wrong values.
Constant Expected Value Windows Linux Remark
--------- -------------------- ----------- ----- ------------------------
#MINBYTE -128 no no
#MAXBYTE 127 yes no
#MINASCII 0 no no
#MAXASCII 255 no no
#MINWORD -32768 no no
#MAXWORD 32767 yes no
#MINCHAR 0 128? no
#MAXCHAR 255 127? no Unicode=65535
#MINLONG -2147483648 2147483648? no Windows=2147483648
#MAXLONG 2147483647 yes no
#MININT -2147483648 no no x64=-9223372036854775808
#MAXINT 2147483647 no no x64=9223372036854775807
#MINQUAD -9223372036854775808 no no
#MAXQUAD 9223372036854775807 no no
#MINDATE 0 no no
#MAXDATE 2147483647 no no
I would like to see unique values for all operating systems.
Only a hint: All constants without trailing #PB_ a API-Constants, the value comes from the header from API.
uwekel wrote:I would like to see unique values for all operating systems.
+ 1
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Constant Expected Value Windows Linux Remark
--------- -------------------- ----------- ----- ------------------------
#MINLONG -2147483648 2147483648? no Windows=2147483648
In this case, you would be comparing a long to a long. If you are displaying the constant value using Debug then it will display as a positive number (a quad), which is incorrect since it represents a signed long value. Instead, assign it to a long and display that; the value displayed will be -2147483648.
Since these values are defined by the OS's API you need to refer to that for their correct use and what their size is (i.e. long, quad or whatever).