Changeset 3640 for trunk/m4/yat_cxx11.m4


Ignore:
Timestamp:
May 3, 2017, 2:55:07 AM (6 years ago)
Author:
Peter
Message:

use std::log2 when available

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/m4/yat_cxx11.m4

    r3591 r3640  
    11## $Id$
    22#
    3 # serial 2  (yat 0.15)
     3# serial 3  (yat 0.15)
    44#
    55# see http://www.gnu.org/software/automake/manual/automake.html#Serials
     
    1212# DESCRIPTION
    1313#
    14 #   Test whether $CXX supports rvalues
     14#   Test whether $CXX supports rvalues and other cxx11 features
    1515#
    1616# LAST MODIFICATION
     
    8282]) # YAT_CXX_RVALUE
    8383
     84
     85# YAT_CXX_LOG2([action-if-found], [action-if-not-found])
     86#
     87# Test whether $CXX supports std::log2. If not, try turning on support
     88# with a number of different switches. If a successful switch is found
     89# invoke shell action-if-found; else issue action-if-not-found.
     90AC_DEFUN([YAT_CXX_LOG2],
     91[
     92YAT_CXX_TRY_CXX11([log2], [ dnl header
     93  @%:@include <cmath>
     94  void foo(double x);
     95  ],[ dnl body
     96  double x = std::log2(3.14);
     97  foo(x);
     98  ], [# action
     99  $1
     100  ], [ # action if not found
     101  $2
     102  ])
     103]) # YAT_CXX_RVALUE
     104
     105
    84106# YAT_CXX_TRY_CXX11([feature], [header], [body], [action-if-found],
    85107#                   [action-if-not-found])
Note: See TracChangeset for help on using the changeset viewer.