Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libedit Deal with changes in the weak_reference semantic...



details:   https://anonhg.NetBSD.org/src/rev/b0faa2b35345
branches:  trunk
changeset: 762208:b0faa2b35345
user:      joerg <joerg%NetBSD.org@localhost>
date:      Thu Feb 17 16:44:48 2011 +0000

description:
Deal with changes in the weak_reference semantic in GCC 4.2 and later.

diffstat:

 lib/libedit/vi.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (48 lines):

diff -r 2f5f41ad4122 -r b0faa2b35345 lib/libedit/vi.c
--- a/lib/libedit/vi.c  Thu Feb 17 16:08:48 2011 +0000
+++ b/lib/libedit/vi.c  Thu Feb 17 16:44:48 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vi.c,v 1.32 2010/10/23 23:27:40 christos Exp $ */
+/*     $NetBSD: vi.c,v 1.33 2011/02/17 16:44:48 joerg Exp $    */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)vi.c       8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: vi.c,v 1.32 2010/10/23 23:27:40 christos Exp $");
+__RCSID("$NetBSD: vi.c,v 1.33 2011/02/17 16:44:48 joerg Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -919,8 +919,13 @@
  * this is against historical precedent...
  */
 #ifdef __weak_reference
+#if __GNUC_PREREQ__(4,2)
+extern char *get_alias_text(const char *) __attribute__((__weak__));
+static char *my_get_alias_text(const char *) __attribute__((__weakref__, __alias__("get_alias_text")));
+#else
 extern char *get_alias_text(const char *) __weak_reference(get_alias_text);
 #endif
+#endif
 protected el_action_t
 /*ARGSUSED*/
 vi_alias(EditLine *el, Int c)
@@ -929,9 +934,15 @@
        char alias_name[3];
        char *alias_text;
 
+#if __GNUC_PREREQ__(4,2)
+       if (my_get_alias_text == 0) {
+               return CC_ERROR;
+       }
+#else
        if (get_alias_text == 0) {
                return CC_ERROR;
        }
+#endif
 
        alias_name[0] = '_';
        alias_name[2] = 0;



Home | Main Index | Thread Index | Old Index