Skip to content

Commit a1fa892

Browse files
committed
patch 8.0.0173: build fails with EBCDIC defined
Problem: When compiling with EBCDIC defined the build fails. (Yaroslav Kuzmin) Solution: Move sortFunctions() to the right file. Avoid warning for redefining __SUSV3.
1 parent 1d669c2 commit a1fa892

4 files changed

Lines changed: 32 additions & 34 deletions

File tree

src/eval.c

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,38 @@ static void list_one_var(dictitem_T *v, char_u *prefix, int *first);
242242
static void list_one_var_a(char_u *prefix, char_u *name, int type, char_u *string, int *first);
243243
static char_u *find_option_end(char_u **arg, int *opt_flags);
244244

245-
#ifdef EBCDIC
246-
static int compare_func_name(const void *s1, const void *s2);
247-
static void sortFunctions();
248-
#endif
249-
250245
/* for VIM_VERSION_ defines */
251246
#include "version.h"
252247

248+
249+
#if defined(EBCDIC) || defined(PROTO)
250+
/*
251+
* Compare struct fst by function name.
252+
*/
253+
static int
254+
compare_func_name(const void *s1, const void *s2)
255+
{
256+
struct fst *p1 = (struct fst *)s1;
257+
struct fst *p2 = (struct fst *)s2;
258+
259+
return STRCMP(p1->f_name, p2->f_name);
260+
}
261+
262+
/*
263+
* Sort the function table by function name.
264+
* The sorting of the table above is ASCII dependant.
265+
* On machines using EBCDIC we have to sort it.
266+
*/
267+
static void
268+
sortFunctions(void)
269+
{
270+
int funcCnt = (int)(sizeof(functions) / sizeof(struct fst)) - 1;
271+
272+
qsort(functions, (size_t)funcCnt, sizeof(struct fst), compare_func_name);
273+
}
274+
#endif
275+
276+
253277
/*
254278
* Initialize the global and v: variables.
255279
*/

src/evalfunc.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -923,34 +923,6 @@ get_expr_name(expand_T *xp, int idx)
923923

924924
#endif /* FEAT_CMDL_COMPL */
925925

926-
#if defined(EBCDIC) || defined(PROTO)
927-
/*
928-
* Compare struct fst by function name.
929-
*/
930-
static int
931-
compare_func_name(const void *s1, const void *s2)
932-
{
933-
struct fst *p1 = (struct fst *)s1;
934-
struct fst *p2 = (struct fst *)s2;
935-
936-
return STRCMP(p1->f_name, p2->f_name);
937-
}
938-
939-
/*
940-
* Sort the function table by function name.
941-
* The sorting of the table above is ASCII dependant.
942-
* On machines using EBCDIC we have to sort it.
943-
*/
944-
static void
945-
sortFunctions(void)
946-
{
947-
int funcCnt = (int)(sizeof(functions) / sizeof(struct fst)) - 1;
948-
949-
qsort(functions, (size_t)funcCnt, sizeof(struct fst), compare_func_name);
950-
}
951-
#endif
952-
953-
954926
/*
955927
* Find internal function in table above.
956928
* Return index, or -1 if not found

src/os_unixx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113

114114
/* shared library access */
115115
#if defined(HAVE_DLFCN_H) && defined(USE_DLOPEN)
116-
# ifdef __MVS__
116+
# if defined(__MVS__) && !defined (__SUSV3)
117117
/* needed to define RTLD_LAZY (Anthony Giorgio) */
118118
# define __SUSV3
119119
# endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
173,
767769
/**/
768770
172,
769771
/**/

0 commit comments

Comments
 (0)