Bug 103674

Summary: u_queue.c:173:7: error: implicit declaration of function 'timespec_get' is invalid in C99
Product: Mesa Reporter: Vinson Lee <vlee>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED MOVED QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: issor.oruam, jon.turney
Version: gitKeywords: regression
Hardware: x86-64 (AMD64)   
OS: Mac OS X (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: proposed patch

Description Vinson Lee 2017-11-10 18:35:00 UTC
mesa: d1edf6e3962e187a1213dd4064ba3b6fb6c3ea4f (master 17.4.0-devel)

u_queue.c:173:7: error: implicit declaration of function 'timespec_get' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      timespec_get(&ts, TIME_UTC);
      ^
Comment 1 Mauro Rossi 2017-11-12 00:52:36 UTC
Created attachment 135413 [details] [review]
proposed patch

Hi,

when building Android, I see a similar error.

external/mesa/src/util/u_queue.c:173: error: undefined reference to 'timespec_get'

clock_gettime(CLOCK_REALTIME, &ts) is equivalent to timespec_get(&ts, TIME_UTC)
but has the advantage that avoids the building error.

Proposed patch is in the attachement.
Mauro Rossi
Comment 3 Nicolai Hähnle 2017-11-16 05:48:49 UTC
commit 2e3d0dd6c8f405f27d68b1ac35e928233bf8b89c
Comment 4 Yurii Kolesnykov 2019-08-22 15:18:59 UTC
Back again with Xcode 11/macOS Catalina. 

../src/util/u_queue.c:176:7: error: implicit declaration of function 'timespec_get' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

clang --version
Apple clang version 11.0.0 (clang-1100.0.32.5)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Comment 5 Lionel Landwerlin 2019-08-23 09:13:35 UTC
Sorry, I broke this again.
Here is a fix https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1753

Let me know if it helps, thanks.
Comment 6 GitLab Migration User 2019-09-18 20:26:47 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/1020.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.