Linux with #ifdef

This commit is contained in:
Ricardo Quesada 2014-01-30 17:10:18 -08:00
parent 7da8c84a75
commit 5691829b72
12 changed files with 61 additions and 3 deletions

View File

@ -1 +1 @@
be9f283a24f020011a1dedfd59ddd6e01da16e3d
caae58ff83f2655d5ea4c19e00a2be17259f8559

View File

@ -23,6 +23,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include "CCApplication.h"
#include <unistd.h>
#include <sys/time.h>
@ -213,3 +216,6 @@ LanguageType Application::getCurrentLanguage()
}
NS_CC_END
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX

View File

@ -26,6 +26,9 @@ THE SOFTWARE.
#ifndef CCAPLICATION_H_
#define CCAPLICATION_H_
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include "platform/CCCommon.h"
#include "platform/CCApplicationProtocol.h"
#include <string>
@ -94,4 +97,6 @@ protected:
NS_CC_END
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#endif /* CCAPLICATION_H_ */

View File

@ -22,6 +22,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include "platform/CCCommon.h"
#include "CCStdC.h"
#include "CCConsole.h"
@ -39,3 +43,5 @@ void LuaLog(const char * format)
}
NS_CC_END
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX

View File

@ -22,6 +22,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include "platform/CCDevice.h"
#include <X11/Xlib.h>
#include <stdio.h>
@ -64,3 +68,5 @@ void Device::setAccelerometerInterval(float interval)
}
NS_CC_END
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX

View File

@ -22,6 +22,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include "CCFileUtilsLinux.h"
#include "platform/CCCommon.h"
#include "ccMacros.h"
@ -114,3 +118,5 @@ bool FileUtilsLinux::isFileExist(const std::string& strFilePath) const
}
NS_CC_END
#endif CC_TARGET_PLATFORM == CC_PLATFORM_LINUX

View File

@ -25,6 +25,9 @@ THE SOFTWARE.
#ifndef __CC_FILEUTILS_LINUX_H__
#define __CC_FILEUTILS_LINUX_H__
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include "platform/CCFileUtils.h"
#include "CCPlatformMacros.h"
#include "ccTypes.h"
@ -56,5 +59,6 @@ public:
NS_CC_END
#endif // __CC_FILEUTILS_LINUX_H__
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#endif // __CC_FILEUTILS_LINUX_H__

View File

@ -25,8 +25,13 @@ THE SOFTWARE.
#ifndef __CCGL_H__
#define __CCGL_H__
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include "GL/glew.h"
#define CC_GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#endif // __CCGL_H__

View File

@ -22,6 +22,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include <string.h>
#include <algorithm>
@ -486,3 +490,5 @@ bool Image::initWithString(
}
NS_CC_END
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX

View File

@ -22,9 +22,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __CCPLATFORMDEFINE_H__
#define __CCPLATFORMDEFINE_H__
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include <string.h>
#if defined(_USRDLL)
@ -47,5 +51,6 @@ THE SOFTWARE.
#endif
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#endif /* __CCPLATFORMDEFINE_H__*/

View File

@ -23,6 +23,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include "CCStdC.h"
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
@ -65,5 +68,6 @@ int CC_DLL gettimeofday(struct timeval * val, struct timezone *)
return 0;
}
#endif // CC_PLATFORM_WIN32
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX

View File

@ -26,6 +26,9 @@ THE SOFTWARE.
#ifndef __CC_STD_C_H__
#define __CC_STD_C_H__
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#include "CCPlatformMacros.h"
#include <float.h>
@ -52,4 +55,6 @@ THE SOFTWARE.
#define cosf cos
#define sinf sin
#endif // CC_TARGET_PLATFORM == CC_PLATFORM_LINUX
#endif // __CC_STD_C_H__