• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: source conversion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: source conversion


  • Subject: Re: source conversion
  • From: "D. Walsh" <email@hidden>
  • Date: Thu, 19 Jan 2006 07:24:01 -0500
  • Mta-interface: amavisd-new-2.3.3 (20050822) at daleenterprise.com


On Jan 19, 2006, at 06:05 , Steve Checkoway wrote:


On Jan 18, 2006, at 11:18 PM, D. Walsh wrote:

I'm in the midst of converting some 65C816 source files and I've run into some code that doesn't quite look right to me.

/* Are we using an old or a new library? */
#ifndef _xsco_version && ndef xsco_version
#define xsco_version() 1.000511
#endif

Now, from what it appears, it looks like it's testing for the existence of a function but I don't believe this is the correct approach but I could be wrong.

It's testing for the existence of two macros. [I never realized that you could use ndef like that, I would have done #if !defined(...) && !defined(...)]


Anyway, before I create a mess by ignoring this code and since there are roughly about 400 files I thought I'd ask for some opinions and advice on what to do with this code since the files are peppered with them.

It is a little odd though. If _xsco_version is defined but xsco_version is not and no function xsco_version() exists then code such as:

double version = xsco_version();

will fail to compile (or link, I never can tell when Apple's gcc will allow implicit definitions).

If that was meant to test for a function, it's going about it the wrong way (see the GNU autotools for one possible way to test for a function).

A quick search of header files turns up nothing for me:

$ find /usr/include /usr/X11R6/include/ -type f -print0|xargs -0 grep -i xsco_version

You don't have xsco installed, I've got the dev API, header files and libraries under an NDA.

#include <xsco/xsco.h>
#include <xsco/xsco_enet.h>
#include <xsco/xsco_ata.h>
#include <xsco/xsco_scsi.h>


it links against libxsco.so (now libxsco.dylib on my Mac)

Newer versions of the library include xsco_version() which returns a double so doing:
  double some_variable = xsco_version();
works but in the older libraries this function is not available so it looks like they hard code a value however, this check method doesn't seem to work or locate the available function and even using !defined(xsco_version) didn't work so I'm not sure how to resolve this.

Being an XCode project I'm not sure how to use the autotools to determine if this function exists.


That said, I think you're probably okay just leaving it alone.

Apparently not, it doesn't find library functions using this method and a lot of the application functionality doesn't work.

- Steve

-- Dale
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: source conversion
      • From: Steve Checkoway <email@hidden>
References: 
 >source conversion (From: "D. Walsh" <email@hidden>)
 >Re: source conversion (From: Steve Checkoway <email@hidden>)

  • Prev by Date: Re: Re: Property list and XML ?
  • Next by Date: a question about linking
  • Previous by thread: Re: source conversion
  • Next by thread: Re: source conversion
  • Index(es):
    • Date
    • Thread