Re: source conversion
Re: source conversion
- Subject: Re: source conversion
- From: Steve Checkoway <email@hidden>
- Date: Fri, 20 Jan 2006 03:14:09 -0800
On Jan 19, 2006, at 7:34 PM, D. Walsh wrote:
Maybe I'm confusing you a little.
Perhaps.
In XSCO prior to version 1.000417 the "xsco_version()" function
doesn't exists.
This means in the header file you don't have the following line.
int xsco_version();
After discussing it with them, it appears that the above lines of
code were to test for the presence of the functions in the header
files and adjust if not present.
This is not an acceptable way to test for the presence of a function
(in a header file or elsewhere). It only works to test for the
presence of a #define.
It is my understanding of the discussion that the original 65C816
compiler accepted this method and worked so I'm not sure how I can
use the installed xsco_XXXXX.h files to determine if these and
other functions exists.
That seems immaterial. I see two cases for you.
1. You are using only the dylib you mentioned which you built
yourself. in this case, you should know exactly what version it is
and more importantly, you should know whether or not the function is
defined. As I mentioned before, just use:
$ nm libxsco.dylib|grep _xsco_version
to test for the presence of the xsco_version function and handle it
appropriately.
2. You want to link this to any version of the dylib (with the same
install name/version number). Some of these might have the function
and others might not. If this is the case, you can do something like:
double xsco_version_wrapper()
{
static double version = 0.0;
if( version == 0.0 )
{
double (*fun)() = (double (*)())dlsym( RTLD_DEFAULT,
"_xsco_version" );
version = fun ? (*fun)() : 1.000511;
}
return version
}
Then use sed (or whatever you wish) to change all of those blocks to
define xsco_version as:
#define xsco_version() xsco_version_wrapper()
(Code all typed in Mail and all that implies.)
- Steve
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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