Skip to content

Commit be77169

Browse files
author
Tor Didriksen
committed
Bug#35489173 Upgrade the libedit library to the latest [patch 4]
Patch 4: Solaris has MIN in <utility.h> and <sys/sysmacros.h> (rather than <sys/param.h>) Get SIZE_MAX from the standard header <limits.h> Change-Id: Ica37cb0cc319489d1fa18ceda80c80d8b5e3e7b0 (cherry picked from commit d3a2416eb4269662b0882f6afb7abfc8df0e774b)
1 parent a29d4e6 commit be77169

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

extra/libedit/libedit-20221030-3.1/src/sys.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#if defined(HAVE_SYS_TYPES_H) && defined(__sun)
4444
#include <sys/types.h>
4545
#endif
46+
#include <limits.h> // SIZE_MAX
4647

4748
#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
4849
# define __attribute__(A)
@@ -116,9 +117,9 @@ wchar_t * wcsdup(const wchar_t *str);
116117
typedef unsigned int u_int32_t;
117118
#endif
118119

119-
#ifndef HAVE_SIZE_MAX
120-
#define SIZE_MAX ((size_t)-1)
121-
#endif
120+
// #ifndef HAVE_SIZE_MAX
121+
// #define SIZE_MAX ((size_t)-1)
122+
// #endif
122123

123124
#define REGEX /* Use POSIX.2 regular expression functions */
124125
#undef REGEXP /* Use UNIX V8 regular expression functions */

extra/libedit/libedit-20221030-3.1/src/vis.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ __FBSDID("$FreeBSD$");
7979
__weak_alias(strvisx,_strvisx)
8080
#endif
8181

82+
/*
83+
* Solaris has MIN in <utility.h> and <sys/sysmacros.h>
84+
* (rather than <sys/param.h>)
85+
* But those files define a lot of other stuff as well.
86+
* So we define it here instead.
87+
*/
88+
#ifdef __sun
89+
#ifndef MIN
90+
#define MIN(a, b) ((a) < (b) ? (a) : (b))
91+
#endif
92+
#endif
93+
8294
#if !HAVE_VIS || !HAVE_SVIS
8395
#include <ctype.h>
8496
#include <limits.h>

0 commit comments

Comments
 (0)