Author: jonpryor
Date: 2005-06-29 08:13:45 -0400 (Wed, 29 Jun 2005)
New Revision: 46718

Modified:
   trunk/mcs/class/Mono.Posix/Mono.Unix/ChangeLog
   trunk/mcs/class/Mono.Posix/Mono.Unix/Syscall.cs
   trunk/mcs/class/Mono.Posix/Mono.Unix/make-map.cs
Log:
        * Syscall.cs: SyslogFacility shouldn't be [Flags] either.  Sigh.
          Thanks to Vorobiev Maksim for pointing this out.
        * make-map.cs: Don't generate conversion code for [Obsolete] enum 
members.
          This assumes that (1) the enum member's value is invalid, or (2) a
          corrected member with the same value exists.  This fix allows us to
          obsolete invalid members (instead of removing them) without screwing 
up
          the generated code -- consider LOG_USRE, the mis-spelling of LOG_USER.
          Since SyslogFacility was (incorrectly) a [Flags] enum, since both 
LOG_USER
          and LOG_USRE had the same value, we'd get a EINVAL error trying to 
convert
          a valid value, since LOG_USRE would exist, would be checked for, and 
the
          check would succeed (since it had the same value as LOG_USER).
          This change allows us to be slightly more permissive with versioning.


Modified: trunk/mcs/class/Mono.Posix/Mono.Unix/ChangeLog
===================================================================
--- trunk/mcs/class/Mono.Posix/Mono.Unix/ChangeLog      2005-06-29 11:45:43 UTC 
(rev 46717)
+++ trunk/mcs/class/Mono.Posix/Mono.Unix/ChangeLog      2005-06-29 12:13:45 UTC 
(rev 46718)
@@ -1,3 +1,18 @@
+2005-06-29  Jonathan Pryor <[EMAIL PROTECTED]>
+
+       * Syscall.cs: SyslogFacility shouldn't be [Flags] either.  Sigh.
+         Thanks to Vorobiev Maksim for pointing this out.
+       * make-map.cs: Don't generate conversion code for [Obsolete] enum 
members.
+         This assumes that (1) the enum member's value is invalid, or (2) a
+         corrected member with the same value exists.  This fix allows us to
+         obsolete invalid members (instead of removing them) without screwing 
up
+         the generated code -- consider LOG_USRE, the mis-spelling of LOG_USER.
+         Since SyslogFacility was (incorrectly) a [Flags] enum, since both 
LOG_USER
+         and LOG_USRE had the same value, we'd get a EINVAL error trying to 
convert
+         a valid value, since LOG_USRE would exist, would be checked for, and 
the
+         check would succeed (since it had the same value as LOG_USER).
+         This change allows us to be slightly more permissive with versioning.
+
 2005-06-28  Jonathan Pryor <[EMAIL PROTECTED]>
 
        * Syscall.cs: correct value of LOG_CRON (it shouldn't be identical to

Modified: trunk/mcs/class/Mono.Posix/Mono.Unix/Syscall.cs
===================================================================
--- trunk/mcs/class/Mono.Posix/Mono.Unix/Syscall.cs     2005-06-29 11:45:43 UTC 
(rev 46717)
+++ trunk/mcs/class/Mono.Posix/Mono.Unix/Syscall.cs     2005-06-29 12:13:45 UTC 
(rev 46718)
@@ -94,7 +94,7 @@
                LOG_PERROR = 0x20   // log to stderr as well
        }
 
-       [Flags][Map]
+       [Map]
        public enum SyslogFacility {
                LOG_KERN      = 0 << 3,
                LOG_USER      = 1 << 3,

Modified: trunk/mcs/class/Mono.Posix/Mono.Unix/make-map.cs
===================================================================
--- trunk/mcs/class/Mono.Posix/Mono.Unix/make-map.cs    2005-06-29 11:45:43 UTC 
(rev 46717)
+++ trunk/mcs/class/Mono.Posix/Mono.Unix/make-map.cs    2005-06-29 12:13:45 UTC 
(rev 46718)
@@ -317,6 +317,11 @@
                foreach (FieldInfo fi in t.GetFields ()) {
                        if (!fi.IsLiteral)
                                continue;
+                       if (Attribute.GetCustomAttribute (fi, 
+                               typeof(ObsoleteAttribute), false) != null) {
+                               sc.WriteLine ("\t/* {0}_{1} is obsolete; 
ignoring */", fn, fi.Name);
+                               continue;
+                       }
                        if (bits)
                                // properly handle case where [Flags] 
enumeration has helper
                                // synonyms.  e.g. DEFFILEMODE and ACCESSPERMS 
for mode_t.

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to