Revert "metadata: Make JACK_METADATA_* constant"
[jack2.git] / windows / JackSystemDeps_os.h
blobd30c9401b0ee95330d53b921988f26475047143c
1 /*
2 Copyright (C) 2004-2008 Grame
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.
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.
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.
21 #ifndef __JackSystemDeps_WIN32__
22 #define __JackSystemDeps_WIN32__
24 #ifdef __MINGW32__
25 #include <winsock2.h>
26 #endif
27 #include <windows.h>
28 #include "JackCompilerDeps.h"
30 #ifndef PATH_MAX
31 #define PATH_MAX 512
32 #endif
34 #ifndef UINT32_MAX
35 #define UINT32_MAX 4294967295U
36 #endif
38 #define DRIVER_HANDLE HINSTANCE
39 #define LoadDriverModule(name) LoadLibraryW((name))
40 #define UnloadDriverModule(handle) (FreeLibrary(((HMODULE)handle)))
41 #define GetDriverProc(handle, name) GetProcAddress(((HMODULE)handle), (name))
43 #define JACK_HANDLE HINSTANCE
44 #define LoadJackModule(name) LoadLibrary((name));
45 #define UnloadJackModule(handle) FreeLibrary((handle));
46 #define GetJackProc(handle, name) GetProcAddress((handle), (name));
48 #ifndef ENOBUFS
49 #define ENOBUFS 55
50 #endif
52 #ifdef _DEBUG
53 #define JACK_DEBUG true
54 #else
55 #define JACK_DEBUG false
56 #endif
58 inline int setenv(const char* name, const char* value, int overwrite)
60 if (overwrite == 0 && getenv(name) != NULL) {
61 return 0;
63 return _putenv_s(name, value);
66 inline int unsetenv(const char* name)
68 return _putenv_s(name, "");
71 #endif