File: port.h

package info (click to toggle)
python-pgsql 2.4.0-5sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 984 kB
  • ctags: 1,291
  • sloc: ansic: 5,913; python: 4,334; sh: 73; makefile: 71
file content (50 lines) | stat: -rw-r--r-- 1,603 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#if ! defined(PYPGSQL_COMPAT_H)
#define PYPGSQL_COMPAT_H

/**********************************************************************
 * Get various constants for LONG_LONG and unsigned LONG_LONG defined *
 **********************************************************************/
#include <limits.h>
#include "Python.h"

#ifdef MS_WIN32
#ifndef LLONG_MAX
#define LLONG_MAX _I64_MAX
#endif
#ifndef ULLONG_MAX
#define ULLONG_MAX _UI64_MAX
#endif
#ifndef LLONG_MIN
#define LLONG_MIN _I64_MIN
#endif
#endif /* MS_WIN32 */

/* There are compiler/platform combinations that HAVE_LONG_LONG, but don't
 * provide the respective constants by default. Examples are Linux glibc and
 * Cygwin.  Only define HAVE_LONG_LONG_SUPPORT if both conditions are
 * fulfilled.
 */
#if defined(HAVE_LONG_LONG) && defined(LLONG_MAX) && defined(ULLONG_MAX)  \
    && defined(LLONG_MIN)
#define HAVE_LONG_LONG_SUPPORT
#endif

/* Under Python 2.3, LONG_LONG has been replaced by PY_LONG_LONG. We continue
 * using LONG_LONG, even under 2.3 or later */
#ifdef PY_LONG_LONG
#define LONG_LONG PY_LONG_LONG
#endif

/*******************************************************
 * Prototypes for the string functions that we include * 
 *******************************************************/
char * pg_strtok_r(char *s, const char *delim, char **last);

char * pg_strtok(char *s, const char *delim);

#if defined(HAVE_LONG_LONG_SUPPORT)
LONG_LONG pg_strtoll(const char *nptr, char **endptr, register int base);
unsigned LONG_LONG pg_strtoull(const char *nptr, char **endptr, register int base);
#endif

#endif /* !defined(PYPGSQL_COMPAT_H) */