/******************************************************************************

	COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2011.

	This file is part of Sortix.

	Sortix is free software: you can redistribute it and/or modify it under the
	terms of the GNU General Public License as published by the Free Software
	Foundation, either version 3 of the License, or (at your option) any later
	version.

	Sortix 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.

	You should have received a copy of the GNU General Public License along
	with Sortix. If not, see <http://www.gnu.org/licenses/>.

	types.h
	Declares the required datatypes for the x86 architecture.

******************************************************************************/

#ifndef SORTIX_TYPES_H
#define SORTIX_TYPES_H

// Define basic signed types.
typedef char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long long int64_t;

// Define basic unsigned types.
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;

typedef unsigned int nat;

// A byte is naturally 8 bits. Seriously.
typedef uint8_t byte;

// The maximum width integers available on this platform.
typedef int64_t intmax_t;
typedef uint64_t uintmax_t;

// Define an integer able to hold the size of the largest continious memory
// region and define pointer safe integer types.
#ifdef PLATFORM_X86
typedef uint32_t size_t;
typedef int32_t ssize_t;
typedef int32_t intptr_t;
typedef uint32_t uintptr_t;
#elif defined(PLATFORM_X64)
typedef uint64_t size_t;
typedef int64_t ssize_t;
typedef int64_t intptr_t;
typedef uint64_t uintptr_t;
#endif

// Not sure what type this should be.
typedef int16_t clrchar;

#endif

