From 45b97e9f4de1b0406058f7fd74b2f71d87b47178 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sat, 8 Nov 2014 03:50:43 +0000 Subject: [PATCH] renames some functions for building on freebsd --- qse/lib/awk/Makefile.am | 2 +- qse/lib/awk/Makefile.in | 8 ++++---- qse/lib/awk/std.c | 10 +++++----- qse/lib/awk/std.h | 38 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 qse/lib/awk/std.h diff --git a/qse/lib/awk/Makefile.am b/qse/lib/awk/Makefile.am index ce00acd1..9a40b357 100644 --- a/qse/lib/awk/Makefile.am +++ b/qse/lib/awk/Makefile.am @@ -23,7 +23,7 @@ CPPFLAGS_LIB_COMMON += -DQSE_AWK_DEFAULT_MODPREFIX=\"$(libdir)/libqseawk-\" -DQS endif lib_LTLIBRARIES = libqseawk.la -libqseawk_la_SOURCES = awk.c err.c tree.c parse.c run.c rec.c val.c fnc.c misc.c rio.c std.c awk.h err.h rio.h val.h fnc.h misc.h parse.h run.h tree.h +libqseawk_la_SOURCES = awk.c err.c tree.c parse.c run.c rec.c val.c fnc.c misc.c rio.c std.c awk.h err.h rio.h val.h fnc.h misc.h parse.h run.h tree.h std.h libqseawk_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) libqseawk_la_LDFLAGS = $(LDFLAGS_LIB_COMMON) libqseawk_la_LIBADD = $(LIBADD_LIB_COMMON) diff --git a/qse/lib/awk/Makefile.in b/qse/lib/awk/Makefile.in index b513be80..e6d4d6ba 100644 --- a/qse/lib/awk/Makefile.in +++ b/qse/lib/awk/Makefile.in @@ -215,9 +215,9 @@ libqseawk_la_DEPENDENCIES = $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_3) am__libqseawk_la_SOURCES_DIST = awk.c err.c tree.c parse.c run.c rec.c \ val.c fnc.c misc.c rio.c std.c awk.h err.h rio.h val.h fnc.h \ - misc.h parse.h run.h tree.h mod-dir.c mod-dir.h mod-math.c \ - mod-math.h mod-sed.c mod-sed.h mod-str.c mod-str.h mod-sys.c \ - mod-sys.h mod-mpi.c mod-mpi.h mod-uci.c mod-uci.h + misc.h parse.h run.h tree.h std.h mod-dir.c mod-dir.h \ + mod-math.c mod-math.h mod-sed.c mod-sed.h mod-str.c mod-str.h \ + mod-sys.c mod-sys.h mod-mpi.c mod-mpi.h mod-uci.c mod-uci.h @ENABLE_STATIC_MODULE_TRUE@am__objects_1 = libqseawk_la-mod-dir.lo \ @ENABLE_STATIC_MODULE_TRUE@ libqseawk_la-mod-math.lo \ @ENABLE_STATIC_MODULE_TRUE@ libqseawk_la-mod-sed.lo \ @@ -500,7 +500,7 @@ LIBADD_LIB_COMMON = -lqsecmn $(LIBM) $(LIBLTDL) lib_LTLIBRARIES = libqseawk.la $(am__append_3) libqseawk_la_SOURCES = awk.c err.c tree.c parse.c run.c rec.c val.c \ fnc.c misc.c rio.c std.c awk.h err.h rio.h val.h fnc.h misc.h \ - parse.h run.h tree.h $(am__append_4) $(am__append_6) \ + parse.h run.h tree.h std.h $(am__append_4) $(am__append_6) \ $(am__append_9) libqseawk_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) $(am__append_7) libqseawk_la_LDFLAGS = $(LDFLAGS_LIB_COMMON) $(am__append_8) diff --git a/qse/lib/awk/std.c b/qse/lib/awk/std.c index 2014aacc..4307e45b 100644 --- a/qse/lib/awk/std.c +++ b/qse/lib/awk/std.c @@ -18,7 +18,7 @@ License along with QSE. If not, see . */ -#include "awk.h" +#include "std.h" #include #include #include @@ -145,7 +145,7 @@ typedef struct ioattr_t static ioattr_t* get_ioattr (qse_htb_t* tab, const qse_char_t* ptr, qse_size_t len); -static qse_awk_flt_t custom_awk_pow (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y) +qse_awk_flt_t qse_awk_stdmathpow (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y) { #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_POWQ) return powq (x, y); @@ -160,7 +160,7 @@ static qse_awk_flt_t custom_awk_pow (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_fl #endif } -static qse_awk_flt_t custom_awk_mod (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y) +qse_awk_flt_t qse_awk_stdmathmod (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y) { #if defined(QSE_USE_AWK_FLTMAX) && defined(HAVE_FMODQ) return fmodq (x, y); @@ -406,8 +406,8 @@ qse_awk_t* qse_awk_openstdwithmmgr (qse_mmgr_t* mmgr, qse_size_t xtnsize, qse_aw qse_awk_prm_t prm; xtn_t* xtn; - prm.math.pow = custom_awk_pow; - prm.math.mod = custom_awk_mod; + prm.math.pow = qse_awk_stdmathpow; + prm.math.mod = qse_awk_stdmathmod; prm.modopen = custom_awk_modopen; prm.modclose = custom_awk_modclose; diff --git a/qse/lib/awk/std.h b/qse/lib/awk/std.h new file mode 100644 index 00000000..a0bb88c0 --- /dev/null +++ b/qse/lib/awk/std.h @@ -0,0 +1,38 @@ +/* + * $Id$ + * + Copyright 2006-2014 Chung, Hyung-Hwan. + This file is part of QSE. + + QSE is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of + the License, or (at your option) any later version. + + QSE is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with QSE. If not, see . + */ + +#ifndef _QSE_LIB_AWK_STD_H +#define _QSE_LIB_AWK_STD_H_ + +#include "awk.h" + +#ifdef __cplusplus +extern "C" { +#endif + +qse_awk_flt_t qse_awk_stdmathpow (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y); +qse_awk_flt_t qse_awk_stdmathmod (qse_awk_t* awk, qse_awk_flt_t x, qse_awk_flt_t y); + +#ifdef __cplusplus +} +#endif + + +#endif