qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Lluís <xscript@gmx.net>
To: qemu-devel@nongnu.org, chouteau@adacore.com
Cc: stefanha@gmail.com
Subject: [Qemu-devel] [PATCH v6 02/14] provide support for default implementations using	weak symbols
Date: Thu, 25 Aug 2011 17:51:43 +0200	[thread overview]
Message-ID: <20110825155143.19177.99563.stgit@ginnungagap.bsc.es> (raw)
In-Reply-To: <20110825155128.19177.80104.stgit@ginnungagap.bsc.es>

Routines using the QEMU_WEAK attribute can have a default implementation that
can be later overriden just by re-implementing it.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 compiler.h |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/compiler.h b/compiler.h
index 9af5dc6..bc06760 100644
--- a/compiler.h
+++ b/compiler.h
@@ -12,7 +12,7 @@
 #define QEMU_WARN_UNUSED_RESULT
 #endif
 
-#define QEMU_BUILD_BUG_ON(x) \
+#define QEMU_BUILD_BUG_ON(x)                                    \
     typedef char qemu_build_bug_on__##__LINE__[(x)?-1:1];
 
 #if defined __GNUC__
@@ -31,4 +31,15 @@
 #define GCC_FMT_ATTR(n, m)
 #endif
 
+/* Routine attribute to provide default (overridable) implementations.
+ *
+ * The code providing the default implementation must define QEMU_WEAK_DEFAULT
+ * before including this file.
+ */
+#if !defined(QEMU_WEAK_DEFAULT)
+#define QEMU_WEAK
+#else
+#define QEMU_WEAK __attribute__((weak))
+#endif
+
 #endif /* COMPILER_H */

  parent reply	other threads:[~2011-08-25 15:52 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 15:51 [Qemu-devel] [PATCH v6 00/14] trace-state: make the behaviour of "disable" consistent across all backends Lluís
2011-08-25 15:51 ` [Qemu-devel] [PATCH v6 01/14] [simple] Include qemu-timer-common.o in trace-obj-y Lluís
2011-08-25 15:51 ` Lluís [this message]
2011-08-25 17:40   ` [Qemu-devel] [PATCH v6 02/14] provide support for default implementations using weak symbols Blue Swirl
2011-08-25 18:27     ` Lluís
2011-08-25 15:51 ` [Qemu-devel] [PATCH v6 03/14] trace: [configure] rename CONFIG_*_TRACE into CONFIG_TRACE_* Lluís
2011-08-25 15:51 ` [Qemu-devel] [PATCH v6 04/14] trace: [make] replace 'ifeq' with values in CONFIG_TRACE_* Lluís
2011-08-25 15:52 ` [Qemu-devel] [PATCH v6 05/14] trace: move backend-specific code into the trace/ directory Lluís
2011-08-25 15:52 ` [Qemu-devel] [PATCH v6 06/14] trace: avoid conditional code compilation during option parsing Lluís
2011-08-25 15:52 ` [Qemu-devel] [PATCH v6 07/14] trace: generalize the "property" concept in the trace-events file Lluís
2011-08-25 15:52 ` [Qemu-devel] [PATCH v6 08/14] trace-state: separate trace event control and query routines from the simple backend Lluís
2011-08-25 15:52 ` [Qemu-devel] [PATCH v6 09/14] trace-state: always compile support for controlling and querying trace event states Lluís
2011-08-25 15:52 ` [Qemu-devel] [PATCH v6 10/14] trace-state: add "-trace events" argument to control initial state Lluís
2011-08-25 15:52 ` [Qemu-devel] [PATCH v6 11/14] trace-state: always use the "nop" backend on events with the "disable" keyword Lluís
2011-08-25 15:52 ` [Qemu-devel] [PATCH v6 12/14] trace-state: [simple] disable all trace points by default Lluís
2011-08-25 15:52 ` [Qemu-devel] [PATCH v6 13/14] trace-state: [stderr] add support for dynamically enabling/disabling events Lluís
2011-08-25 16:04   ` Lluís
2011-08-25 15:53 ` [Qemu-devel] [PATCH v6 14/14] trace: enable all events Lluís

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=20110825155143.19177.99563.stgit@ginnungagap.bsc.es \
    --to=xscript@gmx.net \
    --cc=chouteau@adacore.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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 NNTP newsgroup(s).