Update of /cvsroot/pure-data/externals/grill/flext/source
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6289/source
Modified Files:
flcontainers.h flmap.h flstdc.h
Log Message:
better c++ compliance
fixes for MinGW
fixes for older compilers
added X86-64 code for lockfree fifos
Index: flmap.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flmap.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** flmap.h 1 May 2005 03:12:05 -0000 1.19
--- flmap.h 10 May 2005 10:56:47 -0000 1.20
***************
*** 179,182 ****
--- 179,187 ----
void _getsmall(Data &dt);
void _getbig(Data &dt);
+
+ private:
+ // hide, so that it can't be used.....
+ explicit TableAnyMap(const TableAnyMap &): data(NULL) {}
+ TableAnyMap &operator =(const TableAnyMap &) { return *this; }
};
***************
*** 241,244 ****
--- 246,252 ----
int count;
Data slots[N];
+
+ private:
+ explicit TablePtrMap(const TableAnyMap &p) {}
};
Index: flstdc.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flstdc.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** flstdc.h 31 Mar 2005 03:52:38 -0000 1.34
--- flstdc.h 10 May 2005 10:56:47 -0000 1.35
***************
*** 27,35 ****
#endif
! #ifdef FLEXT_DEBUG
! #if FLEXT_OS == FLEXT_OS_WIN
#include <crtdbg.h>
#endif
- #endif
// PD stuff
--- 27,33 ----
#endif
! #ifdef _MSC_VER
#include <crtdbg.h>
#endif
// PD stuff
***************
*** 232,236 ****
/* If FLEXT_LOGGING is defined implement logging */
! #if FLEXT_OS == FLEXT_OS_WIN
#define FLEXT_LOG(s) _CrtDbgReport(_CRT_WARN,__FILE__,__LINE__,"flext",s)
#define FLEXT_LOG1(s,v1) _CrtDbgReport(_CRT_WARN,__FILE__,__LINE__,"flext",s,v1)
--- 230,234 ----
/* If FLEXT_LOGGING is defined implement logging */
! #ifdef _MSC_VER
#define FLEXT_LOG(s) _CrtDbgReport(_CRT_WARN,__FILE__,__LINE__,"flext",s)
#define FLEXT_LOG1(s,v1) _CrtDbgReport(_CRT_WARN,__FILE__,__LINE__,"flext",s,v1)
***************
*** 273,277 ****
#ifdef FLEXT_DEBUG
! #if FLEXT_OS == FLEXT_OS_WIN
#define FLEXT_ASSERT(b) (!(b)?_CrtDbgReport(_CRT_ASSERT,__FILE__,__LINE__,"flext",#b):1)
#define FLEXT_WARN(str) _CrtDbgReport(_CRT_WARN,__FILE__,__LINE__,"flext",NULL)
--- 271,275 ----
#ifdef FLEXT_DEBUG
! #ifdef _MSC_VER
#define FLEXT_ASSERT(b) (!(b)?_CrtDbgReport(_CRT_ASSERT,__FILE__,__LINE__,"flext",#b):1)
#define FLEXT_WARN(str) _CrtDbgReport(_CRT_WARN,__FILE__,__LINE__,"flext",NULL)
Index: flcontainers.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flcontainers.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** flcontainers.h 12 Mar 2005 04:56:34 -0000 1.5
--- flcontainers.h 10 May 2005 10:56:47 -0000 1.6
***************
*** 181,187 ****
return n;
}
! #elif defined(__GNUC__) && FLEXT_CPU == FLEXT_CPU_X64_64
! #error x86-64 architecture not supported yet
#elif defined(__GNUC__) && FLEXT_CPU == FLEXT_CPU_PPC
--- 181,249 ----
return n;
}
! #elif defined(__GNUC__) && FLEXT_CPU == FLEXT_CPU_X86_64
! /* attention - this only works for EMT64 or newer revisions of AMD 64-bit cpus */
! inline void Push(Cell *cl)
! {
! __asm__ __volatile__ (
! "# LFPUSH \n\t"
! "push %%rbx \n\t"
! "push %%rcx \n\t"
! "mov 0(%%rsi), %%rax \n\t"
! "mov 8(%%rsi), %%rdx \n"
! "1: \t"
! "mov %%rax, %%rbx \n\t"
! "inc %%rbx \n\t"
! "mov %%rdx, (%%rcx) \n\t"
! SMPLOCK "cmpxchg16b (%%rsi) \n\t"
! "jnz 1b \n\t"
! "pop %%rcx \n\t"
! "pop %%rbx \n\t"
! :/* no output */
! :"S" (this), "c" (cl)
! :"memory", "rax", "rdx");
! }
!
! inline Cell *Pop()
! {
! Cell *v=0;
! __asm__ __volatile__ (
! "# LFPOP \n\t"
! "push %%rbx \n\t"
! "push %%rcx \n\t"
! "mov 8(%%rsi), %%rdx \n\t"
! "mov (%%rsi), %%rax \n\t"
! "test %%rax, %%rax \n\t"
! "jz 20f \n"
! "10: \t"
! "mov (%%rax), %%rbx \n\t"
! "mov %%rdx, %%rcx \n\t"
! "inc %%rcx \n\t"
! SMPLOCK "cmpxchg16b (%%rsi) \n\t"
! "jz 20f \n\t"
! "test %%rax, %%rax \n\t"
! "jnz 10b \n"
! "20: \t"
! "pop %%rcx \n\t"
! "pop %%rbx \n\t"
! :"=a" (v)
! :"S" (&this->top)
! :"memory", "rdx");
! return v;
! }
!
! inline size_t Size() const
! {
! size_t n;
! __asm__ __volatile__ (
! "# LFSIZE \n\t"
! "mov 16(%%rsi), %%rdx \n\t"
! "mov (%%rsi), %%rax \n\t"
! "sub %%rdx, %%rax \n\t"
! :"=a" (n)
! :"S" (this)
! :"memory", "rdx");
! return n;
! }
#elif defined(__GNUC__) && FLEXT_CPU == FLEXT_CPU_PPC