~ps10gel/ubuntu/xenial/trafficserver/6.2.0

« back to all changes in this revision

Viewing changes to lib/ts/ink_port.h

  • Committer: Bazaar Package Importer
  • Author(s): Arno Toell
  • Date: 2011-01-13 11:49:18 UTC
  • Revision ID: james.westby@ubuntu.com-20110113114918-vu422h8dknrgkj15
Tags: upstream-2.1.5-unstable
ImportĀ upstreamĀ versionĀ 2.1.5-unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** @file
 
2
 
 
3
  A brief file description
 
4
 
 
5
  @section license License
 
6
 
 
7
  Licensed to the Apache Software Foundation (ASF) under one
 
8
  or more contributor license agreements.  See the NOTICE file
 
9
  distributed with this work for additional information
 
10
  regarding copyright ownership.  The ASF licenses this file
 
11
  to you under the Apache License, Version 2.0 (the
 
12
  "License"); you may not use this file except in compliance
 
13
  with the License.  You may obtain a copy of the License at
 
14
 
 
15
      http://www.apache.org/licenses/LICENSE-2.0
 
16
 
 
17
  Unless required by applicable law or agreed to in writing, software
 
18
  distributed under the License is distributed on an "AS IS" BASIS,
 
19
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
20
  See the License for the specific language governing permissions and
 
21
  limitations under the License.
 
22
 */
 
23
 
 
24
/****************************************************************************
 
25
 
 
26
  Ink_port.h
 
27
 
 
28
  Definitions & declarations to faciliate inter-architecture portability.
 
29
 
 
30
 ****************************************************************************/
 
31
 
 
32
#if !defined (_ink_port_h_)
 
33
#define _ink_port_h_
 
34
 
 
35
#include "ink_config.h"
 
36
#include <stddef.h>
 
37
 
 
38
#ifdef HAVE_STDINT_H
 
39
#define __STDC_LIMIT_MACROS
 
40
# include <stdint.h>
 
41
#else
 
42
// TODO: Add "standard" int types?
 
43
#endif
 
44
 
 
45
#ifdef HAVE_INTTYPES_H
 
46
# define __STDC_FORMAT_MACROS 1
 
47
# include <inttypes.h>
 
48
#else
 
49
// TODO: add PRI*64 stuff?
 
50
#endif
 
51
 
 
52
#ifndef INT64_MIN
 
53
#define INT64_MAX (9223372036854775807LL)
 
54
#define INT64_MIN (-INT64_MAX -1LL)
 
55
#define INTU32_MAX (4294967295U)
 
56
#define INT32_MAX (2147483647)
 
57
#define INT32_MIN (-2147483647-1)
 
58
#endif
 
59
// Hack for MacOSX, have to take this out of the group above.
 
60
#ifndef INTU64_MAX
 
61
#define INTU64_MAX (18446744073709551615ULL)
 
62
#endif
 
63
 
 
64
#define POSIX_THREAD
 
65
#define POSIX_THREAD_10031c
 
66
 
 
67
#ifndef ETIME
 
68
#ifdef ETIMEDOUT
 
69
#define ETIME ETIMEDOUT
 
70
#endif
 
71
#endif
 
72
 
 
73
#ifndef ENOTSUP
 
74
#ifdef EOPNOTSUPP
 
75
#define ENOTSUP EOPNOTSUPP
 
76
#endif
 
77
#endif
 
78
 
 
79
#if defined(freebsd)
 
80
#define NO_MEMALIGN
 
81
#endif
 
82
 
 
83
#if defined(darwin)
 
84
#define NO_MEMALIGN
 
85
#define RENTRENT_GETHOSTBYNAME
 
86
#define RENTRENT_GETHOSTBYADDR
 
87
#endif
 
88
 
 
89
#define NUL '\0'
 
90
 
 
91
// Need to use this to avoid problems when calling variadic functions
 
92
// with many arguments. In such cases, a raw '0' or NULL can be
 
93
// interpreted as 32 bits
 
94
#define NULL_PTR static_cast<void*>(0)
 
95
 
 
96
#endif