[Mono-winforms-list] help needed on gdiplus error on app startup...

2010-03-22 Thread KFD

My first attempt on porting a .net 3.5 app to mono...

MoMA says no porting issues, so I attempt to run using new install of mono
2.6.3...

and get the following (snipped for brevity)...

System.ArgumentException: A null reference or invalid value was found [GDI+
stat
us: InvalidParameter]
  at System.Drawing.GDIPlus.CheckStatus (Status status) [0x0009d] in
C:\cygwin\t
mp\monobuild\build\BUILD\mono-2.6.3\mcs\class\System.Drawing\System.Drawing\gdip
Functions.cs:219
  at System.Drawing.Bitmap..ctor (Int32 width, Int32 height, PixelFormat
format)
 [0x00017] in
C:\cygwin\tmp\monobuild\build\BUILD\mono-2.6.3\mcs\class\System.Dr
awing\System.Drawing\Bitmap.cs:97
  at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor
(int,int,S
ystem.Drawing.Imaging.PixelFormat)
...


For some reason, the build path seems to be under my Cygwin directory, but
when I look under c:\cygwin\tmp, there is nothing there, so I cant check out
the source where the exception is occurring...

Anyone have insight into this error, and/or where the missing source files
have disappeared to?

It looks like mono GDI+ dll hasnt been loaded/initialized yet?... 
-- 
View this message in context: 
http://n4.nabble.com/help-needed-on-gdiplus-error-on-app-startup-tp1678296p1678296.html
Sent from the Mono - WinForms mailing list archive at Nabble.com.
___
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list


[Mono-winforms-list] TreeView.TreeViewNodeSorter seem to have no effect

2010-03-22 Thread Latif Khalifa
Hi,

I'm trying to cure a few last quirks an an application I'm porting
from windows. The problem I'm having is that setting
TreeView.TreeViewNodeSorter seem to have no effect. The nodes gets
sorted alphabetically and Compare() in my IComparer class never gets
called. Any ideas?

Also TreeView seem to be missing [+] and [-] images next to the nodes
that can be expanded and collapsed.

Latif
___
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list


Re: [Mono-winforms-list] help needed on gdiplus error on app startup...

2010-03-22 Thread Sebastien Pouliot
On Mon, 2010-03-22 at 13:15 -0800, KFD wrote:
 My first attempt on porting a .net 3.5 app to mono...
 
 MoMA says no porting issues, so I attempt to run using new install of mono
 2.6.3...
 
 and get the following (snipped for brevity)...
 
 System.ArgumentException: A null reference or invalid value was found [GDI+
 stat
 us: InvalidParameter]
   at System.Drawing.GDIPlus.CheckStatus (Status status) [0x0009d] in
 C:\cygwin\t
 mp\monobuild\build\BUILD\mono-2.6.3\mcs\class\System.Drawing\System.Drawing\gdip
 Functions.cs:219
   at System.Drawing.Bitmap..ctor (Int32 width, Int32 height, PixelFormat
 format)
  [0x00017] in
 C:\cygwin\tmp\monobuild\build\BUILD\mono-2.6.3\mcs\class\System.Dr
 awing\System.Drawing\Bitmap.cs:97
   at (wrapper remoting-invoke-with-check) System.Drawing.Bitmap:.ctor
 (int,int,S
 ystem.Drawing.Imaging.PixelFormat)
 ...
 
 
 For some reason, the build path seems to be under my Cygwin directory, but
 when I look under c:\cygwin\tmp, there is nothing there, so I cant check out
 the source where the exception is occurring...
 
 Anyone have insight into this error, and/or where the missing source files
 have disappeared to?

The file names/paths are stored in the debugging symbols - which are
created at compilation time. If you installed the binaries only then the
file simply don't exists on your system.

 It looks like mono GDI+ dll hasnt been loaded/initialized yet?... 

Possible but unlikely as the exception would have occurred earlier
(there are calls to GDI+ before that). Sadly GDI+ does not report much
details on failure so you have a bit of testing to do.

Try adding some output on the console about the parameters (width,
height and format). My guess one of them is not valid (e.g. 0).

Sebastien

___
Mono-winforms-list maillist  -  Mono-winforms-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-winforms-list


Re: [Mono-dev] Patch for ilasm (ldc.i4 opt)

2010-03-22 Thread Thierry Lafage
Hi Rodrigo,

I don't have an svn account, but I'll soon stop working on our gcc4cli 
project so I think, for the moment, it is not worth I have one (my 
successor may ask for one, when we've found him/her).
I simply would like to add this patch (+ another concerning local 
variable accesses), would you mind commiting it please?

Regards,

Thierry Lafage.



Rodrigo Kumpera a écrit :
 Patch looks good, do you have a SVN  account?


 On Wed, Mar 17, 2010 at 2:22 PM, Thierry Lafage 
 thierry.laf...@inria.fr mailto:thierry.laf...@inria.fr wrote:

 Hi all,

 Here is a small patch for ilasm which makes it replace ldc.i4 with
 short forms when possible.
 Note that I'm a C# and monodevelop newbie (but I tried to respect
 the coding guidelines).
 I suggest to add the -opt:ldc because I would like to add the
 same kind of optimization for ldloc/stloc (use short forms when
 possible). For this latter one, the command line option could be
 -opt:loc (and we could add -opt:all to enable both at once).
 I think the impact of such a patch is quite limited, but it's
 important for us (the gcc4cli team) since we rely on ilasm to
 assemble the CIL code produced by our compiler. And these
 optimizations tasks are better suited to the assembler than to
 the compiler itself.

 Regards,
 Thierry Lafage.


 Index: ilasm/Driver.cs
 ===
 --- ilasm/Driver.cs (revision 153715)
 +++ ilasm/Driver.cs (working copy)
 @@ -20,6 +20,8 @@

 public class Driver {

 +   internal static bool opt_ldc = false;
 +
 enum Target {
 Dll,
 Exe
 @@ -270,6 +272,10 @@
else
keyname =
 command_arg;
break;
 +case opt:
 +   if (ldc ==
 command_arg)
 +  
 Driver.opt_ldc = true;
 +   break;
 case scan_only:
 scan_only = true;
 break;
 @@ -344,6 +350,7 @@
/exe  
 Compile to executable.\n +
/dll  
 Compile to library.\n +
/debug
 Include debug information.\n +
 +   /opt:ldc  
 Optimize ldc instructions (use shorter forms when possible).\n +
   /key:keyfile  
 Strongname using the specified key file\n +
   /key:@container  
  Strongname using the specified key container\n +
 Options can be of the
 form -option or /option\n);
 Index: ilasm/codegen/IntInstr.cs
 ===
 --- ilasm/codegen/IntInstr.cs   (revision 153715)
 +++ ilasm/codegen/IntInstr.cs   (working copy)
 @@ -27,9 +27,35 @@
 public override void Emit (CodeGen code_gen,
 MethodDef meth,
   PEAPI.CILInstructions cil)
 {
 -cil.IntInst (op, operand);
 -}
 +   if (Driver.opt_ldc  op ==
 PEAPI.IntOp.ldc_i4) {
 +   if (operand = -1  operand = 8)
 +   cil.Inst (getOptLdcOp
 (operand));
 +   else if (operand = -128 
 operand = 127)
 +   cil.IntInst
 (PEAPI.IntOp.ldc_i4_s,
 +   operand);
 +   else
 +   cil.IntInst (op, operand);
 +   } else
 +   cil.IntInst (op, operand);
 +   }

 +   private PEAPI.Op getOptLdcOp (int operand)
 +   {
 +   switch (operand) {
 +   case -1: return PEAPI.Op.ldc_i4_m1;
 +   case 0:  return PEAPI.Op.ldc_i4_0;
 +   case 1:  return PEAPI.Op.ldc_i4_1;
 +   case 2:  return PEAPI.Op.ldc_i4_2;
 +   case 3:  return PEAPI.Op.ldc_i4_3;
 +   

[Mono-dev] Embedding Scenario with MonoReflectionType

2010-03-22 Thread Laurent Etiemble
Hello,

I am working on embedding Mono and I am stuck with the following issue: I
would like to get a MonoClass or a MonoType instance from
a MonoReflectionType instance.

So, imagine I have an internal call with the following signature:

[MethodImplAttribute(MethodImplOptions.InternalCall)]
public static extern String GetName(Type type);

Then, the implementation should look like:

MonoString *ves_icall_XXX_ GetName(MonoReflectionType *type) {
MonoType *theType = mono_XXX(type); // -- Don't seem to exist in the
embedding API
// xor
MonoClass *theClass = mono_YYY(type); // -- Don't seem to exist in the
embedding API

const char *name = mono_type_get_name(theType);
// xor
const char *name = mono_class_get_name(theClass);

return mono_string_new(mono_domain_get(), name);
}

I have taken a look to the Marshal internal calls, but they access directly
the MonoReflectionType structure.

Is there any public API to get a MonoClass or a MonoType instance from
a MonoReflectionType instance ?

Regards, Laurent Etiemble.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Embedding Scenario with MonoReflectionType

2010-03-22 Thread Robert Jordan
On 22.03.2010 09:38, Laurent Etiemble wrote:
 Hello,

 I am working on embedding Mono and I am stuck with the following issue: I
 would like to get a MonoClass or a MonoType instance from
 a MonoReflectionType instance.

 So, imagine I have an internal call with the following signature:


There is no way to the a MonoType* from a MonoReflectionType*
than getting it from Type.TypeHandle.Value.

Here is a solution for your problem:


[MethodImplAttribute(MethodImplOptions.InternalCall)]
public static extern String GetName(IntPtr typeHandle);

public static String GetName(Type type)
{
 return GetName (type.TypeHandle.Value);
}


 Then, the implementation should look like:

 MonoString *ves_icall_XXX_ GetName(MonoReflectionType *type) {


MonoString *ves_icall_XXX_ GetName(MonoType *type)
{
...
}


Robert

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Embedding Scenario with MonoReflectionType

2010-03-22 Thread Laurent Etiemble
Hello,

Thanks, this is all I need.

Regards, Laurent Etiemble.

2010/3/22 Robert Jordan robe...@gmx.net

 On 22.03.2010 09:38, Laurent Etiemble wrote:
  Hello,
 
  I am working on embedding Mono and I am stuck with the following issue: I
  would like to get a MonoClass or a MonoType instance from
  a MonoReflectionType instance.
 
  So, imagine I have an internal call with the following signature:
 

 There is no way to the a MonoType* from a MonoReflectionType*
 than getting it from Type.TypeHandle.Value.

 Here is a solution for your problem:


 [MethodImplAttribute(MethodImplOptions.InternalCall)]
 public static extern String GetName(IntPtr typeHandle);

 public static String GetName(Type type)
 {
 return GetName (type.TypeHandle.Value);
 }

 
  Then, the implementation should look like:
 
  MonoString *ves_icall_XXX_ GetName(MonoReflectionType *type) {


 MonoString *ves_icall_XXX_ GetName(MonoType *type)
 {
 ...
 }


 Robert

 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [RFC] Handle lack of SA_SIGINFO

2010-03-22 Thread Paolo Molaro
On 03/22/10 Andreas Färber wrote:
 SA_SIGINFO and sigaction are part of the optional POSIX XSI feature.
 In mini, there's MONO_ARCH_USE_SIGACTION but it doesn't cover everything
[...]
 +#ifdef SA_SIGINFO
 + if (save_sigcont.sa_flags  SA_SIGINFO) {
   if (save_sigcont.sa_sigaction != NULL 
   save_sigcont.sa_sigaction != (void *)SIG_DFL 
   save_sigcont.sa_sigaction != (void *)SIG_IGN)
   (*save_sigcont.sa_sigaction) (signo, the_siginfo, data);
 + } else
 +#else
 + if (save_sigcont.sa_handler != NULL 
 + save_sigcont.sa_handler != (void *)SIG_DFL 
 + save_sigcont.sa_handler != (void *)SIG_IGN)
 + (*save_sigcont.sa_handler) (signo);
 +#endif
  }

These kind of changes are quite ugly. Please introduce a cpp macro
that handles this stuff, so that the code doesn't become a forest of
#ifdefs.
Something like:
#define INVOKE_SIGHANDLER_IF_VALID (siga,signo,sinfo,data)  do {\
if (((siga)-sa_flags  SA_SIGINFO)  (siga)-sa_sigaction != NULL  
...) \
(siga)-sa_sigaction ((signo), (sinfo), (data));\
} while (0)
and the equialent for the non-SA_SIGINFO case.

lupus

-- 
-
lu...@debian.org debian/rules
lu...@ximian.com Monkeys do it better
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Improve System.Net.WebClient's CreateUri(Uri address) query string handling

2010-03-22 Thread Jon Herron
My apologies, I thought from the mdsn documentation it always appened the 
QueryString from WebClient - testing it on windows this morning does confirm 
your statement.  Thanks again for the fix.

Jon

--- On Mon, 3/22/10, Gonzalo Paniagua Javier gonzalo.m...@gmail.com wrote:

 From: Gonzalo Paniagua Javier gonzalo.m...@gmail.com
 Subject: Re: [Mono-dev] [PATCH] Improve System.Net.WebClient's CreateUri(Uri 
 address) query string handling
 To: Jon Herron jon.her...@yahoo.com
 Cc: mono-devel-list@lists.ximian.com
 Date: Monday, March 22, 2010, 5:31 AM
 On Sun, 2010-03-21 at 21:34 -0700,
 Jon Herron wrote:
  Thanks for the commit, there still seems to be an
 issue when
  WebClient's QueryString property is set - it appears
 to be ignoring it
  if the address has a query string as well, instead of
 appending it to
  address' query string.  I've included a patch
 that works with my test
  case below, any feedback is welcome.
 
 When I tested that, MS ignored WebClient.QueryString in
 presence of a
 query string in the actual URL...
 
 -Gonzalo
 
 
 


  
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] stressing mono and xsp

2010-03-22 Thread Hugo Ribeiro
Been testing xsp with 500 simultaneous users per second and found out two 
issues in code. Also had been getting some annoying exceptions.

-Connection.cs (i sink the disposed exception, because sometimes the socket is 
closed on endrequest right away)

while (!stop  (UnfinishedRequests || keep_alive));

if (requests.Count == 0) {
try
{
socket.Close ();
server.EndConnection (this);
server.ReleaseBuffers (receive_buffer, send_buffer);
}
catch (System.ObjectDisposedException) 
{
//do nothing, already disposed on endrequest
}
}

-Server.cs (on RequestCount property)
/*
foreach (Connection c in connections)
requests += c.RequestCount;
*/
for(int i=0;iconnections.Count;i++)
{
requests += ((Connection)connections[i]).RequestCount;
}
return requests;

The first aproach i didnt like it very much, is a pain to sink an exception. 
We should only make the close on one place.

The second change i didnt have more the exception that the collection had 
change, but isnt thread safe also. It resolve the problem because i think it 
was on the add and not on the remove.

A curious fact was that with the second change the pages started to be 
processed 30% faster.

Are these good changes to apply or should we make the changes another way?

Regards,
Ribeiro
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Regex.Match(string, int, int) behaves differently than Microsoft's implementation

2010-03-22 Thread Tom Philpot
So we've reported this bug here: 
https://bugzilla.novell.com/show_bug.cgi?id=474154

Text of the bug report is as follows:
Certain regular expressions will behave differently on Mono when calling
Regex.Match(string, int, int). In particular the expression

new Regex(^quick$).Match(The quick brown fox jumps over the lazy dog., 4,
5).Success

evaluates to true in Microsoft's implementation, but false in Mono. It appears
that in Microsoft's implementation, the results of the method are comparable to
calling string.Substring() on the string being passed in, except that indexes
are still reported in terms of the original string.

As a side note, the expression

new Regex(^quick).Match(The quick brown fox jumps over the lazy dog.,
4).Success

evaluates to false both in Microsoft's implementation and in Mono. Any fix to
the former should not break the latter.
Before I went digging into the bug, I thought I'd ask if any of the devs had a 
quick fix.

Thanks,
Tom
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Regex.Match(string, int, int) behaves differently than Microsoft's implementation

2010-03-22 Thread Rodrigo Kumpera
On Mon, Mar 22, 2010 at 3:52 PM, Tom Philpot tom.phil...@logos.com wrote:

 So we've reported this bug here:
 https://bugzilla.novell.com/show_bug.cgi?id=474154

 Text of the bug report is as follows:
 Certain regular expressions will behave differently on Mono when calling
 Regex.Match(string, int, int). In particular the expression

 new Regex(^quick$).Match(The quick brown fox jumps over the lazy dog.,
 4,
 5).Success

 evaluates to true in Microsoft's implementation, but false in Mono. It
 appears
 that in Microsoft's implementation, the results of the method are
 comparable to
 calling string.Substring() on the string being passed in, except that
 indexes
 are still reported in terms of the original string.

 As a side note, the expression

 new Regex(^quick).Match(The quick brown fox jumps over the lazy dog.,
 4).Success

 evaluates to false both in Microsoft's implementation and in Mono. Any fix
 to
 the former should not break the latter.
 Before I went digging into the bug, I thought I'd ask if any of the devs
 had a quick fix.


Fixing bugs in the regexp engine is really really hard given how subtle is
it's behavior.
Providing a good suite of tests is a great way forwards having it fixed.
I don`t think short-circuiting and checking for ^???$ is the right fix
since the check is
pretty complex due to other regexp rules that can be inside.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Bug 582502 - System.Linq.Enumerable.OrderByDescending is not a stable sort

2010-03-22 Thread Richard Kiene
It would appear that the Compare method in SortSequenceContext.cs (lines 58 - 
70 revision 152310) does not allow for equality. 

If a comparison returns zero on line 60 and a non-zero child context comparison 
is never found then Compare will return first_index - second_index  on line 66 
(which is always going to give you a non-zero number unless you do something 
silly like compare an index to its self).

I've fixed this by replacing line 66 to simply return zero in the equality case.

Unfortunately this breaks the QuickSort.cs implementation. That said, QuickSort 
by definition is not a stable sort (there are variants which are, but it does 
not appear that the current implementation is a stable variant).

To solve this; I replaced QuickSort with MergeSort and everything works as it 
is supposed to. I'm not sure if the desired solution is to use MergeSort or a 
stable QuickSort, but if you'd like a MergeSort implementation I would be happy 
to supply it.

Thanks,

Richard Kiene
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Regex.Match(string, int, int) behaves differently than Microsoft's implementation

2010-03-22 Thread Miguel de Icaza
Hello,

 Text of the bug report is as follows:
 Certain regular expressions will behave differently on Mono when calling
 Regex.Match(string, int, int). In particular the expression

 new Regex(^quick$).Match(The quick brown fox jumps over the lazy dog., 4,
 5).Success

 evaluates to true in Microsoft's implementation, but false in Mono. It appears
 that in Microsoft's implementation, the results of the method are comparable 
 to
 calling string.Substring() on the string being passed in, except that indexes
 are still reported in terms of the original string.

Seems like a genuine bug to me.I do not think there is anything like a quick
fix, only the correct fix.

Miguel.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Don't rely on SIGIO

2010-03-22 Thread Jonathan Pryor
On Sun, 2010-03-21 at 23:44 +0100, Andreas Färber wrote:
 SIGIO is not part of POSIX, Haiku does not support it.

You might want to mention that fact in the ChangeLog, otherwise we'll
need to care why SIGIO is special but not SIGWINCH (which according to
signal(7) is from 4.3BSDand Sun).

Otherwise, the patch looks OK.  Please commit.

 - Jon


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] Don't rely on SIGIO

2010-03-22 Thread Andreas Färber

Am 22.03.2010 um 21:24 schrieb Jonathan Pryor:

 On Sun, 2010-03-21 at 23:44 +0100, Andreas Färber wrote:
 SIGIO is not part of POSIX, Haiku does not support it.

 You might want to mention that fact in the ChangeLog, otherwise we'll
 need to care why SIGIO is special but not SIGWINCH (which according to
 signal(7) is from 4.3BSDand Sun).

 Otherwise, the patch looks OK.  Please commit.

Done, thanks. Applied to trunk in r154029.

Andreas
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] [RFC v2] Handle lack of SA_SIGINFO

2010-03-22 Thread Andreas Faerber
From: Andreas Färber andreas.faer...@web.de

SA_SIGINFO and sigaction are part of the optional POSIX XSI feature.
In mini, there's MONO_ARCH_USE_SIGACTION but it doesn't cover everything
and it isn't available elsewhere.

v1 - v2:
* Introduce helper macros, suggested by Paolo. (untested)

Cc: Paolo Molaro lu...@ximian.com
---
 Thanks Paolo, here's a draft, not yet compile-tested.
 
 Andreas
 
 mono/metadata/ChangeLog  |7 +++
 mono/metadata/console-unix.c |   36 ++--
 mono/mini/ChangeLog  |6 ++
 mono/mini/mini-posix.c   |   15 +--
 4 files changed, 52 insertions(+), 12 deletions(-)

diff --git a/mono/metadata/ChangeLog b/mono/metadata/ChangeLog
index b40af41..82c30e2 100644
--- a/mono/metadata/ChangeLog
+++ b/mono/metadata/ChangeLog
@@ -1,3 +1,10 @@
+2010-03-22  Andreas Färber  andreas.faer...@web.de
+
+   * console-unix.c (sigcont_handler, sigwinch_handler): Fix the build
+   on platforms without sigaction (Haiku).
+   
+   Code is contributed under MIT/X11 license.
+
 2010-03-22  Geoff Norton  gnor...@novell.com
 
* locales.c: Its possible for CFStringGetCStringPtr
diff --git a/mono/metadata/console-unix.c b/mono/metadata/console-unix.c
index 99e0754..8a7da12 100644
--- a/mono/metadata/console-unix.c
+++ b/mono/metadata/console-unix.c
@@ -262,10 +262,32 @@ sigint_handler (int signo)
in_sigint = FALSE;
 }
 
+#define SIGHANDLER_VALID(sigh) \
+   ((sigh) != NULL  \
+(sigh) != (void *)SIG_DFL  \
+(sigh) != (void *)SIG_IGN)
+
+#ifdef SA_SIGINFO
+#define SIGHANDLER_SIGNATURE int signo, void *the_siginfo, void *data
+#define INVOKE_SIGHANDLER_IF_VALID(siga) G_STMT_START \
+   if ((siga).sa_flags  SA_SIGINFO) { \
+   if (SIGHANDLER_VALID((siga).sa_sigaction)) \
+   (*(siga).sa_sigaction) (signo, the_siginfo, 
data); \
+   } else if (SIGHANDLER_VALID((siga).sa_handler)) \
+   (*(siga).sa_handler) (signo); \
+   G_STMT_END
+#else
+#define SIGHANDLER_SIGNATURE int signo
+#define INVOKE_SIGHANDLER_IF_VALID(siga) G_STMT_START \
+   if (SIGHANDLER_VALID((siga).sa_handler)) \
+   (*(siga).sa_handler) (signo); \
+   G_STMT_END
+#endif
+
 static struct sigaction save_sigcont, save_sigint, save_sigwinch;
 
 static void
-sigcont_handler (int signo, void *the_siginfo, void *data)
+sigcont_handler (SIGHANDLER_SIGNATURE)
 {
// Ignore error, there is not much we can do in the sigcont handler.
tcsetattr (STDIN_FILENO, TCSANOW, mono_attr);
@@ -274,24 +296,18 @@ sigcont_handler (int signo, void *the_siginfo, void *data)
write (STDOUT_FILENO, keypad_xmit_str, strlen 
(keypad_xmit_str));
 
// Call previous handler
-   if (save_sigcont.sa_sigaction != NULL 
-   save_sigcont.sa_sigaction != (void *)SIG_DFL 
-   save_sigcont.sa_sigaction != (void *)SIG_IGN)
-   (*save_sigcont.sa_sigaction) (signo, the_siginfo, data);
+   INVOKE_SIGHANDLER_IF_VALID (save_sigcont);
 }
 
 static void
-sigwinch_handler (int signo, void *the_siginfo, void *data)
+sigwinch_handler (SIGHANDLER_SIGNATURE)
 {
int dims = terminal_get_dimensions ();
if (dims != -1)
cols_and_lines = dims;

// Call previous handler
-   if (save_sigwinch.sa_sigaction != NULL 
-   save_sigwinch.sa_sigaction != (void *)SIG_DFL 
-   save_sigwinch.sa_sigaction != (void *)SIG_IGN)
-   (*save_sigwinch.sa_sigaction) (signo, the_siginfo, data);
+   INVOKE_SIGHANDLER_IF_VALID (save_sigwinch);
 }
 
 void
diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog
index f15d276..c1b60ba 100755
--- a/mono/mini/ChangeLog
+++ b/mono/mini/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-22  Andreas Faerber  andreas.faer...@web.de
+
+   * mini-posix.c: Fix the build on platforms without SA_SIGINFO (Haiku).
+   
+   Code is contributed under MIT/X11 license.
+
 2010-03-22  Zoltan Varga  var...@gmail.com
 
* exceptions-amd64.c: Add support for OpenBSD which has no 
UCONTEXT_GREGS.
diff --git a/mono/mini/mini-posix.c b/mono/mini/mini-posix.c
index 823d93b..f53a850 100644
--- a/mono/mini/mini-posix.c
+++ b/mono/mini/mini-posix.c
@@ -82,13 +82,17 @@ save_old_signal_handler (int signo, struct sigaction 
*old_action)
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_CONFIG,
Saving old signal handler for signal %d., 
signo);
 
+#ifdef SA_SIGINFO
if (! (old_action-sa_flags  SA_SIGINFO)) {
+#endif
handler_to_save-sa_handler = old_action-sa_handler;
+#ifdef SA_SIGINFO
} else {
 #ifdef MONO_ARCH_USE_SIGACTION
handler_to_save-sa_sigaction = old_action-sa_sigaction;
 #endif /* MONO_ARCH_USE_SIGACTION */
}
+#endif
handler_to_save-sa_mask = old_action-sa_mask;
handler_to_save-sa_flags = 

Re: [Mono-list] Using Tao with mono

2010-03-22 Thread Miguel de Icaza

 OpenTK looks neat but one of the nifty things about Tao was that it
 aimed to provide XNA API compatibility.

This is news to me.

Perhaps Mono.XNA was using Tao, but I do not believe that Tao ever
ventured into the XNA world.

Miguel

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Moonlight Support Windows Phone 7

2010-03-22 Thread Miguel de Icaza
 I'm gonna ask the question :-)
 
 Will Moonlight support Windows Phone 7 dev just like MS Siverlight does?

Since Windows 7 only runs managed code and not native code, Moonlight
can not be ported to the Windows 7 phone.

It also makes very little sense to port Moonlight to it, as you have the
full Silverlight 3 running on the device.

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Monovation: Assembly Injection into Live Processes

2010-03-22 Thread Miguel de Icaza
 I read  http://tirania.org/blog/archive/2008/Sep-29.html this article by
 Miguel  on attaching an assembly into a live mono process. How is this any
 different to attaching a DLL to a running process? I do this already, but
 once the DLL is attached, it can't be unloaded without using an AppDomain
 (which I am trying to avoid).

This is remote injection of an assembly, without cooperation from the
target process.


___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Considering to move to Mono

2010-03-22 Thread vtortola

Hi ,

My company develops a software done in .NET 3.5, descentralized and Winforms
based. Now, we're gonna start with the new version based in RESTful WCF and
Silverlight 4.0

We need S4 because some of the new features, like the commanding interface
for MVVM pattern, are pretty useful for us so there is no point of moving to
Moonlight for the time being, but we are considering Mono for the server
implementation, because we don't want to be constrained to Windows servers
(specially when we are gonna use MySQL the most) I've seen that Mono WCF is
on the move and have lots of features already implemented. I've also seen
that there is Mono Tools for work from Visual Studio, which is welcomed :D,
so I'd like to ask some questions about Mono and WCF Mono to ensure that it
has what we need.

Actually, we are not going to use any complicated WCF feature, we just need
to create a RESTful web service that serves data to the silverlight clients,
so the features we need are more or less:

- RESTful webservice, and would be nice to have the new UriTemplates of .NET
3.5 SP1.
- The service should work as : ConcurrencyMode=ConcurrencyMode.Multiple,
InstanceContextMode=InstanceContextMode.Single.
- SSL, although maybe this feature could be directly given by Apache, am I
right? Anyway, the Silverlight clients should be able to connect using SSL
to the server.
- Reflection, we use it a lot, we need to be able to create types
dynamically, query types, use TypeDescriptor class for create dynamic type
converters and so on.
- Database connectors, like MySQL, Sql Server and Oracle, without tricks
like ODBC.
- Serve the siverlight .xap application package, I think it's no problem for
apache once you register the mime types.
- Multithreading, so we use the lock synchronization clause (silly question,
but is better to ask though :D).
- C# 3.0 and LINQ to Objects and to XML. We don't use any other LINQ
flavour.
- Abstract data provider factory, the System.Data.Common namespace.

We can aford not use the DataContract model, and create our own
serialization-deserialization mechanism, but would be nice to have it :P

About hosting... do we need a special hosting? or we could install Mono in
any linux hosting on the internet?

Thanks in advance and kind regards.
-- 
View this message in context: 
http://n4.nabble.com/Considering-to-move-to-Mono-tp1678021p1678021.html
Sent from the Mono - General mailing list archive at Nabble.com.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Spec file for mod_mono and xsp 2.6.3

2010-03-22 Thread Oldnavy

Hi,
 I was wondering where can I find the latest spec file for mod_mono and
xsp.spec. The spec file at the url
http://mono.ximian.com/monobuild/snapshot/download-trunk/; are OS based,
that is, only for SLES and SUSE.
Can I use the same for creating rpm on FC11-x86_64 system? If so do I have
to change anything in them.

I also noticed that the name in the spec file is apache2-mod_mono unlike
previous releases where it was mod_mono alone.

I have downloaded  mod_mono-2.6.3.tar.bz2 and xsp-2.6.3.tar.bz2 but am
struggling to create rpm out of it for distribution. 
Any help will be appreciated.. 
-- 
View this message in context: 
http://n4.nabble.com/Spec-file-for-mod-mono-and-xsp-2-6-3-tp1678147p1678147.html
Sent from the Mono - General mailing list archive at Nabble.com.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] How to fix StrLike bug in 2.4

2010-03-22 Thread Andrus
Code below produes invalid result (False) in 2.4 and 2.6
How to fix it so it runs properly in 2.4.2 ?

Andrus.


using System;
using System.IO;

class Program
{

static void Main()
{
string source = @SELECT COALESCE(kartotee.Aj,0) AS Aj,
kartotee.Doktyyp AS Doktyyp, COALESCE(kartotee.Dokumnr,0) AS Dokumnr,
COALESCE(kartotee.Hind,0) AS Hind, COALESCE(rid.Inpdoktyyp,'') AS
Inpdoktyyp,
COALESCE(rid.Inpdokumnr,0) AS Inpdokumnr, COALESCE(kartotee.Kogpak,0) AS
Kogpak, COALESCE(kartotee.Kogus,0) AS Kogus, kartotee.Kuupaev AS Kuupaev,
COALESCE(kartotee.Partii,'') AS Partii, COALESCE(kartotee.Skaubasumm,0) AS
Skaubasumm, COALESCE(kartotee.St,0) AS St, COALESCE(kartotee.Toode,'') AS
Toode, COALESCE(kartotee.Vkaubasumm,0) AS Vkaubasumm,
COALESCE(kartotee.Vm,0)
AS Vm, COALESCE(kartotee.Yksus,'') AS Yksus, COALESCE(Artliik.Arttyyp,'') AS
ArtliikArttyyp, COALESCE(Dok.Kellaaeg,'') AS DokKellaaeg, Dok.Kuupaev AS
DokKuupaev, COALESCE(Dok.Raha,'') AS DokRaha, COALESCE(Toode.Jaehind,0) AS
ToodeJaehind, COALESCE(Toode.Nimetus,'') AS ToodeNimetus,
COALESCE(Toode.Yhik,'') AS ToodeYhik
FROM ({0}) kartotee
JOIN prpalk ON true
JOIN toode ON kartotee.toode=toode.toode
LEFT JOIN artliik USING(grupp,liik)
LEFT JOIN rid ON rid.id=kartotee.id
LEFT JOIN dok ON kartotee.dokumnr=dok.dokumnr
LEFT JOIN klient ON dok.klient=klient.kood
;

string pattern = @SELECT*FROM ({0}) *;

var res = Microsoft.VisualBasic.CompilerServices.StringType.StrLike(
source, pattern,
Microsoft.VisualBasic.CompareMethod.Text);
Console.WriteLine(res.ToString());
Console.ReadLine();
}
}

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Moonlight Support Windows Phone 7

2010-03-22 Thread Lennie De Villiers
Suggestion is to allow u to use Linux or a Mac to write Windows Phone  
7 apps in MonoDevelop

Sent from my iPod

On 22 Mar 2010, at 7:00 PM, Miguel de Icaza mig...@novell.com wrote:

 I'm gonna ask the question :-)

 Will Moonlight support Windows Phone 7 dev just like MS Siverlight  
 does?

 Since Windows 7 only runs managed code and not native code, Moonlight
 can not be ported to the Windows 7 phone.

 It also makes very little sense to port Moonlight to it, as you have  
 the
 full Silverlight 3 running on the device.

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] How to fix StrLike bug in 2.4

2010-03-22 Thread Jonathan Pobst
On 3/22/2010 2:27 PM, Andrus wrote:
 Code below produes invalid result (False) in 2.4 and 2.6
 How to fix it so it runs properly in 2.4.2 ?

If looks like our implementation converts it into a regular expression 
and then runs that.  However, it does not escape regex special 
characters like (, {, ), or }.

http://anonsvn.mono-project.com/viewvc/trunk/mono-basic/vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/StringType.vb

There are three options:

- Escape them yourself:
@SELECT*FROM \(\{0\}\) *;

- Fix the vbruntime to escape them properly.

- Use regular expressions instead of using the StrLike function.

Jonathan
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Moonlight Support Windows Phone 7

2010-03-22 Thread Stifu

Moonlight apps made with MonoDevelop should run with Silverlight, so all is
good.


Lennie De Villiers wrote:
 
 Suggestion is to allow u to use Linux or a Mac to write Windows Phone  
 7 apps in MonoDevelop
 

-- 
View this message in context: 
http://n4.nabble.com/Moonlight-Support-Windows-Phone-7-tp1594016p1678189.html
Sent from the Mono - General mailing list archive at Nabble.com.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Moonlight Support Windows Phone 7

2010-03-22 Thread Miguel de Icaza
 Suggestion is to allow u to use Linux or a Mac to write Windows Phone 7 apps
 in MonoDevelop

It is not a bad idea, but there are a few challenges:

* Lack of simulator to test the results
* Lack of a physical device today to test the results

Perhaps in the future.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Considering to move to Mono

2010-03-22 Thread Miguel de Icaza
Hello,

Most things that you listed work, some you will need to test
yourself:

 - RESTful webservice, and would be nice to have the new UriTemplates of .NET
 3.5 SP1.

This one;   Not clear what this even is.

 - The service should work as : ConcurrencyMode=ConcurrencyMode.Multiple,
 InstanceContextMode=InstanceContextMode.Single.

And this one too.

 About hosting... do we need a special hosting? or we could install Mono in
 any linux hosting on the internet?

Any Linux hosting that gives you root access and a recent Linux kernel
will do;   You need to be able to install an Apache module (this is what
you need root for) and the kernel needs to be relatively new (no more
than 5 years old).

 
 Thanks in advance and kind regards.


___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] How to fix StrLike bug in 2.4

2010-03-22 Thread Kornél Pál
Hi,

StrLike implementation seems to be very inefficient and is also 
defective because does not escape characters that have special meaning 
in regular expressions that are used as the underlaying implementation.

I would suggest you to use regular expressions because those are more 
properly supported.

Kornél

Andrus wrote:
 Code below produes invalid result (False) in 2.4 and 2.6
 How to fix it so it runs properly in 2.4.2 ?
 
 Andrus.
 
 
 using System;
 using System.IO;
 
 class Program
 {
 
 static void Main()
 {
 string source = @SELECT COALESCE(kartotee.Aj,0) AS Aj,
 kartotee.Doktyyp AS Doktyyp, COALESCE(kartotee.Dokumnr,0) AS Dokumnr,
 COALESCE(kartotee.Hind,0) AS Hind, COALESCE(rid.Inpdoktyyp,'') AS
 Inpdoktyyp,
 COALESCE(rid.Inpdokumnr,0) AS Inpdokumnr, COALESCE(kartotee.Kogpak,0) AS
 Kogpak, COALESCE(kartotee.Kogus,0) AS Kogus, kartotee.Kuupaev AS Kuupaev,
 COALESCE(kartotee.Partii,'') AS Partii, COALESCE(kartotee.Skaubasumm,0) AS
 Skaubasumm, COALESCE(kartotee.St,0) AS St, COALESCE(kartotee.Toode,'') AS
 Toode, COALESCE(kartotee.Vkaubasumm,0) AS Vkaubasumm,
 COALESCE(kartotee.Vm,0)
 AS Vm, COALESCE(kartotee.Yksus,'') AS Yksus, COALESCE(Artliik.Arttyyp,'') AS
 ArtliikArttyyp, COALESCE(Dok.Kellaaeg,'') AS DokKellaaeg, Dok.Kuupaev AS
 DokKuupaev, COALESCE(Dok.Raha,'') AS DokRaha, COALESCE(Toode.Jaehind,0) AS
 ToodeJaehind, COALESCE(Toode.Nimetus,'') AS ToodeNimetus,
 COALESCE(Toode.Yhik,'') AS ToodeYhik
 FROM ({0}) kartotee
 JOIN prpalk ON true
 JOIN toode ON kartotee.toode=toode.toode
 LEFT JOIN artliik USING(grupp,liik)
 LEFT JOIN rid ON rid.id=kartotee.id
 LEFT JOIN dok ON kartotee.dokumnr=dok.dokumnr
 LEFT JOIN klient ON dok.klient=klient.kood
 ;
 
 string pattern = @SELECT*FROM ({0}) *;
 
 var res = Microsoft.VisualBasic.CompilerServices.StringType.StrLike(
 source, pattern,
 Microsoft.VisualBasic.CompareMethod.Text);
 Console.WriteLine(res.ToString());
 Console.ReadLine();
 }
 }
 
 ___
 Mono-list maillist  -  Mono-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-list
 
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] How to fix StrLike bug in 2.4

2010-03-22 Thread Andrus
 There are three options:

This was discussed in
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/32649965654df408/57ba3e39a6c2711f?lnk=stq=#57ba3e39a6c2711f

Pattern is not known at design time. I need to implement function below.
How to make this function work properly in Mono 2.4 ?

Andrus.

public static bool Like(string pattern, string source)
{
return
Microsoft.VisualBasic.CompilerServices.StringType.StrLike(source, pattern,
Microsoft.VisualBasic.CompareMethod.Text);
}

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Considering to move to Mono

2010-03-22 Thread vtortola


Miguel de Icaza wrote:
 
 - RESTful webservice, and would be nice to have the new UriTemplates of
 .NET
 3.5 SP1.
 
 This one;   Not clear what this even is.
 

More or less, this:

 Expanded UriTemplate syntax including support for compound template
segments (like /{filename}.{ext} and /customers({id})), default values (like
/customers/{id=0}), and optional trailing slashes.

I'm glad to read your post. I'll download the Mono Tools and I'll try to
create a RESTful WCF service and see what happens :)

Thanks!!





-- 
View this message in context: 
http://n4.nabble.com/Considering-to-move-to-Mono-tp1678021p1678267.html
Sent from the Mono - General mailing list archive at Nabble.com.
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] How to fix StrLike bug in 2.4

2010-03-22 Thread Jonathan Pobst
You can try using the Regex.Escape mentioned in your link, like this:

public static bool Like(string pattern, string source)
{
   pattern = Regex.Escape (pattern);

   return
   Microsoft.VisualBasic.CompilerServices.StringType.StrLike(source, 
pattern, Microsoft.VisualBasic.CompareMethod.Text);
}

Jonathan

On 3/22/2010 3:47 PM, Andrus wrote:
 There are three options:

 This was discussed in
 http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/32649965654df408/57ba3e39a6c2711f?lnk=stq=#57ba3e39a6c2711f


 Pattern is not known at design time. I need to implement function below.
 How to make this function work properly in Mono 2.4 ?

 Andrus.

 public static bool Like(string pattern, string source)
 {
 return
 Microsoft.VisualBasic.CompilerServices.StringType.StrLike(source, pattern,
 Microsoft.VisualBasic.CompareMethod.Text);
 }




___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list