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 #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 */