[asterisk-commits] seanbright: branch group/asterisk-cpp r168634 - in /team/group/asterisk-cpp: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 14 21:17:22 CST 2009


Author: seanbright
Date: Wed Jan 14 21:17:22 2009
New Revision: 168634

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168634
Log:
Make some changes to the Makefile logic to let us build with DONT_OPTIMIZE
enabled, and resolve another chunk of link errors.  This mostly was due to
conflicting header/implementation function signatures.  Also, link
editline's np/strlcat.c and np/strlcpy.c directly into the library since
it now has different linkage the the versions in the strcompat source.

Modified:
    team/group/asterisk-cpp/Makefile.rules
    team/group/asterisk-cpp/include/asterisk/astdb.h
    team/group/asterisk-cpp/include/asterisk/astobj2.h
    team/group/asterisk-cpp/include/asterisk/module.h
    team/group/asterisk-cpp/main/asterisk.c
    team/group/asterisk-cpp/main/editline/configure
    team/group/asterisk-cpp/main/editline/configure.in
    team/group/asterisk-cpp/main/features.c
    team/group/asterisk-cpp/main/fixedjitterbuf.h
    team/group/asterisk-cpp/main/manager.c
    team/group/asterisk-cpp/main/utils.c

Modified: team/group/asterisk-cpp/Makefile.rules
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/Makefile.rules?view=diff&rev=168634&r1=168633&r2=168634
==============================================================================
--- team/group/asterisk-cpp/Makefile.rules (original)
+++ team/group/asterisk-cpp/Makefile.rules Wed Jan 14 21:17:22 2009
@@ -73,11 +73,18 @@
 	$(CMD_PREFIX) $(CC) -o $@ -c $< $(CC_CFLAGS)
 
 %.o: %.i
+ifeq ($(COMPILE_DOUBLE),yes)
+  ifeq ($(strip $(foreach dir,db1-ast editline,$(findstring $(dir),$(CURDIR)/$@))),)
+	$(ECHO_PREFIX) echo "   [CXXi] $< -> $@"
+	$(CMD_PREFIX) $(CXX) -o /dev/null -c $< $(CXX_CFLAGS) $(OPTIMIZE)
+	$(CMD_PREFIX) $(CXX) -o $@ -c $< $(CXX_CFLAGS)
+  else
 	$(ECHO_PREFIX) echo "   [CCi] $< -> $@"
-ifeq ($(COMPILE_DOUBLE),yes)
 	$(CMD_PREFIX) $(CC) -o /dev/null -c $< $(CC_CFLAGS) $(OPTIMIZE)
+	$(CMD_PREFIX) $(CC) -o $@ -c $< $(CC_CFLAGS)
+  endif
 endif
-	$(CMD_PREFIX) $(CC) -o $@ -c $< $(CC_CFLAGS)
+
 
 ifneq ($(COMPILE_DOUBLE),yes)
 %.o: %.c
@@ -91,8 +98,13 @@
 endif
 
 %.i: %.c
+ifeq ($(strip $(foreach dir,db1-ast editline,$(findstring $(dir),$(CURDIR)/$@))),)
+	$(ECHO_PREFIX) echo "   [CXX] $< -> $@"
+	$(CMD_PREFIX) $(CXX) -o $@ -E $< $(CXX_CFLAGS) $(MAKE_DEPS)
+else
 	$(ECHO_PREFIX) echo "   [CPP] $< -> $@"
-	$(CMD_PREFIX) $(CXX) -o $@ -E $< $(CXX_CFLAGS) $(MAKE_DEPS)
+	$(CMD_PREFIX) $(CC) -o $@ -E $< $(CC_CFLAGS) $(MAKE_DEPS)
+endif
 
 %.oo: %.ii
 	$(ECHO_PREFIX) echo "   [CXXi] $< -> $@"

Modified: team/group/asterisk-cpp/include/asterisk/astdb.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/include/asterisk/astdb.h?view=diff&rev=168634&r1=168633&r2=168634
==============================================================================
--- team/group/asterisk-cpp/include/asterisk/astdb.h (original)
+++ team/group/asterisk-cpp/include/asterisk/astdb.h Wed Jan 14 21:17:22 2009
@@ -30,7 +30,7 @@
 };
 
 /*! \brief Get key value specified by family/key */
-int ast_db_get(const char *family, const char *key, char *out, int outlen);
+int ast_db_get(const char *family, const char *key, char *out, size_t outlen);
 
 /*! \brief Store value addressed by family/key*/
 int ast_db_put(const char *family, const char *key, const char *value);

Modified: team/group/asterisk-cpp/include/asterisk/astobj2.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/include/asterisk/astobj2.h?view=diff&rev=168634&r1=168633&r2=168634
==============================================================================
--- team/group/asterisk-cpp/include/asterisk/astobj2.h (original)
+++ team/group/asterisk-cpp/include/asterisk/astobj2.h Wed Jan 14 21:17:22 2009
@@ -443,7 +443,7 @@
 #define ao2_t_ref(arg1,arg2,arg3) _ao2_ref((arg1), (arg2))
 #define ao2_ref(arg1,arg2)        _ao2_ref((arg1), (arg2))
 #endif
-int _ao2_ref_debug(void *o, int delta, char *tag, char *file, int line, const char *funcname);
+int _ao2_ref_debug(void *o, const int delta, const char *tag, const char *file, const int line, const char *funcname);
 int _ao2_ref(void *o, int delta);
 
 /*! \brief
@@ -850,9 +850,9 @@
 #define ao2_t_callback(arg1,arg2,arg3,arg4,arg5) _ao2_callback((arg1), (arg2), (arg3), (arg4))
 #define ao2_callback(arg1,arg2,arg3,arg4)        _ao2_callback((arg1), (arg2), (arg3), (arg4))
 #endif
-void *_ao2_callback_debug(struct ao2_container *c, enum search_flags flags,
-						  ao2_callback_fn *cb_fn, void *arg, char *tag, 
-						  char *file, int line, const char *funcname);
+void *_ao2_callback_debug(struct ao2_container *c, const enum search_flags flags,
+						  ao2_callback_fn *cb_fn, void *arg, const char *tag, 
+						  const char *file, const int line, const char *funcname);
 void *_ao2_callback(struct ao2_container *c,
 					enum search_flags flags,
 					ao2_callback_fn *cb_fn, void *arg);

Modified: team/group/asterisk-cpp/include/asterisk/module.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/include/asterisk/module.h?view=diff&rev=168634&r1=168633&r2=168634
==============================================================================
--- team/group/asterisk-cpp/include/asterisk/module.h (original)
+++ team/group/asterisk-cpp/include/asterisk/module.h Wed Jan 14 21:17:22 2009
@@ -29,10 +29,6 @@
 #define _ASTERISK_MODULE_H
 
 #include "asterisk/utils.h"
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
 
 /*! \brief The text the key() function should return. */
 #define ASTERISK_GPL_KEY \
@@ -428,7 +424,7 @@
  * \retval 0 success
  * \retval -1 failure.
  */
-int ast_register_application2(const char *app, int (*execute)(struct ast_channel *, void *),
+int ast_register_application2(const char *app, int (*execute)(struct ast_channel *, const char *),
 				     const char *synopsis, const char *description, void *mod);
 
 /*! 
@@ -443,9 +439,4 @@
  */
 int ast_unregister_application(const char *app);
 
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
 #endif /* _ASTERISK_MODULE_H */

Modified: team/group/asterisk-cpp/main/asterisk.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/asterisk.c?view=diff&rev=168634&r1=168633&r2=168634
==============================================================================
--- team/group/asterisk-cpp/main/asterisk.c (original)
+++ team/group/asterisk-cpp/main/asterisk.c Wed Jan 14 21:17:22 2009
@@ -122,7 +122,9 @@
 #include "asterisk/utils.h"
 #include "asterisk/file.h"
 #include "asterisk/io.h"
+extern "C" {
 #include "editline/histedit.h"
+}
 #include "asterisk/config.h"
 #include "asterisk/ast_version.h"
 #include "asterisk/linkedlists.h"

Modified: team/group/asterisk-cpp/main/editline/configure.in
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/editline/configure.in?view=diff&rev=168634&r1=168633&r2=168634
==============================================================================
--- team/group/asterisk-cpp/main/editline/configure.in (original)
+++ team/group/asterisk-cpp/main/editline/configure.in Wed Jan 14 21:17:22 2009
@@ -99,6 +99,8 @@
 AC_CHECK_FUNCS(fgetln, , CCSRCS="$CCSRCS np/fgetln.c")
 AC_CHECK_FUNCS(strvis, , CCSRCS="$CCSRCS np/vis.c")
 AC_CHECK_FUNCS(strunvis, , CCSRCS="$CCSRCS np/unvis.c")
+AC_CHECK_FUNCS(strlcat, , CCSRCS="$CCSRCS np/strlcat.c")
+AC_CHECK_FUNCS(strlcpy, , CCSRCS="$CCSRCS np/strlcpy.c")
 
 AC_EGREP_CPP(yes,
 [#include <sys/cdefs.h>

Modified: team/group/asterisk-cpp/main/features.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/features.c?view=diff&rev=168634&r1=168633&r2=168634
==============================================================================
--- team/group/asterisk-cpp/main/features.c (original)
+++ team/group/asterisk-cpp/main/features.c Wed Jan 14 21:17:22 2009
@@ -2847,7 +2847,7 @@
 END_OPTIONS );
 
 /*! \brief Park a call */
-static int park_call_exec(struct ast_channel *chan, void *data)
+static int park_call_exec(struct ast_channel *chan, const char *data)
 {
 	/* Cache the original channel name in case we get masqueraded in the middle
 	 * of a park--it is still theoretically possible for a transfer to happen before
@@ -2935,7 +2935,7 @@
 }
 
 /*! \brief Pickup parked call */
-static int park_exec_full(struct ast_channel *chan, void *data, struct ast_parkinglot *parkinglot)
+static int park_exec_full(struct ast_channel *chan, const char *data, struct ast_parkinglot *parkinglot)
 {
 	int res = 0;
 	struct ast_channel *peer=NULL;
@@ -3066,7 +3066,7 @@
 	return res;
 }
 
-static int park_exec(struct ast_channel *chan, void *data) 
+static int park_exec(struct ast_channel *chan, const char *data) 
 {
 	return park_exec_full(chan, data, default_parkinglot);
 }
@@ -4045,7 +4045,7 @@
  * answer call if not already, check compatible channels, setup bridge config
  * now bridge call, if transfered party hangs up return to PBX extension.
 */
-static int bridge_exec(struct ast_channel *chan, void *data)
+static int bridge_exec(struct ast_channel *chan, const char *data)
 {
 	struct ast_channel *current_dest_chan, *final_dest_chan;
 	char *tmp_data  = NULL;

Modified: team/group/asterisk-cpp/main/fixedjitterbuf.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/fixedjitterbuf.h?view=diff&rev=168634&r1=168633&r2=168634
==============================================================================
--- team/group/asterisk-cpp/main/fixedjitterbuf.h (original)
+++ team/group/asterisk-cpp/main/fixedjitterbuf.h Wed Jan 14 21:17:22 2009
@@ -25,11 +25,6 @@
 
 #ifndef _FIXEDJITTERBUF_H_
 #define _FIXEDJITTERBUF_H_
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
 
 /* return codes */
 enum {
@@ -85,8 +80,4 @@
 
 void fixed_jb_set_force_resynch(struct fixed_jb *jb);
 
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
 #endif /* _FIXEDJITTERBUF_H_ */

Modified: team/group/asterisk-cpp/main/manager.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/manager.c?view=diff&rev=168634&r1=168633&r2=168634
==============================================================================
--- team/group/asterisk-cpp/main/manager.c (original)
+++ team/group/asterisk-cpp/main/manager.c Wed Jan 14 21:17:22 2009
@@ -977,7 +977,7 @@
 		astman_append(s, "\r\n");
 }
 
-void astman_send_response(struct mansession *s, const struct message *m, const char *resp, char *msg)
+void astman_send_response(struct mansession *s, const struct message *m, const char *resp, const char *msg)
 {
 	astman_send_response_full(s, m, resp, msg, NULL);
 }

Modified: team/group/asterisk-cpp/main/utils.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/utils.c?view=diff&rev=168634&r1=168633&r2=168634
==============================================================================
--- team/group/asterisk-cpp/main/utils.c (original)
+++ team/group/asterisk-cpp/main/utils.c Wed Jan 14 21:17:22 2009
@@ -1446,7 +1446,7 @@
 	return dataPut;
 }
 
-void ast_join(char *s, size_t len, char * const w[])
+void ast_join(char *s, size_t len, const char * const w[])
 {
 	int x;
     size_t ofs = 0;




More information about the asterisk-commits mailing list