[Freeswitch-svn] [commit] r5290 - in freeswitch/trunk: . src src/include

Freeswitch SVN mikej at freeswitch.org
Fri Jun 8 10:52:51 EDT 2007


Author: mikej
Date: Fri Jun  8 10:52:50 2007
New Revision: 5290

Modified:
   freeswitch/trunk/configure.in
   freeswitch/trunk/src/include/switch.h
   freeswitch/trunk/src/include/switch_cpp.h
   freeswitch/trunk/src/include/switch_ivr.h
   freeswitch/trunk/src/include/switch_stun.h
   freeswitch/trunk/src/include/switch_types.h
   freeswitch/trunk/src/switch_cpp.cpp
   freeswitch/trunk/src/switch_xml.c

Log:
sun studio/solaris build fixes

Modified: freeswitch/trunk/configure.in
==============================================================================
--- freeswitch/trunk/configure.in	(original)
+++ freeswitch/trunk/configure.in	Fri Jun  8 10:52:50 2007
@@ -123,6 +123,8 @@
     APR_ADDTO(SWITCH_AM_CFLAGS, -DPIC)
     APR_ADDTO(SWITCH_AM_CXXFLAGS, -KPIC)
     APR_ADDTO(SWITCH_AM_CXXFLAGS, -DPIC)
+    APR_ADDTO(SWITCH_AM_CXXFLAGS, "-features=extensions")
+
     APR_ADDTO(SWITCH_AM_LDFLAGS, -R${prefix}/lib)
 elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
     APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC)

Modified: freeswitch/trunk/src/include/switch.h
==============================================================================
--- freeswitch/trunk/src/include/switch.h	(original)
+++ freeswitch/trunk/src/include/switch.h	Fri Jun  8 10:52:50 2007
@@ -53,8 +53,10 @@
 #define __EXTENSIONS__ 1
 #ifndef MACOSX
 #ifndef _XOPEN_SOURCE
+#ifndef __cplusplus
 #define _XOPEN_SOURCE 600
 #endif
+#endif
 #ifndef __BSD_VISIBLE
 #define __BSD_VISIBLE 1
 #endif

Modified: freeswitch/trunk/src/include/switch_cpp.h
==============================================================================
--- freeswitch/trunk/src/include/switch_cpp.h	(original)
+++ freeswitch/trunk/src/include/switch_cpp.h	Fri Jun  8 10:52:50 2007
@@ -26,7 +26,7 @@
 	switch_input_args_t *ap;
  public:
 	CoreSession(char *uuid);
-	CoreSession(switch_core_session_t *session);
+	CoreSession(switch_core_session_t *new_session);
 	~CoreSession();
 	switch_core_session_t *session;
 	switch_channel_t *channel;

Modified: freeswitch/trunk/src/include/switch_ivr.h
==============================================================================
--- freeswitch/trunk/src/include/switch_ivr.h	(original)
+++ freeswitch/trunk/src/include/switch_ivr.h	Fri Jun  8 10:52:50 2007
@@ -562,7 +562,7 @@
 	 typedef enum {
 		 SWITCH_IVR_MENU_FLAG_FALLTOMAIN = (1 << 0),
 		 SWITCH_IVR_MENU_FLAG_FREEPOOL = (1 << 1),
-		 SWITCH_IVR_MENU_FLAG_STACK = (1 << 2),
+		 SWITCH_IVR_MENU_FLAG_STACK = (1 << 2)
 	 } switch_ivr_menu_flags;
 /* Actions are either set in switch_ivr_menu_bind_function or returned by a callback */
 	 typedef enum {
@@ -575,7 +575,7 @@
 		 SWITCH_IVR_ACTION_BACK,	/* Go back 1 menu.                 */
 		 SWITCH_IVR_ACTION_TOMAIN,	/* Go back to the top level menu.  */
 		 SWITCH_IVR_ACTION_TRANSFER,	/* Transfer caller to another ext. */
-		 SWITCH_IVR_ACTION_NOOP,	/* No operation                    */
+		 SWITCH_IVR_ACTION_NOOP	/* No operation                    */
 	 } switch_ivr_action_t;
 	 struct switch_ivr_menu;
 	 typedef switch_ivr_action_t switch_ivr_menu_action_function_t(struct switch_ivr_menu *, char *, char *, size_t, void *);

Modified: freeswitch/trunk/src/include/switch_stun.h
==============================================================================
--- freeswitch/trunk/src/include/switch_stun.h	(original)
+++ freeswitch/trunk/src/include/switch_stun.h	Fri Jun  8 10:52:50 2007
@@ -106,12 +106,12 @@
 typedef struct {
 	int16_t type;
 	uint16_t length;
-	char value[];
+	char value[1];
 } switch_stun_packet_attribute_t;
 
 typedef struct {
 	switch_stun_packet_header_t header;
-	uint8_t first_attribute[];
+	uint8_t first_attribute[1];
 } switch_stun_packet_t;
 
 typedef struct {

Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Fri Jun  8 10:52:50 2007
@@ -161,7 +161,7 @@
 	SST_POSTAL_ADDRESS,
 	SST_ACCOUNT_NUMBER,
 	SST_NAME_SPELLED,
-	SST_NAME_PHONETIC,
+	SST_NAME_PHONETIC
 } switch_say_type_t;
 
 typedef enum {
@@ -196,7 +196,7 @@
 	SWITCH_ABC_TYPE_READ,
 	SWITCH_ABC_TYPE_WRITE,
 	SWITCH_ABC_TYPE_WRITE_REPLACE,
-	SWITCH_ABC_TYPE_CLOSE,
+	SWITCH_ABC_TYPE_CLOSE
 } switch_abc_type_t;
 
 typedef struct {
@@ -332,7 +332,7 @@
 typedef enum {
 	SWITCH_PRIORITY_NORMAL,
 	SWITCH_PRIORITY_LOW,
-	SWITCH_PRIORITY_HIGH,
+	SWITCH_PRIORITY_HIGH
 } switch_priority_t;
 
 /*!
@@ -702,7 +702,7 @@
 </pre>
 */
 typedef enum {
-	SWITCH_DIRECTORY_FLAG_FREE_POOL = (1 << 0),
+	SWITCH_DIRECTORY_FLAG_FREE_POOL = (1 << 0)
 
 } switch_directory_flag_t;
 
@@ -732,7 +732,7 @@
 </pre>
 */
 typedef enum {
-	SWITCH_TIMER_FLAG_FREE_POOL = (1 << 0),
+	SWITCH_TIMER_FLAG_FREE_POOL = (1 << 0)
 } switch_timer_flag_t;
 
 
@@ -786,7 +786,7 @@
 } switch_file_flag_t;
 
 typedef enum {
-	SWITCH_IO_FLAG_NOOP = 0,
+	SWITCH_IO_FLAG_NOOP = 0
 } switch_io_flag_t;
 
 /* make sure this is synced with the EVENT_NAMES array in switch_event.c

Modified: freeswitch/trunk/src/switch_cpp.cpp
==============================================================================
--- freeswitch/trunk/src/switch_cpp.cpp	(original)
+++ freeswitch/trunk/src/switch_cpp.cpp	Fri Jun  8 10:52:50 2007
@@ -6,6 +6,7 @@
 #endif
 
 #define sanity_check(x) do { if (!session) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "session is not initalized\n"); return x;}} while(0)
+#define sanity_check_noreturn do { if (!session) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "session is not initalized\n"); return;}} while(0)
 #define init_vars() do { session = NULL; channel = NULL; uuid = NULL; tts_name = NULL; voice_name = NULL; memset(&args, 0, sizeof(args)); ap = NULL;} while(0)
 
 CoreSession::CoreSession(char *nuuid)
@@ -17,9 +18,10 @@
     }
 }
 
-CoreSession::CoreSession(switch_core_session_t *session)
+CoreSession::CoreSession(switch_core_session_t *new_session)
 {
 	init_vars();
+	session = new_session;
 	channel = switch_core_session_get_channel(session);
 	switch_core_session_read_lock(session);
 }
@@ -55,13 +57,13 @@
 
 void CoreSession::hangup(char *cause)
 {
-	sanity_check();
+	sanity_check_noreturn;
     switch_channel_hangup(channel, switch_channel_str2cause(cause));
 }
 
 void CoreSession::setVariable(char *var, char *val)
 {
-	sanity_check();
+	sanity_check_noreturn;
     switch_channel_set_variable(channel, var, val);
 }
 
@@ -74,7 +76,7 @@
 void CoreSession::execute(char *app, char *data)
 {
 	const switch_application_interface_t *application_interface;
-	sanity_check();
+	sanity_check_noreturn;
 
 	if ((application_interface = switch_loadable_module_get_application_interface(app))) {
 		begin_allow_threads();
@@ -99,7 +101,7 @@
 
 void CoreSession::setDTMFCallback(switch_input_callback_function_t cb, void *buf, uint32_t buflen)
 {
-	sanity_check();
+	sanity_check_noreturn;
 	if (cb) {
 		args.buf = buf;
 		args.buflen = buflen;
@@ -126,7 +128,7 @@
 
 void CoreSession::set_tts_parms(char *tts_name_p, char *voice_name_p)
 {
-	sanity_check();
+	sanity_check_noreturn;
 	switch_safe_free(tts_name);
 	switch_safe_free(voice_name);
     tts_name = strdup(tts_name_p);

Modified: freeswitch/trunk/src/switch_xml.c
==============================================================================
--- freeswitch/trunk/src/switch_xml.c	(original)
+++ freeswitch/trunk/src/switch_xml.c	Fri Jun  8 10:52:50 2007
@@ -60,6 +60,9 @@
 
 #ifdef HAVE_MMAP
 #include <sys/mman.h>
+#ifdef __sun
+extern int madvise(caddr_t, size_t, int);
+#endif
 #endif
 
 #define SWITCH_XML_WS   "\t\r\n "	// whitespace



More information about the Freeswitch-svn mailing list