cmake: Avoid MSVC C4273 warnings in send/recv checks

We use `check_c_source_compiles` to check possible send/recv signatures
by reproducing the forward declarations from system headers.  On Windows
the `winsock2.h` header adds dll linkage settings to its forward
declaration.  If ours does not match the compiler warns:

    warning C4273: 'recv': inconsistent dll linkage

Add `WINSOCK_API_LINKAGE` to our test signatures when it is defined so
that our linkage is consistent with that from `winsock2.h`.

Fixes #4764
Closes #5232
1 file changed
tree: ce6ebd190d299810df19ecab1db8894c6de2c945
  1. .github/
  2. CMake/
  3. docs/
  4. include/
  5. lib/
  6. m4/
  7. packages/
  8. plan9/
  9. projects/
  10. scripts/
  11. src/
  12. tests/
  13. winbuild/
  14. .azure-pipelines.yml
  15. .cirrus.yml
  16. .dir-locals.el
  17. .gitattributes
  18. .gitignore
  19. .lgtm.yml
  20. .mailmap
  21. .travis.yml
  22. acinclude.m4
  23. appveyor.yml
  24. buildconf
  25. buildconf.bat
  27. CMakeLists.txt
  31. GIT-INFO
  33. MacOSX-Framework
  35. Makefile.dist
  36. maketgz
  37. README

curl logo

CII Best Practices Coverity passed Travis-CI Build Status AppVeyor Build Status Azure DevOps Build Status Cirrus Build Status Backers on Open Collective Sponsors on Open Collective Language Grade: C/C++ Codacy Badge Fuzzing Status

Curl is a command-line tool for transferring data specified with URL syntax. Find out how to use curl by reading the curl.1 man page or the MANUAL document. Find out how to install Curl by reading the INSTALL document.

libcurl is the library curl is using to do its job. It is readily available to be used by your software. Read the libcurl.3 man page to learn how!

You can find answers to the most frequent questions we get in the FAQ document.

Study the COPYING file for distribution terms and similar. If you distribute curl binaries or other binaries that involve libcurl, you might enjoy the LICENSE-MIXING document.


If you have problems, questions, ideas or suggestions, please contact us by posting to a suitable mailing list.

All contributors to the project are listed in the THANKS document.


Visit the curl web site for the latest news and downloads.


To download the very latest source from the Git server do this:

git clone

(you'll get a directory named curl created, filled with the source code)

Security problems

Report suspected security problems via our HackerOne page and not in public!


Curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan. This notice is included here to comply with the distribution terms.


Thank you to all our backers! 🙏 [Become a backer]


Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]