2 * Copyright 1993 Robert J. Amstadt
3 * Copyright 1995 Martin von Loewis
4 * Copyright 1995, 1996, 1997 Alexandre Julliard
5 * Copyright 1997 Eric Youngdale
6 * Copyright 1999 Ulrich Weigand
10 #define __WINE_BUILD_H
16 #ifdef NEED_UNDERSCORE_PREFIX
22 #ifdef HAVE_ASM_STRING
23 # define STRING ".string"
25 # define STRING ".ascii"
28 #if defined(__GNUC__) && !defined(__svr4__)
36 TYPE_BYTE, /* byte variable (Win16) */
37 TYPE_WORD, /* word variable (Win16) */
38 TYPE_LONG, /* long variable (Win16) */
39 TYPE_PASCAL_16, /* pascal function with 16-bit return (Win16) */
40 TYPE_PASCAL, /* pascal function with 32-bit return (Win16) */
41 TYPE_ABS, /* absolute value (Win16) */
42 TYPE_REGISTER, /* register function */
43 TYPE_INTERRUPT, /* interrupt handler function (Win16) */
44 TYPE_STUB, /* unimplemented stub */
45 TYPE_STDCALL, /* stdcall function (Win32) */
46 TYPE_CDECL, /* cdecl function (Win32) */
47 TYPE_VARARGS, /* varargs function (Win32) */
48 TYPE_EXTERN, /* external symbol (Win32) */
49 TYPE_FORWARD, /* forwarded function (Win32) */
112 /* Offset of a structure field relative to the start of the struct */
113 #define STRUCTOFFSET(type,field) ((int)&((type *)0)->field)
115 /* Offset of register relative to the start of the CONTEXT struct */
116 #define CONTEXTOFFSET(reg) STRUCTOFFSET(CONTEXT86,reg)
118 /* Offset of register relative to the start of the STACK16FRAME struct */
119 #define STACK16OFFSET(reg) STRUCTOFFSET(STACK16FRAME,reg)
121 /* Offset of register relative to the start of the STACK32FRAME struct */
122 #define STACK32OFFSET(reg) STRUCTOFFSET(STACK32FRAME,reg)
124 /* Offset of the stack pointer relative to %fs:(0) */
125 #define STACKOFFSET (STRUCTOFFSET(TEB,cur_stack))
128 #define MAX_ORDINALS 2048
129 #define MAX_IMPORTS 16
131 /* global functions */
133 extern void *xmalloc (size_t size);
134 extern void *xrealloc (void *ptr, size_t size);
135 extern char *xstrdup( const char *str );
136 extern char *strupper(char *s);
137 extern void fatal_error( const char *msg, ... );
138 extern void dump_bytes( FILE *outfile, const unsigned char *data, int len, const char *label );
140 extern void BuildGlue( FILE *outfile, FILE *infile );
141 extern void BuildRelays( FILE *outfile );
142 extern void BuildSpec16File( FILE *outfile );
143 extern void BuildSpec32File( FILE *outfile );
144 extern SPEC_TYPE ParseTopLevel( FILE *file );
146 /* global variables */
148 extern int current_line;
149 extern int nb_entry_points;
151 extern int nb_imports;
154 extern int DLLHeapSize;
156 extern int debugging;
158 extern unsigned short code_selector;
159 extern unsigned short data_selector;
161 extern char DLLName[80];
162 extern char DLLFileName[80];
163 extern char DLLInitFunc[80];
164 extern char rsrc_name[80];
165 extern char owner_name[80];
166 extern char *DLLImports[MAX_IMPORTS];
167 extern const char *input_file_name;
168 extern const char *output_file_name;
170 extern ORDDEF EntryPoints[MAX_ORDINALS];
171 extern ORDDEF *Ordinals[MAX_ORDINALS];
172 extern ORDDEF *Names[MAX_ORDINALS];
173 extern SPEC_MODE SpecMode;
175 #endif /* __WINE_BUILD_H */