develooper Front page | perl.perl5.porters | Postings from June 2012

RE: Time for a 64-bit perl API?

Thread Previous | Thread Next
From:
bulk 88
Date:
June 19, 2012 13:12
Subject:
RE: Time for a 64-bit perl API?
Message ID:
COL115-W45E3B711861652FB7A44C0DFFF0@phx.gbl

 
----------------------------------------
> Date: Mon, 18 Jun 2012 10:39:45 -0700
> From: rev.chip@gmail.com
> To: bulk88@hotmail.com
> Subject: Re: Time for a 64-bit perl API?
>
> On 6/18/2012 9:46 AM, bulk 88 wrote:
> > A problem I've run into in the past is ((__int64)-1) == ((int)-1) is false.
>
> Well, that's not true. So I think you do not understand the situation.
>
>
_________________________________________
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
 
#include "ppport.h"
 
#define ERRORFLAG (-1)
 
void my_cmp(pTHX_ size_t num){
    size_t num2 = ERRORFLAG;
    if(num != num2)
       croak("not equal");
}
 
 
MODULE = Local::XS        PACKAGE = Local::XS        
 
void
neg1()
PREINIT:
    unsigned int num;
PPCODE:
    num = ERRORFLAG;
    my_cmp(aTHX_ num);
________________________________________
#!/usr/bin/perl -w
use strict;
use Local::XS;
Local::XS::neg1();
________________________________________
not equal at n1.pl line 4.
________________________________________
 
This compiled with no warnings on a x64 machine with Visual C. I already know how this went wrong. I noticed my last message didn't make it to p5p due to a mistake of mine. 		 	   		  
Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About