113498266Sopenharmony_ci#ifndef HEADER_CURL_WARNLESS_H 213498266Sopenharmony_ci#define HEADER_CURL_WARNLESS_H 313498266Sopenharmony_ci/*************************************************************************** 413498266Sopenharmony_ci * _ _ ____ _ 513498266Sopenharmony_ci * Project ___| | | | _ \| | 613498266Sopenharmony_ci * / __| | | | |_) | | 713498266Sopenharmony_ci * | (__| |_| | _ <| |___ 813498266Sopenharmony_ci * \___|\___/|_| \_\_____| 913498266Sopenharmony_ci * 1013498266Sopenharmony_ci * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 1113498266Sopenharmony_ci * 1213498266Sopenharmony_ci * This software is licensed as described in the file COPYING, which 1313498266Sopenharmony_ci * you should have received as part of this distribution. The terms 1413498266Sopenharmony_ci * are also available at https://curl.se/docs/copyright.html. 1513498266Sopenharmony_ci * 1613498266Sopenharmony_ci * You may opt to use, copy, modify, merge, publish, distribute and/or sell 1713498266Sopenharmony_ci * copies of the Software, and permit persons to whom the Software is 1813498266Sopenharmony_ci * furnished to do so, under the terms of the COPYING file. 1913498266Sopenharmony_ci * 2013498266Sopenharmony_ci * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 2113498266Sopenharmony_ci * KIND, either express or implied. 2213498266Sopenharmony_ci * 2313498266Sopenharmony_ci * SPDX-License-Identifier: curl 2413498266Sopenharmony_ci * 2513498266Sopenharmony_ci ***************************************************************************/ 2613498266Sopenharmony_ci 2713498266Sopenharmony_ci#include "curl_setup.h" 2813498266Sopenharmony_ci 2913498266Sopenharmony_ci#ifdef USE_WINSOCK 3013498266Sopenharmony_ci#include <curl/curl.h> /* for curl_socket_t */ 3113498266Sopenharmony_ci#endif 3213498266Sopenharmony_ci 3313498266Sopenharmony_ci#define CURLX_FUNCTION_CAST(target_type, func) \ 3413498266Sopenharmony_ci (target_type)(void (*) (void))(func) 3513498266Sopenharmony_ci 3613498266Sopenharmony_ciunsigned short curlx_ultous(unsigned long ulnum); 3713498266Sopenharmony_ci 3813498266Sopenharmony_ciunsigned char curlx_ultouc(unsigned long ulnum); 3913498266Sopenharmony_ci 4013498266Sopenharmony_ciint curlx_uztosi(size_t uznum); 4113498266Sopenharmony_ci 4213498266Sopenharmony_cicurl_off_t curlx_uztoso(size_t uznum); 4313498266Sopenharmony_ci 4413498266Sopenharmony_ciunsigned long curlx_uztoul(size_t uznum); 4513498266Sopenharmony_ci 4613498266Sopenharmony_ciunsigned int curlx_uztoui(size_t uznum); 4713498266Sopenharmony_ci 4813498266Sopenharmony_ciint curlx_sltosi(long slnum); 4913498266Sopenharmony_ci 5013498266Sopenharmony_ciunsigned int curlx_sltoui(long slnum); 5113498266Sopenharmony_ci 5213498266Sopenharmony_ciunsigned short curlx_sltous(long slnum); 5313498266Sopenharmony_ci 5413498266Sopenharmony_cissize_t curlx_uztosz(size_t uznum); 5513498266Sopenharmony_ci 5613498266Sopenharmony_cisize_t curlx_sotouz(curl_off_t sonum); 5713498266Sopenharmony_ci 5813498266Sopenharmony_ciint curlx_sztosi(ssize_t sznum); 5913498266Sopenharmony_ci 6013498266Sopenharmony_ciunsigned short curlx_uitous(unsigned int uinum); 6113498266Sopenharmony_ci 6213498266Sopenharmony_cisize_t curlx_sitouz(int sinum); 6313498266Sopenharmony_ci 6413498266Sopenharmony_ci#ifdef USE_WINSOCK 6513498266Sopenharmony_ci 6613498266Sopenharmony_ciint curlx_sktosi(curl_socket_t s); 6713498266Sopenharmony_ci 6813498266Sopenharmony_cicurl_socket_t curlx_sitosk(int i); 6913498266Sopenharmony_ci 7013498266Sopenharmony_ci#endif /* USE_WINSOCK */ 7113498266Sopenharmony_ci 7213498266Sopenharmony_ci#if defined(_WIN32) 7313498266Sopenharmony_ci 7413498266Sopenharmony_cissize_t curlx_read(int fd, void *buf, size_t count); 7513498266Sopenharmony_ci 7613498266Sopenharmony_cissize_t curlx_write(int fd, const void *buf, size_t count); 7713498266Sopenharmony_ci 7813498266Sopenharmony_ci#endif /* _WIN32 */ 7913498266Sopenharmony_ci 8013498266Sopenharmony_ci#if defined(__INTEL_COMPILER) && defined(__unix__) 8113498266Sopenharmony_ci 8213498266Sopenharmony_ciint curlx_FD_ISSET(int fd, fd_set *fdset); 8313498266Sopenharmony_ci 8413498266Sopenharmony_civoid curlx_FD_SET(int fd, fd_set *fdset); 8513498266Sopenharmony_ci 8613498266Sopenharmony_civoid curlx_FD_ZERO(fd_set *fdset); 8713498266Sopenharmony_ci 8813498266Sopenharmony_ciunsigned short curlx_htons(unsigned short usnum); 8913498266Sopenharmony_ci 9013498266Sopenharmony_ciunsigned short curlx_ntohs(unsigned short usnum); 9113498266Sopenharmony_ci 9213498266Sopenharmony_ci#endif /* __INTEL_COMPILER && __unix__ */ 9313498266Sopenharmony_ci 9413498266Sopenharmony_ci#endif /* HEADER_CURL_WARNLESS_H */ 9513498266Sopenharmony_ci 9613498266Sopenharmony_ci#ifndef HEADER_CURL_WARNLESS_H_REDEFS 9713498266Sopenharmony_ci#define HEADER_CURL_WARNLESS_H_REDEFS 9813498266Sopenharmony_ci 9913498266Sopenharmony_ci#if defined(_WIN32) 10013498266Sopenharmony_ci#undef read 10113498266Sopenharmony_ci#define read(fd, buf, count) curlx_read(fd, buf, count) 10213498266Sopenharmony_ci#undef write 10313498266Sopenharmony_ci#define write(fd, buf, count) curlx_write(fd, buf, count) 10413498266Sopenharmony_ci#endif 10513498266Sopenharmony_ci 10613498266Sopenharmony_ci#endif /* HEADER_CURL_WARNLESS_H_REDEFS */ 107