• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Compatability.h

Go to the documentation of this file.
00001 /** @file
00002 
00003   A brief file description
00004 
00005   @section license License
00006 
00007   Licensed to the Apache Software Foundation (ASF) under one
00008   or more contributor license agreements.  See the NOTICE file
00009   distributed with this work for additional information
00010   regarding copyright ownership.  The ASF licenses this file
00011   to you under the Apache License, Version 2.0 (the
00012   "License"); you may not use this file except in compliance
00013   with the License.  You may obtain a copy of the License at
00014 
00015       http://www.apache.org/licenses/LICENSE-2.0
00016 
00017   Unless required by applicable law or agreed to in writing, software
00018   distributed under the License is distributed on an "AS IS" BASIS,
00019   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00020   See the License for the specific language governing permissions and
00021   limitations under the License.
00022  */
00023 
00024 #if !defined (_Compatability_h_)
00025 #define _Compatability_h_
00026 
00027 #include <sys/types.h>
00028 #include <sys/uio.h>
00029 #include <unistd.h>
00030 #include <stdio.h>
00031 #include <strings.h>
00032 
00033 #include "ink_defs.h"
00034 
00035 // We can't use #define for min and max becuase it will conflict with
00036 // other declarations of min and max functions.  This conflict
00037 // occurs with STL
00038 template<class T> T min(const T a, const T b)
00039 {
00040   return a < b ? a : b;
00041 }
00042 
00043 template<class T> T max(const T a, const T b)
00044 {
00045   return a > b ? a : b;
00046 }
00047 
00048 #define _O_ATTRIB_NORMAL  0x0000
00049 #define _O_ATTRIB_OVERLAPPED 0x0000
00050 
00051 //
00052 // If you the gethostbyname() routines on your system are automatically
00053 // re-entrent (as in Digital Unix), define the following
00054 //
00055 #if defined(linux)
00056 #define NEED_ALTZONE_DEFINED
00057 #define MAP_SHARED_MAP_NORESERVE (MAP_SHARED)
00058 #elif defined(darwin)
00059 #define MAP_SHARED_MAP_NORESERVE (MAP_SHARED)
00060 #elif defined(solaris)
00061 #define NEED_ALTZONE_DEFINED
00062 #define MAP_SHARED_MAP_NORESERVE (MAP_SHARED | MAP_NORESERVE)
00063 #else
00064 #define MAP_SHARED_MAP_NORESERVE (MAP_SHARED | MAP_NORESERVE)
00065 #endif
00066 
00067 #if defined(darwin)
00068 typedef uint32_t in_addr_t;
00069 #endif
00070 
00071 #define NEED_HRTIME
00072 
00073 #endif

Generated by  doxygen 1.7.1