File: ax_c_arithmetic_rshift.m4

package info (click to toggle)
autoconf-archive 20160916-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 7,960 kB
  • sloc: sh: 694; python: 62; makefile: 49
file content (36 lines) | stat: -rw-r--r-- 1,297 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ===========================================================================
#  http://www.gnu.org/software/autoconf-archive/ax_c_arithmetic_rshift.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_C_ARITHMETIC_RSHIFT
#
# DESCRIPTION
#
#   Checks if the right shift operation is arithmetic.
#
#   This macro uses compile-time detection and so is cross-compile ready.
#
# LICENSE
#
#   Copyright (c) 2008 YAMAMOTO Kengo <yamaken@bp.iij4u.or.jp>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 8

AC_DEFUN([AX_C_ARITHMETIC_RSHIFT], [
  AC_CACHE_CHECK([whether right shift operation is arithmetic],
                 [ax_cv_c_arithmetic_rshift],
                 [AC_COMPILE_IFELSE([[int dummy[((-1 >> 1) < 0) ? 1 : -1];]],
                                    [ax_cv_c_arithmetic_rshift=yes],
                                    [ax_cv_c_arithmetic_rshift=no])])
  if test "x$ax_cv_c_arithmetic_rshift" = xyes; then
    AC_DEFINE([HAVE_ARITHMETIC_RSHIFT], [1],
              [Define to 1 if the right shift operation is arithmetic.])
  fi
])