Added a dummy sensor driver
authorSam Lantinga <slouken@libsdl.org>
Tue, 21 Aug 2018 13:29:21 -0700
changeset 121319601849b3079
parent 12130 24142c5073a4
child 12132 6294a77d0420
Added a dummy sensor driver
Makefile.minimal
Makefile.pandora
Makefile.psp
Makefile.wiz
Xcode/SDL/SDL.xcodeproj/project.pbxproj
configure
configure.in
include/SDL_config.h.cmake
include/SDL_config.h.in
include/SDL_config_iphoneos.h
include/SDL_config_macosx.h
include/SDL_config_minimal.h
include/SDL_config_pandora.h
include/SDL_config_psp.h
include/SDL_config_windows.h
include/SDL_config_winrt.h
include/SDL_config_wiz.h
src/sensor/SDL_sensor.c
src/sensor/SDL_syssensor.h
src/sensor/dummy/SDL_dummysensor.c
src/sensor/dummy/SDL_dummysensor.h
     1.1 --- a/Makefile.minimal	Tue Aug 21 12:11:34 2018 -0700
     1.2 +++ b/Makefile.minimal	Tue Aug 21 13:29:21 2018 -0700
     1.3 @@ -23,6 +23,7 @@
     1.4  	src/render/*.c \
     1.5  	src/render/software/*.c \
     1.6  	src/sensor/*.c \
     1.7 +	src/sensor/dummy/*.c \
     1.8  	src/stdlib/*.c \
     1.9  	src/thread/*.c \
    1.10  	src/thread/generic/*.c \
     2.1 --- a/Makefile.pandora	Tue Aug 21 12:11:34 2018 -0700
     2.2 +++ b/Makefile.pandora	Tue Aug 21 13:29:21 2018 -0700
     2.3 @@ -12,15 +12,38 @@
     2.4  
     2.5  TARGET  = libSDL.a
     2.6  
     2.7 -SOURCES = ./src/*.c ./src/audio/*.c ./src/cpuinfo/*.c ./src/events/*.c \
     2.8 -	./src/file/*.c ./src/sensor/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \
     2.9 -	./src/joystick/*.c ./src/haptic/*.c ./src/power/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \
    2.10 -	./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c \
    2.11 -	./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \
    2.12 -	./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \
    2.13 -	./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c \
    2.14 -	./src/atomic/*.c ./src/filesystem/unix/*.c \
    2.15 -	./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o ./src/video/x11/*.c 
    2.16 +SOURCES = 
    2.17 +	./src/*.c \
    2.18 +	./src/atomic/*.c \
    2.19 +	./src/audio/*.c \
    2.20 +	./src/audio/disk/*.c \
    2.21 +	./src/audio/dsp/*.c \
    2.22 +	./src/audio/dummy/*.c \
    2.23 +	./src/cpuinfo/*.c \
    2.24 +	./src/events/*.c \
    2.25 +	./src/file/*.c \
    2.26 +	./src/filesystem/unix/*.c \
    2.27 +	./src/haptic/*.c \
    2.28 +	./src/haptic/linux/*.c \
    2.29 +	./src/joystick/*.c \
    2.30 +	./src/joystick/linux/*.c \
    2.31 +	./src/loadso/dlopen/*.c \
    2.32 +	./src/power/*.c \
    2.33 +	./src/sensor/*.c \
    2.34 +	./src/sensor/dummy/*.c \
    2.35 +	./src/stdlib/*.c \
    2.36 +	./src/thread/*.c \
    2.37 +	./src/thread/pthread/SDL_syscond.c \
    2.38 +	./src/thread/pthread/SDL_sysmutex.c \
    2.39 +	./src/thread/pthread/SDL_syssem.c \
    2.40 +	./src/thread/pthread/SDL_systhread.c \
    2.41 +	./src/timer/*.c \
    2.42 +	./src/timer/unix/*.c \
    2.43 +	./src/video/*.c \
    2.44 +	./src/video/dummy/*.c \
    2.45 +	./src/video/pandora/SDL_pandora.o \
    2.46 +	./src/video/pandora/SDL_pandora_events.o \
    2.47 +	./src/video/x11/*.c \
    2.48  	
    2.49  
    2.50  OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
     3.1 --- a/Makefile.psp	Tue Aug 21 12:11:34 2018 -0700
     3.2 +++ b/Makefile.psp	Tue Aug 21 13:29:21 2018 -0700
     3.3 @@ -43,6 +43,7 @@
     3.4        src/render/software/SDL_render_sw.o \
     3.5        src/render/software/SDL_rotate.o \
     3.6        src/sensor/SDL_sensor.o \
     3.7 +      src/sensor/dummy/SDL_dummysensor.o \
     3.8        src/stdlib/SDL_getenv.o \
     3.9        src/stdlib/SDL_iconv.o \
    3.10        src/stdlib/SDL_malloc.o \
     4.1 --- a/Makefile.wiz	Tue Aug 21 12:11:34 2018 -0700
     4.2 +++ b/Makefile.wiz	Tue Aug 21 13:29:21 2018 -0700
     4.3 @@ -12,14 +12,33 @@
     4.4  TARGET_STATIC  = libSDL2.a
     4.5  TARGET_SHARED  = libSDL2.so
     4.6  
     4.7 -SOURCES = ./src/*.c ./src/audio/*.c ./src/cpuinfo/*.c ./src/events/*.c \
     4.8 -	./src/file/*.c ./src/sensor/*.c ./src/stdlib/*.c ./src/thread/*.c ./src/timer/*.c ./src/video/*.c \
     4.9 -	./src/joystick/*.c ./src/haptic/*.c ./src/video/dummy/*.c ./src/audio/disk/*.c \
    4.10 -	./src/audio/dummy/*.c ./src/loadso/dlopen/*.c ./src/audio/dsp/*.c \
    4.11 -	./src/thread/pthread/SDL_systhread.c ./src/thread/pthread/SDL_syssem.c \
    4.12 -	./src/thread/pthread/SDL_sysmutex.c ./src/thread/pthread/SDL_syscond.c \
    4.13 -	./src/joystick/linux/*.c ./src/haptic/linux/*.c ./src/timer/unix/*.c \
    4.14 -	./src/video/pandora/SDL_pandora.o ./src/video/pandora/SDL_pandora_events.o
    4.15 +SOURCES = \
    4.16 +	./src/*.c \
    4.17 +	./src/audio/*.c \
    4.18 +	./src/audio/disk/*.c \
    4.19 +	./src/audio/dsp/*.c \
    4.20 +	./src/audio/dummy/*.c \
    4.21 +	./src/cpuinfo/*.c \
    4.22 +	./src/events/*.c \
    4.23 +	./src/file/*.c \
    4.24 +	./src/haptic/*.c \
    4.25 +	./src/haptic/linux/*.c \
    4.26 +	./src/joystick/*.c \
    4.27 +	./src/joystick/linux/*.c \
    4.28 +	./src/loadso/dlopen/*.c \
    4.29 +	./src/sensor/*.c \
    4.30 +	./src/sensor/dummy/*.c \
    4.31 +	./src/stdlib/*.c \
    4.32 +	./src/thread/*.c \
    4.33 +	./src/thread/pthread/SDL_syscond.c \
    4.34 +	./src/thread/pthread/SDL_sysmutex.c \
    4.35 +	./src/thread/pthread/SDL_syssem.c \
    4.36 +	./src/thread/pthread/SDL_systhread.c \
    4.37 +	./src/timer/*.c \
    4.38 +	./src/timer/unix/*.c \
    4.39 +	./src/video/*.c \
    4.40 +	./src/video/dummy/*.c \
    4.41 +	./src/video/pandora/*.c \
    4.42  	
    4.43  
    4.44  OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g')
     5.1 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Tue Aug 21 12:11:34 2018 -0700
     5.2 +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Tue Aug 21 13:29:21 2018 -0700
     5.3 @@ -913,6 +913,12 @@
     5.4  		F30D9C8A212BC94F0047DF2E /* SDL_sensor.c in Sources */ = {isa = PBXBuildFile; fileRef = F30D9C83212BC94F0047DF2E /* SDL_sensor.c */; };
     5.5  		F30D9C8B212BC94F0047DF2E /* SDL_sensor.c in Sources */ = {isa = PBXBuildFile; fileRef = F30D9C83212BC94F0047DF2E /* SDL_sensor.c */; };
     5.6  		F30D9C8C212BC94F0047DF2E /* SDL_sensor.c in Sources */ = {isa = PBXBuildFile; fileRef = F30D9C83212BC94F0047DF2E /* SDL_sensor.c */; };
     5.7 +		F30D9C90212CABDC0047DF2E /* SDL_dummysensor.h in Headers */ = {isa = PBXBuildFile; fileRef = F30D9C8E212CABDB0047DF2E /* SDL_dummysensor.h */; };
     5.8 +		F30D9C91212CABDC0047DF2E /* SDL_dummysensor.h in Headers */ = {isa = PBXBuildFile; fileRef = F30D9C8E212CABDB0047DF2E /* SDL_dummysensor.h */; };
     5.9 +		F30D9C92212CABDC0047DF2E /* SDL_dummysensor.h in Headers */ = {isa = PBXBuildFile; fileRef = F30D9C8E212CABDB0047DF2E /* SDL_dummysensor.h */; };
    5.10 +		F30D9C93212CABDC0047DF2E /* SDL_dummysensor.c in Sources */ = {isa = PBXBuildFile; fileRef = F30D9C8F212CABDB0047DF2E /* SDL_dummysensor.c */; };
    5.11 +		F30D9C94212CABDC0047DF2E /* SDL_dummysensor.c in Sources */ = {isa = PBXBuildFile; fileRef = F30D9C8F212CABDB0047DF2E /* SDL_dummysensor.c */; };
    5.12 +		F30D9C95212CABDC0047DF2E /* SDL_dummysensor.c in Sources */ = {isa = PBXBuildFile; fileRef = F30D9C8F212CABDB0047DF2E /* SDL_dummysensor.c */; };
    5.13  		F3950CD8212BC88D00F51292 /* SDL_sensor.h in Headers */ = {isa = PBXBuildFile; fileRef = F3950CD7212BC88D00F51292 /* SDL_sensor.h */; settings = {ATTRIBUTES = (Public, ); }; };
    5.14  		F3950CD9212BC88D00F51292 /* SDL_sensor.h in Headers */ = {isa = PBXBuildFile; fileRef = F3950CD7212BC88D00F51292 /* SDL_sensor.h */; settings = {ATTRIBUTES = (Public, ); }; };
    5.15  		F3950CDA212BC88D00F51292 /* SDL_sensor.h in Headers */ = {isa = PBXBuildFile; fileRef = F3950CD7212BC88D00F51292 /* SDL_sensor.h */; settings = {ATTRIBUTES = (Public, ); }; };
    5.16 @@ -1244,6 +1250,8 @@
    5.17  		F30D9C81212BC94E0047DF2E /* SDL_sensor_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sensor_c.h; sourceTree = "<group>"; };
    5.18  		F30D9C82212BC94F0047DF2E /* SDL_syssensor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_syssensor.h; sourceTree = "<group>"; };
    5.19  		F30D9C83212BC94F0047DF2E /* SDL_sensor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_sensor.c; sourceTree = "<group>"; };
    5.20 +		F30D9C8E212CABDB0047DF2E /* SDL_dummysensor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_dummysensor.h; sourceTree = "<group>"; };
    5.21 +		F30D9C8F212CABDB0047DF2E /* SDL_dummysensor.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_dummysensor.c; sourceTree = "<group>"; };
    5.22  		F3950CD7212BC88D00F51292 /* SDL_sensor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sensor.h; sourceTree = "<group>"; };
    5.23  		F59C710300D5CB5801000001 /* ReadMe.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = ReadMe.txt; sourceTree = "<group>"; };
    5.24  		F59C710600D5CB5801000001 /* SDL.info */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = SDL.info; sourceTree = "<group>"; };
    5.25 @@ -1998,9 +2006,19 @@
    5.26  			name = "Linked Frameworks";
    5.27  			sourceTree = "<group>";
    5.28  		};
    5.29 +		F30D9C8D212CABB40047DF2E /* dummy */ = {
    5.30 +			isa = PBXGroup;
    5.31 +			children = (
    5.32 +				F30D9C8F212CABDB0047DF2E /* SDL_dummysensor.c */,
    5.33 +				F30D9C8E212CABDB0047DF2E /* SDL_dummysensor.h */,
    5.34 +			);
    5.35 +			path = dummy;
    5.36 +			sourceTree = "<group>";
    5.37 +		};
    5.38  		F3950CDB212BC8BC00F51292 /* sensor */ = {
    5.39  			isa = PBXGroup;
    5.40  			children = (
    5.41 +				F30D9C8D212CABB40047DF2E /* dummy */,
    5.42  				F30D9C81212BC94E0047DF2E /* SDL_sensor_c.h */,
    5.43  				F30D9C83212BC94F0047DF2E /* SDL_sensor.c */,
    5.44  				F30D9C82212BC94F0047DF2E /* SDL_syssensor.h */,
    5.45 @@ -2189,6 +2207,7 @@
    5.46  				04F7804E12FB74A200FC43C0 /* SDL_blendpoint.h in Headers */,
    5.47  				56A67027185654B40007D20F /* SDL_dynapi.h in Headers */,
    5.48  				04F7804F12FB74A200FC43C0 /* SDL_draw.h in Headers */,
    5.49 +				F30D9C90212CABDC0047DF2E /* SDL_dummysensor.h in Headers */,
    5.50  				04F7805112FB74A200FC43C0 /* SDL_drawline.h in Headers */,
    5.51  				04F7805312FB74A200FC43C0 /* SDL_drawpoint.h in Headers */,
    5.52  				0442EC1C12FE1BCB004C9285 /* SDL_render_sw_c.h in Headers */,
    5.53 @@ -2298,6 +2317,7 @@
    5.54  				04BD027212E6671800899322 /* SDL_windowevents_c.h in Headers */,
    5.55  				04BD027312E6671800899322 /* SDL_rwopsbundlesupport.h in Headers */,
    5.56  				5C2EF6FC1FC9EE64003F5197 /* SDL_rect_c.h in Headers */,
    5.57 +				F30D9C91212CABDC0047DF2E /* SDL_dummysensor.h in Headers */,
    5.58  				04BD027B12E6671800899322 /* SDL_haptic_c.h in Headers */,
    5.59  				04BD027C12E6671800899322 /* SDL_syshaptic.h in Headers */,
    5.60  				04BD028212E6671800899322 /* SDL_sysjoystick_c.h in Headers */,
    5.61 @@ -2467,6 +2487,7 @@
    5.62  				DB313F8817554B71006C0E22 /* SDL_windowevents_c.h in Headers */,
    5.63  				DB313F8917554B71006C0E22 /* SDL_rwopsbundlesupport.h in Headers */,
    5.64  				5C2EF6FF1FC9EE65003F5197 /* SDL_rect_c.h in Headers */,
    5.65 +				F30D9C92212CABDC0047DF2E /* SDL_dummysensor.h in Headers */,
    5.66  				DB313F8A17554B71006C0E22 /* SDL_haptic_c.h in Headers */,
    5.67  				DB313F8B17554B71006C0E22 /* SDL_syshaptic.h in Headers */,
    5.68  				DB313F8C17554B71006C0E22 /* SDL_sysjoystick_c.h in Headers */,
    5.69 @@ -2804,6 +2825,7 @@
    5.70  				AADC5A441FDA035D00960936 /* SDL_render_metal.m in Sources */,
    5.71  				04F7804B12FB74A200FC43C0 /* SDL_blendline.c in Sources */,
    5.72  				04F7804D12FB74A200FC43C0 /* SDL_blendpoint.c in Sources */,
    5.73 +				F30D9C93212CABDC0047DF2E /* SDL_dummysensor.c in Sources */,
    5.74  				5C2EF6F81FC9EE35003F5197 /* SDL_egl.c in Sources */,
    5.75  				04F7805012FB74A200FC43C0 /* SDL_drawline.c in Sources */,
    5.76  				04F7805212FB74A200FC43C0 /* SDL_drawpoint.c in Sources */,
    5.77 @@ -2940,6 +2962,7 @@
    5.78  				AADC5A451FDA047900960936 /* SDL_render_metal.m in Sources */,
    5.79  				041B2CAB12FA0D680087D585 /* SDL_render.c in Sources */,
    5.80  				04409B9812FA97ED00FB9AA8 /* SDL_yuv_sw.c in Sources */,
    5.81 +				F30D9C94212CABDC0047DF2E /* SDL_dummysensor.c in Sources */,
    5.82  				04F7803C12FB748500FC43C0 /* SDL_nullframebuffer.c in Sources */,
    5.83  				04F7805512FB74A200FC43C0 /* SDL_blendfillrect.c in Sources */,
    5.84  				04F7805712FB74A200FC43C0 /* SDL_blendline.c in Sources */,
    5.85 @@ -3076,6 +3099,7 @@
    5.86  				AADC5A481FDA048100960936 /* SDL_render_metal.m in Sources */,
    5.87  				DB31405817554B71006C0E22 /* SDL_render.c in Sources */,
    5.88  				DB31405A17554B71006C0E22 /* SDL_yuv_sw.c in Sources */,
    5.89 +				F30D9C95212CABDC0047DF2E /* SDL_dummysensor.c in Sources */,
    5.90  				DB31405B17554B71006C0E22 /* SDL_nullframebuffer.c in Sources */,
    5.91  				DB31405C17554B71006C0E22 /* SDL_blendfillrect.c in Sources */,
    5.92  				DB31405D17554B71006C0E22 /* SDL_blendline.c in Sources */,
     6.1 --- a/configure	Tue Aug 21 12:11:34 2018 -0700
     6.2 +++ b/configure	Tue Aug 21 13:29:21 2018 -0700
     6.3 @@ -24135,6 +24135,18 @@
     6.4              ;;
     6.5            esac
     6.6          fi
     6.7 +        # Set up files for the sensor library
     6.8 +        if test x$enable_sensor = xyes; then
     6.9 +          case $ARCH in
    6.10 +            android)
    6.11 +
    6.12 +$as_echo "#define SDL_SENSOR_ANDROID 1" >>confdefs.h
    6.13 +
    6.14 +                SOURCES="$SOURCES $srcdir/src/sensor/android/*.c"
    6.15 +                have_sensor=yes
    6.16 +            ;;
    6.17 +          esac
    6.18 +        fi
    6.19          # Set up files for the power library
    6.20          if test x$enable_power = xyes; then
    6.21               case $ARCH in
    6.22 @@ -24794,6 +24806,14 @@
    6.23      fi
    6.24      SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
    6.25  fi
    6.26 +if test x$have_sensor != xyes; then
    6.27 +    if test x$enable_sensor = xyes; then
    6.28 +
    6.29 +$as_echo "#define SDL_SENSOR_DISABLED 1" >>confdefs.h
    6.30 +
    6.31 +    fi
    6.32 +    SOURCES="$SOURCES $srcdir/src/sensor/dummy/*.c"
    6.33 +fi
    6.34  if test x$have_threads != xyes; then
    6.35      if test x$enable_threads = xyes; then
    6.36  
     7.1 --- a/configure.in	Tue Aug 21 12:11:34 2018 -0700
     7.2 +++ b/configure.in	Tue Aug 21 13:29:21 2018 -0700
     7.3 @@ -3503,6 +3503,16 @@
     7.4              ;;
     7.5            esac
     7.6          fi
     7.7 +        # Set up files for the sensor library
     7.8 +        if test x$enable_sensor = xyes; then
     7.9 +          case $ARCH in
    7.10 +            android)
    7.11 +                AC_DEFINE(SDL_SENSOR_ANDROID, 1, [ ])
    7.12 +                SOURCES="$SOURCES $srcdir/src/sensor/android/*.c"
    7.13 +                have_sensor=yes
    7.14 +            ;;
    7.15 +          esac
    7.16 +        fi
    7.17          # Set up files for the power library
    7.18          if test x$enable_power = xyes; then
    7.19               case $ARCH in
    7.20 @@ -3998,6 +4008,12 @@
    7.21      fi
    7.22      SOURCES="$SOURCES $srcdir/src/haptic/dummy/*.c"
    7.23  fi
    7.24 +if test x$have_sensor != xyes; then
    7.25 +    if test x$enable_sensor = xyes; then
    7.26 +        AC_DEFINE(SDL_SENSOR_DISABLED, 1, [ ])
    7.27 +    fi
    7.28 +    SOURCES="$SOURCES $srcdir/src/sensor/dummy/*.c"
    7.29 +fi
    7.30  if test x$have_threads != xyes; then
    7.31      if test x$enable_threads = xyes; then
    7.32          AC_DEFINE(SDL_THREADS_DISABLED, 1, [ ])
     8.1 --- a/include/SDL_config.h.cmake	Tue Aug 21 12:11:34 2018 -0700
     8.2 +++ b/include/SDL_config.h.cmake	Tue Aug 21 13:29:21 2018 -0700
     8.3 @@ -223,6 +223,7 @@
     8.4  #cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@
     8.5  #cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@
     8.6  #cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@
     8.7 +#cmakedefine SDL_SENSOR_DISABLED @SDL_SENSOR_DISABLED@
     8.8  #cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@
     8.9  #cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@
    8.10  #cmakedefine SDL_THREADS_DISABLED @SDL_THREADS_DISABLED@
    8.11 @@ -287,6 +288,10 @@
    8.12  #cmakedefine SDL_HAPTIC_XINPUT @SDL_HAPTIC_XINPUT@
    8.13  #cmakedefine SDL_HAPTIC_ANDROID @SDL_HAPTIC_ANDROID@
    8.14  
    8.15 +/* Enable various sensor drivers */
    8.16 +#cmakedefine SDL_SENSOR_ANDROID @SDL_SENSOR_ANDROID@
    8.17 +#cmakedefine SDL_SENSOR_DUMMY @SDL_SENSOR_DUMMY@
    8.18 +
    8.19  /* Enable various shared object loading systems */
    8.20  #cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@
    8.21  #cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@
     9.1 --- a/include/SDL_config.h.in	Tue Aug 21 12:11:34 2018 -0700
     9.2 +++ b/include/SDL_config.h.in	Tue Aug 21 13:29:21 2018 -0700
     9.3 @@ -223,6 +223,7 @@
     9.4  #undef SDL_FILE_DISABLED
     9.5  #undef SDL_JOYSTICK_DISABLED
     9.6  #undef SDL_HAPTIC_DISABLED
     9.7 +#undef SDL_SENSOR_DISABLED
     9.8  #undef SDL_LOADSO_DISABLED
     9.9  #undef SDL_RENDER_DISABLED
    9.10  #undef SDL_THREADS_DISABLED
    9.11 @@ -288,6 +289,10 @@
    9.12  #undef SDL_HAPTIC_DINPUT
    9.13  #undef SDL_HAPTIC_XINPUT
    9.14  
    9.15 +/* Enable various sensor drivers */
    9.16 +#undef SDL_SENSOR_ANDROID
    9.17 +#undef SDL_SENSOR_DUMMY
    9.18 +
    9.19  /* Enable various shared object loading systems */
    9.20  #undef SDL_LOADSO_DLOPEN
    9.21  #undef SDL_LOADSO_DUMMY
    10.1 --- a/include/SDL_config_iphoneos.h	Tue Aug 21 12:11:34 2018 -0700
    10.2 +++ b/include/SDL_config_iphoneos.h	Tue Aug 21 13:29:21 2018 -0700
    10.3 @@ -139,6 +139,9 @@
    10.4  #define SDL_JOYSTICK_MFI 1
    10.5  #define SDL_JOYSTICK_HIDAPI 1
    10.6  
    10.7 +/* Enable the dummy sensor driver */
    10.8 +#define SDL_SENSOR_DUMMY  1
    10.9 +
   10.10  /* Enable Unix style SO loading */
   10.11  #define SDL_LOADSO_DLOPEN 1
   10.12  
    11.1 --- a/include/SDL_config_macosx.h	Tue Aug 21 12:11:34 2018 -0700
    11.2 +++ b/include/SDL_config_macosx.h	Tue Aug 21 13:29:21 2018 -0700
    11.3 @@ -140,6 +140,9 @@
    11.4  #define SDL_JOYSTICK_HIDAPI  1
    11.5  #define SDL_HAPTIC_IOKIT    1
    11.6  
    11.7 +/* Enable the dummy sensor driver */
    11.8 +#define SDL_SENSOR_DUMMY  1
    11.9 +
   11.10  /* Enable various shared object loading systems */
   11.11  #define SDL_LOADSO_DLOPEN   1
   11.12  
    12.1 --- a/include/SDL_config_minimal.h	Tue Aug 21 12:11:34 2018 -0700
    12.2 +++ b/include/SDL_config_minimal.h	Tue Aug 21 13:29:21 2018 -0700
    12.3 @@ -64,6 +64,9 @@
    12.4  /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */
    12.5  #define SDL_HAPTIC_DISABLED 1
    12.6  
    12.7 +/* Enable the stub sensor driver (src/sensor/dummy/\*.c) */
    12.8 +#define SDL_SENSOR_DISABLED 1
    12.9 +
   12.10  /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */
   12.11  #define SDL_LOADSO_DISABLED 1
   12.12  
    13.1 --- a/include/SDL_config_pandora.h	Tue Aug 21 12:11:34 2018 -0700
    13.2 +++ b/include/SDL_config_pandora.h	Tue Aug 21 13:29:21 2018 -0700
    13.3 @@ -114,6 +114,8 @@
    13.4  #define SDL_JOYSTICK_LINUX 1
    13.5  #define SDL_HAPTIC_LINUX 1
    13.6  
    13.7 +#define SDL_SENSOR_DUMMY 1
    13.8 +
    13.9  #define SDL_LOADSO_DLOPEN 1
   13.10  
   13.11  #define SDL_THREAD_PTHREAD 1
    14.1 --- a/include/SDL_config_psp.h	Tue Aug 21 12:11:34 2018 -0700
    14.2 +++ b/include/SDL_config_psp.h	Tue Aug 21 13:29:21 2018 -0700
    14.3 @@ -128,22 +128,25 @@
    14.4  /* PSP isn't that sophisticated */
    14.5  #define LACKS_SYS_MMAN_H 1
    14.6  
    14.7 -/* Enable the stub thread support (src/thread/psp/\*.c) */
    14.8 +/* Enable the PSP thread support (src/thread/psp/\*.c) */
    14.9  #define SDL_THREAD_PSP  1
   14.10  
   14.11 -/* Enable the stub timer support (src/timer/psp/\*.c) */
   14.12 +/* Enable the PSP timer support (src/timer/psp/\*.c) */
   14.13  #define SDL_TIMERS_PSP  1
   14.14  
   14.15 -/* Enable the stub joystick driver (src/joystick/psp/\*.c) */
   14.16 +/* Enable the PSP joystick driver (src/joystick/psp/\*.c) */
   14.17  #define SDL_JOYSTICK_PSP        1
   14.18  
   14.19 -/* Enable the stub audio driver (src/audio/psp/\*.c) */
   14.20 +/* Enable the dummy sensor driver */
   14.21 +#define SDL_SENSOR_DUMMY  1
   14.22 +
   14.23 +/* Enable the PSP audio driver (src/audio/psp/\*.c) */
   14.24  #define SDL_AUDIO_DRIVER_PSP    1
   14.25  
   14.26 -/* PSP video dirver */
   14.27 +/* PSP video driver */
   14.28  #define SDL_VIDEO_DRIVER_PSP   1
   14.29  
   14.30 -/* PSP render dirver */
   14.31 +/* PSP render driver */
   14.32  #define SDL_VIDEO_RENDER_PSP   1
   14.33  
   14.34  #define SDL_POWER_PSP          1
    15.1 --- a/include/SDL_config_windows.h	Tue Aug 21 12:11:34 2018 -0700
    15.2 +++ b/include/SDL_config_windows.h	Tue Aug 21 13:29:21 2018 -0700
    15.3 @@ -194,6 +194,9 @@
    15.4  #define SDL_HAPTIC_DINPUT   1
    15.5  #define SDL_HAPTIC_XINPUT   1
    15.6  
    15.7 +/* Enable the dummy sensor driver */
    15.8 +#define SDL_SENSOR_DUMMY  1
    15.9 +
   15.10  /* Enable various shared object loading systems */
   15.11  #define SDL_LOADSO_WINDOWS  1
   15.12  
    16.1 --- a/include/SDL_config_winrt.h	Tue Aug 21 12:11:34 2018 -0700
    16.2 +++ b/include/SDL_config_winrt.h	Tue Aug 21 13:29:21 2018 -0700
    16.3 @@ -192,6 +192,9 @@
    16.4  #define SDL_HAPTIC_XINPUT   1
    16.5  #endif
    16.6  
    16.7 +/* Enable the dummy sensor driver */
    16.8 +#define SDL_SENSOR_DUMMY  1
    16.9 +
   16.10  /* Enable various shared object loading systems */
   16.11  #define SDL_LOADSO_WINDOWS  1
   16.12  
    17.1 --- a/include/SDL_config_wiz.h	Tue Aug 21 12:11:34 2018 -0700
    17.2 +++ b/include/SDL_config_wiz.h	Tue Aug 21 13:29:21 2018 -0700
    17.3 @@ -129,6 +129,8 @@
    17.4  #define SDL_JOYSTICK_LINUX 1
    17.5  #define SDL_HAPTIC_LINUX 1
    17.6  
    17.7 +#define SDL_SENSOR_DUMMY  1
    17.8 +
    17.9  #define SDL_LOADSO_DLOPEN 1
   17.10  
   17.11  #define SDL_THREAD_PTHREAD 1
    18.1 --- a/src/sensor/SDL_sensor.c	Tue Aug 21 12:11:34 2018 -0700
    18.2 +++ b/src/sensor/SDL_sensor.c	Tue Aug 21 13:29:21 2018 -0700
    18.3 @@ -33,12 +33,12 @@
    18.4  #endif
    18.5  
    18.6  static SDL_SensorDriver *SDL_sensor_drivers[] = {
    18.7 -#if 0 //defined(__IPHONEOS__) || defined(__TVOS__)
    18.8 -    &SDL_IOS_SensorDriver,
    18.9 -#endif
   18.10  #ifdef SDL_SENSOR_ANDROID
   18.11      &SDL_ANDROID_SensorDriver,
   18.12  #endif
   18.13 +#if defined(SDL_SENSOR_DUMMY) || defined(SDL_SENSOR_DISABLED)
   18.14 +    &SDL_DUMMY_SensorDriver
   18.15 +#endif
   18.16  };
   18.17  static SDL_Sensor *SDL_sensors = NULL;
   18.18  static SDL_bool SDL_updating_sensor = SDL_FALSE;
   18.19 @@ -78,11 +78,6 @@
   18.20      }
   18.21  #endif /* !SDL_EVENTS_DISABLED */
   18.22  
   18.23 -    if (SDL_arraysize(SDL_sensor_drivers) == 0) {
   18.24 -        /* What should we return here? We'll just return 0 with no sensors for now. */
   18.25 -        status = 0;
   18.26 -    }
   18.27 -
   18.28      status = -1;
   18.29      for (i = 0; i < SDL_arraysize(SDL_sensor_drivers); ++i) {
   18.30          if (SDL_sensor_drivers[i]->Init() >= 0) {
    19.1 --- a/src/sensor/SDL_syssensor.h	Tue Aug 21 12:11:34 2018 -0700
    19.2 +++ b/src/sensor/SDL_syssensor.h	Tue Aug 21 13:29:21 2018 -0700
    19.3 @@ -93,5 +93,6 @@
    19.4  
    19.5  /* The available sensor drivers */
    19.6  extern SDL_SensorDriver SDL_ANDROID_SensorDriver;
    19.7 +extern SDL_SensorDriver SDL_DUMMY_SensorDriver;
    19.8  
    19.9  /* vi: set ts=4 sw=4 expandtab: */
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/src/sensor/dummy/SDL_dummysensor.c	Tue Aug 21 13:29:21 2018 -0700
    20.3 @@ -0,0 +1,110 @@
    20.4 +/*
    20.5 +  Simple DirectMedia Layer
    20.6 +  Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
    20.7 +
    20.8 +  This software is provided 'as-is', without any express or implied
    20.9 +  warranty.  In no event will the authors be held liable for any damages
   20.10 +  arising from the use of this software.
   20.11 +
   20.12 +  Permission is granted to anyone to use this software for any purpose,
   20.13 +  including commercial applications, and to alter it and redistribute it
   20.14 +  freely, subject to the following restrictions:
   20.15 +
   20.16 +  1. The origin of this software must not be misrepresented; you must not
   20.17 +     claim that you wrote the original software. If you use this software
   20.18 +     in a product, an acknowledgment in the product documentation would be
   20.19 +     appreciated but is not required.
   20.20 +  2. Altered source versions must be plainly marked as such, and must not be
   20.21 +     misrepresented as being the original software.
   20.22 +  3. This notice may not be removed or altered from any source distribution.
   20.23 +*/
   20.24 +
   20.25 +#include "SDL_config.h"
   20.26 +
   20.27 +#if defined(SDL_SENSOR_DUMMY) || defined(SDL_SENSOR_DISABLED)
   20.28 +
   20.29 +#include "SDL_error.h"
   20.30 +#include "SDL_sensor.h"
   20.31 +#include "SDL_dummysensor.h"
   20.32 +#include "../SDL_syssensor.h"
   20.33 +
   20.34 +static int
   20.35 +SDL_DUMMY_SensorInit(void)
   20.36 +{
   20.37 +    return 0;
   20.38 +}
   20.39 +
   20.40 +static int
   20.41 +SDL_DUMMY_SensorGetCount(void)
   20.42 +{
   20.43 +    return 0;
   20.44 +}
   20.45 +
   20.46 +static void
   20.47 +SDL_DUMMY_SensorDetect(void)
   20.48 +{
   20.49 +}
   20.50 +
   20.51 +static const char *
   20.52 +SDL_DUMMY_SensorGetDeviceName(int device_index)
   20.53 +{
   20.54 +    return NULL;
   20.55 +}
   20.56 +
   20.57 +static SDL_SensorType
   20.58 +SDL_DUMMY_SensorGetDeviceType(int device_index)
   20.59 +{
   20.60 +    return SDL_SENSOR_INVALID;
   20.61 +}
   20.62 +
   20.63 +static int
   20.64 +SDL_DUMMY_SensorGetDeviceNonPortableType(int device_index)
   20.65 +{
   20.66 +    return -1;
   20.67 +}
   20.68 +
   20.69 +static SDL_SensorID
   20.70 +SDL_DUMMY_SensorGetDeviceInstanceID(int device_index)
   20.71 +{
   20.72 +    return -1;
   20.73 +}
   20.74 +
   20.75 +static int
   20.76 +SDL_DUMMY_SensorOpen(SDL_Sensor *sensor, int device_index)
   20.77 +{
   20.78 +    return SDL_Unsupported();
   20.79 +}
   20.80 +    
   20.81 +static void
   20.82 +SDL_DUMMY_SensorUpdate(SDL_Sensor* sensor)
   20.83 +{
   20.84 +}
   20.85 +
   20.86 +static void
   20.87 +SDL_DUMMY_SensorClose(SDL_Sensor * sensor)
   20.88 +{
   20.89 +}
   20.90 +
   20.91 +static void
   20.92 +SDL_DUMMY_SensorQuit(void)
   20.93 +{
   20.94 +}
   20.95 +
   20.96 +SDL_SensorDriver SDL_DUMMY_SensorDriver =
   20.97 +{
   20.98 +    SDL_DUMMY_SensorInit,
   20.99 +    SDL_DUMMY_SensorGetCount,
  20.100 +    SDL_DUMMY_SensorDetect,
  20.101 +    SDL_DUMMY_SensorGetDeviceName,
  20.102 +    SDL_DUMMY_SensorGetDeviceType,
  20.103 +    SDL_DUMMY_SensorGetDeviceNonPortableType,
  20.104 +    SDL_DUMMY_SensorGetDeviceInstanceID,
  20.105 +    SDL_DUMMY_SensorOpen,
  20.106 +    SDL_DUMMY_SensorUpdate,
  20.107 +    SDL_DUMMY_SensorClose,
  20.108 +    SDL_DUMMY_SensorQuit,
  20.109 +};
  20.110 +
  20.111 +#endif /* SDL_SENSOR_DUMMY || SDL_SENSOR_DISABLED */
  20.112 +
  20.113 +/* vi: set ts=4 sw=4 expandtab: */
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/src/sensor/dummy/SDL_dummysensor.h	Tue Aug 21 13:29:21 2018 -0700
    21.3 @@ -0,0 +1,23 @@
    21.4 +/*
    21.5 +  Simple DirectMedia Layer
    21.6 +  Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
    21.7 +
    21.8 +  This software is provided 'as-is', without any express or implied
    21.9 +  warranty.  In no event will the authors be held liable for any damages
   21.10 +  arising from the use of this software.
   21.11 +
   21.12 +  Permission is granted to anyone to use this software for any purpose,
   21.13 +  including commercial applications, and to alter it and redistribute it
   21.14 +  freely, subject to the following restrictions:
   21.15 +
   21.16 +  1. The origin of this software must not be misrepresented; you must not
   21.17 +     claim that you wrote the original software. If you use this software
   21.18 +     in a product, an acknowledgment in the product documentation would be
   21.19 +     appreciated but is not required.
   21.20 +  2. Altered source versions must be plainly marked as such, and must not be
   21.21 +     misrepresented as being the original software.
   21.22 +  3. This notice may not be removed or altered from any source distribution.
   21.23 +*/
   21.24 +#include "SDL_config.h"
   21.25 +
   21.26 +/* vi: set ts=4 sw=4 expandtab: */