# Patch created by krokas
# Date: Sat Sep 16 16:56:03 MSD 2006
# Repository: libjit
# Comments:
# 
#### End of Preamble ####

#### Patch data follows ####
Index: jit/jit-insn.c
===================================================================
RCS file: /sources/dotgnu-pnet/./libjit/jit/jit-insn.c,v
retrieving revision 1.50
diff -c -r1.50 jit-insn.c
*** jit/jit-insn.c	15 Sep 2006 16:17:21 -0000	1.50
--- jit/jit-insn.c	16 Sep 2006 12:55:22 -0000
***************
*** 6852,6863 ****
  					{
  						return 0;
  					}
! 
  					/* Output a regular return for the function */
  					if(!create_noarg_note(func, JIT_OP_RETURN))
  					{
  						return 0;
  					}
  				}
  				else
  				{
--- 6852,6870 ----
  					{
  						return 0;
  					}
! #if defined(linux)
! 					/* Output the pointer to the structure to EAX */
! 					if(!create_unary_note(func, JIT_OP_RETURN_INT, value_addr))
! 					{
! 						return 0;
! 					}
! #elif
  					/* Output a regular return for the function */
  					if(!create_noarg_note(func, JIT_OP_RETURN))
  					{
  						return 0;
  					}
+ 
  				}
  				else
  				{
***************
*** 6875,6880 ****
--- 6882,6888 ----
  					{
  						break;
  					}
+ #endif
  				}
  			}
  			break;
***************
*** 6953,6959 ****
  				{
  					return 0;
  				}
! 
  				/* Output a regular return for the function */
  				if(!create_noarg_note(func, JIT_OP_RETURN))
  				{
--- 6961,6973 ----
  				{
  					return 0;
  				}
! #if defined(linux)
! 				/* Output the pointer to the structure to EAX */
! 				if(!create_unary_note(func, JIT_OP_RETURN_INT, value))
! 				{
! 					return 0;
! 				}
! #elif
  				/* Output a regular return for the function */
  				if(!create_noarg_note(func, JIT_OP_RETURN))
  				{
***************
*** 6971,6976 ****
--- 6985,6991 ----
  				{
  					break;
  				}
+ #endif
  			}
  		}
  		break;
Index: jit/jit-rules-x86.c
===================================================================
RCS file: /sources/dotgnu-pnet/./libjit/jit/jit-rules-x86.c,v
retrieving revision 1.40
diff -c -r1.40 jit-rules-x86.c
*** jit/jit-rules-x86.c	14 Sep 2006 06:27:08 -0000	1.40
--- jit/jit-rules-x86.c	16 Sep 2006 12:55:24 -0000
***************
*** 147,165 ****
  	}
  
  	/* Bail out now if we don't need to worry about return values */
  	if(!return_value || ptr_return)
  	{
  		return 1;
  	}
! 
  	/* Structure values must be flushed into the frame, and
  	   everything else ends up in a register */
  	if(jit_type_is_struct(return_type) || jit_type_is_union(return_type))
  	{
  		if(!jit_insn_flush_struct(func, return_value))
  		{
  			return 0;
  		}
  	}
  	else if(return_type == jit_type_float32 ||
  			return_type == jit_type_float64 ||
--- 147,173 ----
  	}
  
  	/* Bail out now if we don't need to worry about return values */
+ #if defined(linux)
+ 	if(!return_value)
+ 	{
+ 		return 1;
+ 	}
+ #elif
  	if(!return_value || ptr_return)
  	{
  		return 1;
  	}
! #endif
  	/* Structure values must be flushed into the frame, and
  	   everything else ends up in a register */
  	if(jit_type_is_struct(return_type) || jit_type_is_union(return_type))
  	{
+ #if !defined(linux)
  		if(!jit_insn_flush_struct(func, return_value))
  		{
  			return 0;
  		}
+ #endif
  	}
  	else if(return_type == jit_type_float32 ||
  			return_type == jit_type_float64 ||
Index: jit/jit-type.c
===================================================================
RCS file: /sources/dotgnu-pnet/./libjit/jit/jit-type.c,v
retrieving revision 1.7
diff -c -r1.7 jit-type.c
*** jit/jit-type.c	12 May 2004 03:00:17 -0000	1.7
--- jit/jit-type.c	16 Sep 2006 12:55:25 -0000
***************
*** 1581,1587 ****
  	{
  		return 0;
  	}
! 
  	/* Determine if the structure can be returned in a register */
  	size = jit_type_get_size(type);
  	if(size >= 1 && size <= 64)
--- 1581,1587 ----
  	{
  		return 0;
  	}
! #if !defined(linux)
  	/* Determine if the structure can be returned in a register */
  	size = jit_type_get_size(type);
  	if(size >= 1 && size <= 64)
***************
*** 1592,1597 ****
--- 1592,1598 ----
  			return 0;
  		}
  	}
+ #endif
  	return 1;
  }
  
#### End of Patch data ####
