FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Bud compiled with GDC on Linux - possible problem

 
Post new topic   Reply to topic     Forum Index -> Build
View previous topic :: View next topic  
Author Message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Fri Jan 26, 2007 2:19 am    Post subject: Bud compiled with GDC on Linux - possible problem Reply with quote

In this thread, funsheep described how he compiled Bud with GDC and had a problem using it to build the Derelict libraries.

The problem turned out to be this:

Code:

version(linux)
{
   // blah
}

version(Unix)
{
   // blah
}


For whatever reason, both blocks of code were being processed by the compiler. The obvious workarounds, of course, are to either add an 'else' in there (should have been there already) or, since the code is the same, to consolidate them. But, the issue still remains that both blocks were getting processed when they shouldn't have been since DMD doesn't recognize 'Unix' and GDC doesn't recognize 'linux'.

I don't know if this is an issue that arises from compiling Bud with GDC, a configuration problem with funsheep's system, or what. But I thought I'd bring it to your attention just in case.
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
Carlos



Joined: 19 Mar 2004
Posts: 396
Location: Canyon, TX

PostPosted: Fri Jan 26, 2007 8:28 am    Post subject: Reply with quote

I think the solution would be something like:
Code:
version(linux)
    version=linuxOrUnix;
version(Unix)
    version=linuxOrUnix;
version(linuxOrUnix)
{
    ...
}
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
afb



Joined: 26 Jan 2005
Posts: 137
Location: Sweden

PostPosted: Fri Jan 26, 2007 10:46 am    Post subject: Re: Bud compiled with GDC on Linux - possible problem Reply with quote

aldacron wrote:

For whatever reason, both blocks of code were being processed by the compiler. The obvious workarounds, of course, are to either add an 'else' in there (should have been there already) or, since the code is the same, to consolidate them. But, the issue still remains that both blocks were getting processed when they shouldn't have been since DMD doesn't recognize 'Unix' and GDC doesn't recognize 'linux'.


I replied in the other thread, but might as well do it here too... GDC does recognize "linux", but it is true that DMD doesn't have the superset "Unix".

So if you compile the code above with GDC on Linux, it will do both blocks. And if you compile it on Mac OS X, it will only do the Unix one (not the linux)
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Fri Jan 26, 2007 12:06 pm    Post subject: Reply with quote

Carlos wrote:
I think the solution would be something like:
Code:
version(linux)
    version=linuxOrUnix;
version(Unix)
    version=linuxOrUnix;
version(linuxOrUnix)
{
    ...
}


Right, that's what I meant by 'consolidate'. But Anders pointed out that my understanding of GDC was flawed. So the issue was with the missing 'else' statement and not with Bud.
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Build All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group