//***************************************************************************
// This source code is copyrighted 2002 by Google Inc.  All rights
// reserved.  You are given a limited license to use this source code for
// purposes of participating in the Google programming contest.  If you
// choose to use or distribute the source code for any other purpose, you
// must either (1) first obtain written approval from Google, or (2)
// prominently display the foregoing copyright notice and the following
// warranty and liability disclaimer on each copy used or distributed.
// 
// The source code and repository (the "Software") is provided "AS IS",
// with no warranty, express or implied, including but not limited to the
// implied warranties of merchantability and fitness for a particular
// use.  In no event shall Google Inc. be liable for any damages, direct
// or indirect, even if advised of the possibility of such damages.
//***************************************************************************


#ifndef _BASICTYPES_H_
#define _BASICTYPES_H_

#include <limits.h>         // So we can set the bounds of our types
#include "goo-port.h"       // Types that only need exist on certain systems

// Standard typedefs
// All Google2 code is compiled with -funsigned-char to make "char"
// unsigned.  Google2 code therefore doesn't need a "uchar" type.
typedef signed char         schar;

typedef short               int16;
typedef int                 int32;
typedef long long           int64;

// NOTE: unsigned types are DANGEROUS in loops and other arithmetical
// places.  Use the signed types unless your variable represents a bit
// pattern (eg a hash value) or you really need the extra bit.  Do NOT
// use 'unsigned' to express "this value should always be positive";
// use assertions for this.
typedef unsigned short     uint16;
typedef unsigned int       uint32;
typedef unsigned long long uint64;

const uint16 kuint16max = ((uint16) 0xFFFF);
const uint64 kuint64max = ((uint64) 0xFFFFFFFFFFFFFFFFLL);
const  int32 kint32max  = (( int32) 0x7FFFFFFF);
const  int64 kint64min  = (( int64) 0x8000000000000000LL);
const  int64 kint64max  = (( int64) 0x7FFFFFFFFFFFFFFFLL);

// Don't make NULL a void* because it leads to type errors with strict
// checking.
#undef NULL
#define NULL 0


// A macro to disallow the evil copy constructor and operator= functions
// This should be used in the private: declarations for a class
#define DISALLOW_EVIL_CONSTRUCTORS(TypeName)    \
    TypeName(const TypeName&);                  \
    void operator=(const TypeName&)

#endif // _BASICTYPES_H_

