$NetBSD$

--- src/dmd/mars.h.orig	2010-12-20 20:02:36.000000000 +0000
+++ src/dmd/mars.h
@@ -37,6 +37,7 @@ Macros defined by the compiler, not the 
         linux           Linux
         __APPLE__       Mac OSX
         __FreeBSD__     FreeBSD
+        __NetBSD__      NetBSD
         __sun&&__SVR4   Solaris, OpenSolaris (yes, both macros are necessary)
 
 For the target systems, there are the target operating system and
@@ -47,6 +48,7 @@ the target object file format:
         TARGET_LINUX    Covers 32 and 64 bit linux
         TARGET_OSX      Covers 32 and 64 bit Mac OSX
         TARGET_FREEBSD  Covers 32 and 64 bit FreeBSD
+        TARGET_NETBSD   Covers 32 and 64 bit NetBSD
         TARGET_SOLARIS  Covers 32 and 64 bit Solaris
         TARGET_NET      Covers .Net
 
@@ -55,7 +57,7 @@ the target object file format:
 
     Target object module format:
         OMFOBJ          Intel Object Module Format, used on Windows
-        ELFOBJ          Elf Object Module Format, used on linux, FreeBSD and Solaris
+        ELFOBJ          Elf Object Module Format, used on linux, FreeBSD, NetBSD and Solaris
         MACHOBJ         Mach-O Object Module Format, used on Mac OSX
 
     There are currently no macros for byte endianness order.
@@ -91,9 +93,9 @@ void unittests();
 #define MODULEINFO_IS_STRUCT DMDV2   // if ModuleInfo is a struct rather than a class
 
 // Set if C++ mangling is done by the front end
-#define CPP_MANGLE (DMDV2 && (TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_SOLARIS))
+#define CPP_MANGLE (DMDV2 && (TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_NETBSD || TARGET_SOLARIS))
 
-/* Other targets are TARGET_LINUX, TARGET_OSX, TARGET_FREEBSD and
+/* Other targets are TARGET_LINUX, TARGET_OSX, TARGET_FREEBSD, TARGET_NETBSD and
  * TARGET_SOLARIS, which are
  * set on the command line via the compiler makefile.
  */
@@ -103,7 +105,7 @@ void unittests();
 #define OMFOBJ 1
 #endif
 
-#if TARGET_LINUX || TARGET_FREEBSD || TARGET_SOLARIS
+#if TARGET_LINUX || TARGET_FREEBSD || TARGET_NETBSD || TARGET_SOLARIS
 #ifndef ELFOBJ
 #define ELFOBJ 1
 #endif
@@ -141,6 +143,7 @@ struct Param
     char isOSX;         // generate code for Mac OSX
     char isWindows;     // generate code for Windows
     char isFreeBSD;     // generate code for FreeBSD
+    char isNetBSD;      // generate code for NetBSD
     char isSolaris;     // generate code for Solaris
     char scheduler;     // which scheduler to use
     char useDeprecated; // allow use of deprecated features
