diff options
-rw-r--r-- | recordmydesktop/configure.ac | 6 | ||||
-rw-r--r-- | recordmydesktop/include/rmdtypes.h | 6 | ||||
-rw-r--r-- | recordmydesktop/src/cache_frame.c | 4 |
3 files changed, 13 insertions, 3 deletions
diff --git a/recordmydesktop/configure.ac b/recordmydesktop/configure.ac index 4661b60..cfd413d 100644 --- a/recordmydesktop/configure.ac +++ b/recordmydesktop/configure.ac @@ -41,6 +41,12 @@ AC_ARG_ENABLE(oss, esac],[oss=false]) AC_CHECK_HEADER([alsa/asoundlib.h]) +AC_CHECK_HEADER([endian.h],default_endian=true) +if test x$default_endian != xtrue; then +AC_CHECK_HEADER([machine/endian.h], + AC_DEFINE([HAVE_MACHINE_ENDIAN_H],1, + endian.h in $include_path/machine/ subdirectory)) +fi AC_CHECK_HEADER([sys/soundcard.h]) AC_CHECK_HEADERS([sys/time.h unistd.h vorbis/vorbisfile.h fcntl.h]) diff --git a/recordmydesktop/include/rmdtypes.h b/recordmydesktop/include/rmdtypes.h index 5430ef4..de9565a 100644 --- a/recordmydesktop/include/rmdtypes.h +++ b/recordmydesktop/include/rmdtypes.h @@ -43,7 +43,11 @@ #include <signal.h> #include <sys/time.h> #include <sys/types.h> -#include <endian.h> +#ifdef HAVE_MACHINE_ENDIAN_H + #include <machine/endian.h> +#else + #include <endian.h> +#endif #include <limits.h> #include <sys/stat.h> #include <sys/ipc.h> diff --git a/recordmydesktop/src/cache_frame.c b/recordmydesktop/src/cache_frame.c index 4258932..d57ecfd 100644 --- a/recordmydesktop/src/cache_frame.c +++ b/recordmydesktop/src/cache_frame.c @@ -65,8 +65,8 @@ int FlushBlock(unsigned char *buf, int flush){ int j,i, bytes_written=0, - block_i=blockno/(width/blockwidth),//place on the grid - block_k=blockno%(width/blockwidth); + block_i=(!blockwidth)?0:(blockno/(width/blockwidth)),//place on the grid + block_k=(!blockwidth)?0:(blockno%(width/blockwidth)); register unsigned char *buf_reg=(&buf[(block_i* width+ block_k)*blockwidth]); |