目标:(八十三)中的问题166
主要是设置不同的操作系统上,系统函数从哪里找
#ifdef WIN32
# include <windows.h>
#else
# include <stdio.h>
# include <stdlib.h>
#endif
#include <sys/types.h>
#ifdef WIN32
# include <sys/utime.h>
#else
# include <utime.h>
#endif
#include <sys/stat.h>
#include <time.h>
#include <list>
#include <sstream>
// currently this impl is for _all_ platforms, except as defined.
// the mac version will change soon to reflect the path scheme under osx, but
// for now, the above include is commented out, and the below code takes precedence.
#if defined(WIN32) && !defined(__CYGWIN__)
#include <io.h>
#define WINBASE_DECLARE_GET_MODULE_HANDLE_EX
#include <windows.h>
#include <winbase.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <direct.h> // for _mkdir
#define mkdir(x,y) _mkdir((x))
#define stat64 _stati64
// set up for windows so acts just like unix access().
#ifndef F_OK
#define F_OK 4
#endif
#else // unix
#if defined( __APPLE__ )
// I'm not sure how we would handle this in raw Darwin
// without the AvailablilityMacros.
#include <AvailabilityMacros.h>
//>OSG_IOS
//IOS includes
#include "TargetConditionals.h"
#if (TARGET_OS_IPHONE)
#include <Availability.h>
// workaround a bug which appears when compiling for SDK < 4.0 and for the simulator
#if defined(__IPHONE_4_0) && (__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_4_0)
#define stat64 stat
#else
#if !TARGET_IPHONE_SIMULATOR
#define stat64 stat
#endif
#endif
#endif
//<OSG_IPHONE
// 10.5 defines stat64 so we can't use this #define
// By default, MAC_OS_X_VERSION_MAX_ALLOWED is set to the latest
// system the headers know about. So I will use this as the control
// variable. (MIN_ALLOWED is set low by default so it is
// unhelpful in this case.)
// Unfortunately, we can't use the label MAC_OS_X_VERSION_10_4
// for older OS's like Jaguar, Panther since they are not defined,
/

本文深入探讨osgEarth的Rex引擎在不同操作系统下如何进行头文件包含的设置,解决跨平台兼容性问题,以确保系统函数正确引用。
osgEarth跨平台的头文件包含设置&spm=1001.2101.3001.5002&articleId=105425046&d=1&t=3&u=a4de214e242b4321b77c8868b620d6f4)
1502

被折叠的 条评论
为什么被折叠?



