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

unable to build under windows #1552

Closed
marakew opened this issue Oct 30, 2024 · 1 comment
Closed

unable to build under windows #1552

marakew opened this issue Oct 30, 2024 · 1 comment

Comments

@marakew
Copy link

marakew commented Oct 30, 2024

In file included from D:\git\boost_\libs\asio\include\boost/asio/deadline_timer.hpp:26:
In file included from D:\git\boost_\libs\asio\include\boost/asio/basic_deadline_timer.hpp:27:
In file included from D:\git\boost_\libs\asio\include\boost/asio/detail/deadline_timer_service.hpp:32:
In file included from D:\git\boost_\libs\asio\include\boost/asio/detail/timer_scheduler.hpp:24:
In file included from D:\git\boost_\libs\asio\include\boost/asio/detail/win_iocp_io_context.hpp:335:
In file included from D:\git\boost_\libs\asio\include\boost/asio/detail/impl/win_iocp_io_context.hpp:22:
In file included from D:\git\boost_\libs\asio\include\boost/asio/detail/completion_handler.hpp:21:
In file included from D:\git\boost_\libs\asio\include\boost/asio/detail/handler_work.hpp:20:
In file included from D:\git\boost_\libs\asio\include\boost/asio/associated_executor.hpp:24:
In file included from D:\git\boost_\libs\asio\include\boost/asio/system_executor.hpp:671:
In file included from D:\git\boost_\libs\asio\include\boost/asio/impl/system_executor.hpp:21:
In file included from D:\git\boost_\libs\asio\include\boost/asio/system_context.hpp:19:
In file included from D:\git\boost_\libs\asio\include\boost/asio/detail/scheduler.hpp:236:
In file included from D:\git\boost_\libs\asio\include\boost/asio/detail/impl/scheduler.ipp:20:
In file included from D:\git\boost_\libs\asio\include\boost/asio/config.hpp:190:
D:\git\boost_\libs\asio\include\boost/asio/impl/config.hpp(54,52): error: too few arguments provided to funct
ion-like macro invocation
   54 |           || result > (std::numeric_limits<T>::max()))
      |                                                    ^
D:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(193,9): note: macro 'max' defined
here
  193 | #define max(a,b)            (((a) > (b)) ? (a) : (b))
      |         ^

pls add
#undef max
for config.hpp

@mabrarov
Copy link

mabrarov commented Oct 30, 2024

Hi,

IMHO, this issue is usually solved by usage of brackets, i.e. by replacing

|| result > (std::numeric_limits<T>::max()))

with

|| result > (std::numeric_limits<T>::max)())

but not with preprocessor directive.

Comparing https://github.com/chriskohlhoff/asio/blob/master/asio/include/asio/impl/config.hpp#L52 with lines:

  1. https://github.com/chriskohlhoff/asio/blob/master/asio/include/asio/impl/config.hpp#L40
  2. https://github.com/chriskohlhoff/asio/blob/master/asio/include/asio/impl/config.hpp#L53

it looks like the last two require fix (it looks like somebody tried to apply the same fix there, but made a typo).

Thank you.

@marakew marakew closed this as completed Nov 1, 2024
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

2 participants