summaryrefslogtreecommitdiff
path: root/src/common/common.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/common/common.h120
1 files changed, 0 insertions, 120 deletions
diff --git a/src/common/common.h b/src/common/common.h
deleted file mode 100644
index f7d0f55c5..000000000
--- a/src/common/common.h
+++ /dev/null
@@ -1,120 +0,0 @@
1// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7// DO NOT EVER INCLUDE <windows.h> directly _or indirectly_ from this file
8// since it slows down the build a lot.
9
10#include <cstdlib>
11#include <cstdio>
12#include <cstring>
13
14#define STACKALIGN
15
16// An inheritable class to disallow the copy constructor and operator= functions
17class NonCopyable
18{
19protected:
20 NonCopyable() {}
21 NonCopyable(const NonCopyable&&) {}
22 void operator=(const NonCopyable&&) {}
23private:
24 NonCopyable(NonCopyable&);
25 NonCopyable& operator=(NonCopyable& other);
26};
27
28#include "common/assert.h"
29#include "common/logging/log.h"
30#include "common/common_types.h"
31#include "common/common_funcs.h"
32#include "common/common_paths.h"
33#include "common/platform.h"
34
35#ifdef __APPLE__
36// The Darwin ABI requires that stack frames be aligned to 16-byte boundaries.
37// This is only needed on i386 gcc - x86_64 already aligns to 16 bytes.
38 #if defined __i386__ && defined __GNUC__
39 #undef STACKALIGN
40 #define STACKALIGN __attribute__((__force_align_arg_pointer__))
41 #endif
42#elif defined _WIN32
43// Check MSC ver
44 #if defined _MSC_VER && _MSC_VER <= 1000
45 #error needs at least version 1000 of MSC
46 #endif
47
48 #ifndef NOMINMAX
49 #define NOMINMAX
50 #endif
51
52// Alignment
53 #define MEMORY_ALIGNED16(x) __declspec(align(16)) x
54 #define MEMORY_ALIGNED32(x) __declspec(align(32)) x
55 #define MEMORY_ALIGNED64(x) __declspec(align(64)) x
56 #define MEMORY_ALIGNED128(x) __declspec(align(128)) x
57 #define MEMORY_ALIGNED16_DECL(x) __declspec(align(16)) x
58 #define MEMORY_ALIGNED64_DECL(x) __declspec(align(64)) x
59#endif
60
61// Windows compatibility
62#ifndef _WIN32
63 #ifdef _LP64
64 #define _M_X64 1
65 #else
66 #define _M_IX86 1
67 #endif
68 #define __forceinline inline __attribute__((always_inline))
69 #define MEMORY_ALIGNED16(x) __attribute__((aligned(16))) x
70 #define MEMORY_ALIGNED32(x) __attribute__((aligned(32))) x
71 #define MEMORY_ALIGNED64(x) __attribute__((aligned(64))) x
72 #define MEMORY_ALIGNED128(x) __attribute__((aligned(128))) x
73 #define MEMORY_ALIGNED16_DECL(x) __attribute__((aligned(16))) x
74 #define MEMORY_ALIGNED64_DECL(x) __attribute__((aligned(64))) x
75#endif
76
77#ifdef _MSC_VER
78 #define __strdup _strdup
79 #define __getcwd _getcwd
80 #define __chdir _chdir
81#else
82 #define __strdup strdup
83 #define __getcwd getcwd
84 #define __chdir chdir
85#endif
86
87#if defined _M_GENERIC
88# define _M_SSE 0x0
89#elif defined __GNUC__
90# if defined __SSE4_2__
91# define _M_SSE 0x402
92# elif defined __SSE4_1__
93# define _M_SSE 0x401
94# elif defined __SSSE3__
95# define _M_SSE 0x301
96# elif defined __SSE3__
97# define _M_SSE 0x300
98# endif
99#elif (_MSC_VER >= 1500) || __INTEL_COMPILER // Visual Studio 2008
100# define _M_SSE 0x402
101#endif
102
103// Host communication.
104enum HOST_COMM
105{
106 // Begin at 10 in case there is already messages with wParam = 0, 1, 2 and so on
107 WM_USER_STOP = 10,
108 WM_USER_CREATE,
109 WM_USER_SETCURSOR,
110};
111
112// Used for notification on emulation state
113enum EMUSTATE_CHANGE
114{
115 EMUSTATE_CHANGE_PLAY = 1,
116 EMUSTATE_CHANGE_PAUSE,
117 EMUSTATE_CHANGE_STOP
118};
119
120#include "swap.h"