Commit 8e67eb9d by Peter Collingbourne

Don't define _HAS_EXCEPTIONS to 0 with libc++.

libc++ uses a predefined macro to control whether to use exceptions, so defining this macro is unnecessary. Defining _HAS_EXCEPTIONS to 0 also breaks libc++ because it depends on MSVC headers that only provide certain declarations if _HAS_EXCEPTIONS is 1. Bug: chromium:801780 Change-Id: I0d0c04e55e1e91c3ce7fe90d15b55de0cd7a21ac Reviewed-on: https://swiftshader-review.googlesource.com/16688Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarPeter Collingbourne <pcc@google.com>
parent 3119a87c
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import("//build/config/c++/c++.gni")
import("//build/config/compiler/compiler.gni") import("//build/config/compiler/compiler.gni")
config("swiftshader_config") { config("swiftshader_config") {
...@@ -26,8 +27,18 @@ config("swiftshader_config") { ...@@ -26,8 +27,18 @@ config("swiftshader_config") {
"/Gd", # Default calling convention "/Gd", # Default calling convention
] ]
if (!use_custom_libcxx) {
# Disable EH usage in STL headers.
# libc++ uses a predefined macro to control whether to use exceptions, so
# defining this macro is unnecessary. Defining _HAS_EXCEPTIONS to 0 also
# breaks libc++ because it depends on MSVC headers that only provide
# certain declarations if _HAS_EXCEPTIONS is 1.
defines += [
"_HAS_EXCEPTIONS=0",
]
}
defines += [ defines += [
"_HAS_EXCEPTIONS=0", # Disable EH usage in STL headers
"_CRT_SECURE_NO_DEPRECATE", "_CRT_SECURE_NO_DEPRECATE",
"NOMINMAX", "NOMINMAX",
"_WINDLL", "_WINDLL",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment