From 0c9abbeead377aa773b1ca3876ac9855bc34d008 Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Mon, 24 Mar 2003 19:44:20 +0000
Subject: [PATCH] Avoid reference to wine_get_cs function from libwine.

---
 tools/winebuild/spec16.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c
index e91709f46fd..3c94bd82106 100644
--- a/tools/winebuild/spec16.c
+++ b/tools/winebuild/spec16.c
@@ -29,7 +29,6 @@
 #include <ctype.h>
 
 #include "wine/exception.h"
-#include "wine/library.h"
 #include "builtin16.h"
 #include "module.h"
 #include "stackframe.h"
@@ -37,6 +36,25 @@
 #include "build.h"
 
 
+/*******************************************************************
+ *         get_cs
+ */
+#ifdef __i386__
+static inline unsigned short get_cs(void)
+{
+    unsigned short res;
+#ifdef __GNUC__
+    __asm__("movw %%cs,%w0" : "=r"(res));
+#elif defined(_MSC_VER)
+    __asm { mov res, cs }
+#else
+    res = 0;
+#endif
+    return res;
+}
+#endif /* __i386__ */
+
+
 /*******************************************************************
  *         output_file_header
  *
@@ -629,7 +647,7 @@ void BuildSpec16File( FILE *outfile )
     unsigned char *data;
     char constructor[100], destructor[100];
 #ifdef __i386__
-    unsigned short code_selector = wine_get_cs();
+    unsigned short code_selector = get_cs();
 #endif
 
     /* File header */
-- 
GitLab