aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flprefix.h
blob: 973a69669b238b471b23e452717eb557cb18153d (plain)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/* 

flext - C++ layer for Max/MSP and pd (pure data) externals

Copyright (c) 2001,2002 Thomas Grill (xovo@gmx.net)
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "license.txt," in this distribution.  

*/

/*! \file flprefix.h
    \brief Try to find out the platform.
*/
 
#ifndef __FLEXT_PREFIX_H
#define __FLEXT_PREFIX_H

// definitions for FLEXT_SYS
#define FLEXT_SYS_UNKNOWN	0
#define FLEXT_SYS_MAX	1
#define FLEXT_SYS_PD	2

// definitions for FLEXT_OS
#define FLEXT_OS_UNKNOWN	0
#define FLEXT_OS_WIN	1
#define FLEXT_OS_MACOS9	2
#define FLEXT_OS_MACOSX	3
#define FLEXT_OS_LINUX	4
#define FLEXT_OS_IRIX	5

// definitions for FLEXT_CPU
#define FLEXT_CPU_UNKNOWN	0
#define FLEXT_CPU_INTEL 1
#define FLEXT_CPU_PPC 	2
#define FLEXT_CPU_MIPS	3


// Old definitions
#if defined(MAXMSP)
	#define FLEXT_SYS FLEXT_SYS_MAX
	#undef MAXMSP
#elif defined(PD)
	#define FLEXT_SYS FLEXT_SYS_PD
	#undef PD
	#undef NT
#endif

// Definition of supported real-time systems
#if FLEXT_SYS == FLEXT_SYS_MAX
#elif FLEXT_SYS == FLEXT_SYS_PD
	#define PD
#else
	#error "System must be defined by either FLEXT_SYS_MAX or FLEXT_SYS_PD"
#endif

// Definition of OS/CPU
#if defined(_MSC_VER)
	// Microsoft C++
	
#elif defined(__MWERKS__)
	// Metrowerks CodeWarrior

	#if defined(__INTEL__)
		#define FLEXT_CPU FLEXT_CPU_INTEL
	#elif defined(__POWERPC__)
		#define FLEXT_CPU FLEXT_CPU_PPC
	#elif defined(__MIPS__)
		#define FLEXT_CPU FLEXT_CPU_MIPS
	#elif defined(__POWERPC__)
		#define FLEXT_CPU FLEXT_CPU_UNKNOWN
	#endif

#elif defined(__GNUG__)
	// GNU C++

#endif


#if FLEXT_OS == FLEXT_OS_WIN
	#if FLEXT_SYS == FLEXT_SYS_MAX
		#define WIN_VERSION 1
	#elif FLEXT_SYS == FLEXT_SYS_PD
		#define NT
	#endif
#elif FLEXT_OS == FLEXT_OS_LINUX
	#if FLEXT_SYS == FLEXT_SYS_MAX
		#error "Flext SYS/OS combination unknown"
	#endif
#elif FLEXT_OS == FLEXT_OS_IRIX
	#if FLEXT_SYS == FLEXT_SYS_MAX
		#error "Flext SYS/OS combination unknown"
	#endif
#elif FLEXT_OS == FLEXT_OS_MACOS9
	#if FLEXT_SYS == FLEXT_SYS_PD
		#error "Flext SYS/OS combination unknown"
	#endif
#elif FLEXT_OS == FLEXT_OS_MACOSX
#else
	#error "Operating system could not be determined"
#endif


#endif