--- runtime/parrot/library/SDL.imc.orig	Sun Dec 12 08:52:51 2004
+++ runtime/parrot/library/SDL.imc	Thu Apr  7 10:59:09 2005
@@ -78,6 +78,11 @@
 	.local pmc libsdl
 	.local pmc sdl_function
 
+	.local string osname
+	osname= _get_config_osname()
+	if 'MSWin32' == osname goto LIB_WIN32
+
+LIB_DEFAULT:
 	loadlib libsdl, 'libSDL'
 	$I0 = typeof libsdl
 	if $I0 != .Undef goto OK
@@ -91,7 +96,13 @@
 	loadlib libsdl, 'libSDL-1.2.so.0'
 	$I0 = typeof libsdl
 	if $I0 != .Undef goto OK_HINT2
-	
+	branch OK
+LIB_WIN32:
+	loadlib libsdl, 'SDL'
+	$I0 = typeof libsdl
+	if $I0 == .Undef goto LIB_LOAD_ERROR
+	branch OK
+LIB_LOAD_ERROR:	
 	# failed to load libSDL
 	$P0 = new Exception
 	$P0["_message"] = "libSDL not found!"
@@ -155,6 +166,11 @@
 	.local pmc image_lib
 	.local pmc nci_sub
 
+	.local string osname
+	osname= _get_config_osname()
+	if 'MSWin32' == osname goto LIB_WIN32
+
+LIB_DEFAULT:
 	loadlib image_lib, 'libSDL_image'
 	$I0 = typeof image_lib
 	if $I0 != .Undef goto OK
@@ -166,7 +182,13 @@
 	loadlib image_lib, 'libSDL_image-1.2.so.0'
 	$I0 = typeof image_lib
 	if $I0 != .Undef goto OK_HINT2
-
+	branch OK
+LIB_WIN32:
+	loadlib image_lib, 'SDL_image'
+	$I0 = typeof image_lib
+	if $I0 == .Undef goto LIB_LOAD_ERROR
+	branch OK
+LIB_LOAD_ERROR:	
 	# failed to load libSDL
 	$P0 = new Exception
 	$P0["_message"] = "libSDL_image not found!"
@@ -634,6 +656,19 @@
 	set  layouts[ 'Pixels' ], layout
 .end
 
+.sub _get_config_osname
+	.local pmc config
+	.local string osname
+
+	config= _config()
+	osname= config['osname']
+
+	.return( osname )
+.end
+
+.include 'library/config.imc'
+
+
 =head2 The SDL::NCI Namespace
 
 Besides all of the actual NCI subs, there's one additional subroutine in the
