[go: up one dir, main page]

Menu

[904618]: / src / ccstub.h  Maximize  Restore  History

Download this file

138 lines (113 with data), 4.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
// ----------------------------------------------------------------------------
// :oCCCCOCoc.
// .cCO8OOOOOOOOO8Oo:
// .oOO8OOOOOOOOOOOOOOOCc
// cO8888: .:oOOOOC. TM
// :888888: :CCCc .oOOOOC. ### ### #########
// C888888: .ooo: .C######## ##### ##### ###### ###### ##########
// O888888: .oO### ### ##### ##### ######## ######## #### ###
// C888888: :8O. .C########## ### #### ### ## ## ## ## #### ###
// :8@@@@8: :888c o### ### #### ### ######## ######## ##########
// :8@@@@C C@@@@ oo######## ### ## ### ###### ###### #########
// cO@@@@@@@@@@@@@@@@@Oc0
// :oO8@@@@@@@@@@Oo.
// .oCOOOOOCc. http://remood.org/
// ----------------------------------------------------------------------------
// Copyright (C) 2012-2013 GhostlyDeath <ghostlydeath@remood.org>
// <ghostlydeath@gmail.com>
// ----------------------------------------------------------------------------
// This program 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.
//
// This program 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.
// ----------------------------------------------------------------------------
// DESCRIPTION: C Compiling Stubs
#ifndef __CCSTUB_H__
#define __CCSTUB_H__
#if defined(__REMOOD_USECCSTUB)
/*****************************************************************************/
/***************
*** INCLUDES ***
***************/
#include "doomtype.h"
/* Palm OS Hacks */
#if defined(__REMOOD_SYSTEM_PALMOS)
// Prevent Palm OS's fixed point routines from taking shape
#define __FIXEDMATH_H__
// Standard Includes
#include <NetMgr.h> // Networking
#include <VFSMgr.h> // File Handling
#include <unix_stdarg.h> // va_list
#include <StringMgr.h> // Strings
#endif
/*******************
*** DEFINE HACKS ***
*******************/
/* Palm OS Hacks */
#if defined(__REMOOD_SYSTEM_PALMOS)
// Map VFS File to C one
typedef FileRef FILE;
// Missing Types
typedef __PTRDIFF_TYPE__ ptrdiff_t;
// Max int
#ifndef INT_MAX
#define INT_MAX __INT_MAX__
#endif
// Min int
#ifndef INT_MIN
#define INT_MIN 0x80000000L
#endif
// Max Short
#ifndef SHRT_MAX
#define SHRT_MAX __SHRT_MAX__
#endif
// Char bits
#ifndef CHAR_BIT
#define CHAR_BIT __CHAR_BIT__
#endif
// offsetof() macro goes by different name
#ifndef offsetof
#define offsetof(t,m) OffsetOf(t,m)
#endif
// File Handling
#define SEEK_SET vfsOriginBeginning
#define SEEK_END vfsOriginEnd
#define SEEK_CUR vfsOriginCurrent
#define R_OK vfsFileAttrReadOnly
#define W_OK vfsFileAttrReadOnly // All files are writeable mostly
// Functions that can just be defined away
#define strcasecmp StrCaselessCompare
#define strncasecmp StrNCaselessCompare
#define strcmp StrCompare
#define strncmp StrNCompare
#define memmove MemMove
#define memcpy MemMove
#define memcmp MemCmp
#define malloc MemPtrNew
#define atoi StrAToI
#define memset(s,c,n) MemSet((s), (n), (c))
#define strlen StrLen
#define strcat StrCat
#define strncat StrNCat
#define strncpy StrNCopy
#define strcpy StrCopy
//#define isalnum TxtCharIsAlNum
//#define isspace TxtCharIsSpace
//#define isdigit TxtCharIsDigit
//#define isxdigit TxtCharIsHex
#define strchr StrChr
#endif
/*****************
*** PROTOTYPES ***
*****************/
int mkdir(const char* const a_PathName);
int socket(int domain, int type, int protocol);
/*****************************************************************************/
#endif /* __REMOOD_USECCSTUB */
#endif /* __CCSTUB_H__ */