From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2802 Path: news.gmane.org!not-for-mail From: Jens Gustedt Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH 4/5] add three macros for empty dummy functions that do nothing Date: Sat, 16 Feb 2013 00:24:30 +0100 Message-ID: References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1360970691 6482 80.91.229.3 (15 Feb 2013 23:24:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 Feb 2013 23:24:51 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2803-gllmg-musl=m.gmane.org@lists.openwall.com Sat Feb 16 00:25:13 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1U6UeX-0000BB-0l for gllmg-musl@plane.gmane.org; Sat, 16 Feb 2013 00:25:13 +0100 Original-Received: (qmail 11610 invoked by uid 550); 15 Feb 2013 23:24:53 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 11602 invoked from network); 15 Feb 2013 23:24:52 -0000 X-IronPort-AV: E=Sophos;i="4.84,675,1355094000"; d="scan'208";a="3112348" In-Reply-To: Resent-From: Jens Gustedt Resent-To: musl@lists.openwall.com Resent-Cc: musl X-Mailer: Evolution 3.2.3-0ubuntu6 Xref: news.gmane.org gmane.linux.lib.musl.general:2802 Archived-At: these are functions that receive arguments according to three different interfaces, void, void* or int. 31 0 src/internal/libc.h diff --git a/src/internal/libc.h b/src/internal/libc.h index a097a66..1f15f4d 100644 --- a/src/internal/libc.h +++ b/src/internal/libc.h @@ -73,6 +73,37 @@ extern char **__environ; #define weak_alias(old, new) \ extern __typeof(old) new __attribute__((weak, alias(#old))) +/* provide a weak function symbol for a function that receives no + arguments */ +#define WEAK_PROVIDE_VOID \ +_Weak \ +void __weak_dummy_void(void) { \ + /* empty */ \ +} \ +/* syntax sugar */ \ +_Weak void __weak_dummy_void(void) + +/* provide a weak function symbol for a function that receives a void + pointer argument */ +#define WEAK_PROVIDE_VOIDP \ +_Weak \ +void __weak_dummy_voidp(void* _ign) { \ + /* empty */ \ +} \ +/* syntax sugar */ \ +_Weak void __weak_dummy_voidp(void*) + +/* provide a weak function symbol for a function that receives an int + argument */ +#define WEAK_PROVIDE_INT \ +_Weak \ +void __weak_dummy_int(int _ign) { \ + /* empty */ \ +} \ +/* syntax sugar */ \ +_Weak void __weak_dummy_int(int _ign) + + #undef LFS64_2 #define LFS64_2(x, y) weak_alias(x, y) -- 1.7.9.5