Re: moving from Xcode 2.5 -> 3.1: problem building a USB kernel driver
Re: moving from Xcode 2.5 -> 3.1: problem building a USB kernel driver
- Subject: Re: moving from Xcode 2.5 -> 3.1: problem building a USB kernel driver
- From: Fritz Anderson <email@hidden>
- Date: Sun, 3 Aug 2008 14:57:26 -0500
On 3 Aug 2008, at 1:10 PM, Eric Gorouben wrote:
I'm building a USB kernel extension that uses
absolutetime_to_nanoseconds.
With Xcode 2.5, no problem.
With Xcode 3.1, I get this error: error: conversion from 'uint64_t'
to non-scalar type 'AbsoluteTime' requested
Why this difference between Xcode 2.5 and Xcode 3.1?
I suspect a change in some MACRO, but I can't find it anywhere.
You have not shared _any_ information about the code at which the
error occurred, so I can only do half an hour's worth of your research
for you, and then guess.
Apparently you are using different SDKs in the two versions of Xcode.
This is a very bad idea.
In each of Xcode 2.5 and Xcode 3.0, hold down the command key and
double-click on absolutetime_to_nanoseconds (the name does not appear
in Xcode's API list). What is the declaration for
absolutetime_to_nanoseconds in each case?
And what do you find, in each version, when you command-double-click
on AbsoluteTime? I've found that in the 10.3.9 SDK, under some
circumstances, absolutetime_to_nanoseconds is defined as a macro that
takes an AbsoluteTime struct and does a simple pointer cast to turn it
into a uint64_t. You are evidently passing a uint64_t type in (though
I can't be sure of this, because you have not bothered to show any of
your code).
The AbsoluteTime struct (actually a typedef for the UnsignedWide
struct) depends on the byte order of its components. That is a
disaster on machines with Intel processors, and the reason the API
changed after 10.3.9.
If you intend to deploy only on 10.3.9, use the 10.3.9 SDK (it's an
optional install on Xcode 3.x). If you intend to deploy on Intel at
all, use the SDK for the highest version of the OS you intend to
support.
— F
_______________________________________________
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