 |
 |
is _unix defined?
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jun 2000
Status:
Offline
|
|
I'm porting some small apps from other platforms and a lot of the code uses
calls and then links from standard files. The problem is that these checks are apparently resolving to false. Now I could go through and just modify the checks to just do whatever it is they need to do for Unix, but is there some reason it's not reading _unix as defined? Is this in a Framework somewhere and I'm just missing it?
Forgive me if this is a newbie question -- I've done a lot of programming, just not on OS X.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Jan 2001
Status:
Offline
|
|
Dunno, never seen _unix used before. Of course, you could always just do
somewhere at the top of the files.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jun 2000
Status:
Offline
|
|
Originally posted by 00101001:
Dunno, never seen _unix used before. Of course, you could always just do
somewhere at the top of the files.
Yeah, that's ultimately what I'm doing. I just didn't know if perhaps _unix was defined in some Framework that I should be including otherwise. Essentially wanted to be sure that it wasn't a symptom of a larger problem.
Thanks for the help!
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
It looks like a flag that is defined during the build process, like in a Makefile or something. BTW, to save adding it to the top of every source file, just add -D_unix to the CFLAGS.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Sep 2000
Location: in front of the keyboard
Status:
Offline
|
|
what kind of overly generalized crap is that?
Might as well put
Code:
#if defined(_is_a_computer)
What code is this?
|
|
signatures are a waste of bandwidth
especially ones with political tripe in them.
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jun 2000
Status:
Offline
|
|
Originally posted by Kristoff:
what kind of overly generalized crap is that?
Might as well put
Code:
#if defined(_is_a_computer)
What code is this?
Well, if you want to get similar functionality across different systems, you often need to use different libraries and write your code differently. Using the pre-processor tags, the compiler only bothers with the relevant code, but you can keep it all in one place for more convenient editing. In this case I'm dealing with time libraries.
Pretty standard practice for cross-platform code.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |