$NetBSD$

--- plugins/titler/title.C.orig	2010-02-01 08:26:24.000000000 +0000
+++ plugins/titler/title.C
@@ -35,6 +35,8 @@
 #include FT_OUTLINE_H
 #include FT_STROKER_H
 
+#include "config.h"
+
 #include "language.h"
 #include "mwindow.inc"
 #include "picon_png.h"
@@ -48,11 +50,14 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <string.h>
-#include <endian.h>
-#include <byteswap.h>
 #include <iconv.h>
 #include <sys/stat.h>
 
+#define bswap_32(x) ((((x) << 24) & 0xff000000) | \
+                     (((x) <<  8) & 0x00ff0000) | \
+                     (((x) >>  8) & 0x0000ff00) | \
+                     (((x) >> 24) & 0x000000ff))
+
 #define ZERO (1.0 / 64.0)
 
 #define FONT_SEARCHPATH "fonts"
@@ -1517,14 +1522,15 @@ void TitleMain::draw_glyphs()
 
 			size_t inbytes,outbytes;
 			char inbuf;
-			char *inp = (char*)&inbuf, *outp = (char *)&char_code;
+			const char *inp = &inbuf;
+            char *outp = (char *)&char_code;
 			
 			inbuf = (char)c;
 			inbytes = 1;
 			outbytes = 4;
 	
 			iconv (cd, &inp, &inbytes, &outp, &outbytes);
-#if     __BYTE_ORDER == __LITTLE_ENDIAN
+#if !defined(WORDS_BIGENDIAN)
 				char_code = bswap_32(char_code);
 #endif                          /* Big endian.  */
 
