Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 1220016 - Don't change the definedness of _DEBUG on Windows builds.
The compiler already sets _DEBUG appropriately for the runtime library
in use.  This patch also removes the workaround of forcing C++ code to
be built for the debug RTL regardless of the USE_DEBUG_RTL setting,
and fixes a warning/error exposed by that.

--HG--
extra : rebase_source : 24d142d9e229eb96265e5565c437acccb1d2ca15
  • Loading branch information
jld committed Nov 6, 2015
1 parent f21977e commit 9a62cb4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
8 changes: 4 additions & 4 deletions coreconf/WIN32.mk
Expand Up @@ -113,14 +113,14 @@ ifdef NS_USE_GCC
else
OPTIMIZER += -O2
endif
DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
DEFINES += -UDEBUG -DNDEBUG
else
OPTIMIZER += -g
NULLSTRING :=
SPACE := $(NULLSTRING) # end of the line
USERNAME := $(subst $(SPACE),_,$(USERNAME))
USERNAME := $(subst -,_,$(USERNAME))
DEFINES += -DDEBUG -D_DEBUG -UNDEBUG -DDEBUG_$(USERNAME)
DEFINES += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME)
endif
else # !NS_USE_GCC
OS_CFLAGS += -W3 -nologo -D_CRT_SECURE_NO_WARNINGS \
Expand Down Expand Up @@ -165,7 +165,7 @@ else # !NS_USE_GCC
else
OPTIMIZER += -O2
endif
DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
DEFINES += -UDEBUG -DNDEBUG
DLLFLAGS += -OUT:$@
ifdef MOZ_DEBUG_SYMBOLS
ifdef MOZ_DEBUG_FLAGS
Expand All @@ -182,7 +182,7 @@ else # !NS_USE_GCC
SPACE := $(NULLSTRING) # end of the line
USERNAME := $(subst $(SPACE),_,$(USERNAME))
USERNAME := $(subst -,_,$(USERNAME))
DEFINES += -DDEBUG -D_DEBUG -UNDEBUG -DDEBUG_$(USERNAME)
DEFINES += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME)
DLLFLAGS += -DEBUG -OUT:$@
LDFLAGS += -DEBUG
ifeq ($(_MSC_VER),$(_MSC_VER_6))
Expand Down
4 changes: 1 addition & 3 deletions external_tests/google_test/Makefile
Expand Up @@ -44,10 +44,8 @@ include $(CORE_DEPTH)/coreconf/rules.mk

MKSHLIB = $(CCC) $(DSO_LDOPTS) $(DARWIN_SDK_SHLIBFLAGS)
ifeq (WINNT,$(OS_ARCH))
# -MTd (not -MD) because that makes it link to the right library
# -EHsc because gtest has exception handlers
OS_CFLAGS := $(filterout -MD,$(OS_CFLAGS))
OS_CFLAGS += -MTd -EHsc
OS_CFLAGS += -EHsc
# On windows, we need to create the parent directory
# Needed because we include files from a subdirectory
MAKE_OBJDIR = $(INSTALL) -D $(dir $@)
Expand Down
4 changes: 1 addition & 3 deletions external_tests/ssl_gtest/Makefile
Expand Up @@ -48,10 +48,8 @@ CFLAGS += -I$(CORE_DEPTH)/lib/ssl
include ../../cmd/platrules.mk

ifeq (WINNT,$(OS_ARCH))
# -MTd (not -MD) because that makes it link to the right library
# -EHsc because gtest has exception handlers
OS_CFLAGS := $(filterout -MD,$(OS_CFLAGS))
OS_CFLAGS += -MTd -EHsc -nologo
OS_CFLAGS += -EHsc -nologo
# http://www.suodenjoki.dk/us/archive/2010/min-max.htm
OS_CFLAGS += -DNOMINMAX

Expand Down
2 changes: 1 addition & 1 deletion external_tests/ssl_gtest/tls_agent.cc
Expand Up @@ -405,7 +405,7 @@ void TlsAgent::EnableExtendedMasterSecret() {
}

void TlsAgent::CheckExtendedMasterSecret(bool expected) {
ASSERT_EQ(expected, static_cast<bool>(info_.extendedMasterSecretUsed))
ASSERT_EQ(expected, info_.extendedMasterSecretUsed != PR_FALSE)
<< "unexpected extended master secret state for " << name_;
}

Expand Down

0 comments on commit 9a62cb4

Please sign in to comment.