|
|
commit 7a879568b3fd16ce84ee4fa3e268272eb53fc590
Author: Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Tue Apr 2 15:26:36 2024 +0200
Commit: Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Tue Apr 2 16:03:00 2024 +0200
Improve support for NetBSD (#944)
- fix gcc version check for FL_DEPRECATED macro
- fix #include for select() on NetBSD < 3.0 (#944)
For more info please see GitHub Issue #944
FL/fl_attr.h | 6 +++---
src/drivers/Unix/Fl_Unix_Screen_Driver.H | 12 ++++++++++++
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git FL/fl_attr.h FL/fl_attr.h
index 52b3507..46d4cb7 100644
--- FL/fl_attr.h
+++ FL/fl_attr.h
@@ -1,7 +1,7 @@
/*
* Function attribute declarations for the Fast Light Tool Kit (FLTK).
*
- * Copyright 1998-2023 by Bill Spitzak and others.
+ * Copyright 1998-2024 by Bill Spitzak and others.
*
* This library is free software. Distribution and use rights are outlined in
* the file "COPYING" which should have been included with this file. If this
@@ -168,11 +168,11 @@
#endif
#endif /* gcc 4.5.0 */
-#if FL_GCC_VERSION > 30100 /* gcc 3.1.0 */
+#if FL_GCC_VERSION >= 30400 /* gcc 3.4.0 */
#ifndef FL_DEPRECATED
#define FL_DEPRECATED(msg, func) func __attribute__((deprecated))
#endif
-#endif /* gcc 3.1.0 */
+#endif /* gcc 3.4.0 */
#endif /* __GNUC__ */
diff --git src/drivers/Unix/Fl_Unix_Screen_Driver.H src/drivers/Unix/Fl_Unix_Screen_Driver.H
index c0d0356..2b8a5a7 100644
--- src/drivers/Unix/Fl_Unix_Screen_Driver.H
+++ src/drivers/Unix/Fl_Unix_Screen_Driver.H
@@ -31,6 +31,18 @@ static pollfd *pollfds = 0;
# include <sys/select.h>
# endif /* HAVE_SYS_SELECT_H */
+// NetBSD before version 3.0 declares select() in "unistd.h" (#944):
+// https://man.netbsd.org/NetBSD-2.1/select.2
+
+# if defined(__NetBSD__)
+# include <sys/param.h> // For '__NetBSD_Version__' definition
+# if defined(__NetBSD_Version__) && (__NetBSD_Version__ < 300000000)
+# include <sys/types.h>
+# include <sys/time.h>
+# include <unistd.h>
+# endif // __NetBSD_Version__
+# endif // __NetBSD__
+
# define POLLIN 1
# define POLLOUT 4
# define POLLERR 8
[ Direct Link to Message ] | |
|
| |