Index: trunk/src/kernel32/misc.cpp
===================================================================
--- trunk/src/kernel32/misc.cpp	(revision 5035)
+++ trunk/src/kernel32/misc.cpp	(revision 5036)
@@ -1,3 +1,3 @@
-/* $Id: misc.cpp,v 1.28 2000-11-21 11:35:08 sandervl Exp $ */
+/* $Id: misc.cpp,v 1.29 2001-01-29 01:21:28 bird Exp $ */
 
 /*
@@ -83,5 +83,5 @@
 /* arguments.                                                        */
 /* ----------------------------------------------------------------- */
-int SYSTEM EXPORT WriteLog(char *f, ...)
+int SYSTEM WriteLog(char *f, ...)
   {
   TIB    *ptib;                    /* process/thread id structures */
@@ -257,5 +257,5 @@
 #endif
 
-int SYSTEM EXPORT WriteLog(char *tekst, ...)
+int SYSTEM WriteLog(char *tekst, ...)
 {
   USHORT  sel = RestoreOS2FS();
@@ -311,5 +311,5 @@
 //******************************************************************************
 //******************************************************************************
-int SYSTEM EXPORT WriteLogNoEOL(char *tekst, ...)
+int SYSTEM WriteLogNoEOL(char *tekst, ...)
 {
   USHORT  sel = RestoreOS2FS();
@@ -369,5 +369,5 @@
 //******************************************************************************
 //******************************************************************************
-int SYSTEM EXPORT WritePrivateLog(void *logfile, char *tekst, ...)
+int SYSTEM WritePrivateLog(void *logfile, char *tekst, ...)
 {
   USHORT  sel = RestoreOS2FS();
@@ -400,27 +400,30 @@
 void LogException(int state)
 {
-  TEB *teb = GetThreadTEB();
-  USHORT *lock;
-
-  if(!teb) return;
-
-  if(teb->o.odin.logfile) {
-    if(state == ENTER_EXCEPTION) {
+    TEB *teb = GetThreadTEB();
+
+    if (!teb) return;
+
+#if !defined(__EMX__)
+    if (teb->o.odin.logfile)
+    {
 #if (__IBMCPP__ == 300) || (__IBMC__ == 300)
-        lock = (USHORT *)(teb->o.odin.logfile+0x1C);
+        PUSHORT lock = (USHORT *)(teb->o.odin.logfile+0x1C);
 #else
 #error Check the offset of the lock count word in the file stream structure for this compiler revision!!!!!
 #endif
-        (*lock)--;
-    }
-    else { //LEAVE_EXCEPTION
-#if (__IBMCPP__ == 300) || (__IBMC__ == 300)
-        lock = (USHORT *)(teb->o.odin.logfile+0x1C);
-#else
-#error Check the offset of the lock count word in the file stream structure for this compiler revision!!!!!
-#endif
-        (*lock)++;
-    }
-  }
+        if (state == ENTER_EXCEPTION)
+        {
+            (*lock)--;
+        }
+        else
+        { //LEAVE_EXCEPTION
+            (*lock)++;
+        }
+    }
+#else
+//kso 2001-01-29: EMX/GCC
+// we maybe should do something with the _more->rsem (_rmutex) structure but
+// I wanna have this compile, so we'll address problems later.
+#endif
 }
 //******************************************************************************
@@ -432,12 +435,13 @@
 {
   TEB *teb = GetThreadTEB();
-  USHORT *lock;
+  PUSHORT lock;
 
   if(!teb) return;
 
+#if !defined(__EMX__)
   if(teb->o.odin.logfile) {
     //oops, exception in vfprintf; let's clear the lock count
 #if (__IBMCPP__ == 300) || (__IBMC__ == 300)
-    lock = (USHORT *)(teb->o.odin.logfile+0x1C);
+    lock = (PUSHORT)(teb->o.odin.logfile+0x1C);
 #else
 #error Check the offset of the lock count word in the file stream structure for this compiler revision!!!!!
@@ -445,4 +449,9 @@
     (*lock)--;
   }
+#else
+//kso 2001-01-29: EMX/GCC
+// we maybe should do something with the _more->rsem (_rmutex) structure but
+// I wanna have this compile, so we'll address problems later.
+#endif
 }
 //******************************************************************************
@@ -486,5 +495,5 @@
 //******************************************************************************
 //******************************************************************************
-int SYSTEM EXPORT WriteLogError(char *tekst, ...)
+int SYSTEM WriteLogError(char *tekst, ...)
 {
   USHORT  sel = RestoreOS2FS();
@@ -568,7 +577,7 @@
  *****************************************************************************/
 
-int SYSTEM EXPORT DebugErrorBox(ULONG  iErrorCode,
-                                char*  pszFormat,
-                                ...)
+int SYSTEM DebugErrorBox(ULONG  iErrorCode,
+                         char*  pszFormat,
+                         ...)
 {
   char   szMessageBuffer[1024];              /* buffer for the text message */
