[PATCH] Provide aliases for backward compatibility



Symbols Ffile_gid_p, Ffile_uid_p, Qfile_gid_p and Qfile_uid_p were
removed from by commit 79ddc940288581e3c04b0df0123f8a8ed41bb403.
To avoid SONAME change, create aliases to new symbols.

GNU binutils disallows aliases to common symbols, Qxxx symbols must
be (un)initialized.

Signed-off-by: Alexey I. Froloff <raorn altlinux org>
---
 src/files.c    |    4 ++++
 src/librep.sym |    4 ++++
 src/rep_lisp.h |    2 +-
 3 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/files.c b/src/files.c
index ff95a2b..3bd7627 100644
--- a/src/files.c
+++ b/src/files.c
@@ -1339,6 +1339,8 @@ Returns the gid of the file called FILE-NAME
 	 return rep_call_file_handler(handler, op_file_gid,
 			              Qfile_gid, 1, file);
 }
+extern __typeof__ (Ffile_gid) Ffile_gid_p __attribute__ ((alias ("Ffile_gid")));
+extern __typeof__ (Qfile_gid) Qfile_gid_p __attribute__ ((alias ("Qfile_gid")));
 
 DEFUN("file-uid", Ffile_uid, Sfile_uid,
 	(repv file), rep_Subr1) /*
@@ -1357,6 +1359,8 @@ Returns the uid of the file called FILE-NAME
 	 return rep_call_file_handler(handler, op_file_uid,
 			 		Qfile_uid, 1, file);
 }
+extern __typeof__ (Ffile_uid) Ffile_uid_p __attribute__ ((alias ("Ffile_uid")));
+extern __typeof__ (Qfile_uid) Qfile_uid_p __attribute__ ((alias ("Qfile_uid")));
 
 DEFUN("file-nlinks", Ffile_nlinks, Sfile_nlinks,
       (repv file), rep_Subr1) /*
diff --git a/src/librep.sym b/src/librep.sym
index 595fba9..074fb8a 100644
--- a/src/librep.sym
+++ b/src/librep.sym
@@ -107,7 +107,9 @@ Ffile_name_nondirectory
 Ffile_nlinks
 Ffile_owner_p
 Ffile_gid
+Ffile_gid_p
 Ffile_uid
+Ffile_uid_p
 Ffile_readable_p
 Ffile_regular_p
 Ffile_size
@@ -439,7 +441,9 @@ Qfile_name_nondirectory
 Qfile_nlinks
 Qfile_owner_p
 Qfile_gid
+Qfile_gid_p
 Qfile_uid
+Qfile_uid_p
 Qfile_readable_p
 Qfile_regular_p
 Qfile_size
diff --git a/src/rep_lisp.h b/src/rep_lisp.h
index 33fb8c5..277ee2c 100644
--- a/src/rep_lisp.h
+++ b/src/rep_lisp.h
@@ -799,7 +799,7 @@ typedef struct rep_gc_n_roots {
 
 /* Declare a symbol stored in variable QX. */
 #define DEFSYM(x, name) \
-    repv Q ## x; DEFSTRING(str_ ## x, name)
+    repv Q ## x = 0; DEFSTRING(str_ ## x, name)
 
 /* Intern a symbol stored in QX, whose name (a lisp string) is stored
    in str_X (i.e. declared with DEFSYM) */
-- 
1.7.0.6



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]