After CL 379474 has landed, the only remaining cgo export header incompatibility with MSVC is the use of the _Complex macro, which is not supported in MSVC even when it is part of the ISO C99 standard (1). Since MSVC 2015 (2), complex math are supported via _Fcomplex and _Dcomplex, which are equivalent to float _Complex and double _Complex. As MSVC and C complex types have the same memory layout, we should be able to typedef GoComplex64 and GoComplex128 to the appropriate type in MSVC. It is important to note that this CL is not adding MSVC support to cgo. C compilers should still be GCC-compatible. This CL is about allowing to include, without further modifications, a DLL export header generated by cgo, normally using Mingw-W64 compiler, into a MSVC project. This was already possible if the export header changes introduced in this CL were done outside cgo, either manually or in a post-build script. Fixes #36233 1: https://docs.microsoft.com/en-us/cpp/c-runtime-library/complex-math-support 2: https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?c-standard-library-features-1 Change-Id: Iad8f26984b115c728e3b73f3a8334ade7a11cfa1 Reviewed-on: https://go-review.googlesource.com/c/go/+/397134 Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Auto-Submit: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> |
||
|---|---|---|
| .github | ||
| api | ||
| doc | ||
| lib/time | ||
| misc | ||
| src | ||
| test | ||
| .gitattributes | ||
| .gitignore | ||
| AUTHORS | ||
| CONTRIBUTING.md | ||
| CONTRIBUTORS | ||
| LICENSE | ||
| PATENTS | ||
| README.md | ||
| SECURITY.md | ||
| codereview.cfg | ||
README.md
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Download and Install
Binary Distributions
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Contributing
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.