From ac4fe4a3da623f9ec1dbb36079da0a8282388176 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Sun, 8 Aug 2004 13:09:02 +0000 Subject: *** empty log message *** svn path=/trunk/externals/k_cext/; revision=1918 --- Makefile | 8 ++++---- k_cext.c | 2 ++ k_cext.h | 32 ++++++++++++++++++++------------ k_cext_win.c | 8 ++++---- 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 1bd0727..2f31278 100644 --- a/Makefile +++ b/Makefile @@ -11,14 +11,14 @@ pd_nt: $(NAME).dll .SUFFIXES: .dll -PDNTCFLAGS = /W3 /WX /DNT /DPD /nologo /DINCLUDEPATH=\"c:\\programme\\audio\\pd\" +PDNTCFLAGS = /W3 /DNT /DPD /nologo /DINCLUDEPATH=\"D:\\sourcescvs\\pd\" -PDNTINCLUDE = /I. /Ic:\programme\audio\pd\src -PDNTLIB = libc.lib oldnames.lib kernel32.lib c:\programme\audio\pd\bin\pd.lib +PDNTINCLUDE = /I. /ID:\sourcescvs\pd\src +PDNTLIB = libc.lib oldnames.lib kernel32.lib "C:\Pure Data\bin\pd.lib" .c.dll: - cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c k_cext_win.c cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c + cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c k_cext_win.c link /dll /export:$(CSYM)_setup $*.obj k_cext_win.obj $(PDNTLIB) # ----------------------- IRIX 5.x ----------------------- diff --git a/k_cext.c b/k_cext.c index 4333aee..8ea9acf 100644 --- a/k_cext.c +++ b/k_cext.c @@ -22,6 +22,8 @@ #include "m_pd.h" #include "k_cext.h" +#include + static char *version = "k_cext v0.3.0, written by Kjetil S. Matheussen, k.s.matheussen@notam02.no\n" "Windows-port by Olaf Matthes."; diff --git a/k_cext.h b/k_cext.h index 147f905..e374952 100644 --- a/k_cext.h +++ b/k_cext.h @@ -17,12 +17,11 @@ * */ - #include #include #include #include -#include +//#include #ifdef _MSC_VER typedef int bool; #define true 1 @@ -33,6 +32,12 @@ typedef int bool; #include +#ifdef MSW +#define K_EXTERN __declspec(dllexport) extern +#else +#define K_EXTERN extern +#endif + typedef struct k_cext { t_object x_ob; @@ -56,22 +61,25 @@ typedef struct k_cext /* The following functions are used by intsort and floatsort */ -extern int k_cext_intcompare(const void *p1, const void *p2); -extern int k_cext_floatcompare(const void *p1, const void *p2); +K_EXTERN int k_cext_intcompare(const void *p1, const void *p2); +K_EXTERN int k_cext_floatcompare(const void *p1, const void *p2); /* The following functions are system dependant, and called internally from k_cext only. All ports must implement these functions. */ -extern int k_sys_getprocessfunction(t_k_cext *x,char *funcname,char *name); -extern void k_sys_freehandle(t_k_cext *x); -extern void k_sys_mktempfilename(char *to); -extern void k_sys_writeincludes(FILE *file); -extern void k_sys_makecompilestring(char *to,char *name,char *funcname); -extern void k_sys_deletefile(char *name); -extern void k_sys_init(void); +K_EXTERN int k_sys_getprocessfunction(t_k_cext *x,char *funcname,char *name); +K_EXTERN void k_sys_freehandle(t_k_cext *x); +K_EXTERN void k_sys_mktempfilename(char *to); +K_EXTERN void k_sys_writeincludes(FILE *file); +K_EXTERN void k_sys_makecompilestring(char *to,char *name,char *funcname); +K_EXTERN void k_sys_deletefile(char *name); +K_EXTERN void k_sys_init(void); +/* TB value accessing functions*/ +K_EXTERN t_float k_cext_getvalue(char c[]); +K_EXTERN int k_cext_setvalue(char c[],float f); #define V(a) (x->values[a]) @@ -108,7 +116,7 @@ do{ \ /* TB: values and bang outlets */ #define Ob(a) outlet_bang(x->outlets[a]); -t_float k_cext_getvalue(char c[]); +float k_cext_getvalue(char c[]); int k_cext_setvalue(char c[],float f); #define VALUE(char) k_cext_getvalue(char) #define SETVALUE(char,float) k_cext_setvalue(char,float) diff --git a/k_cext_win.c b/k_cext_win.c index 7f2330d..f48a8ff 100644 --- a/k_cext_win.c +++ b/k_cext_win.c @@ -80,13 +80,13 @@ void k_sys_mktempfilename(char *to){ fclose(file); } -void k_sys_writeincludes(FILE *file){ - fprintf(file,"#include \"" INCLUDEPATH "\\src\\m_pd.h\"\n"); - fprintf(file,"#include \"" INCLUDEPATH "\\src\\k_cext.h\"\n"); /* needs to be in pd/src, sorry.. */ +void k_sys_writeincludes(FILE *file){ + fprintf(file,"#include \"" INCLUDEPATH "\\src\\m_pd.h\"\n"); + fprintf(file,"#include \"" INCLUDEPATH "\\src\\k_cext.h\"\n"); /* needs to be in pd/src, sorry.. */ } void k_sys_makecompilestring(char *to,char *name,char *funcname){ - sprintf(to,"cl %s " INCLUDEPATH "\\bin\\pd.lib /LD /Gd /GD /Ox /DNT /link /export:%s", + sprintf(to,"cl %s " INCLUDEPATH "\\bin\\pd.lib " INCLUDEPATH "\\bin\\k_cext.lib /LD /Gd /GD /Ox /DNT /link /export:%s", name, funcname); } -- cgit v1.2.1