hzzc1987 / jnaerator

Automatically exported from code.google.com/p/jnaerator
0 stars 0 forks source link

Does not handle #define XXX ((void *) -1) pointers #85

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Using JNAerator 0.9.5 on pthread.h inside /usr/include on Ubuntu 10.04 amd64. 
Ran as studio, pasted file in, modified to #define _GNU_SOURCE 1 as first line 
after comments (although has no effect on this problem).

Generated source for PTHREAD_CANCELED is invalid; should probably be

public static final Pointer PTHREAD_CANCELED = pointerToAddress(-1);

(In header, type is ((void *) -1) ).

Suggestion: Add a special pointer type / const / singleton which is not subject 
to pointer GC, eg CancelledPointer.

Original issue reported on code.google.com by raphael....@gtempaccount.com on 28 Mar 2011 at 4:58

GoogleCodeExporter commented 8 years ago
Hello Raphael,

Thanks a lot for your report.
Surprisingly enough, this constant is defined as 1 on Darwin (Mac OS X ; see 
http://src.gnu-darwin.org/src/include/pthread.h.html), so you'll have to be 
careful when porting your code...
I'll try to fix this parsing issue ASAP.

Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 26 May 2011 at 8:36

GoogleCodeExporter commented 8 years ago
Olivier,

Thank you. Yes, portability is a problem - however, we plan only on
supporting 64-bit linux - too many things differ in pthread!

Just to let you know, everything is currently dandy with the BridJ part of
our app. It's not in production (yet) but it has been working just fine.

We'll be doing a cloud preview release 3Q so you can see it 'in action'...

We also do a few speaking slots, etc, happy to introduce BridJ to the world
- it's cool.

Openssl next... we need TLS 1.2 with Java 6!

Raph

Raphael Cohn
Managing Director
raphael.cohn@StormMQ.com
StormMQ Limited

UK Office:
Gateshead int'l Business Centre, Mulgrave Terrace, Gateshead, NE8 1AN,
United Kingdom
Telephone: +44 845 3712 567

Registered office:
78 Broomfield Road, Chelmsford, Essex, CM1 1SS, United Kingdom
StormMQ Limited is Registered in England and Wales under Company Number
07175657
StormMQ.com

Original comment by raphael....@gtempaccount.com on 26 May 2011 at 8:44

GoogleCodeExporter commented 8 years ago
Hehe, thanks for the feedback, can't wait to see your preview :-)
I haven't presented BridJ publicly yet (was waiting for JNAerator to be able to 
convert basic C++ programs first), but I'd be delighted if you did so : there 
would be definitely nothing better than a real-world use case to promote the 
project ! 

Regarding your bug, I've checked in a fix 
(http://code.google.com/p/nativelibs4java/source/detail?r=2004) but probably 
won't be able to upload a new snapshot until a few days, so please be patient...

Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 26 May 2011 at 10:20

GoogleCodeExporter commented 8 years ago
Olivier,

I'm eyeballed out, so I wouldn't be able to test a fix for a week or two -
so no panic.

Out of interest, are you thinking about whether to offer commercial support
around BridJ in the future? Obviously, that good be painful now with lots to
do - but it could be a nice earner!

I'll wait a little while telling the world then - at least until Q3.

Raph

Raphael Cohn
Managing Director
raphael.cohn@StormMQ.com
StormMQ Limited

UK Office:
Gateshead int'l Business Centre, Mulgrave Terrace, Gateshead, NE8 1AN,
United Kingdom
Telephone: +44 845 3712 567

Registered office:
78 Broomfield Road, Chelmsford, Essex, CM1 1SS, United Kingdom
StormMQ Limited is Registered in England and Wales under Company Number
07175657
StormMQ.com

Original comment by raphael....@gtempaccount.com on 26 May 2011 at 10:45

GoogleCodeExporter commented 8 years ago
Hello Raphael,

The fix is now in version 0.9.8-SNAPSHOT :-)
Regarding commercial support, I'm actually starting to consider that option 
seriously (along with GPGPU consulting stuff)... Be sure I'll let you know when 
I'm decided (and I'll probably beg for your input if I do a market study ;-))

Cheers
--
zOlive
http://ochafik.com

Original comment by olivier.chafik@gmail.com on 30 May 2011 at 12:40