From 7728843c66bcd2cc15f0b9b7bf6b50a3f1d01d22 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 31 Aug 2004 17:29:47 +0500 Subject: fixed compiling bug (non gcc compilers don't understand '-Dx()=' option) cmd-line-utils/libedit/Makefile.am: discarded '-Dx()=' options for compatibility with non-gcc compilers cmd-line-utils/libedit/config.h: added empty definitions of __RCSID(x), __COPYRIGHT(x), __RENAME(x), _DIAGASSERT(x) cmd-line-utils/libedit/np/unvis.c: added #include "config.h" to define __RCSID(x) cmd-line-utils/libedit/np/vis.c: reinsert #include "config.h" before using of __RCSID(x) --- cmd-line-utils/libedit/Makefile.am | 2 +- cmd-line-utils/libedit/config.h | 5 +++++ cmd-line-utils/libedit/np/unvis.c | 1 + cmd-line-utils/libedit/np/vis.c | 4 ++-- 4 files changed, 9 insertions(+), 3 deletions(-) (limited to 'cmd-line-utils') diff --git a/cmd-line-utils/libedit/Makefile.am b/cmd-line-utils/libedit/Makefile.am index c532884ca7d..b16ee36550d 100644 --- a/cmd-line-utils/libedit/Makefile.am +++ b/cmd-line-utils/libedit/Makefile.am @@ -30,7 +30,7 @@ EXTRA_DIST = makelist.sh np/unvis.c np/strlcpy.c np/vis.c np/strlcat.c np/fgetln CLEANFILES = makelist common.h emacs.h vi.h fcns.h help.h fcns.c help.c -DEFS = -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR '-D__RCSID(x)=' '-D__COPYRIGHT(x)=' '-D__RENAME(x)=' '-D_DIAGASSERT(x)=' +DEFS = -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR SUFFIXES = .sh diff --git a/cmd-line-utils/libedit/config.h b/cmd-line-utils/libedit/config.h index 966cd1bedc0..3a8d0fd4b55 100644 --- a/cmd-line-utils/libedit/config.h +++ b/cmd-line-utils/libedit/config.h @@ -1,3 +1,8 @@ #include "my_config.h" #include "sys.h" + +#define __RCSID(x) +#define __COPYRIGHT(x) +#define __RENAME(x) +#define _DIAGASSERT(x) diff --git a/cmd-line-utils/libedit/np/unvis.c b/cmd-line-utils/libedit/np/unvis.c index 01056c776e9..895ff2059ac 100644 --- a/cmd-line-utils/libedit/np/unvis.c +++ b/cmd-line-utils/libedit/np/unvis.c @@ -33,6 +33,7 @@ * SUCH DAMAGE. */ +#include "config.h" #if defined(LIBC_SCCS) && !defined(lint) #if 0 static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93"; diff --git a/cmd-line-utils/libedit/np/vis.c b/cmd-line-utils/libedit/np/vis.c index 9abc2e6e478..db42443800b 100644 --- a/cmd-line-utils/libedit/np/vis.c +++ b/cmd-line-utils/libedit/np/vis.c @@ -34,12 +34,12 @@ * SUCH DAMAGE. */ +#include "config.h" + #if defined(LIBC_SCCS) && !defined(lint) __RCSID("$NetBSD: vis.c,v 1.22 2002/03/23 17:38:27 christos Exp $"); #endif /* LIBC_SCCS and not lint */ -#include "config.h" - #include #include #ifdef HAVE_ALLOCA_H -- cgit v1.2.1 From 51fce2d24710fb25a2da30eab7fa2be78430b3fc Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 31 Aug 2004 17:51:02 +0500 Subject: fixed compiling bug of libedit on qnx discarded using of uint in cmd-line-utils/libedit/chared.c because it's undefined on qnx cmd-line-utils/libedit/chared.c: discarded using of uint because it's undefined on qnx --- cmd-line-utils/libedit/chared.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd-line-utils') diff --git a/cmd-line-utils/libedit/chared.c b/cmd-line-utils/libedit/chared.c index 559e714d9fd..62a407e66a8 100644 --- a/cmd-line-utils/libedit/chared.c +++ b/cmd-line-utils/libedit/chared.c @@ -62,13 +62,13 @@ cv_undo(EditLine *el) { c_undo_t *vu = &el->el_chared.c_undo; c_redo_t *r = &el->el_chared.c_redo; - uint size; + int size; /* Save entire line for undo */ size = el->el_line.lastchar - el->el_line.buffer; vu->len = size; vu->cursor = el->el_line.cursor - el->el_line.buffer; - memcpy(vu->buf, el->el_line.buffer, size); + memcpy(vu->buf, el->el_line.buffer, (size_t)size); /* save command info for redo */ r->count = el->el_state.doingarg ? el->el_state.argument : 0; -- cgit v1.2.1 From 8bf3885883b0ddedda634a3aeffe7d395dbc5dd0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 31 Aug 2004 18:29:01 +0500 Subject: fixed two compiling bugs for libedit acinclude.m4: added macro to check if dirent.d_namlen is defined cmd-line-utils/libedit/config.h: added define for __attribute__ cmd-line-utils/libedit/readline.c: checked STRUCT_DIRENT_HAS_D_NAMLEN instead of old enumeration of problem platforms configure.in: added checking if dirent has d_namlen member field --- cmd-line-utils/libedit/config.h | 6 ++++++ cmd-line-utils/libedit/readline.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'cmd-line-utils') diff --git a/cmd-line-utils/libedit/config.h b/cmd-line-utils/libedit/config.h index 3a8d0fd4b55..b6f002d5b9e 100644 --- a/cmd-line-utils/libedit/config.h +++ b/cmd-line-utils/libedit/config.h @@ -6,3 +6,9 @@ #define __COPYRIGHT(x) #define __RENAME(x) #define _DIAGASSERT(x) + +#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8) +#define __attribute__(A) +#endif + + diff --git a/cmd-line-utils/libedit/readline.c b/cmd-line-utils/libedit/readline.c index 13b0369de96..5b40ade582c 100644 --- a/cmd-line-utils/libedit/readline.c +++ b/cmd-line-utils/libedit/readline.c @@ -1345,7 +1345,7 @@ filename_completion_function(const char *text, int state) /* otherwise, get first entry where first */ /* filename_len characters are equal */ if (entry->d_name[0] == filename[0] -#if defined(__SVR4) || defined(__linux__) +#ifndef STRUCT_DIRENT_HAS_D_NAMLEN && strlen(entry->d_name) >= filename_len #else && entry->d_namlen >= filename_len @@ -1358,7 +1358,7 @@ filename_completion_function(const char *text, int state) if (entry) { /* match found */ struct stat stbuf; -#if defined(__SVR4) || defined(__linux__) +#ifndef STRUCT_DIRENT_HAS_D_NAMLEN len = strlen(entry->d_name) + #else len = entry->d_namlen + -- cgit v1.2.1