doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
strtoofft.h
Go to the documentation of this file.
1 #ifndef _CURL_STRTOOFFT_H
2 #define _CURL_STRTOOFFT_H
3 /***************************************************************************
4  * _ _ ____ _
5  * Project ___| | | | _ \| |
6  * / __| | | | |_) | |
7  * | (__| |_| | _ <| |___
8  * \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) 1998 - 2004, 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  * $Id: strtoofft.h,v 1.9 2004/03/03 13:32:57 bagder Exp $
24  ***************************************************************************/
25 
26 /*
27  * CAUTION: this header is designed to work when included by the app-side
28  * as well as the library. Do not mix with library internals!
29  */
30 
31 #include "setup.h"
32 #include <stddef.h>
33 #include <curl/curl.h> /* for the curl_off_t type */
34 
35 /* Determine what type of file offset conversion handling we wish to use. For
36  * systems with a 32-bit curl_off_t type, we should use strtol. For systems
37  * with a 64-bit curl_off_t type, we should use strtoll if it exists, and if
38  * not, should try to emulate its functionality. At any rate, we define
39  * 'strtoofft' such that it can be used to work with curl_off_t's regardless.
40  */
41 #if SIZEOF_CURL_OFF_T > 4
42 #if HAVE_STRTOLL
43 #define strtoofft strtoll
44 #else /* HAVE_STRTOLL */
45 
46 /* For MSVC7 we can use _strtoi64() which seems to be a strtoll() clone */
47 #if defined(_MSC_VER) && (_MSC_VER >= 1300)
48 #define strtoofft _strtoi64
49 #else /* MSVC7 or later */
50 curl_off_t curlx_strtoll(const char *nptr, char **endptr, int base);
51 #define strtoofft curlx_strtoll
52 #define NEED_CURL_STRTOLL
53 #endif /* MSVC7 or later */
54 
55 #endif /* HAVE_STRTOLL */
56 #else /* SIZEOF_CURL_OFF_T > 4 */
57 /* simply use strtol() to get 32bit numbers */
58 #define strtoofft strtol
59 #endif
60 
61 #endif
62 
off_t curl_off_t
Definition: curl.h:96