[patch 1/2] Rename COMPAT_VERSION to COMPAT_VERSION_SAMEPROTO

Mark Wielaard mjw at redhat.com
Mon Apr 29 21:57:12 UTC 2013


On Sun, Apr 28, 2013 at 08:44:09PM +0200, Jan Kratochvil wrote:
> index 1fa4249..9af0655 100644
> --- a/lib/ChangeLog
> +++ b/lib/ChangeLog
> @@ -1,3 +1,8 @@
> +2013-04-28  Jan Kratochvil  <jan.kratochvil at redhat.com>
> +
> +	* eu-config.h (COMPAT_VERSION): Move its __typeof part ...
> +	(COMPAT_VERSION_SAMEPROTO): ... into this new wrapper.  Twice.
> +
>  2013-04-26  Jan Kratochvil  <jan.kratochvil at redhat.com>
>  
>  	* system.h (LE64, BE64): Move here the definitions from
> diff --git a/lib/eu-config.h b/lib/eu-config.h
> index 68efb82..94eede8 100644
> --- a/lib/eu-config.h
> +++ b/lib/eu-config.h
> @@ -171,12 +171,16 @@ asm (".section predict_data, \"aw\"; .previous\n"
>  # define NEW_VERSION(name, version) \
>    asm (".symver " #name "," #name "@@@" #version);
>  # define COMPAT_VERSION(name, version, prefix) \
> -  asm (".symver _compat." #version "." #name "," #name "@" #version); \
> +  asm (".symver _compat." #version "." #name "," #name "@" #version);
> +# define COMPAT_VERSION_SAMEPROTO(name, version, prefix) \
> +  COMPAT_VERSION (name, version, prefix); \
>    __typeof (name) _compat_##prefix##_##name asm ("_compat." #version "." #name);

These macros are a bit hairy and I don't fully understand them.
Hopefully Roland can comment on the change too.

If I read this right then for the new COMPAT_VERSION macro we don't define
a _compat_prefix_name symbol anymore. Why isn't that necessary in
that case? (I don't fully understand what that asm statement is trying
to accomplish to be honest.)

I think it is slightly cleaner to keep the old name do the same
thing. So have a COMPAT_VERSION macro that deals with the prototype of
the function being the same. And a new macro COMPAT_VERSION_NEWPROTO
that deals with compat functions that have different prototypes. Then
you don't have to change any existing code.

Thanks,

Mark


More information about the elfutils-devel mailing list