$OpenBSD$
--- indra/newview/viewer.cpp.orig	Thu Nov 29 16:47:17 2007
+++ indra/newview/viewer.cpp	Mon Dec  3 04:21:37 2007
@@ -104,6 +104,11 @@
 	    #undef require
     #endif
   #endif
+#elif defined(__OpenBSD__)
+  #	include <sys/socket.h>
+  #	include <netinet/in.h>
+  #	include <arpa/inet.h>	// inet_ntoa()
+  #     include <unistd.h>
 #endif // !LL_WINDOWS
 
 // Support for sending crash reports from the viewer?
@@ -2223,7 +2228,7 @@ void init_logging()
 							     "SecondLife.old");
 	LLFile::remove(old_log_file.c_str());
 
-#if LL_LINUX || LL_SOLARIS
+#if LL_LINUX || LL_SOLARIS || defined(__OpenBSD__)
 	// Remove the last stack trace, if any
 	std::string old_stack_file =
 		gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log");
@@ -2372,7 +2377,7 @@ std::string get_serial_number()
 
 	return serial_md5;
 
-#elif LL_LINUX || LL_SOLARIS
+#elif LL_LINUX || LL_SOLARIS || defined(__OpenBSD__)
 	// TODO
 	return serial_md5;
 
@@ -2583,7 +2588,7 @@ static inline bool being_debugged()
 	return debugged == yes;
 }
 
-#ifdef LL_SOLARIS
+#if defined(LL_SOLARIS) || defined(__OpenBSD__)
 static inline BOOL do_basic_glibc_backtrace()
 {
 	BOOL success = FALSE;
@@ -2700,7 +2705,7 @@ void viewer_crash_callback()
 	// Sometimes signals don't seem to quit the viewer.  
 	// Make sure we exit so as to not totally confuse the user.
 	exit(1);
-#elif LL_LINUX || LL_SOLARIS
+#elif LL_LINUX || LL_SOLARIS || defined(__OpenBSD__)
 	// Always generate the report, have the logger do the asking, and
 	// don't wait for the logger before exiting (-> total cleanup).
 	if (CRASH_BEHAVIOR_NEVER_SEND != gCrashBehavior)
@@ -5347,7 +5352,7 @@ void signal_handlers(S32 s)
 		return;
 	}
 
-# if LL_LINUX || LL_SOLARIS
+# if LL_LINUX || LL_SOLARIS || defined(__OpenBSD__)
 	// Really useful to know what KIND of crash we got.
 	// Might want this on OSX too!
 	llwarns << "*** Caught signal " << s << llendl;
