+int main ( int argc, char **argv )
+{
+#if defined(_MSC_VER) || defined(_WIN32)
+ // Don't show blocking "no disk in drive" error messages on Windows 7,
+ // silently return errors to application instead.
+ // See Microsoft MSDN #ms680621: "GUI apps should specify SEM_NOOPENFILEERRORBOX"
+ SetErrorMode(SEM_NOOPENFILEERRORBOX);
+
+ hostname = ::getenv( "COMPUTERNAME" );
+#else
+ // Unix(alike) systems
+ char _hostname[256];
+ gethostname(_hostname, 256);
+ hostname = _hostname;
+
+ signal(SIGPIPE, SIG_IGN);
+#endif