From f41ff727909317e2e3d4c11c5bccd8129d455ab6 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Fri, 3 Dec 2010 14:42:37 -0500 Subject: [PATCH] Fixed compilation issues --- .../ftmod_sangoma_isdn/ftmod_sangoma_isdn.h | 67 ------------------- libs/freetdm/src/testsangomaboost.c | 2 + 2 files changed, 2 insertions(+), 67 deletions(-) diff --git a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h index b80d5b5577..9172dab7cf 100644 --- a/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h +++ b/libs/freetdm/src/ftmod/ftmod_sangoma_isdn/ftmod_sangoma_isdn.h @@ -65,33 +65,6 @@ /* TODO: rename all *_cc_* to *_an_* */ -#define SNGISDN_ENUM_NAMES(_NAME, _STRINGS) static const char * _NAME [] = { _STRINGS , NULL }; -#define SNGISDN_STR2ENUM_P(_FUNC1, _FUNC2, _TYPE) _TYPE _FUNC1 (const char *name); const char * _FUNC2 (_TYPE type); -#define SNGISDN_STR2ENUM(_FUNC1, _FUNC2, _TYPE, _STRINGS, _MAX) \ - _TYPE _FUNC1 (const char *name) \ -{ \ - int i; \ - _TYPE t = _MAX ; \ - \ - for (i = 0; i < _MAX ; i++) { \ - if (!strcasecmp(name, _STRINGS[i])) { \ - t = (_TYPE) i; \ - break; \ -} \ -} \ - \ - return t; \ -} \ - const char * _FUNC2 (_TYPE type) \ -{ \ - if (type > _MAX) { \ - type = _MAX; \ -} \ - return _STRINGS[(int)type]; \ -} \ - - - typedef enum { FLAG_RESET_RX = (1 << 0), FLAG_RESET_TX = (1 << 1), @@ -164,46 +137,6 @@ typedef enum { SNGISDN_EVENT_RST_IND, } ftdm_sngisdn_event_id_t; -typedef enum { - /* Call is not end-to-end ISDN */ - SNGISDN_PROGIND_DESCR_NETE_ISDN, - /* Destination address is non-ISDN */ - SNGISDN_PROGIND_DESCR_DEST_NISDN, - /* Origination address is non-ISDN */ - SNGISDN_PROGIND_DESCR_ORIG_NISDN, - /* Call has returned to the ISDN */ - SNGISDN_PROGIND_DESCR_RET_ISDN, - /* Interworking as occured and has resulted in a telecommunication service change */ - SNGISDN_PROGIND_DESCR_SERV_CHANGE, - /* In-band information or an appropriate pattern is now available */ - SNGISDN_PROGIND_DESCR_IB_AVAIL, - /* Invalid */ - SNGISDN_PROGIND_DESCR_INVALID, -} ftdm_sngisdn_progind_descr_t; -#define SNGISDN_PROGIND_DESCR_STRINGS "not-end-to-end-isdn", "destination-is-non-isdn", "origination-is-non-isdn", "call-returned-to-isdn", "service-change", "inband-info-available", "invalid" -SNGISDN_STR2ENUM_P(ftdm_str2ftdm_sngisdn_progind_descr, ftdm_sngisdn_progind_descr2str, ftdm_sngisdn_progind_descr_t); - -typedef enum { - /* User */ - SNGISDN_PROGIND_LOC_USER, - /* Private network serving the local user */ - SNGISDN_PROGIND_LOC_PRIV_NET_LOCAL_USR, - /* Public network serving the local user */ - SNGISDN_PROGIND_LOC_PUB_NET_LOCAL_USR, - /* Transit network */ - SNGISDN_PROGIND_LOC_TRANSIT_NET, - /* Public network serving remote user */ - SNGISDN_PROGIND_LOC_PUB_NET_REMOTE_USR, - /* Private network serving remote user */ - SNGISDN_PROGIND_LOC_PRIV_NET_REMOTE_USR, - /* Network beyond the interworking point */ - SNGISDN_PROGIND_LOC_NET_BEYOND_INTRW, - /* Invalid */ - SNGISDN_PROGIND_LOC_INVALID, -} ftdm_sngisdn_progind_loc_t; -#define SNGISDN_PROGIND_LOC_STRINGS "user", "private-net-local-user", "public-net-local-user", "transit-network", "public-net-remote-user", "private-net-remote-user", "beyond-interworking", "invalid" -SNGISDN_STR2ENUM_P(ftdm_str2ftdm_sngisdn_progind_loc, ftdm_sngisdn_progind_loc2str, ftdm_sngisdn_progind_loc_t); - typedef struct ftdm_sngisdn_prog_ind { ftdm_sngisdn_progind_loc_t loc; /* location */ ftdm_sngisdn_progind_descr_t descr; /* description */ diff --git a/libs/freetdm/src/testsangomaboost.c b/libs/freetdm/src/testsangomaboost.c index 85b5332635..84ff287830 100644 --- a/libs/freetdm/src/testsangomaboost.c +++ b/libs/freetdm/src/testsangomaboost.c @@ -49,7 +49,9 @@ #include #include #ifdef __linux__ +#ifndef __USE_BSD #define __USE_BSD +#endif #include #endif #include "freetdm.h"