提交 681b8e94 authored 作者: Michael Jerris's avatar Michael Jerris

we can't cast from apr_dso_sym_t directly to a function pointer (c99 says no no)…

we can't cast from apr_dso_sym_t directly to a function pointer (c99 says no no) so we must cast to intptr_t first.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4240 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 64c3ecf2
...@@ -460,7 +460,7 @@ static switch_status_t sm_load_file(char *filename) ...@@ -460,7 +460,7 @@ static switch_status_t sm_load_file(char *filename)
} }
status = apr_dso_sym(&function_handle, dso, "spidermonkey_init"); status = apr_dso_sym(&function_handle, dso, "spidermonkey_init");
spidermonkey_init = (spidermonkey_init_t) function_handle; spidermonkey_init = (spidermonkey_init_t)(intptr_t) function_handle;
if (spidermonkey_init == NULL) { if (spidermonkey_init == NULL) {
err = "Cannot Load"; err = "Cannot Load";
...@@ -2209,12 +2209,12 @@ static JSBool js_log(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva ...@@ -2209,12 +2209,12 @@ static JSBool js_log(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
} }
if ((msg = JS_GetStringBytes(JS_ValueToString(cx, argv[1])))) { if ((msg = JS_GetStringBytes(JS_ValueToString(cx, argv[1])))) {
switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char*) file, "console_log", line, level, "%s", msg); switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, "console_log", line, level, "%s", msg);
return JS_TRUE; return JS_TRUE;
} }
} else if (argc > 0) { } else if (argc > 0) {
if ((msg = JS_GetStringBytes(JS_ValueToString(cx, argv[0])))) { if ((msg = JS_GetStringBytes(JS_ValueToString(cx, argv[0])))) {
switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char*) file, "console_log", line, level, "%s", msg); switch_log_printf(SWITCH_CHANNEL_ID_LOG, file, "console_log", line, level, "%s", msg);
return JS_TRUE; return JS_TRUE;
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论