Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS/Macports] Build error: unknown type name 'clockid_t'; did you mean 'clock_id_t'? #4595

Open
barracuda156 opened this issue Sep 29, 2023 · 0 comments

Comments

@barracuda156
Copy link
Contributor

We have now build failure for zmq on 10.11 and below:

/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_zmq/zmq-devel/work/libzmq-8c725093ac4b44a97e6cb64566989ef12b71986c/src/clock.cpp
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_zmq/zmq-devel/work/libzmq-8c725093ac4b44a97e6cb64566989ef12b71986c/src/clock.cpp:31:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_devel_zmq/zmq-devel/work/libzmq-8c725093ac4b44a97e6cb64566989ef12b71986c/src/clock.hpp:48:
/opt/local/include/LegacySupport/time.h:83:27: error: unknown type name 'clockid_t'; did you mean 'clock_id_t'?
extern int clock_gettime( clockid_t clk_id, struct timespec *ts );
                          ^
/usr/include/mach/clock_types.h:53:13: note: 'clock_id_t' declared here
typedef int     clock_id_t;                     /* clock identification type */
                ^

Both zmq 4.3.4 and devel build fail likewise.

The following patch fixes the build (and does not affect the build on newer macOS):

--- a/src/clock.hpp	2023-08-27 04:19:35.000000000 +0700
+++ b/src/clock.hpp	2023-09-24 23:52:51.000000000 +0700
@@ -7,14 +7,6 @@
 #include "stdint.hpp"

 #if defined ZMQ_HAVE_OSX
-// TODO this is not required in this file, but condition_variable.hpp includes
-// clock.hpp to get these definitions
-#ifndef CLOCK_REALTIME
-#define CLOCK_REALTIME 0
-#endif
-#ifndef HAVE_CLOCK_GETTIME
-#define HAVE_CLOCK_GETTIME
-#endif

 #include <mach/clock.h>
 #include <mach/mach.h>

Is it the correct solution, or what would you suggest instead?

See also: https://trac.macports.org/ticket/68213
macports/macports-ports#20574
Logs for 4.3.4 on all macOS versions 10.6+ can be found on: https://ports.macports.org/port/zmq/details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant