7edeca2123914f6989aaaeb789d3e852fa2f9198
[platform/upstream/curl.git] / lib / curl_setup.h
1 #ifndef HEADER_CURL_SETUP_H
2 #define HEADER_CURL_SETUP_H
3 /***************************************************************************
4  *                                  _   _ ____  _
5  *  Project                     ___| | | |  _ \| |
6  *                             / __| | | | |_) | |
7  *                            | (__| |_| |  _ <| |___
8  *                             \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) 1998 - 2013, 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 http://curl.haxx.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  ***************************************************************************/
24
25 /*
26  * Define WIN32 when build target is Win32 API
27  */
28
29 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) && \
30     !defined(__SYMBIAN32__)
31 #define WIN32
32 #endif
33
34 /*
35  * Include configuration script results or hand-crafted
36  * configuration file for platforms which lack config tool.
37  */
38
39 #ifdef HAVE_CONFIG_H
40
41 #include "curl_config.h"
42
43 #else /* HAVE_CONFIG_H */
44
45 #ifdef _WIN32_WCE
46 #  include "config-win32ce.h"
47 #else
48 #  ifdef WIN32
49 #    include "config-win32.h"
50 #  endif
51 #endif
52
53 #if defined(macintosh) && defined(__MRC__)
54 #  include "config-mac.h"
55 #endif
56
57 #ifdef __riscos__
58 #  include "config-riscos.h"
59 #endif
60
61 #ifdef __AMIGA__
62 #  include "config-amigaos.h"
63 #endif
64
65 #ifdef __SYMBIAN32__
66 #  include "config-symbian.h"
67 #endif
68
69 #ifdef __OS400__
70 #  include "config-os400.h"
71 #endif
72
73 #ifdef TPF
74 #  include "config-tpf.h"
75 #endif
76
77 #ifdef __VXWORKS__
78 #  include "config-vxworks.h"
79 #endif
80
81 #endif /* HAVE_CONFIG_H */
82
83 /* ================================================================ */
84 /* Definition of preprocessor macros/symbols which modify compiler  */
85 /* behavior or generated code characteristics must be done here,   */
86 /* as appropriate, before any system header file is included. It is */
87 /* also possible to have them defined in the config file included   */
88 /* before this point. As a result of all this we frown inclusion of */
89 /* system header files in our config files, avoid this at any cost. */
90 /* ================================================================ */
91
92 /*
93  * AIX 4.3 and newer needs _THREAD_SAFE defined to build
94  * proper reentrant code. Others may also need it.
95  */
96
97 #ifdef NEED_THREAD_SAFE
98 #  ifndef _THREAD_SAFE
99 #    define _THREAD_SAFE
100 #  endif
101 #endif
102
103 /*
104  * Tru64 needs _REENTRANT set for a few function prototypes and
105  * things to appear in the system header files. Unixware needs it
106  * to build proper reentrant code. Others may also need it.
107  */
108
109 #ifdef NEED_REENTRANT
110 #  ifndef _REENTRANT
111 #    define _REENTRANT
112 #  endif
113 #endif
114
115 /* ================================================================ */
116 /*  If you need to include a system header file for your platform,  */
117 /*  please, do it beyond the point further indicated in this file.  */
118 /* ================================================================ */
119
120 /*
121  * libcurl's external interface definitions are also used internally,
122  * and might also include required system header files to define them.
123  */
124
125 #include <curl/curlbuild.h>
126
127 /*
128  * Compile time sanity checks must also be done when building the library.
129  */
130
131 #include <curl/curlrules.h>
132
133 /*
134  * Ensure that no one is using the old SIZEOF_CURL_OFF_T macro
135  */
136
137 #ifdef SIZEOF_CURL_OFF_T
138 #  error "SIZEOF_CURL_OFF_T shall not be defined!"
139    Error Compilation_aborted_SIZEOF_CURL_OFF_T_shall_not_be_defined
140 #endif
141
142 /*
143  * Set up internal curl_off_t formatting string directives for
144  * exclusive use with libcurl's internal *printf functions.
145  */
146
147 #ifdef FORMAT_OFF_T
148 #  error "FORMAT_OFF_T shall not be defined before this point!"
149    Error Compilation_aborted_FORMAT_OFF_T_already_defined
150 #endif
151
152 #ifdef FORMAT_OFF_TU
153 #  error "FORMAT_OFF_TU shall not be defined before this point!"
154    Error Compilation_aborted_FORMAT_OFF_TU_already_defined
155 #endif
156
157 #if (CURL_SIZEOF_CURL_OFF_T > CURL_SIZEOF_LONG)
158 #  define FORMAT_OFF_T  "lld"
159 #  define FORMAT_OFF_TU "llu"
160 #else
161 #  define FORMAT_OFF_T  "ld"
162 #  define FORMAT_OFF_TU "lu"
163 #endif
164
165 /*
166  * Disable other protocols when http is the only one desired.
167  */
168
169 #ifdef HTTP_ONLY
170 #  ifndef CURL_DISABLE_TFTP
171 #    define CURL_DISABLE_TFTP
172 #  endif
173 #  ifndef CURL_DISABLE_FTP
174 #    define CURL_DISABLE_FTP
175 #  endif
176 #  ifndef CURL_DISABLE_LDAP
177 #    define CURL_DISABLE_LDAP
178 #  endif
179 #  ifndef CURL_DISABLE_TELNET
180 #    define CURL_DISABLE_TELNET
181 #  endif
182 #  ifndef CURL_DISABLE_DICT
183 #    define CURL_DISABLE_DICT
184 #  endif
185 #  ifndef CURL_DISABLE_FILE
186 #    define CURL_DISABLE_FILE
187 #  endif
188 #  ifndef CURL_DISABLE_RTSP
189 #    define CURL_DISABLE_RTSP
190 #  endif
191 #  ifndef CURL_DISABLE_POP3
192 #    define CURL_DISABLE_POP3
193 #  endif
194 #  ifndef CURL_DISABLE_IMAP
195 #    define CURL_DISABLE_IMAP
196 #  endif
197 #  ifndef CURL_DISABLE_SMTP
198 #    define CURL_DISABLE_SMTP
199 #  endif
200 #  ifndef CURL_DISABLE_RTSP
201 #    define CURL_DISABLE_RTSP
202 #  endif
203 #  ifndef CURL_DISABLE_RTMP
204 #    define CURL_DISABLE_RTMP
205 #  endif
206 #  ifndef CURL_DISABLE_GOPHER
207 #    define CURL_DISABLE_GOPHER
208 #  endif
209 #endif
210
211 /*
212  * When http is disabled rtsp is not supported.
213  */
214
215 #if defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_RTSP)
216 #  define CURL_DISABLE_RTSP
217 #endif
218
219 /* ================================================================ */
220 /* No system header file shall be included in this file before this */
221 /* point. The only allowed ones are those included from curlbuild.h */
222 /* ================================================================ */
223
224 /*
225  * OS/400 setup file includes some system headers.
226  */
227
228 #ifdef __OS400__
229 #  include "setup-os400.h"
230 #endif
231
232 /*
233  * VMS setup file includes some system headers.
234  */
235
236 #ifdef __VMS
237 #  include "setup-vms.h"
238 #endif
239
240 /*
241  * Include header files for windows builds before redefining anything.
242  * Use this preprocessor block only to include or exclude windows.h,
243  * winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
244  * to any other further and independent block.  Under Cygwin things work
245  * just as under linux (e.g. <sys/socket.h>) and the winsock headers should
246  * never be included when __CYGWIN__ is defined.  configure script takes
247  * care of this, not defining HAVE_WINDOWS_H, HAVE_WINSOCK_H, HAVE_WINSOCK2_H,
248  * neither HAVE_WS2TCPIP_H when __CYGWIN__ is defined.
249  */
250
251 #ifdef HAVE_WINDOWS_H
252 #  if defined(UNICODE) && !defined(_UNICODE)
253 #    define _UNICODE
254 #  endif
255 #  if defined(_UNICODE) && !defined(UNICODE)
256 #    define UNICODE
257 #  endif
258 #  ifndef WIN32_LEAN_AND_MEAN
259 #    define WIN32_LEAN_AND_MEAN
260 #  endif
261 #  include <windows.h>
262 #  ifdef HAVE_WINSOCK2_H
263 #    include <winsock2.h>
264 #    ifdef HAVE_WS2TCPIP_H
265 #       include <ws2tcpip.h>
266 #    endif
267 #  else
268 #    ifdef HAVE_WINSOCK_H
269 #      include <winsock.h>
270 #    endif
271 #  endif
272 #  include <tchar.h>
273 #  ifdef UNICODE
274      typedef wchar_t *(*curl_wcsdup_callback)(const wchar_t *str);
275 #  endif
276 #endif
277
278 /*
279  * Define USE_WINSOCK to 2 if we have and use WINSOCK2 API, else
280  * define USE_WINSOCK to 1 if we have and use WINSOCK  API, else
281  * undefine USE_WINSOCK.
282  */
283
284 #undef USE_WINSOCK
285
286 #ifdef HAVE_WINSOCK2_H
287 #  define USE_WINSOCK 2
288 #else
289 #  ifdef HAVE_WINSOCK_H
290 #    define USE_WINSOCK 1
291 #  endif
292 #endif
293
294 #ifdef USE_LWIPSOCK
295 #  include <lwip/init.h>
296 #  include <lwip/sockets.h>
297 #  include <lwip/netdb.h>
298 #endif
299
300 #ifdef HAVE_EXTRA_STRICMP_H
301 #  include <extra/stricmp.h>
302 #endif
303
304 #ifdef HAVE_EXTRA_STRDUP_H
305 #  include <extra/strdup.h>
306 #endif
307
308 #ifdef TPF
309 #  include <strings.h>    /* for bzero, strcasecmp, and strncasecmp */
310 #  include <string.h>     /* for strcpy and strlen */
311 #  include <stdlib.h>     /* for rand and srand */
312 #  include <sys/socket.h> /* for select and ioctl*/
313 #  include <netdb.h>      /* for in_addr_t definition */
314 #  include <tpf/sysapi.h> /* for tpf_process_signals */
315    /* change which select is used for libcurl */
316 #  define select(a,b,c,d,e) tpf_select_libcurl(a,b,c,d,e)
317 #endif
318
319 #ifdef __VXWORKS__
320 #  include <sockLib.h>    /* for generic BSD socket functions */
321 #  include <ioLib.h>      /* for basic I/O interface functions */
322 #endif
323
324 #ifdef __AMIGA__
325 #  ifndef __ixemul__
326 #    include <exec/types.h>
327 #    include <exec/execbase.h>
328 #    include <proto/exec.h>
329 #    include <proto/dos.h>
330 #    define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,0)
331 #  endif
332 #endif
333
334 #include <stdio.h>
335 #ifdef HAVE_ASSERT_H
336 #include <assert.h>
337 #endif
338
339 #ifdef __TANDEM /* for nsr-tandem-nsk systems */
340 #include <floss.h>
341 #endif
342
343 #ifndef STDC_HEADERS /* no standard C headers! */
344 #include <curl/stdcheaders.h>
345 #endif
346
347 #ifdef __POCC__
348 #  include <sys/types.h>
349 #  include <unistd.h>
350 #  define sys_nerr EILSEQ
351 #endif
352
353 /*
354  * Salford-C kludge section (mostly borrowed from wxWidgets).
355  */
356 #ifdef __SALFORDC__
357   #pragma suppress 353             /* Possible nested comments */
358   #pragma suppress 593             /* Define not used */
359   #pragma suppress 61              /* enum has no name */
360   #pragma suppress 106             /* unnamed, unused parameter */
361   #include <clib.h>
362 #endif
363
364 /*
365  * Large file (>2Gb) support using WIN32 functions.
366  */
367
368 #ifdef USE_WIN32_LARGE_FILES
369 #  include <io.h>
370 #  include <sys/types.h>
371 #  include <sys/stat.h>
372 #  undef  lseek
373 #  define lseek(fdes,offset,whence)  _lseeki64(fdes, offset, whence)
374 #  undef  fstat
375 #  define fstat(fdes,stp)            _fstati64(fdes, stp)
376 #  undef  stat
377 #  define stat(fname,stp)            _stati64(fname, stp)
378 #  define struct_stat                struct _stati64
379 #  define LSEEK_ERROR                (__int64)-1
380 #endif
381
382 /*
383  * Small file (<2Gb) support using WIN32 functions.
384  */
385
386 #ifdef USE_WIN32_SMALL_FILES
387 #  include <io.h>
388 #  include <sys/types.h>
389 #  include <sys/stat.h>
390 #  ifndef _WIN32_WCE
391 #    undef  lseek
392 #    define lseek(fdes,offset,whence)  _lseek(fdes, (long)offset, whence)
393 #    define fstat(fdes,stp)            _fstat(fdes, stp)
394 #    define stat(fname,stp)            _stat(fname, stp)
395 #    define struct_stat                struct _stat
396 #  endif
397 #  define LSEEK_ERROR                (long)-1
398 #endif
399
400 #ifndef struct_stat
401 #  define struct_stat struct stat
402 #endif
403
404 #ifndef LSEEK_ERROR
405 #  define LSEEK_ERROR (off_t)-1
406 #endif
407
408 /*
409  * Default sizeof(off_t) in case it hasn't been defined in config file.
410  */
411
412 #ifndef SIZEOF_OFF_T
413 #  if defined(__VMS) && !defined(__VAX)
414 #    if defined(_LARGEFILE)
415 #      define SIZEOF_OFF_T 8
416 #    endif
417 #  elif defined(__OS400__) && defined(__ILEC400__)
418 #    if defined(_LARGE_FILES)
419 #      define SIZEOF_OFF_T 8
420 #    endif
421 #  elif defined(__MVS__) && defined(__IBMC__)
422 #    if defined(_LP64) || defined(_LARGE_FILES)
423 #      define SIZEOF_OFF_T 8
424 #    endif
425 #  elif defined(__370__) && defined(__IBMC__)
426 #    if defined(_LP64) || defined(_LARGE_FILES)
427 #      define SIZEOF_OFF_T 8
428 #    endif
429 #  endif
430 #  ifndef SIZEOF_OFF_T
431 #    define SIZEOF_OFF_T 4
432 #  endif
433 #endif
434
435 /*
436  * Arg 2 type for gethostname in case it hasn't been defined in config file.
437  */
438
439 #ifndef GETHOSTNAME_TYPE_ARG2
440 #  ifdef USE_WINSOCK
441 #    define GETHOSTNAME_TYPE_ARG2 int
442 #  else
443 #    define GETHOSTNAME_TYPE_ARG2 size_t
444 #  endif
445 #endif
446
447 /* Below we define some functions. They should
448
449    4. set the SIGALRM signal timeout
450    5. set dir/file naming defines
451    */
452
453 #ifdef WIN32
454
455 #  define DIR_CHAR      "\\"
456 #  define DOT_CHAR      "_"
457
458 #else /* WIN32 */
459
460 #  ifdef MSDOS  /* Watt-32 */
461
462 #    include <sys/ioctl.h>
463 #    define select(n,r,w,x,t) select_s(n,r,w,x,t)
464 #    define ioctl(x,y,z) ioctlsocket(x,y,(char *)(z))
465 #    include <tcp.h>
466 #    ifdef word
467 #      undef word
468 #    endif
469 #    ifdef byte
470 #      undef byte
471 #    endif
472
473 #  endif /* MSDOS */
474
475 #  ifdef __minix
476      /* Minix 3 versions up to at least 3.1.3 are missing these prototypes */
477      extern char * strtok_r(char *s, const char *delim, char **last);
478      extern struct tm * gmtime_r(const time_t * const timep, struct tm *tmp);
479 #  endif
480
481 #  define DIR_CHAR      "/"
482 #  ifndef DOT_CHAR
483 #    define DOT_CHAR      "."
484 #  endif
485
486 #  ifdef MSDOS
487 #    undef DOT_CHAR
488 #    define DOT_CHAR      "_"
489 #  endif
490
491 #  ifndef fileno /* sunos 4 have this as a macro! */
492      int fileno( FILE *stream);
493 #  endif
494
495 #endif /* WIN32 */
496
497 /*
498  * msvc 6.0 requires PSDK in order to have INET6_ADDRSTRLEN
499  * defined in ws2tcpip.h as well as to provide IPv6 support.
500  */
501
502 #if defined(_MSC_VER) && !defined(__POCC__)
503 #  if !defined(HAVE_WS2TCPIP_H) || \
504      ((_MSC_VER < 1300) && !defined(INET6_ADDRSTRLEN))
505 #    undef HAVE_GETADDRINFO_THREADSAFE
506 #    undef HAVE_FREEADDRINFO
507 #    undef HAVE_GETADDRINFO
508 #    undef HAVE_GETNAMEINFO
509 #    undef ENABLE_IPV6
510 #  endif
511 #endif
512
513 /* ---------------------------------------------------------------- */
514 /*             resolver specialty compile-time defines              */
515 /*         CURLRES_* defines to use in the host*.c sources          */
516 /* ---------------------------------------------------------------- */
517
518 /*
519  * lcc-win32 doesn't have _beginthreadex(), lacks threads support.
520  */
521
522 #if defined(__LCC__) && defined(WIN32)
523 #  undef USE_THREADS_POSIX
524 #  undef USE_THREADS_WIN32
525 #endif
526
527 /*
528  * MSVC threads support requires a multi-threaded runtime library.
529  * _beginthreadex() is not available in single-threaded ones.
530  */
531
532 #if defined(_MSC_VER) && !defined(__POCC__) && !defined(_MT)
533 #  undef USE_THREADS_POSIX
534 #  undef USE_THREADS_WIN32
535 #endif
536
537 /*
538  * Mutually exclusive CURLRES_* definitions.
539  */
540
541 #ifdef USE_ARES
542 #  define CURLRES_ASYNCH
543 #  define CURLRES_ARES
544 /* now undef the stock libc functions just to avoid them being used */
545 #  undef HAVE_GETADDRINFO
546 #  undef HAVE_GETHOSTBYNAME
547 #elif defined(USE_THREADS_POSIX) || defined(USE_THREADS_WIN32)
548 #  define CURLRES_ASYNCH
549 #  define CURLRES_THREADED
550 #else
551 #  define CURLRES_SYNCH
552 #endif
553
554 #ifdef ENABLE_IPV6
555 #  define CURLRES_IPV6
556 #else
557 #  define CURLRES_IPV4
558 #endif
559
560 /* ---------------------------------------------------------------- */
561
562 /*
563  * When using WINSOCK, TELNET protocol requires WINSOCK2 API.
564  */
565
566 #if defined(USE_WINSOCK) && (USE_WINSOCK != 2)
567 #  define CURL_DISABLE_TELNET 1
568 #endif
569
570 /*
571  * msvc 6.0 does not have struct sockaddr_storage and
572  * does not define IPPROTO_ESP in winsock2.h. But both
573  * are available if PSDK is properly installed.
574  */
575
576 #if defined(_MSC_VER) && !defined(__POCC__)
577 #  if !defined(HAVE_WINSOCK2_H) || ((_MSC_VER < 1300) && !defined(IPPROTO_ESP))
578 #    undef HAVE_STRUCT_SOCKADDR_STORAGE
579 #  endif
580 #endif
581
582 /*
583  * Intentionally fail to build when using msvc 6.0 without PSDK installed.
584  * The brave of heart can circumvent this, defining ALLOW_MSVC6_WITHOUT_PSDK
585  * in lib/config-win32.h although absolutely discouraged and unsupported.
586  */
587
588 #if defined(_MSC_VER) && !defined(__POCC__)
589 #  if !defined(HAVE_WINDOWS_H) || ((_MSC_VER < 1300) && !defined(_FILETIME_))
590 #    if !defined(ALLOW_MSVC6_WITHOUT_PSDK)
591 #      error MSVC 6.0 requires "February 2003 Platform SDK" a.k.a. \
592              "Windows Server 2003 PSDK"
593 #    else
594 #      define CURL_DISABLE_LDAP 1
595 #    endif
596 #  endif
597 #endif
598
599 #ifdef NETWARE
600 int netware_init(void);
601 #ifndef __NOVELL_LIBC__
602 #include <sys/bsdskt.h>
603 #include <sys/timeval.h>
604 #endif
605 #endif
606
607 #if defined(HAVE_LIBIDN) && defined(HAVE_TLD_H)
608 /* The lib was present and the tld.h header (which is missing in libidn 0.3.X
609    but we only work with libidn 0.4.1 or later) */
610 #define USE_LIBIDN
611 #endif
612
613 #ifndef SIZEOF_TIME_T
614 /* assume default size of time_t to be 32 bit */
615 #define SIZEOF_TIME_T 4
616 #endif
617
618 #define LIBIDN_REQUIRED_VERSION "0.4.1"
619
620 #if defined(USE_GNUTLS) || defined(USE_SSLEAY) || defined(USE_NSS) || \
621     defined(USE_QSOSSL) || defined(USE_POLARSSL) || defined(USE_AXTLS) || \
622     defined(USE_CYASSL) || defined(USE_SCHANNEL) || \
623     defined(USE_DARWINSSL) || defined(USE_GSKIT)
624 #define USE_SSL    /* SSL support has been enabled */
625 #endif
626
627 #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
628 #define USE_HTTP_NEGOTIATE
629 #endif
630
631 /* Single point where USE_NTLM definition might be done */
632 #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_NTLM)
633 #if defined(USE_SSLEAY) || defined(USE_WINDOWS_SSPI) || \
634     defined(USE_GNUTLS) || defined(USE_NSS) || defined(USE_DARWINSSL)
635 #define USE_NTLM
636 #endif
637 #endif
638
639 /* non-configure builds may define CURL_WANTS_CA_BUNDLE_ENV */
640 #if defined(CURL_WANTS_CA_BUNDLE_ENV) && !defined(CURL_CA_BUNDLE)
641 #define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")
642 #endif
643
644 /*
645  * Provide a mechanism to silence picky compilers, such as gcc 4.6+.
646  * Parameters should of course normally not be unused, but for example when
647  * we have multiple implementations of the same interface it may happen.
648  */
649
650 #if defined(__GNUC__) && ((__GNUC__ >= 3) || \
651   ((__GNUC__ == 2) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 7)))
652 #  define UNUSED_PARAM __attribute__((__unused__))
653 #else
654 #  define UNUSED_PARAM /*NOTHING*/
655 #endif
656
657 /*
658  * Include macros and defines that should only be processed once.
659  */
660
661 #ifndef HEADER_CURL_SETUP_ONCE_H
662 #include "curl_setup_once.h"
663 #endif
664
665 /*
666  * Definition of our NOP statement Object-like macro
667  */
668
669 #ifndef Curl_nop_stmt
670 #  define Curl_nop_stmt do { } WHILE_FALSE
671 #endif
672
673 /*
674  * Ensure that Winsock and lwIP TCP/IP stacks are not mixed.
675  */
676
677 #if defined(__LWIP_OPT_H__)
678 #  if defined(SOCKET) || \
679      defined(USE_WINSOCK) || \
680      defined(HAVE_WINSOCK_H) || \
681      defined(HAVE_WINSOCK2_H) || \
682      defined(HAVE_WS2TCPIP_H)
683 #    error "Winsock and lwIP TCP/IP stack definitions shall not coexist!"
684 #  endif
685 #endif
686
687 /*
688  * Portable symbolic names for Winsock shutdown() mode flags.
689  */
690
691 #ifdef USE_WINSOCK
692 #  define SHUT_RD   0x00
693 #  define SHUT_WR   0x01
694 #  define SHUT_RDWR 0x02
695 #endif
696
697 /* Define S_ISREG if not defined by system headers, f.e. MSVC */
698 #if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG)
699 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
700 #endif
701
702 /* Define S_ISDIR if not defined by system headers, f.e. MSVC */
703 #if !defined(S_ISDIR) && defined(S_IFMT) && defined(S_IFDIR)
704 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
705 #endif
706
707 #endif /* HEADER_CURL_SETUP_H */