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

Gimesketvirtadien's time requested changes #104

Merged
merged 34 commits into from
Aug 11, 2016

Conversation

KjellKod
Copy link
Owner

@KjellKod KjellKod commented Jul 3, 2016

Inherited changes from: gimesketvirtadieni's #90

  • added support for OSX (get_timespec for now, on Linux)
  • fixed formatting
  • corrected default logging header
  • started with simplified logic (skip c-arrays)... it can be renamed better though

** not yet unit tests which is sad. It'll be added! this was exploratory coding more than TDD
** not yet Windows support.

@KjellKod KjellKod changed the title Gimesketvirtadieni upstream time Gimesketvirtadien's time requested changes Jul 3, 2016
@KjellKod
Copy link
Owner Author

KjellKod commented Jul 3, 2016

@gimesketvirtadieni, travis fails but I think that has to do with the compiler being too old. I will investigate that later.

const size_t kIdentifierSize = 2;


std::string fractional_to_string(size_t fractional, size_t cutOffDivider) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has to be moved to the .h/cpp so that it can be put under test

@gimesketvirtadieni
Copy link

Hi

I can see you merged milli/micro/nano sec functionality into a dedicated branch. Did I understand you correctly that you will make more refactoring of this functionality based on your comments above? Or do you want me to open one more pull request?
BTW there are few corrections required for your changes to make them compile on Linux, that is why Travis fails ;)

@KjellKod
Copy link
Owner Author

KjellKod commented Jul 6, 2016

Thanks. No it's OK. I would have taken care of it already but I've been burning the midnight oil lately with work for my company

@@ -52,7 +52,7 @@ ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "-Wall -Wunused -std=c++11 -pthread -D_GLIBCXX_USE_NANOSLEEP -D_GLIBCXX_USE_SCHED_YIELD")
ELSE()
set(PLATFORM_LINK_LIBRIES rt)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -rdynamic -Wunused -std=c++11 -pthread -D_GLIBCXX_USE_NANOSLEEP -D_GLIBCXX_USE_SCHED_YIELD")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -rdynamic -Wunused -std=c++11 -pthread -lrt -D_GLIBCXX_USE_NANOSLEEP -D_GLIBCXX_USE_SCHED_YIELD")
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this change needed for clock_gettime?

@KjellKod KjellKod mentioned this pull request Aug 10, 2016
@@ -99,9 +99,12 @@ namespace g3 {
ts->tv_sec = now.tv_sec;
ts->tv_nsec = now.tv_usec * 1000;
return 0;
#elif(defined(WIN32) || defined(_WIN32) || defined(__WIN32__))
return timespec_get(ts, TIME_UTC);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one was annoying m. std::timespec_get(...) doesn't exist but timespec_get(...) does

@KjellKod
Copy link
Owner Author

@gimesketvirtadieni PR updated for Windows/OSX/Linux.

Thanks for the work on this

@KjellKod KjellKod merged commit 86473c6 into master Aug 11, 2016
@KjellKod KjellKod deleted the gimesketvirtadieni_upstream_time branch August 11, 2016 06:27
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

Successfully merging this pull request may close these issues.

2 participants