Commit 9484fcc3 authored by sletz's avatar sletz
Browse files

Compiles on Windows again

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2458 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 0ed0c4d9
......@@ -40,11 +40,31 @@ struct AtomicArrayCounter
UInt32 fLongVal;
}info;
AtomicArrayCounter()
{
info.fLongVal = 0;
}
AtomicArrayCounter(volatile const AtomicArrayCounter& obj)
{
info.fLongVal = obj.info.fLongVal;
}
AtomicArrayCounter(volatile AtomicArrayCounter& obj)
{
info.fLongVal = obj.info.fLongVal;
}
AtomicArrayCounter& operator=(volatile AtomicArrayCounter& obj)
{
info.fLongVal = obj.info.fLongVal;
return *this;
}
AtomicArrayCounter& operator=(AtomicArrayCounter& obj)
{
info.fLongVal = obj.info.fLongVal;
return *this;
}
};
#define Counter1(e) (e).info.fLongVal
......
......@@ -29,9 +29,16 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
namespace Jack
{
unsigned int JackShmMem::fSegmentNum = 0;
jack_shm_info_t JackShmMem::gInfo;
static unsigned int fSegmentNum;
static jack_shm_info_t gInfo;
size_t JackMem::gSize = 0;
JackShmMem::JackShmMem()
{
fInfo.index = gInfo.index;
fInfo.attached_at = gInfo.attached_at;
fInfo.size = gInfo.size;
}
void* JackShmMem::operator new(size_t size, void* memory)
{
......@@ -45,7 +52,7 @@ void* JackShmMem::operator new(size_t size)
JackShmMem* obj;
char name[64];
snprintf(name, sizeof(name), "/jack_shared%d", JackShmMem::fSegmentNum++);
snprintf(name, sizeof(name), "/jack_shared%d", fSegmentNum++);
if (jack_shmalloc(name, size, &info)) {
jack_error("cannot create shared memory segment of size = %d", size, strerror(errno));
......
......@@ -23,6 +23,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "shm.h"
#include "JackError.h"
#include "JackExports.h"
#include <new> // GCC 4.0
#include <errno.h>
......@@ -46,8 +47,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
namespace Jack
{
void LockMemoryImp(void* ptr, size_t size);
void UnlockMemoryImp(void* ptr, size_t size);
EXPORT void LockMemoryImp(void* ptr, size_t size);
EXPORT void UnlockMemoryImp(void* ptr, size_t size);
class JackMem
{
......@@ -93,28 +94,28 @@ class JackMem
A class which objects need to be allocated in shared memory derives from this class.
*/
class JackShmMem
class EXPORT JackShmMem
{
protected:
jack_shm_info_t fInfo;
static unsigned int fSegmentNum;
static jack_shm_info_t gInfo;
public:
void* operator new(size_t size);
void* operator new(size_t size, void* memory);
void operator delete(void* p, size_t size);
void operator delete(void* p);
void operator delete(void* p);
JackShmMem()
JackShmMem();
/*
{
fInfo.index = gInfo.index;
fInfo.attached_at = gInfo.attached_at;
fInfo.size = gInfo.size;
}
*/
virtual ~JackShmMem()
{}
......
......@@ -88,7 +88,7 @@ We have:
*/
class JackTransportEngine : public JackAtomicArrayState<jack_position_t>
class EXPORT JackTransportEngine : public JackAtomicArrayState<jack_position_t>
{
private:
......
......@@ -578,7 +578,7 @@ int main (int argc, char *argv[])
signal1[0] = 0;
int p;
for (p = 1; p < 48000;p++) {
signal1[p] = (sin((p * 2 * M_PI * 1000 ) / 48000));
signal1[p] = (float)(sin((p * 2 * M_PI * 1000 ) / 48000));
}
for (p = 0; p < 95999;p++) {
signal2[p] = 0.0 ;
......@@ -1930,5 +1930,5 @@ int main (int argc, char *argv[])
fprintf(file, "set label \"| buf.siz:%i | fr.wl:%i | rg.ports:%i | 2nd.client:%i | trsprt:%i |\" at graph 0.01, 0.04\n", linebuf, linefw, lineports, linecl2, linetransport);
fprintf(file, "plot 'framefile-%i.dat' using 2 with impulses title \"Xruns\",'framefile-%i.dat' using 1 with line title \"Sampletime variation at %i\"\n", cur_buffer_size, cur_buffer_size, cur_buffer_size);
fclose(file);
exit(0);
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment