From: Iain Hibbert <plu...@netbsd.org>

We need to detect the presence of "Bluetooth Device Address" type
in order to provide the BtOBEX_ function prototypes, which needs
to be from a header included prior to <openobex/obex.h>
---
 include/openobex/obex.h |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/include/openobex/obex.h b/include/openobex/obex.h
index 1e9e0d7..6dda861 100644
--- a/include/openobex/obex.h
+++ b/include/openobex/obex.h
@@ -131,18 +131,25 @@ OPENOBEX_SYMBOL(int) IrOBEX_TransportConnect(obex_t 
*self, const char *service);
  * Bluetooth OBEX API
  */
 #if !defined(bt_addr_t)
-#  if defined(SOL_RFCOMM)
-#    if defined(_WIN32) /* Windows */
-#      define bt_addr_t BTH_ADDR
-#    else /* Linux, FreeBSD, NetBSD */
-#      define bt_addr_t bdaddr_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
-#  else /* no bluetooth stack available */
-#    define bt_addr_t unsigned long
 #  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
 
 /*
  * OBEX File API
-- 
1.7.5.4


------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Openobex-users mailing list
Openobex-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/openobex-users

Reply via email to