[PD-dev] PD_LONGINTTYPE

IOhannes m zmoelnig zmoelnig at iem.at
Wed Jun 20 09:49:18 CEST 2018


On 2018-06-20 02:51, Miller Puckette wrote:
> I think m_pd.h should make a reasonable guess, in a way that makes it
> easy to override.  Perhaps like this:
> 
> #if !defined(PD_LONGINTTYPE)
> #if (sizeof(void *) > sizeof(long))
> #define PD_LONGINTTYPE long long
> #else
> #define PD_LONGINTTYPE long
> #endif
> #endif

unfortunately, we cannot use sizeof() in pre-processor conditionals.

there might be some compiler-specific hacks to achieve something like
that on C99-compliant compilers, but i don't really think it's worth it.
(that is: i think being able to compile Pd with older microsoft
compilers is more interesting, than adding quirks).

> 
> There's a patch on github I haven't yet looked at closely - perhpas there's
> a better fix there.
> 

i've inluded the patch in my "more toward double-precision" PR, found at:
 https://github.com/pure-data/pure-data/pull/300
the original (single-patch) PR is
https://github.com/pure-data/pure-data/pull/7

it is much simpler, as there the only known system with an LLP64 data
model¹ (which mandates "long" to be 32bit on 64bit architectures) is... MSW.
so it's simple enough to just special-case w64 and be done.

i've also included


fgmasdr
IOhannes

PS: i've just seen that the patch only addresses the amd64 (aka x86_64)
architecture, while w64 also uses LLP64 on ia-64 (aka itanium).

¹ https://en.wikipedia.org/wiki/64-bit_computing#64-bit_data_models

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20180620/19f91dff/attachment.sig>


More information about the Pd-dev mailing list