Procházet zdrojové kódy

s-s-d: Use reserved system preprocessor symbols

Use underscore-prefixed symbols to distinguish the system we are
building for.
Guillem Jover před 10 roky
rodič
revize
454721714d
2 změnil soubory, kde provedl 5 přidání a 3 odebrání
  1. 2 0
      debian/changelog
  2. 3 3
      utils/start-stop-daemon.c

+ 2 - 0
debian/changelog

@@ -34,6 +34,8 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
     - Cast off_t variables to intmax_t when printing them with "%jd".
     - Add missing <string.h> include in libdpkg.
     - Cast strlen() return value to ssize_t to match write() return type.
+    - Use underscore-prefixed system preprocessor symbols instead of namespace
+      polluting ones (such as “linux”, “OPENBSD” or “hpux”).
   * Perl modules:
     - Obsolete Source-Version substvar in Dpkg::Substvars by emitting errors.
     - Rework keyring hooks in Dpkg::Vendor. Deprecate the keyrings hook, and

+ 3 - 3
utils/start-stop-daemon.c

@@ -25,15 +25,15 @@
 
 #include <dpkg/macros.h>
 
-#if defined(linux)
+#if defined(__linux__)
 #  define OSLinux
 #elif defined(__GNU__)
 #  define OSHurd
 #elif defined(__sun)
 #  define OSsunos
-#elif defined(OPENBSD) || defined(__OpenBSD__)
+#elif defined(__OpenBSD__)
 #  define OSOpenBSD
-#elif defined(hpux)
+#elif defined(__hpux)
 #  define OShpux
 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 #  define OSFreeBSD