From 54c9745f4ccf8e69527364ee9c56c3b78106c131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Gallo?= Date: Fri, 16 Mar 2012 13:05:44 +0000 Subject: [PATCH] [INTERPRETER] * BUG: The exp10() function is temporarily removed from gbx on FreeBSD because of the BSD libc that doesn't have this one. [GB.V4L] * NEW: compile with success on FreeBSD git-svn-id: svn://localhost/gambas/trunk@4555 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.v4l/src/CWebcam.h | 10 ++++++++-- gb.v4l/src/gv4l2.c | 9 ++++++++- main/gbx/gbx_subr_math.c | 12 ++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/gb.v4l/src/CWebcam.h b/gb.v4l/src/CWebcam.h index f0b6f210b..9a8055fb1 100644 --- a/gb.v4l/src/CWebcam.h +++ b/gb.v4l/src/CWebcam.h @@ -27,11 +27,17 @@ #include #include #include -#include +#include "config.h" #include #include -#include "videodev.h" +#ifdef OS_FREEBSD + #include +#else + #include + #include "videodev.h" +#endif + #include "gambas.h" #ifndef __CWEBCAM_C diff --git a/gb.v4l/src/gv4l2.c b/gb.v4l/src/gv4l2.c index dec2f5ed7..75a1de98e 100644 --- a/gb.v4l/src/gv4l2.c +++ b/gb.v4l/src/gv4l2.c @@ -37,7 +37,7 @@ #include #include -#include + #ifdef HAVE_STDLIB_H #undef HAVE_STDLIB_H @@ -45,6 +45,13 @@ #include "main.h" #include "CWebcam.h" + +#ifdef OS_FREEBSD + #include +#else + #include +#endif + // bool gv4l2_debug_mode = TRUE; // diff --git a/main/gbx/gbx_subr_math.c b/main/gbx/gbx_subr_math.c index 3e1b41302..f73cbeaff 100644 --- a/main/gbx/gbx_subr_math.c +++ b/main/gbx/gbx_subr_math.c @@ -135,11 +135,19 @@ void SUBR_round(ushort code) void SUBR_math(ushort code) { +#ifdef OS_FREEBSD + static void *jump[] = { + NULL, &&__FRAC, &&__LOG, &&__EXP, &&__SQRT, &&__SIN, &&__COS, &&__TAN, &&__ATAN, &&__ASIN, &&__ACOS, + &&__DEG, &&__RAD, &&__LOG10, &&__SINH, &&__COSH, &&__TANH, &&__ASINH, &&__ACOSH, &&__ATANH, + &&__EXP2 /*, &&__EXP10 */, &&__LOG2, &&__CBRT, &&__EXPM1, &&__LOG1P, &&__FLOOR, &&__CEIL + }; +#else static void *jump[] = { NULL, &&__FRAC, &&__LOG, &&__EXP, &&__SQRT, &&__SIN, &&__COS, &&__TAN, &&__ATAN, &&__ASIN, &&__ACOS, &&__DEG, &&__RAD, &&__LOG10, &&__SINH, &&__COSH, &&__TANH, &&__ASINH, &&__ACOSH, &&__ATANH, &&__EXP2, &&__EXP10, &&__LOG2, &&__CBRT, &&__EXPM1, &&__LOG1P, &&__FLOOR, &&__CEIL }; +#endif SUBR_ENTER_PARAM(1); @@ -167,7 +175,11 @@ __ASINH: PARAM->_float.value = __builtin_asinh(PARAM->_float.value); goto __END; __ACOSH: PARAM->_float.value = __builtin_acosh(PARAM->_float.value); goto __END; __ATANH: PARAM->_float.value = __builtin_atanh(PARAM->_float.value); goto __END; __EXP2: PARAM->_float.value = __builtin_exp2(PARAM->_float.value); goto __END; +#ifdef OS_FREEBSD + /* code here the exp10() function manually */ +#else __EXP10: PARAM->_float.value = __builtin_exp10(PARAM->_float.value); goto __END; +#endif __LOG2: PARAM->_float.value = __builtin_log2(PARAM->_float.value); goto __END; __CBRT: PARAM->_float.value = __builtin_cbrt(PARAM->_float.value); goto __END; __EXPM1: PARAM->_float.value = __builtin_expm1(PARAM->_float.value); goto __END;