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

date/tz.h can not be imported for the lack of pthread #1189

Closed
1 task done
callingmybluff opened this issue Jun 20, 2022 · 4 comments
Closed
1 task done

date/tz.h can not be imported for the lack of pthread #1189

callingmybluff opened this issue Jun 20, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@callingmybluff
Copy link

Verification

  • I searched for similar bug reports and found none was relevant.

What happened?

tz.h error: 'once_flag' is not a member of 'std'

What should happen instead?

I should be able to include that

Reproduction steps

From the latest dev, try to add these 2 lines to any of your .cpp files:

#include <date/tz.h>

auto x = date::current_zone();

Then you will get this error while trying to build:

/workspaces/InfiniTime/src/libs/date/includes/date/tz.h:792:26: error: 'once_flag' is not a member of 'std'
[build] 792 | std::unique_ptrstd::once_flag adjusted_;
[build] | ^~~~~~~~~
[build] /workspaces/InfiniTime/src/libs/date/includes/date/tz.h:117:1: note: 'std::once_flag' is defined in header ''; did you forget to '#include '?
[build] 116 | #include
[build] +++ |+#include
[build] 117 | #include
[build] /workspaces/InfiniTime/src/libs/date/includes/date/tz.h:792:26: error: 'once_flag' is not a member of 'std'
[build] 792 | std::unique_ptrstd::once_flag adjusted_;
[build] | ^~~~~~~~~
[build] /workspaces/InfiniTime/src/libs/date/includes/date/tz.h:792:26: note: 'std::once_flag' is defined in header ''; did you forget to '#include '?
[build] /workspaces/InfiniTime/src/libs/date/includes/date/tz.h:792:35: error: template argument 1 is invalid
[build] 792 | std::unique_ptrstd::once_flag adjusted_;
[build] | ^
[build] /workspaces/InfiniTime/src/libs/date/includes/date/tz.h:792:35: error: template argument 2 is invalid

More details?

No response

Version

develop

Companion app

No response

@callingmybluff callingmybluff added the bug Something isn't working label Jun 20, 2022
@callingmybluff callingmybluff changed the title date/tz.h can not be impoted foir the lack of pthread date/tz.h can not be imported for the lack of pthread Jun 20, 2022
@Avamander
Copy link
Collaborator

Works as it can and should. Closing.

@Avamander Avamander closed this as not planned Won't fix, can't repro, duplicate, stale Jun 20, 2022
@callingmybluff
Copy link
Author

@Avamander, can you please elaborate on how else one can get time zones? or the current time zone?

@Avamander
Copy link
Collaborator

You can't.

@callingmybluff callingmybluff mentioned this issue Jun 20, 2022
1 task
@JF002
Copy link
Collaborator

JF002 commented Jul 8, 2022

Just to give a bit more detail about this issue : if tz.h depends on pthread, it won't work on InfiniTime. InfiniTime is based on FreeRTOS, which, as most RTOS design for embedded systems, do not support POSIX threads. To work around this, you'll probably want to edit tz.h so it does not depend on pthread or implement timezone without tz.h.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants