Am Montag, 20. Juni 2011, 22:00:26 schrieb Iain Hibbert:
> On Mon, 20 Jun 2011, Hendrik Sattler wrote:
> > Am Montag, 20. Juni 2011, 19:51:18 schrieb Iain Hibbert:
> > > I actually disklike this method, for the reason that it breaks when the
> > > OS changes even though the feature remains (eg _WIN64 will fail to
> > > work in your example :) better to rely just on the feature itself,
> > > though it could be better expressed the other way around for safety
> > 
> > _WIN32 is also defined on Windows 64bit for all relevant compilers.
> > And __FreeBSD__ or __FreeBSD better be defined on FreeBSD because that
> > what cmake uses to "see" that you compile for FreeBSD, at least gcc and
> > llvm. Also checking the system identifier is safer.
> 
> Well to be honest I will go with whatever you guys prefer.. so with that
> method it looks as below, and will provide the BtOBEX_ prototypes if the
> relevant headers are included prior.. ok?
> 
> iain
> 
> /*
>  * Bluetooth OBEX API
>  */
> #if !defined(bt_addr_t)
> #  if defined(_WIN32)
> #    if defined(BTH_ADDR_NULL)
> #      define bt_addr_t       BTH_ADDR
> #    endif
> #  elif defined(__FreeBSD__)
> #    if defined(NG_HCI_BDADDR_ANY)
> #      define bt_addr_t       bdaddr_t
> #    endif
> #  else       /* Linux, NetBSD, etc.. */
> #    if defined(BDADDR_ANY)
> #      define bt_addr_t       bdaddr_t
> #    endif
> #  endif
> #endif
> 
> #if defined(bt_addr_t)
> OPENOBEX_SYMBOL(int) BtOBEX_ServerRegister(obex_t *self, const bt_addr_t
> *src, uint8_t channel); OPENOBEX_SYMBOL(int)
> BtOBEX_TransportConnect(obex_t *self, const bt_addr_t *src, const
> bt_addr_t *dst, uint8_t channel); #endif

If that works on FreeBSD and NetBSD, that looks good to me.

HS


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Openobex-users mailing list
Openobex-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/openobex-users

Reply via email to