Menu

[b84aab]: / src / platform / common / utils.h  Maximize  Restore  History

Download this file

75 lines (61 with data), 1.8 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
// This file is part of SmallBASIC
//
// Copyright(C) 2001-2013 Chris Warren-Smith.
//
// This program is distributed under the terms of the GPL v2.0 or later
// Download the GNU Public License (GPL) from www.gnu.org
//
#ifndef UTILS_H
#define UTILS_H
typedef unsigned char U8;
typedef unsigned short U16;
typedef signed short S16;
typedef unsigned long U32;
typedef signed long S32;
#ifndef MAX
#define MAX(a,b) ((a<b) ? (b) : (a))
#endif
#ifndef MIN
#define MIN(a,b) ((a>b) ? (b) : (a))
#endif
#if defined(_FLTK)
#define DEFAULT_FOREGROUND 0
#define DEFAULT_BACKGROUND 0xecedef
#define HANDLE_SCREEN_BUFFER HANDLE_SCREEN + 1
#else
#define DEFAULT_FOREGROUND 0xa1a1a1
#define DEFAULT_BACKGROUND 0
#define HANDLE_SCREEN_BUFFER HANDLE_SCREEN
#endif
#define USER_MESSAGE_EXIT 1000
#define OUTSIDE_RECT(px, py, x, y, w, h) \
(px < (x) || py < (y) || px > ((x)+(w)) || py > ((y)+(h)))
#if defined(VARIANT_MOSYNC_EMULATOR)
#define _DEBUG
#endif
#if defined(MAPIP)
#include <mavsprintf.h>
#define deviceLog lprintfln
#elif defined(_FLTK)
extern "C" void trace(const char *format, ...);
#define deviceLog trace
#elif defined (_TIZEN)
#include <FBaseLog.h>
#define deviceLog AppLog
#elif defined (_ANDROID)
#include <android/log.h>
#define deviceLog(...) __android_log_print(ANDROID_LOG_INFO, \
"smallbasic", __VA_ARGS__)
#endif
#if defined(_DEBUG)
#define trace(...) deviceLog(__VA_ARGS__)
#else
#define trace(...)
#endif
#define logEntered() trace("%s entered (%s %d)", \
__FUNCTION__, __FILE__, __LINE__);
#define logLeaving() trace("%s leaving (%s %d)", \
__FUNCTION__, __FILE__, __LINE__);
#define C_LINKAGE_BEGIN extern "C" {
#define C_LINKAGE_END }
#endif
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.