public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/azanella/master-posix_clock] Replace PREPARE_VERSION macro with inline function
Date: Tue, 02 Jul 2019 17:25:00 -0000	[thread overview]
Message-ID: <20190702172535.15788.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=589787f8894251c3b114f4ce06a89ecf2763f1b4

commit 589787f8894251c3b114f4ce06a89ecf2763f1b4
Author: Tobias Klauser <tklauser@distanz.ch>
Date:   Fri Jun 28 08:46:00 2019 -0300

    Replace PREPARE_VERSION macro with inline function
    
    	* sysdeps/unix/sysv/linux/dl-vdso.h (PREPARE_VERSION): Remove macro.
    	(prepare_version_base): New helper inline function.
    	(prepare_version): New macro replacing PREPARE_VERSION.
    	(PREPARE_VERSION_KNOWN): Use prepare_version instead of PREPARE_VERSION.
    
    Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>

Diff:
---
 ChangeLog                         |  7 +++++++
 sysdeps/unix/sysv/linux/dl-vdso.h | 18 +++++++++---------
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2bb4d83..e1d6327 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-06-28  Tobias Klauser  <tklauser@distanz.ch>
+
+	* sysdeps/unix/sysv/linux/dl-vdso.h (PREPARE_VERSION): Remove macro.
+	(prepare_version_base): New helper inline function.
+	(prepare_version): New macro replacing PREPARE_VERSION.
+	(PREPARE_VERSION_KNOWN): Use prepare_version instead of PREPARE_VERSION.
+
 2019-06-28  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #24741]
diff --git a/sysdeps/unix/sysv/linux/dl-vdso.h b/sysdeps/unix/sysv/linux/dl-vdso.h
index 9e61ca7..c418c69 100644
--- a/sysdeps/unix/sysv/linux/dl-vdso.h
+++ b/sysdeps/unix/sysv/linux/dl-vdso.h
@@ -24,19 +24,19 @@
 #include <dl-hash.h>
 
 /* Create version number record for lookup.  */
-#define PREPARE_VERSION(var, vname, vhash) \
-  struct r_found_version var;						      \
-  var.name = vname;							      \
-  var.hidden = 1;							      \
-  var.hash = vhash;							      \
-  assert (var.hash == _dl_elf_hash (var.name));				      \
-  /* We don't have a specific file where the symbol can be found.  */	      \
-  var.filename = NULL
+static inline struct r_found_version
+prepare_version_base (const char *name, ElfW(Word) hash)
+{
+  assert (hash == _dl_elf_hash (name));
+  return (struct r_found_version) { name, hash, 1, NULL };
+}
+#define prepare_version(vname) \
+  prepare_version_base (VDSO_NAME_##vname, VDSO_HASH_##vname)
 
 /* Use this for the known version sets defined below, where we
    record their precomputed hash values only once, in this file.  */
 #define PREPARE_VERSION_KNOWN(var, vname) \
-  PREPARE_VERSION (var, VDSO_NAME_##vname, VDSO_HASH_##vname)
+  struct r_found_version var = prepare_version (vname);
 
 #define VDSO_NAME_LINUX_2_6	"LINUX_2.6"
 #define VDSO_HASH_LINUX_2_6	61765110


                 reply	other threads:[~2019-07-02 17:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190702172535.15788.qmail@sourceware.org \
    --to=azanella@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).