X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_joystick.c;h=82fc444eda8ddde2d9e5b242085ea7049a1671dc;hb=f5a6203a479c182d2a2fad69186acb1430c53886;hp=378e408fc1dd43b547b65fea2c3f9d80ab864b97;hpb=9b5ed2940eac112c894bb43f802fbda5b1c8b27a;p=freeglut diff --git a/src/freeglut_joystick.c b/src/freeglut_joystick.c index 378e408..82fc444 100644 --- a/src/freeglut_joystick.c +++ b/src/freeglut_joystick.c @@ -56,8 +56,12 @@ #else # include # include -# ifdef __FreeBSD__ +# if defined(__FreeBSD__) || defined(__NetBSD__) +# if __FreeBSD_version >= 500000 +# include +# else # include +# endif # define JS_DATA_TYPE joystick # define JS_RETURN (sizeof(struct JS_DATA_TYPE)) # elif defined(__linux__) @@ -247,13 +251,13 @@ static void fghJoystickRawRead ( SFG_Joystick* joy, int* buttons, float* axes ) if( status != JS_RETURN ) { - g_warning( joy->fname ); + fgWarning( "%s", joy->fname ); joy->error = TRUE; return; } if( buttons ) -# ifdef __FreeBSD__ +# if defined(__FreeBSD__) || defined(__NetBSD__) *buttons = (joy->js.b1 ? 1 : 0) | (joy->js.b2 ? 2 : 0); # else *buttons = joy->js.buttons; @@ -413,7 +417,7 @@ static void fghJoystickOpen( SFG_Joystick* joy ) if( joy->error ) return ; - sprintf( joyfname, "%s/.joy%drc", g_getenv( "HOME" ), joy->id ); + sprintf( joyfname, "%s/.joy%drc", getenv( "HOME" ), joy->id ); joyfile = fopen( joyfname, "r" ); joy->error = (joyfile == NULL);