* Syscall.cs: SyslogFacility shouldn't be [Flags] either. Sigh.
authorJonathan Pryor <jpryor@novell.com>
Wed, 29 Jun 2005 12:13:45 +0000 (12:13 -0000)
committerJonathan Pryor <jpryor@novell.com>
Wed, 29 Jun 2005 12:13:45 +0000 (12:13 -0000)
  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.

svn path=/trunk/mcs/; revision=46718

mcs/class/Mono.Posix/Mono.Unix/ChangeLog
mcs/class/Mono.Posix/Mono.Unix/Syscall.cs
mcs/class/Mono.Posix/Mono.Unix/make-map.cs

index 0113cfce3bdbc1d0bed96180b25d811db8008577..d5fe52063598cbf175b60c2ce51ef1bee89c4bb8 100644 (file)
@@ -1,3 +1,18 @@
+2005-06-29  Jonathan Pryor <jonpryor@vt.edu>
+
+       * 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 <jonpryor@vt.edu>
 
        * Syscall.cs: correct value of LOG_CRON (it shouldn't be identical to
index d45d4e227cdf2de7ccadc71328d3d8441de00ed1..cd8485f3e457256933d7cf43016e1d518068269d 100644 (file)
@@ -94,7 +94,7 @@ namespace Mono.Unix {
                LOG_PERROR = 0x20   // log to stderr as well
        }
 
-       [Flags][Map]
+       [Map]
        public enum SyslogFacility {
                LOG_KERN      = 0 << 3,
                LOG_USER      = 1 << 3,
index ae56ec7f20cce06cd2db1ab91b287d65e16b9aca..d5ef929cf82e6a941bb9c6c0eda3e1f987236a4d 100644 (file)
@@ -317,6 +317,11 @@ class SourceFileGenerator : FileGenerator {
                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.