Jack2  1.9.8
windows/JackCompilerDeps_os.h
1 /*
2  Copyright (C) 2004-2008 Grame
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU Lesser General Public License as published by
6  the Free Software Foundation; either version 2.1 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 
18  */
19 
20 
21 #ifndef __JackCompilerDeps_WIN32__
22 #define __JackCompilerDeps_WIN32__
23 
24 #if __GNUC__
25  #define PRE_PACKED_STRUCTURE
26 
27  #ifndef POST_PACKED_STRUCTURE
28  /* POST_PACKED_STRUCTURE needs to be a macro which
29  expands into a compiler directive. The directive must
30  tell the compiler to arrange the preceding structure
31  declaration so that it is packed on byte-boundaries rather
32  than use the natural alignment of the processor and/or
33  compiler.
34  */
35  #if (__GNUC__< 4) /* Does not seem to work with GCC 3.XX serie */
36  #define POST_PACKED_STRUCTURE
37  #elif defined(JACK_32_64)
38  #define POST_PACKED_STRUCTURE __attribute__((__packed__))
39  #else
40  #define POST_PACKED_STRUCTURE
41  #endif
42  #endif
43  #define MEM_ALIGN(x,y) x __attribute__((aligned(y)))
44  #define LIB_EXPORT __declspec(dllexport)
45  #ifdef SERVER_SIDE
46  #define SERVER_EXPORT __declspec(dllexport)
47  #else
48  #define SERVER_EXPORT
49  #endif
50 #else
51  #define MEM_ALIGN(x,y) x
52  #define LIB_EXPORT __declspec(dllexport)
53  #ifdef SERVER_SIDE
54  #define SERVER_EXPORT __declspec(dllexport)
55  #else
56  #define SERVER_EXPORT
57  #endif
58 
59  #ifdef _MSC_VER
60  #if defined(JACK_32_64)
61  #define PRE_PACKED_STRUCTURE1 __pragma(pack(push,1))
62  #define PRE_PACKED_STRUCTURE PRE_PACKED_STRUCTURE1
63  /* PRE_PACKED_STRUCTURE needs to be a macro which
64  expands into a compiler directive. The directive must
65  tell the compiler to arrange the following structure
66  declaration so that it is packed on byte-boundaries rather
67  than use the natural alignment of the processor and/or
68  compiler.
69  */
70  #define POST_PACKED_STRUCTURE ;__pragma(pack(pop))
71  /* and POST_PACKED_STRUCTURE needs to be a macro which
72  restores the packing to its previous setting */
73  #else
74  #define PRE_PACKED_STRUCTURE
75  #define POST_PACKED_STRUCTURE
76  #endif
77  #else
78  /* Other Windows compilers to go here */
79  #define PRE_PACKED_STRUCTURE
80  #define POST_PACKED_STRUCTURE
81  #endif
82 #endif
83 
84 #endif