Description: port import/ code to D language version 2
  With this patch the code is accapted by GDC 4.8 without triggering deprecation
  warnings/errors.
Author: Peter De Wachter <pdewacht@gmail.com>

--- a/import/SDL_audio.d
+++ b/import/SDL_audio.d
@@ -24,6 +24,7 @@
 import SDL_error;
 import SDL_rwops;
 import SDL_byteorder;
+import std.string;
 
 extern(C):
 
@@ -42,7 +43,7 @@
 	   Once the callback returns, the buffer will no longer be valid.
 	   Stereo samples are stored in a LRLRLR ordering.
 	*/
-	void (*callback)(void *userdata, Uint8 *stream, int len);
+	void function(void *userdata, Uint8 *stream, int len) callback;
 	void  *userdata;
 }
 
@@ -74,7 +75,7 @@
 	int    len_cvt;			/* Length of converted audio buffer */
 	int    len_mult;		/* buffer must be len*len_mult big */
 	double len_ratio; 	/* Given len, final size is len*len_ratio */
-	void (*filters[10])(SDL_AudioCVT *cvt, Uint16 format);
+	void function(SDL_AudioCVT *cvt, Uint16 format)[10] filters;
 	int filter_index;		/* Current audio conversion function */
 }
 
@@ -161,7 +162,7 @@
  * This function loads a WAVE from the data source, automatically freeing
  * that source if 'freesrc' is non-zero.  For example, to load a WAVE file,
  * you could do:
- *	SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
+ *	SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", toStringz("rb")), 1, ...);
  * 
  * If this function succeeds, it returns the given SDL_AudioSpec,
  * filled with the audio data format of the wave data, and sets
@@ -178,7 +179,7 @@
 		 SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len);
 
 /* Compatibility convenience function -- loads a WAV from a file */
-SDL_AudioSpec *SDL_LoadWAV(char* file, SDL_AudioSpec* spec,
+SDL_AudioSpec *SDL_LoadWAV(const(char)* file, SDL_AudioSpec* spec,
 		Uint8 **audio_buf, Uint32 *audio_len)
 {		
 	return SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1, spec,
--- a/import/SDL_cdrom.d
+++ b/import/SDL_cdrom.d
@@ -49,7 +49,7 @@
 }
 
 /* Given a status, returns true if there's a disk in the drive */
-bit CD_INDRIVE(int status) { return status > 0; }
+bool CD_INDRIVE(int status) { return status > 0; }
 
 struct SDL_CDtrack {
 	Uint8 id;		/* Track number */
--- a/import/SDL_endian.d
+++ b/import/SDL_endian.d
@@ -47,7 +47,7 @@
 */
 
 Uint16 SDL_Swap16(Uint16 D) {
-	return((D<<8)|(D>>8));
+	return cast(Uint16)((D<<8)|(D>>8));
 }
 
 Uint32 SDL_Swap32(Uint32 D) {
--- a/import/SDL_events.d
+++ b/import/SDL_events.d
@@ -271,7 +271,7 @@
 
   The filter is protypted as:
 */
-alias int (*SDL_EventFilter)(SDL_Event *event);
+alias int function(SDL_Event *event) SDL_EventFilter;
 /*
   If the filter returns 1, then the event will be added to the internal queue.
   If it returns 0, then the event will be dropped from the queue, but the 
--- a/import/SDL_mixer.d
+++ b/import/SDL_mixer.d
@@ -22,7 +22,7 @@
 
 // convert to D by shinichiro.h
 
-/* $Id: SDL_mixer.h,v 1.24 2002/05/21 05:45:59 slouken Exp $ */
+/* $Id: SDL_mixer.d,v 1.1.1.1 2006/11/19 07:54:54 kenta Exp $ */
 
 import SDL;
 
@@ -104,10 +104,10 @@
 
 /* Load a wave file or a music (.mod .s3m .it .xm) file */
 	Mix_Chunk * Mix_LoadWAV_RW(SDL_RWops *src, int freesrc);
-	Mix_Chunk * Mix_LoadWAV(char *file) {
+	Mix_Chunk * Mix_LoadWAV(const(char) *file) {
 		return Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1);
 	}
-	Mix_Music * Mix_LoadMUS(char *file);
+	Mix_Music * Mix_LoadMUS(const(char) *file);
 
 /* Load a wave file of the mixer format from a memory buffer */
 	Mix_Chunk * Mix_QuickLoad_WAV(Uint8 *mem);
@@ -128,19 +128,17 @@
    This can be used to provide real-time visual display of the audio stream
    or add a custom mixer filter for the stream data.
 */
-	void Mix_SetPostMix(void (*mix_func)
-						(void *udata, Uint8 *stream, int len), void *arg);
+	void Mix_SetPostMix(void function(void *udata, Uint8 *stream, int len) mix_func, void *arg);
 
 /* Add your own music player or additional mixer function.
    If 'mix_func' is NULL, the default music player is re-enabled.
 */
-	void Mix_HookMusic(void (*mix_func)
-					   (void *udata, Uint8 *stream, int len), void *arg);
+	void Mix_HookMusic(void function(void *udata, Uint8 *stream, int len) mix_func, void *arg);
 
 /* Add your own callback when the music has finished playing.
    This callback is only called if the music finishes naturally.
 */
-	void Mix_HookMusicFinished(void (*music_finished)());
+	void Mix_HookMusicFinished(void function() music_finished);
 
 /* Get a pointer to the user data for the current music hook */
 	void * Mix_GetMusicHookData();
@@ -153,7 +151,7 @@
  *  inside the audio callback, or SDL_mixer will explicitly lock the audio
  *  before calling your callback.
  */
-	void Mix_ChannelFinished(void (*channel_finished)(int channel));
+	void Mix_ChannelFinished(void function(int channel) channel_finished);
 
 
 /* Special Effects API by ryan c. gordon. (icculus@linuxgames.com) */
@@ -177,7 +175,7 @@
  *
  * DO NOT EVER call SDL_LockAudio() from your callback function!
  */
-	typedef void (*Mix_EffectFunc_t)(int chan, void *stream, int len, void *udata);
+	alias void function(int chan, void *stream, int len, void *udata) Mix_EffectFunc_t;
 
 /*
  * This is a callback that signifies that a channel has finished all its
@@ -188,7 +186,7 @@
  *
  * DO NOT EVER call SDL_LockAudio() from your callback function!
  */
-	typedef void (*Mix_EffectDone_t)(int chan, void *udata);
+	alias void function(int chan, void *udata) Mix_EffectDone_t;
 
 
 /* Register a special effect function. At mixing time, the channel data is
@@ -510,7 +508,7 @@
 	int Mix_PlayingMusic();
 
 /* Stop music and set external music playback command */
-	int Mix_SetMusicCMD(char *command);
+	int Mix_SetMusicCMD(const(char) *command);
 
 /* Synchro value is set by MikMod from modules while playing */
 	int Mix_SetSynchroValue(int value);
--- a/import/SDL_quit.d
+++ b/import/SDL_quit.d
@@ -40,8 +40,8 @@
 */
 
 /* There are no functions directly affecting the quit event */
-bit SDL_QuitRequested()
+bool SDL_QuitRequested()
 {
 	SDL_PumpEvents();
-	return cast(bit)SDL_PeepEvents(null, 0, SDL_PEEKEVENT, SDL_QUITMASK);
+	return 0 != SDL_PeepEvents(null, 0, SDL_PEEKEVENT, SDL_QUITMASK);
 }
--- a/import/SDL_rwops.d
+++ b/import/SDL_rwops.d
@@ -28,11 +28,6 @@
 
 extern(C):
 
-typedef int (*_seek_func_t)(SDL_RWops *context, int offset, int whence);
-typedef int (*_read_func_t)(SDL_RWops *context, void *ptr, int size, int maxnum);
-typedef int (*_write_func_t)(SDL_RWops *context, void *ptr, int size, int num);
-typedef int (*_close_func_t)(SDL_RWops *context);
-
 /* This is the read/write operation structure -- very basic */
 
 struct SDL_RWops {
@@ -40,26 +35,22 @@
 		SEEK_SET, SEEK_CUR, SEEK_END
 	   Returns the final offset in the data source.
 	 */
-	_seek_func_t seek;
-//	int (*seek)(SDL_RWops *context, int offset, int whence);
+	int function(SDL_RWops *context, int offset, int whence) seek;
 
 	/* Read up to 'num' objects each of size 'objsize' from the data
 	   source to the area pointed at by 'ptr'.
 	   Returns the number of objects read, or -1 if the read failed.
 	 */
-	_read_func_t read;
-//	int (*read)(SDL_RWops *context, void *ptr, int size, int maxnum);
+	int function(SDL_RWops *context, void *ptr, int size, int maxnum) read;
 
 	/* Write exactly 'num' objects each of size 'objsize' from the area
 	   pointed at by 'ptr' to data source.
 	   Returns 'num', or -1 if the write failed.
 	 */
-	_write_func_t write;
-//	int (*write)(SDL_RWops *context, void *ptr, int size, int num);
+	int function(SDL_RWops *context, void *ptr, int size, int num) write;
 
 	/* Close and free an allocated SDL_FSops structure */
-	_close_func_t close;
-//	int (*close)(SDL_RWops *context);
+	int function(SDL_RWops *context) close;
 
 	Uint32 type;
 	union {
@@ -81,7 +72,7 @@
 
 /* Functions to create SDL_RWops structures from various data sources */
 
-SDL_RWops * SDL_RWFromFile(char *file, char *mode);
+SDL_RWops * SDL_RWFromFile(const(char)* file, const(char)* mode);
 
 SDL_RWops * SDL_RWFromFP(void *fp, int autoclose);
 
@@ -93,40 +84,25 @@
 /* Macros to easily read and write from an SDL_RWops structure */
 int SDL_RWseek(SDL_RWops *ctx, int offset, int whence)
 {
-	_seek_func_t seek;
-//	int (*seek)(SDL_RWops *context, int offset, int whence);
-	seek = ctx.seek;
-	return (*seek)(ctx, offset, whence);
+	return ctx.seek(ctx, offset, whence);
 }
 
 int SDL_RWtell(SDL_RWops *ctx)
 {
-	_seek_func_t seek;
-//	int (*seek)(SDL_RWops *context, int offset, int whence);
-	seek = ctx.seek;
-	return (*seek)(ctx, 0, 1);
+	return ctx.seek(ctx, 0, 1);
 }
 
 int SDL_RWread(SDL_RWops *ctx, void* ptr, int size, int n)
 {
-	_read_func_t read;
-//	int (*read)(SDL_RWops *context, void *ptr, int size, int maxnum);
-	read = ctx.read;
-	return (*read)(ctx, ptr, size, n);
+	return ctx.read(ctx, ptr, size, n);
 }
 
 int SDL_RWwrite(SDL_RWops *ctx, void* ptr, int size, int n)
 {
-	_write_func_t write;
-//	int (*write)(SDL_RWops *context, void *ptr, int size, int num);
-	write = ctx.write;
-	return (*write)(ctx, ptr, size, n);
+	return ctx.write(ctx, ptr, size, n);
 }
 
 int SDL_RWclose(SDL_RWops *ctx)
 {
-	_close_func_t close;
-//	int (*close)(SDL_RWops *context);
-	close = ctx.close;
-	return (*close)(ctx);
+	return ctx.close(ctx);
 }
--- a/import/SDL_thread.d
+++ b/import/SDL_thread.d
@@ -34,7 +34,7 @@
 struct SDL_Thread { }
 
 /* Create a thread */
-SDL_Thread * SDL_CreateThread(int (*fn)(void *), void *data);
+SDL_Thread * SDL_CreateThread(int function(void *) fn, void *data);
 
 /* Get the 32-bit thread identifier for the current thread */
 Uint32 SDL_ThreadID();
--- a/import/SDL_timer.d
+++ b/import/SDL_timer.d
@@ -39,7 +39,7 @@
 void SDL_Delay(Uint32 ms);
 
 /* Function prototype for the timer callback function */
-alias Uint32 (*SDL_TimerCallback)(Uint32 interval);
+alias Uint32 function(Uint32 interval) SDL_TimerCallback;
 
 /* Set a callback to run after the specified number of milliseconds has
  * elapsed. The callback function is passed the current timer interval
@@ -79,7 +79,7 @@
  * passed in, the periodic alarm continues, otherwise a new alarm is
  * scheduled.  If the callback returns 0, the periodic alarm is cancelled.
  */
-alias Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param);
+alias Uint32 function(Uint32 interval, void *param) SDL_NewTimerCallback;
 
 /* Definition of the timer ID type */
 alias void *SDL_TimerID;
--- a/import/SDL_types.d
+++ b/import/SDL_types.d
@@ -33,7 +33,7 @@
 alias ushort	Uint16;
 alias short	Sint16;
 alias uint	Uint32;
-alias int		Sint32;
+alias int	Sint32;
 
 alias ulong	Uint64;
 alias long	Sint64;
--- a/import/SDL_version_.d
+++ b/import/SDL_version_.d
@@ -63,7 +63,7 @@
 									SDL_PATCHLEVEL;
 
 /* This macro will evaluate to true if compiled with SDL at least X.Y.Z */
-bit SDL_VERSION_ATLEAST(Uint8 X, Uint8 Y, Uint8 Z)
+bool SDL_VERSION_ATLEAST(Uint8 X, Uint8 Y, Uint8 Z)
 {
 	return (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z));
 }
--- a/import/SDL_video.d
+++ b/import/SDL_video.d
@@ -74,9 +74,9 @@
 	Uint8  alpha;
 }
 
-/* typedef for private surface blitting functions */
-typedef int (*SDL_blit)(SDL_Surface *src, SDL_Rect *srcrect,
-			SDL_Surface *dst, SDL_Rect *dstrect);
+/* alias for private surface blitting functions */
+alias int function(SDL_Surface *src, SDL_Rect *srcrect,
+			SDL_Surface *dst, SDL_Rect *dstrect) SDL_blit;
 
 /* This structure should be treated as read-only, except for 'pixels',
    which, if not NULL, contains the raw pixel data for the surface.
@@ -132,7 +132,7 @@
 const uint SDL_PREALLOC	= 0x01000000;	/* Surface uses preallocated memory */
 
 /* Evaluates to true if the surface needs to be locked before access */
-bit SDL_MUSTLOCK(SDL_Surface *surface)
+bool SDL_MUSTLOCK(SDL_Surface *surface)
 {
 	return surface.offset || ((surface.flags &
 		(SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_RLEACCEL)) != 0);
@@ -186,7 +186,7 @@
 	/* Special flags */
 	union
 	{
-		bit hw_overlay;
+		bool hw_overlay;
 		Uint32 _dummy;
 	}
 //		Uint32 hw_overlay :1;	/* Flag: This overlay hardware accelerated? */
@@ -540,7 +540,7 @@
 SDL_Surface * SDL_LoadBMP_RW(SDL_RWops *src, int freesrc);
 
 /* Convenience macro -- load a surface from a file */
-SDL_Surface * SDL_LoadBMP(char* file)
+SDL_Surface * SDL_LoadBMP(const(char)* file)
 {
 	return SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1);
 }
@@ -554,7 +554,7 @@
 		(SDL_Surface *surface, SDL_RWops *dst, int freedst);
 
 /* Convenience macro -- save a surface to a file */
-int SDL_SaveBMP(SDL_Surface *surface, char* file)
+int SDL_SaveBMP(SDL_Surface *surface, const(char)* file)
 {
 	return SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1);
 }
@@ -837,7 +837,7 @@
 /*
  * Sets/Gets the title and icon text of the display window
  */
-void SDL_WM_SetCaption(char *title, char *icon);
+void SDL_WM_SetCaption(const(char) *title, char *icon);
 void SDL_WM_GetCaption(char **title, char **icon);
 
 /*
--- a/import/bulletml.d
+++ b/import/bulletml.d
@@ -1,7 +1,7 @@
 extern (C) {
 alias int BulletMLParserTinyXML;
-int* BulletMLParserTinyXML_new(char*);
-void BulletMLParserTinyXML_parse(int* );
+int* BulletMLParserTinyXML_new(const(char)*);
+void BulletMLParserTinyXML_parse(int*);
 void BulletMLParserTinyXML_delete(int*);
 alias int BulletMLParser;
 alias int BulletMLState;
@@ -10,22 +10,22 @@
 int* BulletMLRunner_new_parser(BulletMLParser*);
 int* BulletMLRunner_new_state(BulletMLState*);
 void BulletMLRunner_delete(int*);
-void BulletMLRunner_run(int* );
-bool BulletMLRunner_isEnd(int* );
-void BulletMLRunner_set_getBulletDirection(int*, double (*fp) (int* )); 
-void BulletMLRunner_set_getAimDirection(int*, double (*fp) (int* )); 
-void BulletMLRunner_set_getBulletSpeed(int*, double (*fp) (int* )); 
-void BulletMLRunner_set_getDefaultSpeed(int*, double (*fp) (int* )); 
-void BulletMLRunner_set_getRank(int*, double (*fp) (int* )); 
-void BulletMLRunner_set_createSimpleBullet(int*, void (*fp) (int* , double, double)); 
-void BulletMLRunner_set_createBullet(int*, void (*fp) (int* , BulletMLState*, double, double)); 
-void BulletMLRunner_set_getTurn(int*, int (*fp) (int* )); 
-void BulletMLRunner_set_doVanish(int*, void (*fp) (int* )); 
-void BulletMLRunner_set_doChangeDirection(int*, void (*fp) (int* , double)); 
-void BulletMLRunner_set_doChangeSpeed(int*, void (*fp) (int* , double)); 
-void BulletMLRunner_set_doAccelX(int*, void (*fp) (int* , double)); 
-void BulletMLRunner_set_doAccelY(int*, void (*fp) (int* , double)); 
-void BulletMLRunner_set_getBulletSpeedX(int*, double (*fp) (int* )); 
-void BulletMLRunner_set_getBulletSpeedY(int*, double (*fp) (int* )); 
-void BulletMLRunner_set_getRand(int*, double (*fp) (int* )); 
+void BulletMLRunner_run(int*);
+bool BulletMLRunner_isEnd(int*);
+void BulletMLRunner_set_getBulletDirection(int*, double function(int*) fp); 
+void BulletMLRunner_set_getAimDirection(int*, double function(int*) fp); 
+void BulletMLRunner_set_getBulletSpeed(int*, double function(int*) fp); 
+void BulletMLRunner_set_getDefaultSpeed(int*, double function(int*) fp); 
+void BulletMLRunner_set_getRank(int*, double function(int*) fp); 
+void BulletMLRunner_set_createSimpleBullet(int*, void function(int*, double, double) fp); 
+void BulletMLRunner_set_createBullet(int*, void function(int*, BulletMLState*, double, double) fp); 
+void BulletMLRunner_set_getTurn(int*, int function(int*) fp); 
+void BulletMLRunner_set_doVanish(int*, void function(int*) fp); 
+void BulletMLRunner_set_doChangeDirection(int*, void function(int*, double) fp); 
+void BulletMLRunner_set_doChangeSpeed(int*, void function(int*, double) fp); 
+void BulletMLRunner_set_doAccelX(int*, void function(int*, double) fp); 
+void BulletMLRunner_set_doAccelY(int*, void function(int*, double) fp); 
+void BulletMLRunner_set_getBulletSpeedX(int*, double function(int*) fp); 
+void BulletMLRunner_set_getBulletSpeedY(int*, double function(int*) fp); 
+void BulletMLRunner_set_getRand(int*, double function(int*) fp); 
 }
--- a/import/opengl.d
+++ b/import/opengl.d
@@ -1,10 +1,4 @@
-version (Win32) {
-	private import std.c.windows.windows;
-	extern(Windows):
-}
-version (linux) {
-	extern(C):
-}
+extern(System):
 
 alias uint GLenum;
 alias ubyte GLboolean;
@@ -165,6 +159,7 @@
 const uint GL_3_BYTES                    = 0x1408;
 const uint GL_4_BYTES                    = 0x1409;
 const uint GL_DOUBLE                     = 0x140A;
+const uint GL_UNSIGNED_INT_8_8_8_8_REV   = 0x8367;
 
 /* DepthFunction */
 /*      GL_NEVER */
@@ -1116,7 +1111,7 @@
 /*************************************************************/
 
 void /*APIENTRY*/glAccum (GLenum op, GLfloat value);
-//void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf ref);
+void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf ref_);
 GLboolean /*APIENTRY*/glAreTexturesResident (GLsizei n, GLuint *textures, GLboolean *residences);
 void /*APIENTRY*/glArrayElement (GLint i);
 void /*APIENTRY*/glBegin (GLenum mode);
@@ -1369,7 +1364,7 @@
 void /*APIENTRY*/glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
 void /*APIENTRY*/glSelectBuffer (GLsizei size, GLuint *buffer);
 void /*APIENTRY*/glShadeModel (GLenum mode);
-//void /*APIENTRY*/glStencilFunc (GLenum func, GLint ref, GLuint mask);
+void /*APIENTRY*/glStencilFunc (GLenum func, GLint ref_, GLuint mask);
 void /*APIENTRY*/glStencilMask (GLuint mask);
 void /*APIENTRY*/glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
 void /*APIENTRY*/glTexCoord1d (GLdouble s);
@@ -1454,35 +1449,30 @@
 
 
 /* EXT_vertex_array */
-typedef void (* PFNGLARRAYELEMENTEXTPROC) (GLint i);
-typedef void (* PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (* PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer);
-typedef void (* PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer);
-typedef void (* PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer);
-typedef void (* PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer);
-typedef void (* PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer);
-typedef void (* PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, GLboolean *pointer);
-typedef void (* PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params);
-typedef void (* PFNGLARRAYELEMENTARRAYEXTPROC)(GLenum mode, GLsizei count, GLvoid* pi);
+alias void function(GLint i) PFNGLARRAYELEMENTEXTPROC;
+alias void function(GLenum mode, GLint first, GLsizei count) PFNGLDRAWARRAYSEXTPROC;
+alias void function(GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer) PFNGLVERTEXPOINTEREXTPROC;
+alias void function(GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer) PFNGLNORMALPOINTEREXTPROC;
+alias void function(GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer) PFNGLCOLORPOINTEREXTPROC;
+alias void function(GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer) PFNGLINDEXPOINTEREXTPROC;
+alias void function(GLint size, GLenum type, GLsizei stride, GLsizei count, GLvoid *pointer) PFNGLTEXCOORDPOINTEREXTPROC;
+alias void function(GLsizei stride, GLsizei count, GLboolean *pointer) PFNGLEDGEFLAGPOINTEREXTPROC;
+alias void function(GLenum pname, GLvoid* *params) PFNGLGETPOINTERVEXTPROC;
+alias void function(GLenum mode, GLsizei count, GLvoid* pi) PFNGLARRAYELEMENTARRAYEXTPROC;
 
 /* WIN_draw_range_elements */
-typedef void (* PFNGLDRAWRANGEELEMENTSWINPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLvoid *indices);
+alias void function(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLvoid *indices) PFNGLDRAWRANGEELEMENTSWINPROC;
 
 /* WIN_swap_hint */
-typedef void (* PFNGLADDSWAPHINTRECTWINPROC)  (GLint x, GLint y, GLsizei width, GLsizei height);
+alias void function(GLint x, GLint y, GLsizei width, GLsizei height) PFNGLADDSWAPHINTRECTWINPROC;
 
 /* EXT_paletted_texture */
-typedef void (* PFNGLCOLORTABLEEXTPROC)
-    (GLenum target, GLenum internalFormat, GLsizei width, GLenum format,
-     GLenum type, GLvoid *data);
-typedef void (* PFNGLCOLORSUBTABLEEXTPROC)
-    (GLenum target, GLsizei start, GLsizei count, GLenum format,
-     GLenum type, GLvoid *data);
-typedef void (* PFNGLGETCOLORTABLEEXTPROC)
-    (GLenum target, GLenum format, GLenum type, GLvoid *data);
-typedef void (* PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)
-    (GLenum target, GLenum pname, GLint *params);
-typedef void (* PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)
-    (GLenum target, GLenum pname, GLfloat *params);
+alias void function(GLenum target, GLenum internalFormat, GLsizei width, GLenum format,
+     GLenum type, GLvoid *data) PFNGLCOLORTABLEEXTPROC;
+alias void function(GLenum target, GLsizei start, GLsizei count, GLenum format,
+     GLenum type, GLvoid *data) PFNGLCOLORSUBTABLEEXTPROC;
+alias void function(GLenum target, GLenum format, GLenum type, GLvoid *data) PFNGLGETCOLORTABLEEXTPROC;
+alias void function(GLenum target, GLenum pname, GLint *params) PFNGLGETCOLORTABLEPARAMETERIVEXTPROC;
+alias void function(GLenum target, GLenum pname, GLfloat *params) PFNGLGETCOLORTABLEPARAMETERFVEXTPROC;
 
 //import openglu;
--- a/import/openglu.d
+++ b/import/openglu.d
@@ -1,11 +1,6 @@
 import opengl;
 
-version (Win32) {
-	extern(Windows):
-}
-version (linux) {
-	extern(C):
-}
+extern(System):
 
 GLubyte* gluErrorString (
     GLenum   errCode);
@@ -33,7 +28,7 @@
     GLdouble y, 
     GLdouble width, 
     GLdouble height, 
-    GLint[4]    viewport);
+    ref GLint[4] viewport);
 
 void gluLookAt (
     GLdouble eyex, 
@@ -50,9 +45,9 @@
     GLdouble        objx, 
     GLdouble        objy, 
     GLdouble        objz,  
-    GLdouble[16]    modelMatrix, 
-    GLdouble[16]    projMatrix, 
-    GLint[4]        viewport, 
+    ref GLdouble[16] modelMatrix, 
+    ref GLdouble[16] projMatrix, 
+    ref GLint[4]    viewport, 
     GLdouble        *winx, 
     GLdouble        *winy, 
     GLdouble        *winz);
@@ -61,8 +56,8 @@
     GLdouble       winx, 
     GLdouble       winy, 
     GLdouble       winz, 
-    GLdouble[16]   modelMatrix, 
-    GLdouble[16]   projMatrix, 
+    ref GLdouble[16] modelMatrix, 
+    ref GLdouble[16] projMatrix, 
     GLint[4]       viewport, 
     GLdouble       *objx, 
     GLdouble       *objy, 
@@ -89,7 +84,7 @@
     GLenum      type, 
     void  *data);
 
-public int gluBuild2DMipmaps (
+int gluBuild2DMipmaps (
     GLenum      target, 
     GLint       components, 
     GLint       width, 
@@ -162,7 +157,7 @@
 void gluQuadricCallback (
     GLUquadric          *qobj, 
     GLenum              which, 
-    void                (* fn)());
+    void                function() fn);
 
 GLUtesselator*  gluNewTess(          
     );
@@ -179,7 +174,7 @@
 
 void  gluTessVertex(       
     GLUtesselator       *tess,
-    GLdouble[3]         coords, 
+    ref GLdouble[3]     coords, 
     void                *data );
 
 void  gluTessEndContour(   
@@ -202,7 +197,7 @@
 void  gluTessCallback(     
     GLUtesselator       *tess,
     GLenum              which, 
-    void                ( *fn)());
+    void                function() fn);
 
 void  gluGetTessProperty(  
     GLUtesselator       *tess,
@@ -265,9 +260,9 @@
 void 
 gluLoadSamplingMatrices (
     GLUnurbs            *nobj, 
-    GLfloat[16]     modelMatrix, 
-    GLfloat[16]     projMatrix, 
-    GLint[4]        viewport );
+    ref GLfloat[16]     modelMatrix, 
+    ref GLfloat[16]     projMatrix, 
+    ref GLint[4]        viewport );
 
 void 
 gluNurbsProperty (
@@ -285,37 +280,37 @@
 gluNurbsCallback (
     GLUnurbs            *nobj, 
     GLenum              which, 
-    void                (* fn)() );
+    void                function() fn );
 
 
 /****            function prototypes    ****/
 
 /* gluQuadricCallback */
-typedef void (* GLUquadricErrorProc) (GLenum);
+alias void function(GLenum) GLUquadricErrorProc;
 
 /* gluTessCallback */
-typedef void (* GLUtessBeginProc)        (GLenum);
-typedef void (* GLUtessEdgeFlagProc)     (GLboolean);
-typedef void (* GLUtessVertexProc)       (void *);
-typedef void (* GLUtessEndProc)          ();
-typedef void (* GLUtessErrorProc)        (GLenum);
-typedef void (* GLUtessCombineProc)      (GLdouble[3],
-                                                  void*[4], 
-                                                  GLfloat[4],
-                                                  void** );
-typedef void (* GLUtessBeginDataProc)    (GLenum, void *);
-typedef void (* GLUtessEdgeFlagDataProc) (GLboolean, void *);
-typedef void (* GLUtessVertexDataProc)   (void *, void *);
-typedef void (* GLUtessEndDataProc)      (void *);
-typedef void (* GLUtessErrorDataProc)    (GLenum, void *);
-typedef void (* GLUtessCombineDataProc)  (GLdouble[3],
-                                                  void*[4], 
-                                                  GLfloat[4],
-                                                  void**,
-                                                  void* );
+alias void function(GLenum) GLUtessBeginProc;
+alias void function(GLboolean) GLUtessEdgeFlagProc;
+alias void function(void *) GLUtessVertexProc;
+alias void function() GLUtessEndProc;
+alias void function(GLenum) GLUtessErrorProc;
+alias void function(ref GLdouble[3],
+                    ref void*[4], 
+                    ref GLfloat[4],
+                    void**) GLUtessCombineProc;
+alias void function(GLenum, void *) GLUtessBeginDataProc;
+alias void function(GLboolean, void *) GLUtessEdgeFlagDataProc;
+alias void function(void *, void *) GLUtessVertexDataProc;
+alias void function(void *) GLUtessEndDataProc;
+alias void function(GLenum, void *) GLUtessErrorDataProc;
+alias void function(ref GLdouble[3],
+                    ref void*[4], 
+                    ref GLfloat[4],
+                    void**,
+                    void*) GLUtessCombineDataProc;
 
 /* gluNurbsCallback */
-typedef void (* GLUnurbsErrorProc)   (GLenum);
+alias void function(GLenum) GLUnurbsErrorProc;
 
 
 /****           Generic constants               ****/
--- a/import/MPEGfilter.d
+++ b/import/MPEGfilter.d
@@ -36,8 +36,8 @@
 	}
 
 /* Callback functions for the filter */
-	typedef void (* SMPEG_FilterCallback)( SDL_Overlay * dest, SDL_Overlay * source, SDL_Rect * region, SMPEG_FilterInfo * filter_info, void * data );
-	typedef void (* SMPEG_FilterDestroy)( SMPEG_Filter * filter );
+	alias void function( SDL_Overlay * dest, SDL_Overlay * source, SDL_Rect * region, SMPEG_FilterInfo * filter_info, void * data ) SMPEG_FilterCallback;
+	alias void function( SMPEG_Filter * filter ) SMPEG_FilterDestroy;
 
 /* The filter definition itself */
 	struct SMPEG_Filter {
--- a/import/smpeg.d
+++ b/import/smpeg.d
@@ -75,8 +75,8 @@
 
 
 /* Matches the declaration of SDL_UpdateRect() */
-	typedef void(*SMPEG_DisplayCallback)(SDL_Surface* dst, int x, int y,
-										 uint w, uint h);
+	alias void function(SDL_Surface* dst, int x, int y,
+										 uint w, uint h) SMPEG_DisplayCallback;
 
 /* Create a new SMPEG object from an MPEG file.
    On return, if 'info' is not NULL, it will be filled with information 
@@ -135,7 +135,7 @@
 	void SMPEG_scaleXY( SMPEG* mpeg, int width, int height );
 	void SMPEG_scale( SMPEG* mpeg, int scale );
 /* */
-	void SMPEG_double(SMPEG* mpeg, bit on) {
+	void SMPEG_double(SMPEG* mpeg, bool on) {
 		SMPEG_scale(mpeg, (on) ? 2 : 1);
 	}
 
