functypes.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #ifndef HEADER_CURL_FUNCTYPES_H
  2. #define HEADER_CURL_FUNCTYPES_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2022, 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_TYPE_ARG2 char *
  56. #define SEND_TYPE_ARG3 int
  57. #define SEND_TYPE_RETV int
  58. #endif
  59. #ifndef RECV_TYPE_ARG1
  60. #define RECV_TYPE_ARG1 int
  61. #endif
  62. #ifndef RECV_TYPE_ARG2
  63. #define RECV_TYPE_ARG2 void *
  64. #endif
  65. #ifndef RECV_TYPE_ARG3
  66. #define RECV_TYPE_ARG3 size_t
  67. #endif
  68. #ifndef RECV_TYPE_ARG4
  69. #define RECV_TYPE_ARG4 int
  70. #endif
  71. #ifndef RECV_TYPE_RETV
  72. #define RECV_TYPE_RETV ssize_t
  73. #endif
  74. #ifndef SEND_QUAL_ARG2
  75. #define SEND_QUAL_ARG2 const
  76. #endif
  77. #ifndef SEND_TYPE_ARG1
  78. #define SEND_TYPE_ARG1 int
  79. #endif
  80. #ifndef SEND_TYPE_ARG2
  81. #define SEND_TYPE_ARG2 void *
  82. #endif
  83. #ifndef SEND_TYPE_ARG3
  84. #define SEND_TYPE_ARG3 size_t
  85. #endif
  86. #ifndef SEND_TYPE_ARG4
  87. #define SEND_TYPE_ARG4 int
  88. #endif
  89. #ifndef SEND_TYPE_RETV
  90. #define SEND_TYPE_RETV ssize_t
  91. #endif
  92. #endif /* HEADER_CURL_FUNCTYPES_H */