On Wed, 9 Jan 2013, Diego Biurrun wrote:
--- libavutil/x86/x86inc.asm | 41 ++++++++++++++++++++++++++++------------- libavutil/x86/x86util.asm | 1 + 2 files changed, 29 insertions(+), 13 deletions(-)diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm index 4d8d0db..e205aea 100644 --- a/libavutil/x86/x86inc.asm +++ b/libavutil/x86/x86inc.asm @@ -38,6 +38,10 @@ %define private_prefix x264 %endif +%ifndef public_prefix + %define public_prefix private_prefix +%endif + %define WIN64 0 %define UNIX64 0 %if ARCH_X86_64 @@ -627,30 +631,41 @@ DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14 %macro cglobal 1-2+ "" ; name, [PROLOGUE args] ; the "" is a workaround for nasm, which fails if SUFFIX is empty ; and we call cglobal_internal with just %1 %+ SUFFIX (without %2) - cglobal_internal %1 %+ SUFFIX, %2 + cglobal_internal 1, %1 %+ SUFFIX, %2 +%endmacro +%macro cvisible 1-2+ "" ; name, [PROLOGUE args] + ; the "" is a workaround for nasm, which fails if SUFFIX is empty + ; and we call cglobal_internal with just %1 %+ SUFFIX (without %2) + cglobal_internal 0, %1 %+ SUFFIX, %2 %endmacro -%macro cglobal_internal 1-2+ - %ifndef cglobaled_%1 - %xdefine %1 mangle(private_prefix %+ _ %+ %1) - %xdefine %1.skip_prologue %1 %+ .skip_prologue - CAT_XDEFINE cglobaled_, %1, 1 +%macro cglobal_internal 2-3+ + %xdefine HIDDEN %1 + %if %1 + %xdefine FUNCTION_PREFIX private_prefix + %else + %xdefine FUNCTION_PREFIX public_prefix + %endif + %ifndef cglobaled_%2 + %xdefine %2 mangle(FUNCTION_PREFIX %+ _ %+ %2) + %xdefine %2.skip_prologue %2 %+ .skip_prologue + CAT_XDEFINE cglobaled_, %2, 1 %endif - %xdefine current_function %1 - %ifidn __OUTPUT_FORMAT__,elf - global %1:function hidden + %xdefine current_function %2 + %ifidn __OUTPUT_FORMAT__,elf && HIDDEN + global %2:function hidden %else - global %1 + global %2
You still would want to mark it as a function if targeting elf, even if it's a public function (see my original patch).
// Martin _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
