View unanswered posts | View active topics It is currently Tue May 21, 2013 6:10 am



Post new topic Reply to topic  [ 3 posts ] 
 GetBlackboxPath - Why is it different? 
Author Message
BBDinosaur
User avatar

Joined: Wed Dec 13, 2006 7:33 pm
Posts: 263
Location: Pretoria, South Africa
Reply with quote
Post GetBlackboxPath - Why is it different?
This has been puzzling me for a while now and I'd like to know if some of the dev's who have been here longer can shed some light on this.

GetBlackboxPath is declared as WIN_API, making it use the stdcall calling convention. This has led to several work-arounds being used to allow Mingw and VC plugins and boxes to work together, because the VC compiler and the GCC compiler do not export or import stdcall functions from libraries in the same way.

Why is GetBlackboxPath defined like this, when no other part of the API is?

_________________
Try boxCore! :)
boxCore homepage. Forum thread on lostinthebox.
Bugs, Feature requests


Tue Dec 02, 2008 7:37 pm
Report this post
Profile WWW
Sponsored Links
Google Adsense


Moderator
User avatar

Joined: Sun Feb 04, 2007 2:57 pm
Posts: 1008
Location: austria
Reply with quote
Post Re: GetBlackboxPath - Why is it different?
The two folks best equipped to answer your question - ironhead & grischka - have never logged on to the site. ironhead's EmergeDesktop - which he worked on while being chief Dev of bb4win - is built on MingW. As best I understand it, however, grischka was the first to use MingW for a building a bb4win flavour.

qwilk, tresni & NC-17 have never used MingW. At a guess, azathoth never did either. FAIK it was either azathoth or qwilk who settled on naming the routine GetBlackboxPath.

As you and I both know, using MingW with a custom makefile is the standard workaround for the GetBlackboxPath issue.

From the little experimentation I once did (before settling for the custom makefile solution), it would seem that an API routine using GET && PATH trips over something in the innards of MingW. It could well be that using SET && PATH for an API routine would have the same issue.

This pitfall would seem to predate bb4win. (MingW started in 1998. bb4win started in 2001.) It could well be that when whoever it was decided to name the routine GetBlackboxPath they had no idea that anyone would want to build bb4win on MingW.

_________________
HTH

unkamunka - #bb4win


Thu Dec 04, 2008 2:59 pm
Report this post
Profile
BBDinosaur
User avatar

Joined: Wed Dec 13, 2006 7:33 pm
Posts: 263
Location: Pretoria, South Africa
Reply with quote
Post Re: GetBlackboxPath - Why is it different?
Somebody deliberatly chose to make GetBlackboxPath (and only GetBlackboxPath) use a different calling convention. This has nothing to do with the name itself, it is the WINAPI prefix that is placed before it that causes the change.

I'm not asking why it has different results under Mingw and VC, I want to know why WINAPI was added to GetBlackboxPath in the first place, which has nothing to do with either compiler/

I'm wondering why that was done to that function specifically, because it just seems utterly random. There are several functions taing similar types of parameters in the api which haven't been altered in this way.

Using the def file under Mingw is the result, but I want to know the cause.

GetBlackboxPath has been defined as
Code:
__declspec(dllexport) bool WINAPI GetBlackboxPath(LPSTR, int);
or similar since the first version of BBApi.h was imported into CVS. It's quite possible that this has been there since azahoth originally started the project. But why add WINAPI?

Maybe qwilk knows, and he can answer if he sees this, but its quite possible that nobody know anymore.

_________________
Try boxCore! :)
boxCore homepage. Forum thread on lostinthebox.
Bugs, Feature requests


Thu Dec 04, 2008 3:31 pm
Report this post
Profile WWW
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.