Skip to content

deleting the macro MICRO_SECONDS_PRE_SEC broke builds #2419

@gav2xlin

Description

@gav2xlin

Notice
If you need support or clarification regarding the usage of Drogon in your project, visit the official Drogon support channel at gitter

Please create a new issue only if you think you have found a bug or if have a feature request/enhancement.

Describe the bug
A clear and concise description of what the bug is.

drogon 1.9.11
trantor 1.5.25 (it works with 1.5.23)

https://conan.io/center/recipes/drogon
https://conan.io/center/recipes/trantor

To Reproduce
Steps to reproduce the behavior:

I build the Conan package drogon and get this error

/home/gav2xlin/.conan2/p/b/drogo9f0dcc0bb5db8/b/src/lib/src/HttpResponseImpl.cc: In member function ‘std::shared_ptrtrantor::MsgBuffer drogon::HttpResponseImpl::renderToBuffer()’:
/home/gav2xlin/.conan2/p/b/drogo9f0dcc0bb5db8/b/src/lib/src/HttpResponseImpl.cc:657:54: error: ‘MICRO_SECONDS_PRE_SEC’ was not declared in this scope
657 | ((now.microSecondsSinceEpoch() / MICRO_SECONDS_PRE_SEC) !=
| ^~~~~~~~~~~~~~~~~~~~~
[101/148] Building CXX object CMakeFiles/drogon.dir/lib/src/IntranetIpFilter.cc.o

The version 1.9.11 requires this macro:
./lib/tests/unittests/HttpDateTest.cc: CHECK(date.microSecondsSinceEpoch() / MICRO_SECONDS_PRE_SEC == 1591348778);
./lib/tests/unittests/HttpDateTest.cc: CHECK(date.microSecondsSinceEpoch() / MICRO_SECONDS_PRE_SEC == 1591348778);
./lib/tests/unittests/HttpDateTest.cc: CHECK(date.microSecondsSinceEpoch() / MICRO_SECONDS_PRE_SEC == epoch);
./lib/src/Utilities.cc: auto nowSecond = date.microSecondsSinceEpoch() / MICRO_SECONDS_PRE_SEC;
./lib/src/Utilities.cc: auto nowSecond = date.microSecondsSinceEpoch() / MICRO_SECONDS_PRE_SEC;
./lib/src/Utilities.cc: auto nowSecond = date.microSecondsSinceEpoch() / MICRO_SECONDS_PRE_SEC;
./lib/src/Utilities.cc: return trantor::Date(epoch * MICRO_SECONDS_PRE_SEC);
./lib/src/HttpResponseImpl.cc: ((now.microSecondsSinceEpoch() / MICRO_SECONDS_PRE_SEC) !=
./lib/src/HttpResponseImpl.cc: now.microSecondsSinceEpoch() / MICRO_SECONDS_PRE_SEC;

But the macro was completely removed and even renamed

an-tao/trantor@v1.5.23...v1.5.25

MICRO_SECONDS_PRE_SEC -> MICRO_SECONDS_PER_SEC

MICRO_SECONDS_PRE_SEC is defined nowhere
./trantor/utils/Date.h:#define MICRO_SECONDS_PRE_SEC 1000000LL <- was deleted

Is is a system macro or what?

Expected behavior
A clear and concise description of what you expected to happen.

Build without errors. Please, release a newer version of Drogon compatible with Trantor

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions