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

Fix: missing <limits> include in network/core/packet.h #9123

Merged
merged 1 commit into from Apr 27, 2021

Conversation

Milek7
Copy link
Contributor

@Milek7 Milek7 commented Apr 27, 2021

Motivation / Problem

In file included from /home/milek7/ottd3/src/script/api/../../network/core/tcp.h:16,
                 from /home/milek7/ottd3/src/script/api/../../network/core/tcp_game.h:16,
                 from /home/milek7/ottd3/src/script/api/../../network/network_internal.h:14,
                 from /home/milek7/ottd3/src/script/api/../../network/network_admin.h:13,
                 from /home/milek7/ottd3/src/script/api/script_admin.cpp:13:
/home/milek7/ottd3/src/script/api/../../network/core/packet.h: In member function ‘ssize_t Packet::TransferOut(F, D, Args&& ...)’:
/home/milek7/ottd3/src/script/api/../../network/core/packet.h:142:72: error: ‘numeric_limits’ is not a member of ‘std’
  142 |                 return TransferOutWithLimit<A>(transfer_function, std::numeric_limits<size_t>::max(), destination, std::forward<Args>(args)...);
      |                                                                        ^~~~~~~~~~~~~~
/home/milek7/ottd3/src/script/api/../../network/core/packet.h:142:93: error: expected primary-expression before ‘>’ token
  142 |                 return TransferOutWithLimit<A>(transfer_function, std::numeric_limits<size_t>::max(), destination, std::forward<Args>(args)...);
      |                                                                                             ^
/home/milek7/ottd3/src/script/api/../../network/core/packet.h:142:96: error: ‘::max’ has not been declared; did you mean ‘std::max’?
  142 |                 return TransferOutWithLimit<A>(transfer_function, std::numeric_limits<size_t>::max(), destination, std::forward<Args>(args)...);
      |                                                                                                ^~~
      |                                                                                                std::max
In file included from /usr/include/c++/12.0.0/algorithm:62,
                 from /home/milek7/ottd3/src/script/api/../../stdafx.h:88,
                 from /home/milek7/ottd3/src/script/api/script_admin.cpp:10:
/usr/include/c++/12.0.0/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~

Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

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

What platform was this on?

@James103
Copy link
Contributor

Did you reinstate the Description, Limitations, and Checklist for Review? If not, why?

@Milek7
Copy link
Contributor Author

Milek7 commented Apr 27, 2021

Linux, gcc (GCC) 12.0.0 20210427 (experimental)

@LordAro LordAro merged commit a341852 into OpenTTD:master Apr 27, 2021
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.

None yet

3 participants