Loading...
Searching...
No Matches
mjs_internal.h
1/*
2 * Copyright (c) 2016 Cesanta Software Limited
3 * All rights reserved
4 */
5
6#ifndef MJS_INTERNAL_H_
7#define MJS_INTERNAL_H_
8
9#include <assert.h>
10#include <ctype.h>
11#include <math.h>
12#include <stdarg.h>
13#include <stdio.h>
14#include <string.h>
15
16#ifndef FAST
17#define FAST
18#endif
19
20#ifndef STATIC
21#define STATIC
22#endif
23
24#ifndef ENDL
25#define ENDL "\n"
26#endif
27
28#ifndef MJS_EXPOSE_PRIVATE
29#define MJS_EXPOSE_PRIVATE 1
30#endif
31
32#if MJS_EXPOSE_PRIVATE
33#define MJS_PRIVATE
34#else
35#define MJS_PRIVATE static
36#endif
37
38#ifndef ARRAY_SIZE
39#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
40#endif
41
42#if !defined(WEAK)
43#if(defined(__GNUC__) || defined(__TI_COMPILER_VERSION__)) && !defined(_WIN32)
44#define WEAK __attribute__((weak))
45#else
46#define WEAK
47#endif
48#endif
49
50#ifndef CS_ENABLE_STDIO
51#define CS_ENABLE_STDIO 1
52#endif
53
54#include "common/cs_dbg.h"
55#include "common/cs_file.h"
56#include "common/mbuf.h"
57
58#if defined(_WIN32) && _MSC_VER < 1700
59typedef signed char int8_t;
60typedef unsigned char uint8_t;
61typedef int int32_t;
62typedef unsigned int uint32_t;
63typedef short int16_t;
64typedef unsigned short uint16_t;
65typedef __int64 int64_t;
66typedef unsigned long uintptr_t;
67#define STRX(x) #x
68#define STR(x) STRX(x)
69#define __func__ __FILE__ ":" STR(__LINE__)
70// #define snprintf _snprintf
71#define vsnprintf _vsnprintf
72#define isnan(x) _isnan(x)
73#define va_copy(x, y) (x) = (y)
74#define CS_DEFINE_DIRENT
75#include <windows.h>
76#else
77#if defined(__unix__) || defined(__APPLE__)
78#include <dlfcn.h>
79#endif
80#endif
81
82/*
83 * Number of bytes reserved for the jump offset initially. The most practical
84 * value is 1, but for testing it's useful to set it to 0 and to some large
85 * value as well (like, 4), to make sure that the code behaves correctly under
86 * all circumstances.
87 */
88#ifndef MJS_INIT_OFFSET_SIZE
89#define MJS_INIT_OFFSET_SIZE 1
90#endif
91
92#endif /* MJS_INTERNAL_H_ */
Furi string container.