View Single Post
 
Old 01-16-2011, 02:09 AM
kidslow kidslow is offline
Cheetah
 
Join Date: Jan 2011
Posts: 4
I got those sources to compile

I finally was able to get the sources to compile. Would be better to #include it in a different file, but I tested this & it builds and runs. Answer came from following this thread:

http://lists.apple.com/archives/darw.../msg00059.html

It won't compile for Tiger now, but will for Leopard and SL.

Add the following code at the end of these files:

./VoodooPS2Keyboard/VoodooPS2Keyboard.h
./VoodooPS2Mouse/VoodooPS2Mouse.h
./VoodooPS2Trackpad/VoodooPS2ALPSGlidePoint.h
./VoodooPS2Trackpad/VoodooPS2SentelicFSP.h
./VoodooPS2Trackpad/VoodooPS2SynapticsTouchPad.h

Code:
#ifdef ADD_ABSOLUTETIME

#define AsUInt64(x)     (x)

#else

static inline const UInt64& AsUInt64(const AbsoluteTime& rhs)
{
    return reinterpret_cast<const uint64_t&>(rhs);
}

static inline UInt64& AsUInt64(AbsoluteTime& rhs)
{
    return reinterpret_cast<uint64_t&>(rhs);
}

static inline void absolutetime_to_nanoseconds(const AbsoluteTime& abs, UInt64* ns)
{
absolutetime_to_nanoseconds(AsUInt64(abs), ns);
}

static inline void nanoseconds_to_absolutetime(UInt64 ns, AbsoluteTime* abs)
{
    nanoseconds_to_absolutetime(ns, reinterpret_cast<uint64_t*>(abs));
}

static inline void clock_get_uptime(AbsoluteTime* abs)
{
    clock_get_uptime(reinterpret_cast<uint64_t*>(abs));
}

static inline void ADD_ABSOLUTETIME(AbsoluteTime* time, const AbsoluteTime* offset)
{
*reinterpret_cast<uint64_t*>(time) += *reinterpret_cast<const uint64_t*>(offset);
}

static inline void SUB_ABSOLUTETIME(AbsoluteTime* time, const AbsoluteTime* offset)
{
*reinterpret_cast<uint64_t*>(time) -= *reinterpret_cast<const uint64_t*>(offset);
}

static inline int64_t CMP_ABSOLUTETIME(const AbsoluteTime* lhs, const AbsoluteTime* rhs)
{
return (*reinterpret_cast<const uint64_t*>(lhs) - *reinterpret_cast<const uint64_t*>(rhs));
}

#endif /* ADD_ABSOLUTETIME */

Last edited by kidslow; 01-16-2011 at 02:17 AM.
Reply With Quote