Moo
mooplatform.h
Go to the documentation of this file.
1 
4 
5 #ifndef __mooplatform__
6 #define __mooplatform__
7 
9 #if defined (_WIN32)
10 # include <Windows.h>
11 # ifndef WINDOWS
12 # define WINDOWS 1
13 # endif
14 #endif
15 
17 #if defined (__APPLE__)
18 # include "TargetConditionals.h"
19 # if TARGET_OS_IPHONE
20 # if !TARGET_OS_TV
21 # ifndef MAC_iOS
22 # define MAC_iOS 1
23 # endif
24 # endif
25 # else
26 # ifndef MAC_OS
27 # define MAC_OS 1
28 # endif
29 # endif
30 #endif
31 
35 typedef unsigned short mooChar;
36 
40 #if WINDOWS
41 typedef __int64 mooInt;
42 #else
43 typedef long long mooInt;
44 #endif
45 
49 #if WINDOWS
50 typedef unsigned __int64 mooUInt;
51 #else
52 typedef unsigned long long mooUInt;
53 #endif
54 
58 typedef double mooDouble;
59 
63 typedef bool mooBool;
64 
67 inline mooInt mooStrLen (const mooChar* wcs)
68 {
69  const mooChar* eos = wcs;
70  while (*eos++);
71  return (mooInt)(eos - wcs - 1);
72 }
73 
77 enum
78 {
79  MOO_OK = 0,
80  MOO_INVALID_STRING = -10000, // invalid const mooChar*
81  MOO_INVALID_PARAMETER = -10001,
82  MOO_NOT_LOGGED_IN = -10002
83 };
84 
85 //-----------------------------------------------------------------------------
88 #if defined (__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
89 # define MOO_EXPORT __attribute__ ((visibility ("default")))
90 #else
91 # define MOO_EXPORT __declspec (dllexport)
92 #endif
93 
94 #endif
unsigned short mooChar
Definition: mooplatform.h:35
mooInt mooStrLen(const mooChar *wcs)
Definition: mooplatform.h:67
__int64 mooInt
All signed ints are 64 bit wide.
Definition: mooplatform.h:41
unsigned __int64 mooUInt
All unsigned ints are 64 bit wide.
Definition: mooplatform.h:50
bool mooBool
just a bool
Definition: mooplatform.h:63
double mooDouble
just a double
Definition: mooplatform.h:58