Browse Source

Better control of exported symbols : windows adaptation in progress

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2457 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.90
sletz 17 years ago
parent
commit
0ed0c4d91e
5 changed files with 72 additions and 26 deletions
  1. +21
    -2
      common/JackAtomicState.h
  2. +12
    -12
      common/JackExports.h
  3. +37
    -11
      common/JackGlobals.cpp
  4. +1
    -1
      common/JackMutex.h
  5. +1
    -0
      windows/JackWinNamedPipeClientChannel.cpp

+ 21
- 2
common/JackAtomicState.h View File

@@ -41,14 +41,33 @@ struct AtomicCounter
UInt32 fLongVal;
}info;

AtomicCounter& operator=(volatile AtomicCounter& obj)
AtomicCounter()
{
info.fLongVal = 0;
}

AtomicCounter(volatile const AtomicCounter& obj)
{
info.fLongVal = obj.info.fLongVal;
}
AtomicCounter(volatile AtomicCounter& obj)
{
info.fLongVal = obj.info.fLongVal;
}

AtomicCounter& operator=(AtomicCounter& obj)
{
info.fLongVal = obj.info.fLongVal;
return *this;
}

};
AtomicCounter& operator=(volatile AtomicCounter& obj)
{
info.fLongVal = obj.info.fLongVal;
return *this;
}

};

#define Counter(e) (e).info.fLongVal
#define CurIndex(e) (e).info.scounter.fShortVal1


+ 12
- 12
common/JackExports.h View File

@@ -2,18 +2,18 @@
Copyright (C) 2004-2005 Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/



+ 37
- 11
common/JackGlobals.cpp View File

@@ -29,7 +29,15 @@ static bool g_key_log_function_initialized = false;
jack_tls_key gRealTime;
jack_tls_key g_key_log_function;

__attribute__ ((constructor))
// Initialisation at library load time

#ifdef WIN32

#ifdef __cplusplus
extern "C"
{
#endif

static void jack_init()
{
if (!gKeyRealtimeInitialized) {
@@ -40,7 +48,6 @@ static void jack_init()
g_key_log_function_initialized = jack_tls_allocate_key(&g_key_log_function);
}

__attribute__ ((destructor))
static void jack_uninit()
{
if (gKeyRealtimeInitialized) {
@@ -54,15 +61,6 @@ static void jack_uninit()
}
}

// Initialisation at library load time

#ifdef WIN32

#ifdef __cplusplus
extern "C"
{
#endif

BOOL WINAPI DllEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
switch (fdwReason) {
@@ -80,4 +78,32 @@ BOOL WINAPI DllEntryPoint(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserv
}
#endif

#else

__attribute__ ((constructor))
static void jack_init()
{
if (!gKeyRealtimeInitialized) {
gKeyRealtimeInitialized = jack_tls_allocate_key(&gRealTime);
}
if (!g_key_log_function_initialized)
g_key_log_function_initialized = jack_tls_allocate_key(&g_key_log_function);
}
__attribute__ ((destructor))
static void jack_uninit()
{
if (gKeyRealtimeInitialized) {
jack_tls_free_key(gRealTime);
gKeyRealtimeInitialized = false;
}
if (g_key_log_function_initialized) {
jack_tls_free_key(g_key_log_function);
g_key_log_function_initialized = false;
}
}



#endif

+ 1
- 1
common/JackMutex.h View File

@@ -52,7 +52,7 @@ class JackMutex
JackMutex()
{
// In recursive mode by default
fMutex = CreateMutex(0, FALSE, 0);
fMutex = (HANDLE)CreateMutex(0, FALSE, 0);
}
~JackMutex()
{


+ 1
- 0
windows/JackWinNamedPipeClientChannel.cpp View File

@@ -25,6 +25,7 @@ Copyright (C) 2004-2006 Grame
#include "JackRequest.h"
#include "JackClient.h"
#include "JackGlobals.h"
#include "JackError.h"

namespace Jack
{


Loading…
Cancel
Save