2002-08-02 19:57:46 +00:00
|
|
|
/*
|
|
|
|
* synergy -- mouse and keyboard sharing utility
|
|
|
|
* Copyright (C) 2002 Chris Schoeneman
|
|
|
|
*
|
|
|
|
* This package is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* found in the file COPYING that should have accompanied this file.
|
|
|
|
*
|
|
|
|
* This package is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
2001-10-06 14:13:28 +00:00
|
|
|
#ifndef BASICTYPES_H
|
|
|
|
#define BASICTYPES_H
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
2002-06-19 11:23:49 +00:00
|
|
|
//
|
|
|
|
// pick types of particular sizes
|
|
|
|
//
|
|
|
|
|
|
|
|
#if !defined(TYPE_OF_SIZE_1)
|
|
|
|
# if SIZEOF_CHAR == 1
|
|
|
|
# define TYPE_OF_SIZE_1 char
|
|
|
|
# endif
|
|
|
|
#endif
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-06-19 11:23:49 +00:00
|
|
|
#if !defined(TYPE_OF_SIZE_2)
|
|
|
|
# if SIZEOF_INT == 2
|
|
|
|
# define TYPE_OF_SIZE_2 int
|
|
|
|
# else
|
|
|
|
# define TYPE_OF_SIZE_2 short
|
|
|
|
# endif
|
|
|
|
#endif
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-06-19 11:23:49 +00:00
|
|
|
#if !defined(TYPE_OF_SIZE_4)
|
2004-04-11 14:58:08 +00:00
|
|
|
// Carbon defines SInt32 and UInt32 in terms of long
|
|
|
|
# if SIZEOF_INT == 4 && !defined(__APPLE__)
|
2002-06-19 11:23:49 +00:00
|
|
|
# define TYPE_OF_SIZE_4 int
|
|
|
|
# else
|
|
|
|
# define TYPE_OF_SIZE_4 long
|
|
|
|
# endif
|
|
|
|
#endif
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-06-19 11:23:49 +00:00
|
|
|
//
|
|
|
|
// verify existence of required types
|
|
|
|
//
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-06-19 11:23:49 +00:00
|
|
|
#if !defined(TYPE_OF_SIZE_1)
|
|
|
|
# error No 1 byte integer type
|
|
|
|
#endif
|
|
|
|
#if !defined(TYPE_OF_SIZE_2)
|
|
|
|
# error No 2 byte integer type
|
|
|
|
#endif
|
|
|
|
#if !defined(TYPE_OF_SIZE_4)
|
|
|
|
# error No 4 byte integer type
|
|
|
|
#endif
|
2001-10-06 14:13:28 +00:00
|
|
|
|
|
|
|
|
2002-06-19 11:23:49 +00:00
|
|
|
//
|
|
|
|
// make typedefs
|
|
|
|
//
|
|
|
|
// except for SInt8 and UInt8 these types are only guaranteed to be
|
|
|
|
// at least as big as indicated (in bits). that is, they may be
|
|
|
|
// larger than indicated.
|
|
|
|
//
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-06-19 11:23:49 +00:00
|
|
|
typedef signed TYPE_OF_SIZE_1 SInt8;
|
|
|
|
typedef signed TYPE_OF_SIZE_2 SInt16;
|
|
|
|
typedef signed TYPE_OF_SIZE_4 SInt32;
|
2001-11-19 00:33:36 +00:00
|
|
|
|
2002-06-19 11:23:49 +00:00
|
|
|
typedef unsigned TYPE_OF_SIZE_1 UInt8;
|
|
|
|
typedef unsigned TYPE_OF_SIZE_2 UInt16;
|
|
|
|
typedef unsigned TYPE_OF_SIZE_4 UInt32;
|
2001-11-19 00:33:36 +00:00
|
|
|
|
2002-06-19 11:23:49 +00:00
|
|
|
//
|
|
|
|
// clean up
|
|
|
|
//
|
2001-10-06 14:13:28 +00:00
|
|
|
|
2002-06-19 11:23:49 +00:00
|
|
|
#undef TYPE_OF_SIZE_1
|
|
|
|
#undef TYPE_OF_SIZE_2
|
|
|
|
#undef TYPE_OF_SIZE_4
|
2001-10-06 14:13:28 +00:00
|
|
|
|
|
|
|
#endif
|