[svn:PHP-Sandwich] rev 1054 - PHP-Sandwich/trunk

[email protected] 19 May 2005 03:11:42 -0000
Newsgroups perl.php.sandwich.dev
Message-ID <[email protected]>
Author: gschlossnagle
Date: Wed May 18 20:11:41 2005
New Revision: 1054

Modified:
   PHP-Sandwich/trunk/phpfuncs.c
Log:
make this compile without a threaded perl


Modified: PHP-Sandwich/trunk/phpfuncs.c
==============================================================================
--- PHP-Sandwich/trunk/phpfuncs.c	(original)
+++ PHP-Sandwich/trunk/phpfuncs.c	Wed May 18 20:11:41 2005
@@ -37,7 +37,9 @@ sandwich_dim_read(zval *obj, zval *offse
   pTHX;
 
   pl = zend_object_store_get_object(obj TSRMLS_CC);
+#ifdef USE_ITHREADS
   aTHX = pl->perl;
+#endif
   value = NULL;
   
   if (Z_TYPE_P(offset) != IS_STRING) {
@@ -98,7 +100,9 @@ PHP_METHOD(perl, getvariable)
   }
   
   pl = zend_object_store_get_object(getThis() TSRMLS_CC);
+#ifdef USE_ITHREADS
   aTHX = pl->perl;
+#endif
   var = NULL;
   
   switch (name[0]) {
@@ -143,7 +147,9 @@ PHP_METHOD(perl, setvariable)
   }
   
   pl = zend_object_store_get_object(getThis() TSRMLS_CC);
+#ifdef USE_ITHREADS
   aTHX = pl->perl;
+#endif
   var = NULL;
   
   switch (name[0]) {
@@ -183,7 +189,9 @@ static int _sandwich_call_method(char *m
   pTHX;
 
   pl = zend_object_store_get_object(getThis() TSRMLS_CC);
+#ifdef USE_ITHREADS
   aTHX = pl->perl;
+#endif
   {
     dSP;
   
@@ -195,8 +203,9 @@ static int _sandwich_call_method(char *m
     }
     
     pl = zend_object_store_get_object(getThis() TSRMLS_CC);
+#ifdef USE_ITHREADS
     aTHX = pl->perl;
-  
+#endif  
     ENTER;
     SAVETMPS;
     PUSHMARK(SP);
@@ -336,7 +345,9 @@ PHP_METHOD(perl, eval)
     return;
   }
   pl = zend_object_store_get_object(getThis() TSRMLS_CC);
+#ifdef USE_ITHREADS
   aTHX = pl->perl;
+#endif
   if((rv = sandwich_perl_eval(aTHX_ func)) == NULL)  { 
     fprintf(stderr, "eval returned null\n"); 
   } else {
@@ -389,7 +400,9 @@ plobj_new(zend_class_entry *ce TSRMLS_DC
   ALLOC_HASHTABLE(pl->zo.properties);
   zend_hash_init(pl->zo.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
 
+#ifdef USE_ITHREADS
   pl->perl = aTHX;
+#endif
 
   return pl;
 }