gabr42 / OmniThreadLibrary

A simple and powerful multithreading library for Delphi
http://www.omnithreadlibrary.com
Other
462 stars 141 forks source link

C++ Builder Errors in generated DSiWin32.hpp, OtlCommon.hpp, OtlSync.hpp #72

Open Creakyhat opened 8 years ago

Creakyhat commented 8 years ago

Files.zip

After building the Packages generating all C++ Files i get a number of error messages when trying to run a program.

typedef _WKSTA_INFO_100 *PWkstaInfo100; flags as an error E2257 , expected

then i get a bunch of E2040 Declaration terminated incorrectly for things like

static const System::Int8 CSIDL_ADMINTOOLS = System::Int8(0x30); static const System::Int8 CSIDL_ALTSTARTUP = System::Int8(0x1d); static const System::Int8 CSIDL_APPDATA = System::Int8(0x1a); static const System::Int8 CSIDL_CDBURN_AREA = System::Int8(0x3b);

after all those i get errors in OtlCommon.hpp

E2238 Multiple declaration for 'TOmniValue::AsArrayItem' for the following

__property TOmniValue AsArrayItem[const System::UnicodeString name] = {read=GetAsArrayItem, write=SetAsArrayItem};
__property TOmniValue AsArrayItem[TOmniValue param] = {read=GetAsArrayItem, write=SetAsArrayItem};

and E2238 Multiple declaration for 'TOmniValueContainer::Item'

__property TOmniValue Item[const System::UnicodeString paramName] = {read=GetItem, write=SetItem};
__property TOmniValue Item[TOmniValue param] = {read=GetItem, write=SetItem};

in OtlSync.hpp i get the following E2113 Virtual function '_fastcall IOmniCriticalSection::Release()' conflicts with base class 'IUnknown' E2113 Virtual function '_fastcall IOmniResourceCount::Release()' conflicts with base class 'IUnknown'

currently i am getting round this by commenting out the lines in the hpp files

I've asked for assistance on stackover flow see link for details http://stackoverflow.com/questions/37775739/omnithreadlibrary-c-builder-build-issues/37777095?noredirect=1#comment63023683_37777095

i'm using C++ builder seattle and the latest OmniThreadLibrary form here i've attached my edited files

gabr42 commented 8 years ago

If you fix DSiWin32, I'll commit it.

Creakyhat commented 8 years ago

The attached seems to produce a file that complies for c++ builder settle DSiWin32.zip

what about OtlCommon.hpp and OtlSync.hpp ?

gabr42 commented 8 years ago

Added to the repository, thanks!

What about OtlCommon.hpp and OtlSync.hpp? Please keep in mind that I really know nothing about how C++Builder works with Delphi sources.

If you want anything changed, send me changes and I'll review and commit.

Creakyhat commented 8 years ago

i know a little Delphi i'll see what i can workout. am i able to check these in myself to the repo? or do i need to upload them here?

Creakyhat commented 8 years ago

OtlCommon.zip

I've looked at OtlCommon i've changed the duplicate proprieties names to have ByName or ByOV appended to them. i could not just exclude them from being added to the hpp files. hopefully this is only a minor change for everybody

__property TOmniValue AsArrayItemByName[const System::UnicodeString name] ={read=GetAsArrayItem, write=SetAsArrayItem};
__property TOmniValue AsArrayItemByOV[TOmniValue param] = {read=GetAsArrayItem, write=SetAsArrayItem};
__property TOmniValue ItemByName[const System::UnicodeString paramName] = {read=GetItem, write=SetItem};
__property TOmniValue ItemByOV[TOmniValue param] = {read=GetItem, write=SetItem};

OtlSync is proving to be more of an issue.

gabr42 commented 8 years ago

Sorry, but I will not commit a file that would change such a basic functionality for many users. The pascal side should stay - if at all possible - the same.

Is there a way to ifdef a code so it is ignored in the C++Builder? I would have no problems with this:

property AsArrayItem[idx: integer]: TOmniValue ... property AsArrayItemByName[idx: integer]: TOmniValue ... {$ifdef not-in-c} property AsArrayItem[const name: string]: TOmniValue .... {$endif}

This way Delphi users can use the code as they use it now and we have a new way to access the same functionality from both C++Builder and Delphi.

Creakyhat commented 8 years ago

Yes i did i try that at first but could not seem to exclude them just for C++ which is why i did it the way i did. plus this causes issue in another file so i don't think that would work anyway,

Maybe you could see if its is possible, as i said i know a little Delphi and i can't see a way to do it.

Maybe one of your other users knows how to do it?

gabr42 commented 8 years ago

IFDEF BCB should do the trick: http://stackoverflow.com/questions/2627927/conditional-directive-to-identify-c-builder-personalities/2631343#2631343

This is how I imagined the new code:

property AsArrayItem[idx: integer]: TOmniValue read GetAsArrayItem write SetAsArrayItem; default; {$IFNDEF BCB} property AsArrayItem[const name: string]: TOmniValue read GetAsArrayItem write SetAsArrayItem; default; {$ELSE} property AsArrayItemByName[const name: string]: TOmniValue read GetAsArrayItemByName write SetAsArrayItemByName; {$ENDIF}

Creakyhat commented 8 years ago

Hi i'll give it ago when i get a chance

Thanks

zlojvavan commented 7 years ago

hello in order to build DSiWin32 with bcb2007 I've had to introduce few more externalsym directives, please see attached version, note comments marked as // vavan

ouch. the page says "We don’t support that file type. with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP" though I tried to upload zip

zlojvavan commented 7 years ago

attached as txt DSiWin32.txt