Index: trunk/src/odincrt/makefile
===================================================================
--- trunk/src/odincrt/makefile	(revision 523)
+++ trunk/src/odincrt/makefile	(revision 524)
@@ -1,3 +1,3 @@
-# $Id: makefile,v 1.5 1999-08-16 16:28:03 sandervl Exp $
+# $Id: makefile,v 1.6 1999-08-17 12:46:04 sandervl Exp $
 
 #
@@ -19,5 +19,5 @@
 TARGET = odincrt
 
-OBJS =  odincrt.obj odinfs.obj initterm.obj
+OBJS =  odincrt.obj initterm.obj
 
 all: $(TARGET).dll $(TARGET).lib
@@ -32,10 +32,7 @@
         $(CP) $@ $(PDWIN32_LIB)
 
-
-odincrt.obj: odincrt.cpp $(PDWIN32_INCLUDE)\odincrt.h
-
 initterm.obj: initterm.cpp
 
-odinfs.obj: odinfs.asm
+odincrt.obj: odincrt.asm
 
 clean:
Index: trunk/src/odincrt/odincrt.asm
===================================================================
--- trunk/src/odincrt/odincrt.asm	(revision 524)
+++ trunk/src/odincrt/odincrt.asm	(revision 524)
@@ -0,0 +1,68 @@
+; $Id: odincrt.asm,v 1.1 1999-08-17 12:46:20 sandervl Exp $
+
+;/*
+; * Project Odin Software License can be found in LICENSE.TXT
+; * Win32 Exception handling + misc functions for OS/2
+; *
+; * Copyright 1998 Sander van Leeuwen
+; *
+; */
+
+; 1999/08/09 PH see if we can do this as INLINE functions
+
+.386p
+                NAME    odinfs
+
+CODE32          SEGMENT DWORD PUBLIC USE32 'CODE'
+                ASSUME  CS:FLAT ,DS:FLAT,SS:FLAT
+
+                PUBLIC  __threadid 
+__threadid proc near
+	push    ebp
+	push	fs
+        mov     ax, 150bh
+	mov	fs, ax
+		
+        mov     eax,dword ptr fs:[0000000cH]
+
+	pop	fs
+        mov     ebp,esp
+        leave   
+        ret     
+__threadid endp
+
+        PUBLIC GetFS
+GetFS   proc near
+        mov     eax, fs
+        ret
+GetFS   endp
+
+
+        PUBLIC SetFS
+SetFS   proc near
+        mov     eax, [esp+4]
+        mov     fs, eax
+        ret
+SetFS   endp
+
+
+        PUBLIC SetReturnFS
+SetReturnFS proc near
+        push    fs
+        mov     eax, [esp+8]
+        mov     fs, eax
+        pop     eax
+        ret
+SetReturnFS endp
+
+
+        PUBLIC RestoreOS2FS
+RestoreOS2FS proc near
+        push    150bh           ; @@@PH that's NOT the clean way ! :)
+        mov     ax, fs
+        pop     fs
+        ret
+RestoreOS2FS endp
+
+CODE32          ENDS
+                END
Index: trunk/src/odincrt/odincrt.cpp
===================================================================
--- trunk/src/odincrt/odincrt.cpp	(revision 523)
+++ 	(revision )
@@ -1,109 +1,0 @@
-/* $Id: odincrt.cpp,v 1.6 1999-08-16 20:15:54 achimha Exp $ */
-/************************************************************************/
-/*                             odincrt.c                                */
-/************************************************************************/
-/*                                                                      */
-/*         Odin shared C runtime library for IBM VAC++ 3.08             */
-/*                                                                      */
-/************************************************************************/
-/* Created:     99/08/08                                                */
-/* Last Edited: 99/00/08                                                */
-/************************************************************************/
-/* (C)'99 Patrick Haller, Achim Hasenmueller                            */
-/************************************************************************/
-
-/* we need all prototypes for the C runtime library                     */
-/****************************************************************************
- * Includes                                                                 *
- ****************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <odincrt.h>
-
-typedef unsigned short USHORT;
-
-
-/****************************************************************************
- * Macros                                                                   *
- ****************************************************************************/
-
-#define ODIN_TEB_OFF         {            \
-                               USHORT sel = RestoreOS2FS();
-
-#define ODIN_TEB_ON1(rc)       SetFS(sel);\
-                               return(rc);\
-                             }
-
-#define ODIN_TEB_ON0()         SetFS(sel);\
-                             }
-
-
-/****************************************************************************
- * Memory Management                                                        *
- ****************************************************************************/
-
-void* ODINAPI ODIN_calloc ( size_t s1, size_t s2 )
-  ODIN_TEB_OFF
-  void* rc =  calloc(s1,s2);
-  ODIN_TEB_ON1(rc)
-
-void* ODINAPI ODIN_realloc( void * p1, size_t s1 )
-  ODIN_TEB_OFF
-  void* rc = realloc(p1,s1);
-  ODIN_TEB_ON1(rc)
-
-void* ODINAPI ODIN_malloc (size_t size)
-  ODIN_TEB_OFF
-  void *rc = malloc(size);
-  ODIN_TEB_ON1(rc)
-
-void ODINAPI ODIN_free    (void *ptr)
-  ODIN_TEB_OFF
-  free(ptr);
-  ODIN_TEB_ON0()
-
-void * ODINAPI  ODIN_debug_calloc ( size_t s1, size_t s2, const char *p1, size_t s3)
-  ODIN_TEB_OFF
-  void* rc =  _debug_calloc(s1,s2,p1,s3);
-  ODIN_TEB_ON1(rc)
-
-void   ODINAPI  ODIN_debug_free   ( void *p1, const char *p2, size_t s1)
-  ODIN_TEB_OFF
-  _debug_free(p1,p2,s1);
-  ODIN_TEB_ON0()
-
-void * ODINAPI  ODIN_debug_malloc ( size_t s1, const char * p1, size_t s2)
-  ODIN_TEB_OFF
-  void *rc = _debug_malloc(s1,p1,s2);
-  ODIN_TEB_ON1(rc)
-
-void * ODINAPI  ODIN_debug_realloc( void *p1, size_t s1, const char *p2, size_t s2)
-  ODIN_TEB_OFF
-  void* rc = _debug_realloc(p1,s1,p2,s2);
-  ODIN_TEB_ON1(rc)
-
-
-
-
-/****************************************************************************
- * String operations                                                        *
- ****************************************************************************/
-
-char* ODINAPI ODIN_strdup( const char *s1)
-  ODIN_TEB_OFF
-  char *rc = strdup(s1);
-  ODIN_TEB_ON1(rc)
-
-
-/****************************************************************************
- * C++ operator wrappers (experimental)                                     *
- ****************************************************************************/
-
-// operator new()
-//void* _Optlink ODIN__nw__FUi(unsigned int i)
-//  ODIN_TEB_OFF
-//  void* rc = __nw__FUi(i);
-//  ODIN_TEB_ON1(rc)
-
Index: trunk/src/odincrt/odincrt.def
===================================================================
--- trunk/src/odincrt/odincrt.def	(revision 523)
+++ trunk/src/odincrt/odincrt.def	(revision 524)
@@ -1,3 +1,3 @@
-; $Id: odincrt.def,v 1.15 1999-08-16 20:15:54 achimha Exp $
+; $Id: odincrt.def,v 1.16 1999-08-17 12:46:04 sandervl Exp $
 ; Odin VAC++ 3.08 shared multithreaded runtime
 LIBRARY ODINCRT INITINSTANCE TERMINSTANCE
@@ -18,43 +18,13 @@
 ; memory management
 ; -----------------
-       ODIN_calloc
-       calloc                  = ODIN_calloc          @346
-
-       ODIN_realloc
-       realloc                 = ODIN_realloc         @583
-
-       ODIN_malloc
-       malloc                  = ODIN_malloc          @351
-
-       ODIN_free
-       free                    = ODIN_free            @219
-
-       ODIN_debug_calloc
-       _debug_calloc           = ODIN_debug_calloc    @117
-
-       ODIN_debug_realloc
-       _debug_realloc          = ODIN_debug_realloc   @182
-
-       ODIN_debug_malloc
-       _debug_malloc           = ODIN_debug_malloc    @119
-
-       ODIN_debug_free
-       _debug_free             = ODIN_debug_free      @59
-
-; -----------------
-; string management
-; -----------------
-
-       ODIN_strdup
-       strdup                  = ODIN_strdup          @472
-
-; -----------------
-; C++ wrappers
-; -----------------
-
-;      ODIN__nw__FUi
-;      __nw__FUi               = ODIN__nw__FUi   ; operator new()
-
-
+       calloc                            		@346
+       realloc                          		@583
+       malloc                            		@351
+       free                                		@219
+       _debug_calloc               			@117
+       _debug_realloc             			@182
+       _debug_malloc               			@119
+       _debug_free                   			@59
+       strdup                  			       	@472
 
 ; original exports
Index: trunk/src/odincrt/odinfs.asm
===================================================================
--- trunk/src/odincrt/odinfs.asm	(revision 523)
+++ trunk/src/odincrt/odinfs.asm	(revision 524)
@@ -1,3 +1,3 @@
-; $Id: odinfs.asm,v 1.1 1999-08-09 11:21:46 phaller Exp $
+; $Id: odinfs.asm,v 1.2 1999-08-17 12:46:05 sandervl Exp $
 
 ;/*
@@ -16,4 +16,19 @@
 CODE32          SEGMENT DWORD PUBLIC USE32 'CODE'
                 ASSUME  CS:FLAT ,DS:FLAT,SS:FLAT
+
+                PUBLIC  __threadid 
+__threadid proc near
+	push    ebp
+	push	fs
+        mov     ax, 150bh
+	mov	fs, ax
+		
+        mov     eax,dword ptr fs:[0000000cH]
+
+	pop	fs
+        mov     ebp,esp
+        leave   
+        ret     
+__threadid endp
 
         PUBLIC GetFS
