Imported Upstream version 3.0
[debian/gnuradio] / config / gr_check_createfilemapping.m4
1 dnl
2 dnl Copyright 2005 Free Software Foundation, Inc.
3 dnl 
4 dnl This file is part of GNU Radio
5 dnl 
6 dnl GNU Radio is free software; you can redistribute it and/or modify
7 dnl it under the terms of the GNU General Public License as published by
8 dnl the Free Software Foundation; either version 2, or (at your option)
9 dnl any later version.
10 dnl 
11 dnl GNU Radio is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 dnl GNU General Public License for more details.
15 dnl 
16 dnl You should have received a copy of the GNU General Public License
17 dnl along with GNU Radio; see the file COPYING.  If not, write to
18 dnl the Free Software Foundation, Inc., 51 Franklin Street,
19 dnl Boston, MA 02110-1301, USA.
20
21 dnl AC_DEFUN([GR_CHECK_CREATEFILEMAPPING],
22 dnl [
23 dnl   AC_CHECK_FUNCS([CreateFileMapping])
24 dnl ])
25
26 AC_DEFUN([GR_CHECK_CREATEFILEMAPPING],[
27   AC_MSG_CHECKING([for CreateFileMapping function])
28   AC_COMPILE_IFELSE([
29 #include <windows.h>
30 int main (int argc, char **argv)
31
32     HANDLE handle;
33     int size;
34     char                seg_name[[1024]];
35     handle = CreateFileMapping(
36                      INVALID_HANDLE_VALUE,    // use paging file
37                      NULL,                    // default security
38                      PAGE_READWRITE,          // read/write access
39                      0,                       // max. object size
40                      size,                // buffer size
41                      seg_name);                 // name of mapping object
42     return 0;
43 }
44 ],[HAVE_CREATEFILEMAPPING=yes
45    AC_DEFINE(HAVE_CREATEFILEMAPPING,[1],[Define if you have the CreateFilemapping function(win32).])],
46   [HAVE_CREATEFILEMAPPING=no])
47
48   AC_MSG_RESULT($HAVE_CREATEFILEMAPPING)
49   AM_CONDITIONAL(HAVE_CREATEFILEMAPPING,     test x$HAVE_CREATEFILEMAPPING = xyes)
50 ])
51
52