Centralized the calling of #include <stdint.h> and VS fallback into include/osg/Types header

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14376 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2014-07-21 16:36:47 +00:00
parent d3945d5210
commit 3b23b474dc
5 changed files with 36 additions and 37 deletions

View File

@ -14,6 +14,7 @@
#include <osg/CoordinateSystemNode>
#include <osg/Switch>
#include <osg/Types>
#include <osgText/Text>
#include <osgViewer/Viewer>
@ -31,7 +32,6 @@
#include <osgGA/Device>
#include <iostream>
#include <stdint.h>
#include <osg/GLExtensions>

30
include/osg/Types Normal file
View File

@ -0,0 +1,30 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library 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
* OpenSceneGraph Public License for more details.
*/
#ifndef __OSG_TYPES
#define __OSG_TYPES
#ifdef _MSC_VER
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
#endif // __OSG_TYPES

View File

@ -12,19 +12,7 @@
*/
#include <osgDB/ReaderWriter>
#ifdef _MSC_VER
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
#include <osg/Types>
struct KTXTexHeader
{

View File

@ -2,15 +2,9 @@
#define OSG2_BINARYSTREAMOPERATOR
#include <osgDB/StreamOperator>
#include <osg/Types>
#include <vector>
#if defined(_MSC_VER)
typedef unsigned __int32 uint32_t;
typedef __int32 int32_t;
#else
#include <stdint.h>
#endif
class BinaryOutputIterator : public osgDB::OutputIterator
{

View File

@ -19,20 +19,7 @@
#include <stdlib.h>
#include <string.h>
#if defined(_MSC_VER)
typedef UINT64 uint64_t;
typedef INT64 int64_t;
typedef UINT32 uint32_t;
typedef INT32 int32_t;
typedef UINT16 uint16_t;
typedef UINT8 uint8_t;
#else
#if defined __sun || defined __hpux
#include <inttypes.h>
#else
#include <stdint.h>
#endif
#endif
#include <osg/Types>
using namespace osg;