From d7400bf3193da8efcbe1d6f4013aecc99e0583d4 Mon Sep 17 00:00:00 2001
From: Anthony Minessale <anthony.minessale@gmail.com>
Date: Mon, 18 Dec 2006 00:48:34 +0000
Subject: [PATCH] build changed

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3690 d0543943-73ff-0310-b7d9-9358b9ac24b2
---
 configure                                 |  2 +-
 configure.in                              |  2 +-
 src/include/switch_am_config.h.in         |  2 +-
 src/include/switch_channel.h              | 24 +++++++++++------------
 src/include/switch_core.h                 |  4 ++--
 src/include/switch_platform.h             |  3 +++
 src/mod/codecs/mod_g729/mod_g729.c        |  9 +++++----
 src/mod/languages/mod_spidermonkey/sm.mak |  4 ++--
 src/switch_channel.c                      | 12 ++++++------
 9 files changed, 33 insertions(+), 29 deletions(-)

diff --git a/configure b/configure
index b1a2a4cfce..e9f894edf7 100755
--- a/configure
+++ b/configure
@@ -20678,7 +20678,7 @@ esac
 
 
 cat >>confdefs.h <<_ACEOF
-#define __FUNCTION__ $FUNC_DEF
+#define __AUTO_FUNCTION__ $FUNC_DEF
 _ACEOF
 
 
diff --git a/configure.in b/configure.in
index df7aac8be4..f69ab7755d 100644
--- a/configure.in
+++ b/configure.in
@@ -103,7 +103,7 @@ AC_SUBST(new_AM_CFLAGS)
 AC_SUBST(new_AM_LDFLAGS)
 AC_SUBST(SOLINK)
 AC_SUBST(DYNAMIC_LIB_EXTEN)
-AC_DEFINE_UNQUOTED([__FUNCTION__],[$FUNC_DEF],[define it the right way ;)])
+AC_DEFINE_UNQUOTED([__AUTO_FUNCTION__],[$FUNC_DEF],[define it the right way ;)])
 AC_DEFINE_UNQUOTED([inline],[$IN_LINE],[sunpro is bad at inline])
 AC_DEFINE_UNQUOTED([__inline__],[$IN_LINE],[sunpro is bad at inline])
 
diff --git a/src/include/switch_am_config.h.in b/src/include/switch_am_config.h.in
index f9cd16b810..dacaa97b38 100644
--- a/src/include/switch_am_config.h.in
+++ b/src/include/switch_am_config.h.in
@@ -113,7 +113,7 @@
 #undef VERSION
 
 /* define it the right way ;) */
-#undef __FUNCTION__
+#undef __AUTO_FUNCTION__
 
 /* sunpro is bad at inline */
 #undef __inline__
diff --git a/src/include/switch_channel.h b/src/include/switch_channel.h
index 5e42eab7b3..5f4b37ed59 100644
--- a/src/include/switch_channel.h
+++ b/src/include/switch_channel.h
@@ -77,7 +77,7 @@ SWITCH_DECLARE(uint8_t) switch_channel_ready(switch_channel_t *channel);
 
 SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_state(switch_channel_t *channel,
                                                                         const char *file,
-                                                                        char *func,
+                                                                        const char *func,
                                                                         int line,
                                                                         switch_channel_state_t state);
 
@@ -87,7 +87,7 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_state(switch_c
   \param state new state
   \return current state of channel after application of new state
 */	
-#define switch_channel_set_state(channel, state) switch_channel_perform_set_state(channel, __FILE__, (char *)__FUNCTION__, __LINE__, state)
+#define switch_channel_set_state(channel, state) switch_channel_perform_set_state(channel, __FILE__, __FUNCTION__, __LINE__, state)
 
 /*!
   \brief return a cause code for a given string
@@ -272,12 +272,12 @@ SWITCH_DECLARE(void) switch_channel_clear_flag(switch_channel_t *channel, switch
 
 SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *channel,
                                                               const char *file,
-                                                              char *func,
+                                                              const char *func,
                                                               int line);
 
 SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_channel_t *channel,
                                                                      const char *file,
-                                                                     char *func,
+                                                                     const char *func,
                                                                      int line);
 
 /*!
@@ -285,37 +285,37 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan
   \param channel channel to answer
   \return SWITCH_STATUS_SUCCESS if channel was answered successfully
 */
-#define switch_channel_answer(channel) switch_channel_perform_answer(channel, __FILE__, (char *) __FUNCTION__, __LINE__)
+#define switch_channel_answer(channel) switch_channel_perform_answer(channel, __FILE__, __FUNCTION__, __LINE__)
 
 /*!
   \brief Mark a channel answered with no indication (for outbound calls)
   \param channel channel to mark answered
   \return SWITCH_STATUS_SUCCESS if channel was answered successfully
 */
-#define switch_channel_mark_answered(channel) switch_channel_perform_mark_answered(channel, __FILE__, (char *) __FUNCTION__, __LINE__)
+#define switch_channel_mark_answered(channel) switch_channel_perform_mark_answered(channel, __FILE__, __FUNCTION__, __LINE__)
 
 SWITCH_DECLARE(switch_status_t) switch_channel_perform_ringback(switch_channel_t *channel,
 																const char *file,
-																char *func,
+																const char *func,
 																int line);
 /*!
   \brief Send Ringing message to a channel
   \param channel channel to ring
   \return SWITCH_STATUS_SUCCESS if successful
 */
-#define switch_channel_ringback(channel) switch_channel_perform_ringback(channel, __FILE__, (char *) __FUNCTION__, __LINE__)
+#define switch_channel_ringback(channel) switch_channel_perform_ringback(channel, __FILE__, __FUNCTION__, __LINE__)
 
 
 SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel_t *channel,
                                                                   const char *file,
-                                                                  char *func,
+                                                                  const char *func,
                                                                   int line);
 /*!
   \brief Indicate progress on a channel to attempt early media
   \param channel channel to pre-answer
   \return SWITCH_STATUS_SUCCESS
 */								
-#define switch_channel_pre_answer(channel) switch_channel_perform_pre_answer(channel, __FILE__, (char *) __FUNCTION__, __LINE__)
+#define switch_channel_pre_answer(channel) switch_channel_perform_pre_answer(channel, __FILE__, __FUNCTION__, __LINE__)
 
 /*!
   \brief add a state handler table to a given channel
@@ -375,7 +375,7 @@ SWITCH_DECLARE(char *) switch_channel_get_name(switch_channel_t *channel);
 
 SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_channel_t *channel, 
                                                                      const char *file,
-                                                                     char *func,
+                                                                     const char *func,
                                                                      int line,
                                                                      switch_call_cause_t hangup_cause);
 
@@ -385,7 +385,7 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan
   \param hangup_cause the appropriate hangup cause
   \return the resulting channel state.
 */
-#define switch_channel_hangup(channel, hangup_cause) switch_channel_perform_hangup(channel, __FILE__, (char *)__FUNCTION__, __LINE__, hangup_cause)
+#define switch_channel_hangup(channel, hangup_cause) switch_channel_perform_hangup(channel, __FILE__, __FUNCTION__, __LINE__, hangup_cause)
 
 /*!
   \brief Test for presence of DTMF on a given channel
diff --git a/src/include/switch_core.h b/src/include/switch_core.h
index 0951d9d5eb..ef813ce107 100644
--- a/src/include/switch_core.h
+++ b/src/include/switch_core.h
@@ -639,7 +639,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
 
 SWITCH_DECLARE(switch_status_t) switch_core_session_perform_kill_channel(switch_core_session_t *session, 
                                                                          const char *file, 
-                                                                         char *func, 
+                                                                         const char *func, 
                                                                          int line, 
                                                                          switch_signal_t sig);
 /*! 
@@ -648,7 +648,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_kill_channel(switch_
   \param sig signal to send
   \return status returned by the session's signal handler
 */
-#define switch_core_session_kill_channel(session, sig) switch_core_session_perform_kill_channel(session, __FILE__, (char*)__FUNCTION__, __LINE__, sig)
+#define switch_core_session_kill_channel(session, sig) switch_core_session_perform_kill_channel(session, __FILE__, __FUNCTION__, __LINE__, sig)
 
 /*! 
   \brief Wait for a session to be ready for input
diff --git a/src/include/switch_platform.h b/src/include/switch_platform.h
index fbc8a93856..8a8014381c 100644
--- a/src/include/switch_platform.h
+++ b/src/include/switch_platform.h
@@ -41,6 +41,9 @@ SWITCH_BEGIN_EXTERN_C
 #endif
 
 #include <stdio.h>
+#ifndef __FUNCTION__
+#define __FUNCTION__ (const char *)__AUTO_FUNCTION__
+#endif
 
 #ifdef _MSC_VER
 
diff --git a/src/mod/codecs/mod_g729/mod_g729.c b/src/mod/codecs/mod_g729/mod_g729.c
index 34f75561f8..d05c1ced6c 100644
--- a/src/mod/codecs/mod_g729/mod_g729.c
+++ b/src/mod/codecs/mod_g729/mod_g729.c
@@ -262,13 +262,14 @@ static const switch_codec_implementation_t g729_8k_implementation = {
 	&g729_10ms_8k_implementation
 };
 
-static const switch_codec_interface_t g729_codec_interface = { 
-	/*.interface_name */ "g729", 
-	/*.implementations */ &g729_8k_implementation, 
+static const switch_codec_interface_t g729_codec_interface = {
+	/*.interface_name */ "g729",
+	/*.implementations */ &g729_8k_implementation,
+	/*.next */ NULL
 };
 
 static switch_loadable_module_interface_t g729_module_interface = { 
-	/*.module_name */ modname, 
+	/*.module_name */ "g729",
 	/*.endpoint_interface */ NULL, 
 	/*.timer_interface */ NULL, 
 	/*.dialplan_interface */ NULL, 
diff --git a/src/mod/languages/mod_spidermonkey/sm.mak b/src/mod/languages/mod_spidermonkey/sm.mak
index e279209152..bb351f3d4a 100644
--- a/src/mod/languages/mod_spidermonkey/sm.mak
+++ b/src/mod/languages/mod_spidermonkey/sm.mak
@@ -63,5 +63,5 @@ endif
 endif
 endif
 
-CFLAGS += -I../mod_spidermonkey -I$(BASE)/libs/mozilla/js/src -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DX86_LINUX  -DDEBUG -DDEBUG_root -DJS_THREADSAFE -I$(BASE)/libs/mozilla/js/src -I$(BASE)/libs/mozilla/js/src/$(OS_CONFIG)_$(VER).OBJ -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DX86_LINUX  -DDEBUG -DDEBUG_root -DJS_THREADSAFE -I$(BASE)/libs/mozilla/nsprpub/dist/include/nspr -I$(OS_CONFIG)_$(VER).OBJ
-LDFLAGS +=-DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DX86_LINUX  -DDEBUG -DDEBUG_root -DJS_THREADSAFE -I$(BASE)/libs/mozilla/nsprpub/dist/include/nspr -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DX86_LINUX  -DDEBUG -DDEBUG_root -DJS_THREADSAFE -I$(BASE)/libs/mozilla/nsprpub/dist/include/nspr -lteletone
+CFLAGS += -I../mod_spidermonkey -I$(BASE)/libs/mozilla/js/src -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DX86_LINUX -DDEBUG_root -DJS_THREADSAFE -I$(BASE)/libs/mozilla/js/src -I$(BASE)/libs/mozilla/js/src/$(OS_CONFIG)_$(VER).OBJ -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DX86_LINUX -DDEBUG_root -DJS_THREADSAFE -I$(BASE)/libs/mozilla/nsprpub/dist/include/nspr -I$(OS_CONFIG)_$(VER).OBJ
+LDFLAGS +=-DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DX86_LINUX  -DDEBUG_root -DJS_THREADSAFE -I$(BASE)/libs/mozilla/nsprpub/dist/include/nspr -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DX86_LINUX -DDEBUG_root -DJS_THREADSAFE -I$(BASE)/libs/mozilla/nsprpub/dist/include/nspr
diff --git a/src/switch_channel.c b/src/switch_channel.c
index dd14229e3f..bd45d9a9fd 100644
--- a/src/switch_channel.c
+++ b/src/switch_channel.c
@@ -452,7 +452,7 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_name_state(char *name)
 
 SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_set_state(switch_channel_t *channel,
                                                                         const char *file,
-                                                                        char *func,
+                                                                        const char *func,
                                                                         int line,
                                                                         switch_channel_state_t state)
 {
@@ -936,7 +936,7 @@ SWITCH_DECLARE(switch_caller_extension_t *) switch_channel_get_caller_extension(
 
 SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_channel_t *channel, 
                                                                      const char *file,
-                                                                     char *func,
+                                                                     const char *func,
                                                                      int line,
                                                                      switch_call_cause_t hangup_cause)
 {
@@ -976,7 +976,7 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan
 
 SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel_t *channel,
                                                                   const char *file,
-                                                                  char *func,
+                                                                  const char *func,
                                                                   int line)
 {
 	switch_core_session_message_t msg;
@@ -1017,7 +1017,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel
 
 SWITCH_DECLARE(switch_status_t) switch_channel_perform_ringback(switch_channel_t *channel,
 																const char *file,
-																char *func,
+																const char *func,
 																int line)
 {
 	switch_core_session_message_t msg;
@@ -1051,7 +1051,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_ringback(switch_channel_t
 
 SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_channel_t *channel,
                                                                      const char *file,
-                                                                     char *func,
+                                                                     const char *func,
                                                                      int line)
 {
     switch_event_t *event;
@@ -1086,7 +1086,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_answered(switch_chan
 
 SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *channel,
                                                               const char *file,
-                                                              char *func,
+                                                              const char *func,
                                                               int line)
 {
 	assert(channel != NULL);