-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTypes.h
26 lines (20 loc) · 827 Bytes
/
Types.h
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
//----------------------------------------------------------------------------------------------------------------------
// Variable type support, size and limits
// Copyright (c) 2024 Samuel Gomes
//----------------------------------------------------------------------------------------------------------------------
#pragma once
#include <cstdint>
// QB64 false is 0 and true is -1 (sad, but true XD)
typedef int8_t qb_bool;
#ifndef INC_COMMON_CPP
#define QB_TRUE -1
#define QB_FALSE 0
#endif
#define TO_QB_BOOL(expression) (qb_bool(-(bool(expression))))
/// @brief Casts a QB64 _OFFSET to a C string. QB64 does the right thing to convert this to a QB64 string
/// @param p A pointer (_OFFSET)
/// @return A C string (char ptr)
inline const char *CString(uintptr_t p)
{
return reinterpret_cast<const char *>(p);
}