]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/regex/test/c_compiler_checks/wide_posix_api_check.cpp
3 * Copyright (c) 1998-2002
6 * Use, modification and distribution are subject to the
7 * Boost Software License, Version 1.0. (See accompanying file
8 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
13 * LOCATION: see http://www.boost.org for most recent version.
14 * FILE wide_posix_api_compiler_check.c
15 * VERSION see <boost/version.hpp>
16 * DESCRIPTION: Verify that POSIX API calls compile: note this is a compile
27 #include <boost/regex.h>
32 #ifndef BOOST_NO_WREGEX
34 const wchar_t* expression
= L
"^";
35 const wchar_t* text
= L
"\n ";
36 regmatch_t matches
[1];
37 int flags
= REG_EXTENDED
| REG_BASIC
| REG_NOSPEC
| REG_ICASE
| REG_NOSUB
|
38 REG_NEWLINE
| REG_PEND
| REG_NOCOLLATE
| REG_ESCAPE_IN_LISTS
|
39 REG_NEWLINE_ALT
| REG_PERL
| REG_AWK
| REG_GREP
| REG_EGREP
;
46 result
= regcomp(&re
, expression
, REG_AWK
);
47 if(result
> REG_NOERROR
)
50 regerror(result
, &re
, buf
, sizeof(buf
));
52 for(int i
= 0; i
< 256; ++i
)
53 nbuf
[i
] = static_cast<char>(buf
[i
]);
63 matches
[0].rm_eo
= wcslen(text
);
64 result
= regexec(&re
, text
, 1, matches
, REG_NOTBOL
| REG_NOTEOL
| REG_STARTEND
);
65 if(result
> REG_NOERROR
)
68 regerror(result
, &re
, buf
, sizeof(buf
));
70 for(int i
= 0; i
< 256; ++i
)
71 nbuf
[i
] = static_cast<char>(buf
[i
]);
76 if((matches
[0].rm_so
!= matches
[0].rm_eo
) || (matches
[0].rm_eo
!= 1))
82 printf("%s", "no errors found\n");
94 "This platform does not provide the needed wide character support for this test.\n"