Ticket #1182 (closed todo: done)

Opened 5 years ago

Last modified 3 years ago

Add 'long long' to types supported by NCI

Reported by: japhb Owned by: plobsing
Priority: normal Milestone:
Component: core Version: 1.7.0
Severity: medium Keywords: NCI longlong
Cc: plobsing Language:
Patch status: Platform: all

Description

This is a migration of RT #53406; original request as follows:

At least MySQL and OpenGL have function prototypes either taking or returning C<long long> or C<unsigned long long>. There is no way to correctly handle this with Parrot's NCI signature types. Currently both MySQL and OpenGL are just substituting C<long> instead, which will work on 64-bit architectures, but fail miserably on 32-bit arches.

(I wish we could just insist that INTVAL be 64 bits everywhere, but alas that doesn't make a lot of sense for very memory-constrained environments. Though those do get rarer by the day ....)

Change History

  Changed 3 years ago by jkeenan

  • cc plobsing added
  • component changed from none to core

When I hear NCI, I think: plobsing. Peter, cc-ing you to see if you have any comments or recommendations.

Thank you very much.

kid51

  Changed 3 years ago by plobsing

This is a longstanding known issue.

Slots for supporting 'long long', 'long double', and explicitly-sized 64-bit types was in the recently-merged ptrbuf branch, which improves the native struct interface and are planned for changes to bring the native call interface in line with the former.

All of this is, of course, conditional on th C system implementing these. It doesn't make sense for a C-compatibility layer to provide types that the system's C does not support. To make use of these slots, we'll need configure-probes which currently do not exist.

  Changed 3 years ago by plobsing

  • owner set to plobsing

follow-up: ↓ 5   Changed 3 years ago by jkeenan

  • summary changed from [TODO] Add 'long long' to types supported by NCI to Add 'long long' to types supported by NCI

Possible locations to conduct such probes, as inferred from the output of find ./config | xargs grep -l 'long long':

./config/auto/cpu.pm
./config/auto/format.pm
./config/auto/sizes.pm

in reply to: ↑ 4   Changed 3 years ago by plobsing

Replying to jkeenan:

Possible locations to conduct such probes, as inferred from the output of find ./config | xargs grep -l 'long long': {{{ ./config/auto/cpu.pm ./config/auto/format.pm ./config/auto/sizes.pm }}}

These probes have been added to auto::sizes and their results are being used by StructView. NCI will follow in some future update.

  Changed 3 years ago by plobsing

  • status changed from new to closed
  • resolution set to done

long long, long double, and sized integer types have been added to NCI in c7e27f5

Note: See TracTickets for help on using tickets.