+/*\r
+ * Platform-Specific Code\r
+ */\r
+\r
+#if TARGET_HOST_MACINTOSH\r
+void fgPlatformJoystickClose ( int ident )\r
+{\r
+ ISpSuspend( );\r
+ ISpStop( );\r
+ ISpShutdown( );\r
+}\r
+#endif\r
+\r
+#if TARGET_HOST_MAC_OSX\r
+void fgPlatformJoystickClose ( int ident )\r
+{\r
+ ( *( fgJoystick[ ident ]->hidDev ) )->\r
+ close( fgJoystick[ ident ]->hidDev );\r
+}\r
+#endif\r
+\r
+#if TARGET_HOST_POSIX_X11\r
+void fgPlatformJoystickClose ( int ident )\r
+{\r
+#if defined( __FreeBSD__ ) || defined(__FreeBSD_kernel__) || defined( __NetBSD__ )\r
+ if( fgJoystick[ident]->os )\r
+ {\r
+ if( ! fgJoystick[ ident ]->error )\r
+ close( fgJoystick[ ident ]->os->fd );\r
+#ifdef HAVE_USB_JS\r
+ if( fgJoystick[ ident ]->os->hids )\r
+ free (fgJoystick[ ident ]->os->hids);\r
+ if( fgJoystick[ ident ]->os->hid_data_buf )\r
+ free( fgJoystick[ ident ]->os->hid_data_buf );\r
+#endif\r
+ free( fgJoystick[ident]->os );\r
+ }\r
+#endif\r
+\r
+ if( ! fgJoystick[ident]->error )\r
+ close( fgJoystick[ ident ]->fd );\r
+}\r
+#endif\r
+\r
+\r