From 72e830f256419c58165b5ca7c45ecf8b60bf6935 Mon Sep 17 00:00:00 2001 From: dcnieho Date: Mon, 31 Jul 2017 20:49:16 +0000 Subject: [PATCH 1/2] Fixed freeglut.pdb install for builds with MSVC compiler and NMake. The CMake variable "MSVC" indicates that the Visual Studio compiler is used but when using that compiler and the "NMake Makefiles JOM" build generator the *.pdb is wasn't output in a "Debug" directory. (cherry picked from commit 4e6bceed00b2c64a3cfc0bcbf84350f656a4a7c3) git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1834 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/freeglut/freeglut/CMakeLists.txt b/freeglut/freeglut/CMakeLists.txt index c86d4ce..fef41fd 100644 --- a/freeglut/freeglut/CMakeLists.txt +++ b/freeglut/freeglut/CMakeLists.txt @@ -484,10 +484,17 @@ IF(FREEGLUT_BUILD_SHARED_LIBS) INCLUDES DESTINATION include ) IF(INSTALL_PDB) - INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/freeglut${CMAKE_DEBUG_POSTFIX}.pdb - DESTINATION bin - CONFIGURATIONS Debug - COMPONENT Devel) + IF(CMAKE_GENERATOR MATCHES "^Visual Studio") + INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/freeglut${CMAKE_DEBUG_POSTFIX}.pdb + DESTINATION bin + CONFIGURATIONS Debug + COMPONENT Devel) + ELSE() + INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/freeglut${CMAKE_DEBUG_POSTFIX}.pdb + DESTINATION bin + CONFIGURATIONS Debug + COMPONENT Devel) + ENDIF() ENDIF() ENDIF() IF(FREEGLUT_BUILD_STATIC_LIBS) From 5bcf802a95af7656749eb198459f4fdc0bf44fcd Mon Sep 17 00:00:00 2001 From: dcnieho Date: Mon, 31 Jul 2017 20:49:26 +0000 Subject: [PATCH 2/2] Fix build on NetBSD. (cherry picked from commit 1236c7644508227b616e97e29e123b34257e36d1) git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1835 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/fg_joystick.c | 59 -------------------- freeglut/freeglut/src/x11/fg_joystick_x11.c | 61 +++++++++++++++++++++ 2 files changed, 61 insertions(+), 59 deletions(-) diff --git a/freeglut/freeglut/src/fg_joystick.c b/freeglut/freeglut/src/fg_joystick.c index e548c04..b24476a 100644 --- a/freeglut/freeglut/src/fg_joystick.c +++ b/freeglut/freeglut/src/fg_joystick.c @@ -40,65 +40,6 @@ #define JS_TRUE 1 #define JS_FALSE 0 -/* BSD defines from "jsBSD.cxx" around lines 42-270 */ - -#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - -# ifdef HAVE_USB_JS -# if defined(__NetBSD__) -# ifdef HAVE_USBHID_H -# include -# else -# include -# endif -# include -# elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -# ifdef HAVE_USBHID_H -# include -# else -# include -# endif -# include -# endif -# include - -/* Compatibility with older usb.h revisions */ -# if !defined(USB_MAX_DEVNAMES) && defined(MAXDEVNAMES) -# define USB_MAX_DEVNAMES MAXDEVNAMES -# endif -# endif - -struct os_specific_s { - char fname [128 ]; - int fd; - int is_analog; - /* The following structure members are specific to analog joysticks */ - struct joystick ajs; -# ifdef HAVE_USB_JS - /* The following structure members are specific to USB joysticks */ - struct hid_item *hids; - int hid_dlen; - int hid_offset; - char *hid_data_buf; - int axes_usage [ _JS_MAX_AXES ]; -# endif - /* We keep button and axes state ourselves, as they might not be updated - * on every read of a USB device - */ - int cache_buttons; - float cache_axes [ _JS_MAX_AXES ]; -}; - -/* Idents lower than USB_IDENT_OFFSET are for analog joysticks. */ -# define USB_IDENT_OFFSET 2 - -# define USBDEV "/dev/usb" -# define UHIDDEV "/dev/uhid" -# define AJSDEV "/dev/joy" - - -#endif - /* * Functions associated with the "jsJoystick" class in PLIB */ diff --git a/freeglut/freeglut/src/x11/fg_joystick_x11.c b/freeglut/freeglut/src/x11/fg_joystick_x11.c index 30ad4b5..8c75bbe 100644 --- a/freeglut/freeglut/src/x11/fg_joystick_x11.c +++ b/freeglut/freeglut/src/x11/fg_joystick_x11.c @@ -42,8 +42,68 @@ #include +/* BSD defines from "jsBSD.cxx" around lines 42-270 */ + #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +# ifdef HAVE_USB_JS +# if defined(__NetBSD__) +# ifdef HAVE_USBHID_H +# include +# else +# include +# endif +# include +# elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +# ifdef HAVE_USBHID_H +# include +# else +# include +# endif +# include +# endif +# include + +/* Compatibility with older usb.h revisions */ +# if !defined(USB_MAX_DEVNAMES) && defined(MAXDEVNAMES) +# define USB_MAX_DEVNAMES MAXDEVNAMES +# endif +# endif + +struct os_specific_s { + char fname [128 ]; + int fd; + int is_analog; + /* The following structure members are specific to analog joysticks */ + struct joystick ajs; +# ifdef HAVE_USB_JS + /* The following structure members are specific to USB joysticks */ + struct hid_item *hids; + int hid_dlen; + int hid_offset; + char *hid_data_buf; + int axes_usage [ _JS_MAX_AXES ]; +# endif + /* We keep button and axes state ourselves, as they might not be updated + * on every read of a USB device + */ + int cache_buttons; + float cache_axes [ _JS_MAX_AXES ]; +}; + +/* Idents lower than USB_IDENT_OFFSET are for analog joysticks. */ +# define USB_IDENT_OFFSET 2 + +# define USBDEV "/dev/usb" +# define UHIDDEV "/dev/uhid" +# define AJSDEV "/dev/joy" + + +#endif + +#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) static int hatmap_x[9] = {0, 0, 1, 1, 1, 0, -1, -1, -1}; static int hatmap_y[9] = {0, 1, 1, 0, -1, -1, -1, 0, 1}; @@ -104,6 +164,7 @@ static int fghJoystickFindUSBdev(char *name, char *out, int outlen) } return 0; } +#endif static int fghJoystickInitializeHID(struct os_specific_s *os, int *num_axes, int *num_buttons)