Source-Changes-D archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/tools/compat
On 23-07-08 19:10, Palle Lyckegaard wrote:
| Module Name: src
| Committed By: palle
| Date: Sat Jul 8 19:10:00 UTC 2023
|
| Modified Files:
| src/tools/compat: compat_defs.h
|
| Log Message:
| Add support for missing NAME_MAX when building on Solaris hosts
|
|
| Index: src/tools/compat/compat_defs.h
| diff -u src/tools/compat/compat_defs.h:1.120 src/tools/compat/compat_defs.h:1.121
| --- src/tools/compat/compat_defs.h:1.120 Sun May 30 10:39:41 2021
| +++ src/tools/compat/compat_defs.h Sat Jul 8 19:10:00 2023
| @@ -1,4 +1,4 @@
| -/* $NetBSD: compat_defs.h,v 1.120 2021/05/30 10:39:41 cjep Exp $ */
| +/* $NetBSD: compat_defs.h,v 1.121 2023/07/08 19:10:00 palle Exp $ */
|
| #ifndef __NETBSD_COMPAT_DEFS_H__
| #define __NETBSD_COMPAT_DEFS_H__
| @@ -31,6 +31,17 @@
| #endif /* __linux__ && HAVE_FEATURES_H */
|
| /*
| + * Solaris:
| + * No NAME_MAX define is available (as documented in the Solaris
| + * limits.h file), so use the XOPEN defined constant.
| + */
| +
| +#if defined(__sun__)
| +#define NAME_MAX _XOPEN_NAME_MAX
| +#endif
| +
This might be better as a check for NAME_MAX not being defined
and _XOPEN_NAME_MAX being defined?
Something like:
#if !defined(NAME_MAX)
#if defined(_XOPEN_NAME_MAX)
#define NAME_MAX _XOPEN_NAME_MAX
#else
#error "Unable to determine NAME_MAX"
#endif
#endif
There might be an even cleaner idiom.
regards,
Luke.
Home |
Main Index |
Thread Index |
Old Index