Skip to content

Commit

Permalink
mapping: define NOMINMAX to prevent breakage for foo::max()
Browse files Browse the repository at this point in the history
sys_clock::time_point::max() is now used and without NOMINMAX, max
is defined as a macro in a common Windows header.

This commit defines NOMINMAX in the CMakeLists.txt and removes some
commented code in mapping.cpp.

Gitlab: #41
Change-Id: I98654cbafd362417d61734c4389b11ed68ff8dd8
  • Loading branch information
atraczyk committed Sep 5, 2024
1 parent bd9a288 commit 9e064bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ else()
-DMSGPACK_DISABLE_LEGACY_NIL \
-DMSGPACK_DISABLE_LEGACY_CONVERT \
-DUNICODE \
-D_UNICODE")
-D_UNICODE \
-DNOMINMAX \
")
endif()

if (DNC_SYSTEMD AND BUILD_TOOLS AND NOT MSVC)
Expand Down
8 changes: 1 addition & 7 deletions src/upnp/protocol/mapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#include "upnp/mapping.h"
// #include "logger.h"
#include "igd.h"

namespace dhtnet {
Expand Down Expand Up @@ -63,7 +63,6 @@ void
Mapping::updateFrom(const Mapping& other)
{
if (type_ != other.type_) {
// JAMI_ERR("The source and destination types must match");
return;
}

Expand All @@ -77,11 +76,6 @@ Mapping::updateFrom(const Mapping& other)
void
Mapping::setAvailable(bool val)
{
// JAMI_DBG("Changing mapping %s state from %s to %s",
// toString().c_str(),
// available_ ? "AVAILABLE" : "UNAVAILABLE",
// val ? "AVAILABLE" : "UNAVAILABLE");

std::lock_guard lock(mutex_);
available_ = val;
}
Expand Down

0 comments on commit 9e064bf

Please sign in to comment.