diff options
author | unknown <vva@eagle.mysql.r18.ru> | 2004-08-31 18:29:01 +0500 |
---|---|---|
committer | unknown <vva@eagle.mysql.r18.ru> | 2004-08-31 18:29:01 +0500 |
commit | 8bf3885883b0ddedda634a3aeffe7d395dbc5dd0 (patch) | |
tree | caa5daeb44390bc03d609ca8b9f015c21b5ae594 /cmd-line-utils | |
parent | 51fce2d24710fb25a2da30eab7fa2be78430b3fc (diff) | |
download | mariadb-git-8bf3885883b0ddedda634a3aeffe7d395dbc5dd0.tar.gz |
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
Diffstat (limited to 'cmd-line-utils')
-rw-r--r-- | cmd-line-utils/libedit/config.h | 6 | ||||
-rw-r--r-- | cmd-line-utils/libedit/readline.c | 4 |
2 files changed, 8 insertions, 2 deletions
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 + |