+#ifdef emacs
+
+/* Defined in xfns.c. When config.h defines `static' as empty, we get
+ redefinition errors when gray_bitmap is included more than once, so
+ we're referring to the one include in xfns.c here. */
+
+extern int gray_bitmap_width;
+extern int gray_bitmap_height;
+extern char *gray_bitmap_bits;
+
+/* Defined in xterm.c. */
+extern int x_alloc_nearest_color_for_widget __P ((Widget, Colormap, XColor*));
+extern int x_alloc_lighter_color_for_widget __P ((Widget, Display*, Colormap,
+ unsigned long *,
+ double, int));
+extern int x_catch_errors __P ((Display*));
+extern int x_uncatch_errors __P ((Display*, int));
+extern int x_had_errors_p __P ((Display*));
+extern int x_clear_errors __P ((Display*));
+extern unsigned long x_copy_dpy_color __P ((Display *, Colormap,
+ unsigned long));
+
+/* Defined in xfaces.c. */
+extern void x_free_dpy_colors __P ((Display *, Screen *, Colormap,
+ unsigned long *pixels, int npixels));
+#else /* not emacs */
+
+#include <X11/bitmaps/gray>
+#define gray_bitmap_width gray_width
+#define gray_bitmap_height gray_height
+#define gray_bitmap_bits gray_bits
+
+#endif /* not emacs */
+