]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/regex/test/c_compiler_checks/wide_posix_api_check.c
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
23 #include <boost/regex.h>
29 #ifndef BOOST_NO_WREGEX
32 const wchar_t* expression
= L
"^";
33 const wchar_t* text
= L
"\n ";
34 regmatch_t matches
[1];
35 int flags
= REG_EXTENDED
| REG_BASIC
| REG_NOSPEC
| REG_ICASE
| REG_NOSUB
|
36 REG_NEWLINE
| REG_PEND
| REG_NOCOLLATE
| REG_ESCAPE_IN_LISTS
|
37 REG_NEWLINE_ALT
| REG_PERL
| REG_AWK
| REG_GREP
| REG_EGREP
;
47 result
= regcomp(&re
, expression
, REG_AWK
);
48 if(result
> (int)REG_NOERROR
)
50 regerror(result
, &re
, buf
, sizeof(buf
));
51 for(i
= 0; i
< 256; ++i
)
52 nbuf
[i
] = (char)(buf
[i
]);
62 matches
[0].rm_eo
= wcslen(text
);
63 result
= regexec(&re
, text
, 1, matches
, REG_NOTBOL
| REG_NOTEOL
| REG_STARTEND
);
64 if(result
> (int)REG_NOERROR
)
66 regerror(result
, &re
, buf
, sizeof(buf
));
67 for(i
= 0; i
< 256; ++i
)
68 nbuf
[i
] = (char)(buf
[i
]);
73 if((matches
[0].rm_so
!= matches
[0].rm_eo
) || (matches
[0].rm_eo
!= 1))
79 printf("no errors found\n");
84 # error "This library has not been configured for wide character support"