functypes.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #ifndef HEADER_CURL_FUNCTYPES_H
  2. #define HEADER_CURL_FUNCTYPES_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  11. *
  12. * This software is licensed as described in the file COPYING, which
  13. * you should have received as part of this distribution. The terms
  14. * are also available at https://curl.se/docs/copyright.html.
  15. *
  16. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  17. * copies of the Software, and permit persons to whom the Software is
  18. * furnished to do so, under the terms of the COPYING file.
  19. *
  20. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  21. * KIND, either express or implied.
  22. *
  23. * SPDX-License-Identifier: curl
  24. *
  25. ***************************************************************************/
  26. #include "curl_setup.h"
  27. /* defaults:
  28. ssize_t recv(int, void *, size_t, int);
  29. ssize_t send(int, const void *, size_t, int);
  30. If other argument or return types are needed:
  31. 1. For systems that run configure or cmake, the alternatives are provided
  32. here.
  33. 2. For systems with config-*.h files, define them there.
  34. */
  35. #ifdef _WIN32
  36. /* int recv(SOCKET, char *, int, int) */
  37. #define RECV_TYPE_ARG1 SOCKET
  38. #define RECV_TYPE_ARG2 char *
  39. #define RECV_TYPE_ARG3 int
  40. #define RECV_TYPE_RETV int
  41. /* int send(SOCKET, const char *, int, int); */
  42. #define SEND_TYPE_ARG1 SOCKET
  43. #define SEND_TYPE_ARG2 char *
  44. #define SEND_TYPE_ARG3 int
  45. #define SEND_TYPE_RETV int
  46. #elif defined(__AMIGA__) /* Any AmigaOS flavour */
  47. /* long recv(long, char *, long, long); */
  48. #define RECV_TYPE_ARG1 long
  49. #define RECV_TYPE_ARG2 char *
  50. #define RECV_TYPE_ARG3 long
  51. #define RECV_TYPE_ARG4 long
  52. #define RECV_TYPE_RETV long
  53. /* int send(int, const char *, int, int); */
  54. #define SEND_TYPE_ARG1 int
  55. #define SEND_QUAL_ARG2
  56. #define SEND_TYPE_ARG2 char *
  57. #define SEND_TYPE_ARG3 int
  58. #define SEND_TYPE_RETV int
  59. #endif
  60. #ifndef RECV_TYPE_ARG1
  61. #define RECV_TYPE_ARG1 int
  62. #endif
  63. #ifndef RECV_TYPE_ARG2
  64. #define RECV_TYPE_ARG2 void *
  65. #endif
  66. #ifndef RECV_TYPE_ARG3
  67. #define RECV_TYPE_ARG3 size_t
  68. #endif
  69. #ifndef RECV_TYPE_ARG4
  70. #define RECV_TYPE_ARG4 int
  71. #endif
  72. #ifndef RECV_TYPE_RETV
  73. #define RECV_TYPE_RETV ssize_t
  74. #endif
  75. #ifndef SEND_QUAL_ARG2
  76. #define SEND_QUAL_ARG2 const
  77. #endif
  78. #ifndef SEND_TYPE_ARG1
  79. #define SEND_TYPE_ARG1 int
  80. #endif
  81. #ifndef SEND_TYPE_ARG2
  82. #define SEND_TYPE_ARG2 void *
  83. #endif
  84. #ifndef SEND_TYPE_ARG3
  85. #define SEND_TYPE_ARG3 size_t
  86. #endif
  87. #ifndef SEND_TYPE_ARG4
  88. #define SEND_TYPE_ARG4 int
  89. #endif
  90. #ifndef SEND_TYPE_RETV
  91. #define SEND_TYPE_RETV ssize_t
  92. #endif
  93. #endif /* HEADER_CURL_FUNCTYPES_H */