# HG changeset patch # User Mychaela Falconia # Date 1718759188 0 # Node ID b0333fa167c3f08ba1f54730228019e9a9c8bc57 # Parent 597b39aef4847ca5515fccf3faeefca0eeb747ee libgsmhr1: compile mathhalf.c diff -r 597b39aef484 -r b0333fa167c3 .hgignore --- a/.hgignore Wed Jun 19 00:54:44 2024 +0000 +++ b/.hgignore Wed Jun 19 01:06:28 2024 +0000 @@ -72,6 +72,7 @@ ^frtest/gsmfr-encode-r$ ^frtest/gsmfr-preproc$ +^libgsmhr1/namespace\.h$ ^libtwamr/namespace\.h$ ^miscutil/amrts-pcm8-compact$ diff -r 597b39aef484 -r b0333fa167c3 libgsmhr1/Makefile --- a/libgsmhr1/Makefile Wed Jun 19 00:54:44 2024 +0000 +++ b/libgsmhr1/Makefile Wed Jun 19 01:06:28 2024 +0000 @@ -1,12 +1,15 @@ -OBJS= dhf_params.o pack_frame.o rtp_in.o sid_detect.o sid_reset.o \ +OBJS= dhf_params.o mathhalf.o pack_frame.o rtp_in.o sid_detect.o sid_reset.o \ twts002_in.o twts002_out.o unpack_frame.o -HDRS= tw_gsmhr.h +HDRS= mathhalf.h namespace.h tw_gsmhr.h typedefs.h LIB= libgsmhr1.a include ../config.defs all: ${LIB} +namespace.h: namespace.awk namespace.list + awk -f namespace.awk namespace.list > $@ + ${OBJS}: ${HDRS} ${LIB}: ${OBJS} @@ -20,4 +23,4 @@ # install -c -m 444 ${LIB} ${DESTDIR}${libdir} clean: - rm -f *.[oa] errs + rm -f *.[oa] namespace.h errs diff -r 597b39aef484 -r b0333fa167c3 libgsmhr1/mathhalf.c --- a/libgsmhr1/mathhalf.c Wed Jun 19 00:54:44 2024 +0000 +++ b/libgsmhr1/mathhalf.c Wed Jun 19 01:06:28 2024 +0000 @@ -52,6 +52,7 @@ */ #include "typedefs.h" +#include "namespace.h" #include "mathhalf.h" /*************************************************************************** diff -r 597b39aef484 -r b0333fa167c3 libgsmhr1/namespace.awk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgsmhr1/namespace.awk Wed Jun 19 01:06:28 2024 +0000 @@ -0,0 +1,22 @@ +# This awk script generates namespace.h from namespace.list + +BEGIN { + print "/* Auto-generated; do not edit! */" + print "" + print "#ifndef namespace_h" + print "#define namespace_h" + print "" +} + +{ + for (i = 1; i <= NF; i++) { + if ($i ~ /^#/) + break; + printf "#define %s gsmhr__%s\n", $i, $i; + } +} + +END { + print "" + print "#endif" +} diff -r 597b39aef484 -r b0333fa167c3 libgsmhr1/namespace.list --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libgsmhr1/namespace.list Wed Jun 19 01:06:28 2024 +0000 @@ -0,0 +1,13 @@ +# This file is the source input for automatic generation of namespace.h +# for libgsmhr1. Each word in every non-empty, non-comment line lists a +# function or a data object with intermodule linkage whose name needs to be +# transformed in order to avoid namespace pollution for users of our library. + +add sub L_add L_sub +mult L_mult mult_r +shr shl L_shr L_shl shift_r L_shift_r +abs_s L_abs +L_mac mac_r L_msu msu_r +negate L_negate +L_deposit_l L_deposit_h extract_l extract_h +round norm_l norm_s divide_s