[PD-cvs] externals/clr clr.cpp,1.13,1.14 makefile,1.2,1.3

Thomas Grill xovo at users.sourceforge.net
Thu Mar 9 18:27:39 CET 2006


Update of /cvsroot/pure-data/externals/clr
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3296/clr

Modified Files:
	clr.cpp makefile 
Log Message:
fixes for mono object passing

Index: makefile
===================================================================
RCS file: /cvsroot/pure-data/externals/clr/makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** makefile	12 Jan 2006 11:59:58 -0000	1.2
--- makefile	9 Mar 2006 17:27:37 -0000	1.3
***************
*** 12,31 ****
  # leave it blank if it is a system directory (like /usr/local/include), 
  # 	since gcc 3.2 complains about it
- PDPATH=/home/Davide
  
! LINUXCFLAGS = -DPD -O2 -mno-cygwin
! #LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer \
! #    -Wall -W -Wshadow -Wstrict-prototypes -Werror \
! #    -Wno-unused -Wno-parentheses -Wno-switch
  
! LINUXINCLUDE =  -I../../src -I$PDPATH
  
! MONOSRC = -IC:/cygwin/tmp/build_deps/include -IC:/cygwin/tmp/build_deps/include/glib-2.0 -IC:/cygwin/tmp/build_deps/lib/glib-2.0/include -IC:/cygwin/home/Davide/mono/include 
! MONOLIB = -LC:/cygwin/tmp/build_deps/lib -LC:/cygwin/home/Davide/mono/lib -lmono -lm -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl -liconv 
  
! .c.dll:
! #	gcc $(LINUXCFLAGS) $(LINUXINCLUDE) `pkg-config --cflags --libs mono` -lm -ID:/Davide/cygwin/home/Davide/mono/include -LD:/Davide/cygwin/home/Davide/mono/lib $*.c
! 	gcc $(LINUXCFLAGS) $(LINUXINCLUDE) $(MONOSRC) -o $*.o -c $*.c
! 	gcc -export_dynamic  -shared -mno-cygwin $(MONOLIB) -o $*.dll $*.o -lm pd.dll libmono.dll.a
  #	ld -export_dynamic $(MONOLIB) -o $*.dll $*.o -lm pd.dll
  #	strip --strip-unneeded $*.pd_linux
--- 12,31 ----
  # leave it blank if it is a system directory (like /usr/local/include), 
  # 	since gcc 3.2 complains about it
  
! PDPATH=/cygdrive/c/data/pd/pd-cvs
! MONOPATH=/cygdrive/c/programme/prog/mono
! 
! 
! CFLAGS = -DPD -O2 -mno-cygwin
  
! PDINC= -I$(PDPATH)/src
! PDLIB= $(PDPATH)/bin/pd.dll
  
! MONOINC = -I$(MONOPATH)/include -I$(MONOPATH)/include/glib-2.0 -I$(MONOPATH)/lib/glib-2.0/include
! MONOLIB = -L$(MONOPATH)/lib -lmono.dll -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl -liconv
  
! .cpp.dll:
! 	g++ $(CFLAGS) $(PDINC) $(MONOINC) -o $*.o -c $*.cpp
! 	g++ -export_dynamic  -shared -mno-cygwin $(PDLIB) $(MONOLIB) -o $*.dll $*.o -lm
  #	ld -export_dynamic $(MONOLIB) -o $*.dll $*.o -lm pd.dll
  #	strip --strip-unneeded $*.pd_linux

Index: clr.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/clr/clr.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** clr.cpp	9 Mar 2006 14:34:33 -0000	1.13
--- clr.cpp	9 Mar 2006 17:27:37 -0000	1.14
***************
*** 328,350 ****
              break;
          case Delegate::k_float: 
!             if(argc == 0 || argv[0].a_type != A_FLOAT) { 
                  error("%s - %s handler: float argument expected",x->clr_clss->name->s_name,s->s_name); 
                  return; 
              }
-             exc = (*d)(x->mono_obj,argv[0].a_w.w_float); 
              break;
          case Delegate::k_symbol:
!             if(argc == 0 || argv[0].a_type != A_SYMBOL) { 
                  error("%s - %s handler: symbol argument expected",x->clr_clss->name->s_name,s->s_name); 
                  return; 
              }
-             exc = (*d)(x->mono_obj,argv[0].a_w.w_symbol); 
              break;
          case Delegate::k_pointer:
!             if(argc == 0 || argv[0].a_type != A_POINTER) { 
                  error("%s - %s handler: pointer argument expected",x->clr_clss->name->s_name,s->s_name); 
                  return; 
              }
-             exc = (*d)(x->mono_obj,argv[0].a_w.w_gpointer); 
              break;
          case Delegate::k_list:
--- 328,353 ----
              break;
          case Delegate::k_float: 
!             if((argc == 1 || (argc >= 1 && s == &s_list)) && argv[0].a_type == A_FLOAT)
!                 exc = (*d)(x->mono_obj,argv[0].a_w.w_float); 
!             else {
                  error("%s - %s handler: float argument expected",x->clr_clss->name->s_name,s->s_name); 
                  return; 
              }
              break;
          case Delegate::k_symbol:
!             if((argc == 1 || (argc >= 1 && s == &s_list)) && argv[0].a_type == A_SYMBOL)
!                 exc = (*d)(x->mono_obj,argv[0].a_w.w_symbol); 
!             else {
                  error("%s - %s handler: symbol argument expected",x->clr_clss->name->s_name,s->s_name); 
                  return; 
              }
              break;
          case Delegate::k_pointer:
!             if((argc == 1 || (argc >= 1 && s == &s_list)) && argv[0].a_type == A_POINTER)
!                 exc = (*d)(x->mono_obj,argv[0].a_w.w_gpointer); 
!             else {
                  error("%s - %s handler: pointer argument expected",x->clr_clss->name->s_name,s->s_name); 
                  return; 
              }
              break;
          case Delegate::k_list:
***************
*** 687,691 ****
      ClrMap::iterator it = clr_map.find(classname);
      if(it == clr_map.end()) {
!         error("CLR class %s not found",classname->s_name);
          return NULL;
      }
--- 690,694 ----
      ClrMap::iterator it = clr_map.find(classname);
      if(it == clr_map.end()) {
!         error("CLR - class %s not found",classname->s_name);
          return NULL;
      }
***************
*** 698,702 ****
      if(!x->mono_obj) {
          pd_free((t_pd *)x);
!         error("CLR class %s could not be instantiated",classname->s_name);
          return NULL;
      }
--- 701,705 ----
      if(!x->mono_obj) {
          pd_free((t_pd *)x);
!         error("CLR - class %s could not be instantiated",classname->s_name);
          return NULL;
      }
***************
*** 801,806 ****
      assert(clr_class->obj_field);
  
!     // find static Main method
! 
      MonoMethodDesc *clr_desc_main = mono_method_desc_new("::Setup",FALSE);
      assert(clr_desc_main);
--- 804,808 ----
      assert(clr_class->obj_field);
  
!     // find static Setup method
      MonoMethodDesc *clr_desc_main = mono_method_desc_new("::Setup",FALSE);
      assert(clr_desc_main);
***************
*** 820,824 ****
          clr_setup_class = clr_class;
  
!         // call static Main method
  	    gpointer args = obj;
          MonoObject *exc;
--- 822,826 ----
          clr_setup_class = clr_class;
  
!         // call static Setup method
  	    gpointer args = obj;
          MonoObject *exc;





More information about the Pd-cvs mailing list