Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 20827 invoked by uid 500); 28 Jan 2002 12:39:40 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 20739 invoked from network); 28 Jan 2002 12:39:38 -0000 Reply-To: From: "Mladen Turk" To: Cc: "William A. Rowe, Jr." Subject: [PATCH] Support WINNT builds and initial WINCE support Date: Mon, 28 Jan 2002 13:39:13 +0100 Organization: MappingSoft Message-ID: <000001c1a7f8$cd001ff0$5f00000a@armada> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0001_01C1A801.2EC60E90" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C1A801.2EC60E90 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, all The patch solves the NT only builds and the non-ANSI architectures. Since I have a working port of current APR for Windows CE 3.0+ to be able to start to include the needed changes, this patches are needed. How it works: Beside the current APR_HAS_UNICODE_FS, I've added the APR_HAS_ANSI_FS preprocessor flag. Additionaly there is compile time flag WINNT that forces to exclude all the non-NT code from the build. I've changed the OS enumeration with the LSB indicating if the OS supports UNICODE. MT. ------=_NextPart_000_0001_01C1A801.2EC60E90 Content-Type: application/octet-stream; name="userinfo.c.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="userinfo.c.diff" Index: userinfo.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /home/cvspublic/apr/user/win32/userinfo.c,v=0A= retrieving revision 1.16=0A= diff -u -r1.16 userinfo.c=0A= --- userinfo.c 28 Dec 2001 23:50:49 -0000 1.16=0A= +++ userinfo.c 28 Jan 2002 12:23:21 -0000=0A= @@ -135,7 +135,8 @@=0A= return APR_FROM_OS_ERROR(rv);=0A= =0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT) {=0A= + APR_OS_IS_UNICODE(apr_os_level)=0A= + {=0A= =0A= keylen =3D sizeof(regkey);=0A= rv =3D RegQueryValueExW(key, L"ProfileImagePath", NULL, &type,=0A= @@ -162,8 +163,9 @@=0A= else=0A= return APR_ENOENT;=0A= }=0A= - else=0A= -#endif /* APR_HAS_UNICODE_FS */=0A= +#endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= {=0A= keylen =3D sizeof(regkey);=0A= rv =3D RegQueryValueEx(key, "ProfileImagePath", NULL, &type,=0A= @@ -182,6 +184,7 @@=0A= else=0A= return APR_ENOENT;=0A= }=0A= +#endif /* APR_HAS_ANSI_FS */=0A= for (fixch =3D *dirname; *fixch; ++fixch)=0A= if (*fixch =3D=3D '\\')=0A= *fixch =3D '/';=0A= ------=_NextPart_000_0001_01C1A801.2EC60E90 Content-Type: application/octet-stream; name="dir.c.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="dir.c.diff" Index: dir.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /home/cvspublic/apr/file_io/win32/dir.c,v=0A= retrieving revision 1.61=0A= diff -u -r1.61 dir.c=0A= --- dir.c 27 Nov 2001 03:08:58 -0000 1.61=0A= +++ dir.c 28 Jan 2002 12:14:36 -0000=0A= @@ -100,15 +100,16 @@=0A= (*new)->dirname[len] =3D '\0';=0A= =0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT)=0A= + APR_OS_IS_UNICODE(apr_os_level)=0A= {=0A= /* Create a buffer for the longest file name we will ever see =0A= */=0A= (*new)->w.entry =3D apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW));=0A= (*new)->name =3D apr_pcalloc(cont, APR_FILE_MAX * 3 + 1); = =0A= }=0A= - else=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= {=0A= /* Note that we won't open a directory that is greater than = MAX_PATH,=0A= * including the trailing /* wildcard suffix. If a * won't = fit, then=0A= @@ -122,6 +123,7 @@=0A= }=0A= (*new)->n.entry =3D apr_pcalloc(cont, sizeof(WIN32_FIND_DATAW));=0A= }=0A= +#endif=0A= (*new)->rootlen =3D len - 1;=0A= (*new)->cntxt =3D cont;=0A= (*new)->dirhand =3D INVALID_HANDLE_VALUE;=0A= @@ -147,7 +149,7 @@=0A= #if APR_HAS_UNICODE_FS=0A= apr_wchar_t wdirname[APR_PATH_MAX];=0A= apr_wchar_t *eos =3D NULL;=0A= - if (apr_os_level >=3D APR_WIN_NT)=0A= + APR_OS_IS_UNICODE(apr_os_level)=0A= {=0A= if (thedir->dirhand =3D=3D INVALID_HANDLE_VALUE) =0A= {=0A= @@ -181,8 +183,9 @@=0A= return rv;=0A= fname =3D thedir->name;=0A= }=0A= - else=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= {=0A= char *eop =3D strchr(thedir->dirname, '\0');=0A= if (thedir->dirhand =3D=3D INVALID_HANDLE_VALUE) {=0A= @@ -208,7 +211,7 @@=0A= }=0A= fname =3D thedir->n.entry->cFileName;=0A= }=0A= -=0A= +#endif=0A= fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) = thedir->w.entry, =0A= 0, wanted);=0A= finfo->cntxt =3D thedir->cntxt;=0A= @@ -220,7 +223,7 @@=0A= /* Go back and get more_info if we can't answer the whole = inquiry=0A= */=0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT) {=0A= + APR_OS_IS_UNICODE(apr_os_level) {=0A= /* Almost all our work is done. Tack on the wide file name=0A= * to the end of the wdirname (already / delimited)=0A= */=0A= @@ -231,13 +234,16 @@=0A= eos[0] =3D '\0';=0A= return rv;=0A= }=0A= - else {=0A= +#endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= + {=0A= /* Don't waste stack space on a second buffer, the one we = set=0A= * aside for the wide directory name is twice what we need.=0A= */=0A= +#if APR_HAS_UNICODE_FS=0A= char *fspec =3D (char*)wdirname;=0A= -#else /* !APR_HAS_UNICODE_FS */=0A= - {=0A= +#else=0A= char fspec[APR_PATH_MAX];=0A= #endif=0A= int dirlen =3D strlen(thedir->dirname);=0A= @@ -247,6 +253,7 @@=0A= apr_cpystrn(fspec + dirlen, fname, sizeof(fspec) - dirlen);=0A= return more_finfo(finfo, fspec, wanted, MORE_OF_FSPEC);=0A= }=0A= +#endif=0A= }=0A= =0A= return APR_SUCCESS;=0A= @@ -264,7 +271,7 @@=0A= apr_pool_t *cont)=0A= {=0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT) =0A= + APR_OS_IS_UNICODE(apr_os_level) =0A= {=0A= apr_wchar_t wpath[APR_PATH_MAX];=0A= apr_status_t rv;=0A= @@ -276,18 +283,20 @@=0A= return apr_get_os_error();=0A= }=0A= }=0A= - else=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= if (!CreateDirectory(path, NULL)) {=0A= return apr_get_os_error();=0A= }=0A= +#endif=0A= return APR_SUCCESS;=0A= }=0A= =0A= APR_DECLARE(apr_status_t) apr_dir_remove(const char *path, apr_pool_t = *cont)=0A= {=0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT) =0A= + APR_OS_IS_UNICODE(apr_os_level) =0A= {=0A= apr_wchar_t wpath[APR_PATH_MAX];=0A= apr_status_t rv;=0A= @@ -299,11 +308,13 @@=0A= return apr_get_os_error();=0A= }=0A= }=0A= - else=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= if (!RemoveDirectory(path)) {=0A= return apr_get_os_error();=0A= }=0A= +#endif=0A= return APR_SUCCESS;=0A= }=0A= ------=_NextPart_000_0001_01C1A801.2EC60E90 Content-Type: application/octet-stream; name="dso.c.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="dso.c.diff" Index: dso.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /home/cvspublic/apr/dso/win32/dso.c,v=0A= retrieving revision 1.26=0A= diff -u -r1.26 dso.c=0A= --- dso.c 28 Dec 2001 23:50:48 -0000 1.26=0A= +++ dso.c 28 Jan 2002 12:13:00 -0000=0A= @@ -89,7 +89,7 @@=0A= UINT em;=0A= =0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT) =0A= + APR_OS_IS_UNICODE(apr_os_level) =0A= {=0A= apr_wchar_t wpath[APR_PATH_MAX];=0A= if ((rv =3D utf8_to_unicode_path(wpath, sizeof(wpath) =0A= @@ -107,8 +107,9 @@=0A= rv =3D apr_get_os_error();=0A= SetErrorMode(em);=0A= }=0A= - else=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= {=0A= char fspec[APR_PATH_MAX], *p =3D fspec;=0A= /* Must convert path from / to \ notation.=0A= @@ -132,6 +133,7 @@=0A= rv =3D APR_SUCCESS;=0A= SetErrorMode(em);=0A= }=0A= +#endif=0A= *res_handle =3D apr_pcalloc(ctx, sizeof(**res_handle));=0A= (*res_handle)->cont =3D ctx;=0A= =0A= @@ -156,8 +158,8 @@=0A= struct apr_dso_handle_t *handle, =0A= const char *symname)=0A= {=0A= - *ressym =3D (apr_dso_handle_sym_t)GetProcAddress(handle->handle, = symname);=0A= =0A= + *ressym =3D (apr_dso_handle_sym_t)GetProcAddress(handle->handle, = symname);=0A= if (!*ressym) {=0A= return apr_get_os_error();=0A= }=0A= ------=_NextPart_000_0001_01C1A801.2EC60E90 Content-Type: application/octet-stream; name="fileio.h.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="fileio.h.diff" Index: fileio.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /home/cvspublic/apr/include/arch/win32/fileio.h,v=0A= retrieving revision 1.62=0A= diff -u -r1.62 fileio.h=0A= --- fileio.h 8 Jan 2002 22:48:25 -0000 1.62=0A= +++ fileio.h 28 Jan 2002 12:18:11 -0000=0A= @@ -225,9 +225,11 @@=0A= WIN32_FIND_DATAW *entry;=0A= } w;=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= struct {=0A= WIN32_FIND_DATAA *entry;=0A= } n;=0A= +#endif =0A= };=0A= };=0A= ------=_NextPart_000_0001_01C1A801.2EC60E90 Content-Type: application/octet-stream; name="filestat.c.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="filestat.c.diff" Index: filestat.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /home/cvspublic/apr/file_io/win32/filestat.c,v=0A= retrieving revision 1.60=0A= diff -u -r1.60 filestat.c=0A= --- filestat.c 28 Nov 2001 14:40:26 -0000 1.60=0A= +++ filestat.c 28 Jan 2002 12:14:38 -0000=0A= @@ -476,7 +476,8 @@=0A= }=0A= =0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT) {=0A= + APR_OS_IS_UNICODE(apr_os_level)=0A= + {=0A= if (rv =3D utf8_to_unicode_path(wfname, sizeof(wfname) =0A= / sizeof(apr_wchar_t), = fname))=0A= return rv;=0A= @@ -505,8 +506,9 @@=0A= filename =3D apr_pstrdup(cont, tmpname);=0A= }=0A= }=0A= - else=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= if ((apr_os_level >=3D APR_WIN_98) && (!(wanted & APR_FINFO_NAME) = || isroot))=0A= {=0A= /* cannot use FindFile on a Win98 root, it returns \*=0A= @@ -550,7 +552,7 @@=0A= FindClose(hFind);=0A= filename =3D apr_pstrdup(cont, FileInfo.n.cFileName);=0A= }=0A= -=0A= +#endif=0A= if (ident_rv !=3D APR_INCOMPLETE) {=0A= if (fillin_fileinfo(finfo, (WIN32_FILE_ATTRIBUTE_DATA *) = &FileInfo, =0A= 0, wanted))=0A= @@ -559,7 +561,8 @@=0A= * to reliably translate char devices to the path = '\\.\device'=0A= * so go ask for the full path.=0A= */=0A= - if (apr_os_level >=3D APR_WIN_NT) {=0A= + APR_OS_IS_UNICODE(apr_os_level)=0A= + {=0A= #if APR_HAS_UNICODE_FS=0A= apr_wchar_t tmpname[APR_FILE_MAX];=0A= apr_wchar_t *tmpoff;=0A= ------=_NextPart_000_0001_01C1A801.2EC60E90 Content-Type: application/octet-stream; name="filesys.c.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="filesys.c.diff" Index: filesys.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /home/cvspublic/apr/file_io/win32/filesys.c,v=0A= retrieving revision 1.5=0A= diff -u -r1.5 filesys.c=0A= --- filesys.c 28 Dec 2001 23:50:48 -0000 1.5=0A= +++ filesys.c 28 Jan 2002 12:14:39 -0000=0A= @@ -120,7 +120,7 @@=0A= {=0A= char path[APR_PATH_MAX];=0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT)=0A= + APR_OS_IS_UNICODE(apr_os_level)=0A= {=0A= apr_wchar_t *ignored;=0A= apr_wchar_t wdrive[8];=0A= @@ -136,8 +136,9 @@=0A= if ((rv =3D unicode_to_utf8_path(path, sizeof(path), wpath)))=0A= return rv;=0A= }=0A= - else=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= {=0A= char *ignored;=0A= char drivestr[4];=0A= @@ -148,6 +149,7 @@=0A= if (!GetFullPathName(drivestr, sizeof(path), path, &ignored))=0A= return apr_get_os_error();=0A= }=0A= +#endif=0A= if (!(flags & APR_FILEPATH_NATIVE)) {=0A= for (*rootpath =3D path; **rootpath; ++*rootpath) {=0A= if (**rootpath =3D=3D '\\')=0A= @@ -162,7 +164,7 @@=0A= apr_status_t filepath_root_case(char **rootpath, char *root, apr_pool_t = *p)=0A= {=0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT)=0A= + APR_OS_IS_UNICODE(apr_os_level)=0A= {=0A= apr_wchar_t *ignored;=0A= apr_wchar_t wpath[APR_PATH_MAX];=0A= @@ -183,8 +185,9 @@=0A= return rv;=0A= *rootpath =3D apr_pstrdup(p, (char*)wroot);=0A= }=0A= - else=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= {=0A= char path[APR_PATH_MAX];=0A= char *ignored;=0A= @@ -192,6 +195,7 @@=0A= return apr_get_os_error();=0A= *rootpath =3D apr_pstrdup(p, path);=0A= }=0A= +#endif=0A= return APR_SUCCESS;=0A= }=0A= =0A= @@ -201,7 +205,7 @@=0A= {=0A= char path[APR_PATH_MAX];=0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT)=0A= + APR_OS_IS_UNICODE(apr_os_level)=0A= {=0A= apr_wchar_t wpath[APR_PATH_MAX];=0A= apr_status_t rv;=0A= @@ -210,12 +214,14 @@=0A= if ((rv =3D unicode_to_utf8_path(path, sizeof(path), wpath)))=0A= return rv;=0A= }=0A= - else=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= {=0A= if (!GetCurrentDirectory(sizeof(path), path))=0A= return apr_get_os_error();=0A= }=0A= +#endif=0A= if (!(flags & APR_FILEPATH_NATIVE)) {=0A= for (*rootpath =3D path; **rootpath; ++*rootpath) {=0A= if (**rootpath =3D=3D '\\')=0A= @@ -231,7 +237,7 @@=0A= apr_pool_t *p)=0A= {=0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT)=0A= + APR_OS_IS_UNICODE(apr_os_level)=0A= {=0A= apr_wchar_t wpath[APR_PATH_MAX];=0A= apr_status_t rv;=0A= @@ -241,11 +247,13 @@=0A= if (!SetCurrentDirectoryW(wpath))=0A= return apr_get_os_error();=0A= }=0A= - else=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= {=0A= if (!SetCurrentDirectory(rootpath))=0A= return apr_get_os_error();=0A= }=0A= +#endif=0A= return APR_SUCCESS;=0A= }=0A= ------=_NextPart_000_0001_01C1A801.2EC60E90 Content-Type: application/octet-stream; name="misc.c.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="misc.c.diff" Index: misc.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /home/cvspublic/apr/misc/win32/misc.c,v=0A= retrieving revision 1.7=0A= diff -u -r1.7 misc.c=0A= --- misc.c 30 Dec 2001 20:46:22 -0000 1.7=0A= +++ misc.c 28 Jan 2002 12:20:12 -0000=0A= @@ -64,7 +64,6 @@=0A= static OSVERSIONINFO oslev;=0A= oslev.dwOSVersionInfoSize =3D sizeof(OSVERSIONINFO);=0A= GetVersionEx(&oslev);=0A= -=0A= if (oslev.dwPlatformId =3D=3D VER_PLATFORM_WIN32_NT) =0A= {=0A= static unsigned int servpack =3D 0;=0A= @@ -122,6 +121,7 @@=0A= apr_os_level =3D APR_WIN_XP;=0A= }=0A= }=0A= +#ifndef WINNT=0A= else if (oslev.dwPlatformId =3D=3D VER_PLATFORM_WIN32_WINDOWS) {=0A= char *prevision;=0A= if (prevision =3D oslev.szCSDVersion) {=0A= @@ -147,6 +147,18 @@=0A= apr_os_level =3D APR_WIN_ME;=0A= }=0A= }=0A= +#endif=0A= +#ifdef _WIN32_WCE=0A= + else if (oslev.dwPlatformId =3D=3D VER_PLATFORM_WIN32_CE) =0A= + {=0A= + if (oslev.dwMajorVersion < 3) {=0A= + apr_os_level =3D APR_WIN_UNSUP;=0A= + }=0A= + else {=0A= + apr_os_level =3D APR_WIN_CE_3;=0A= + }=0A= + }=0A= +#endif=0A= else {=0A= apr_os_level =3D APR_WIN_UNSUP;=0A= }=0A= ------=_NextPart_000_0001_01C1A801.2EC60E90 Content-Type: application/octet-stream; name="misc.h.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="misc.h.diff" Index: misc.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /home/cvspublic/apr/include/arch/win32/misc.h,v=0A= retrieving revision 1.36=0A= diff -u -r1.36 misc.h=0A= --- misc.h 30 Dec 2001 20:54:38 -0000 1.36=0A= +++ misc.h 28 Jan 2002 12:18:12 -0000=0A= @@ -104,27 +104,28 @@=0A= * export new kernel or winsock functions or behavior.=0A= */=0A= typedef enum {=0A= - APR_WIN_UNK =3D 0,=0A= - APR_WIN_UNSUP =3D 1,=0A= - APR_WIN_95 =3D 10,=0A= - APR_WIN_95_B =3D 11,=0A= - APR_WIN_95_OSR2 =3D 12,=0A= - APR_WIN_98 =3D 14,=0A= - APR_WIN_98_SE =3D 16,=0A= - APR_WIN_ME =3D 18,=0A= - APR_WIN_NT =3D 30,=0A= - APR_WIN_NT_3_5 =3D 35,=0A= - APR_WIN_NT_3_51 =3D 36,=0A= - APR_WIN_NT_4 =3D 40,=0A= - APR_WIN_NT_4_SP2 =3D 42,=0A= - APR_WIN_NT_4_SP3 =3D 43,=0A= - APR_WIN_NT_4_SP4 =3D 44,=0A= - APR_WIN_NT_4_SP5 =3D 45,=0A= - APR_WIN_NT_4_SP6 =3D 46,=0A= - APR_WIN_2000 =3D 50,=0A= - APR_WIN_2000_SP1 =3D 51,=0A= - APR_WIN_2000_SP2 =3D 52,=0A= - APR_WIN_XP =3D 60=0A= + APR_WIN_UNK =3D 0x0000,=0A= + APR_WIN_UNSUP =3D 0x0010,=0A= + APR_WIN_CE_3 =3D 0x1001,=0A= + APR_WIN_95 =3D 0x2010,=0A= + APR_WIN_95_B =3D 0x2020,=0A= + APR_WIN_95_OSR2 =3D 0x2040,=0A= + APR_WIN_98 =3D 0x2100,=0A= + APR_WIN_98_SE =3D 0x2110,=0A= + APR_WIN_ME =3D 0x2200,=0A= + APR_WIN_NT =3D 0x4010,=0A= + APR_WIN_NT_3_5 =3D 0x4020,=0A= + APR_WIN_NT_3_51 =3D 0x4040,=0A= + APR_WIN_NT_4 =3D 0x4101,=0A= + APR_WIN_NT_4_SP2 =3D 0x4111,=0A= + APR_WIN_NT_4_SP3 =3D 0x4121,=0A= + APR_WIN_NT_4_SP4 =3D 0x4141,=0A= + APR_WIN_NT_4_SP5 =3D 0x4181,=0A= + APR_WIN_NT_4_SP6 =3D 0x4183,=0A= + APR_WIN_2000 =3D 0x4201,=0A= + APR_WIN_2000_SP1 =3D 0x4211,=0A= + APR_WIN_2000_SP2 =3D 0x4241,=0A= + APR_WIN_XP =3D 0x4401=0A= } apr_oslevel_e;=0A= =0A= extern apr_oslevel_e apr_os_level;=0A= @@ -255,6 +256,15 @@=0A= #define GetSecurityInfo apr_winapi_GetSecurityInfo=0A= =0A= apr_status_t apr_get_oslevel(struct apr_pool_t *, apr_oslevel_e *);=0A= +=0A= +#if defined(_WIN32_WCE) || defined(WINNT)=0A= +#define APR_OS_IS_UNICODE(os_level)=0A= +#define APR_OS_SUPPORT_ANSI=0A= +#else=0A= +#define APR_OS_IS_UNICODE(os_level) if ((os_level) & 0x0001)=0A= +#define APR_OS_SUPPORT_ANSI else=0A= +#endif /* WINNT */=0A= +=0A= #endif /* WIN32 */=0A= =0A= #endif /* ! MISC_H */=0A= ------=_NextPart_000_0001_01C1A801.2EC60E90 Content-Type: application/octet-stream; name="open.c.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="open.c.diff" Index: open.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /home/cvspublic/apr/file_io/win32/open.c,v=0A= retrieving revision 1.90=0A= diff -u -r1.90 open.c=0A= --- open.c 9 Jan 2002 22:05:09 -0000 1.90=0A= +++ open.c 28 Jan 2002 12:14:40 -0000=0A= @@ -168,7 +168,7 @@=0A= void *res_name_from_filename(const char *file, int global, apr_pool_t = *pool)=0A= {=0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT) {=0A= + APR_OS_IS_UNICODE(apr_os_level) {=0A= apr_wchar_t *wpre, *wfile, *ch;=0A= apr_size_t n =3D strlen(file) + 1;=0A= apr_size_t r, d;=0A= @@ -205,8 +205,9 @@=0A= }=0A= return wfile;=0A= }=0A= - else=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= {=0A= char *nfile, *ch;=0A= apr_size_t n =3D strlen(file) + 1;=0A= @@ -247,6 +248,7 @@=0A= }=0A= return nfile;=0A= }=0A= +#endif=0A= }=0A= =0A= =0A= @@ -333,7 +335,7 @@=0A= }=0A= =0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT) {=0A= + APR_OS_IS_UNICODE(apr_os_level) {=0A= apr_wchar_t wfname[APR_PATH_MAX];=0A= if (rv =3D utf8_to_unicode_path(wfname, sizeof(wfname) =0A= / sizeof(apr_wchar_t), = fname))=0A= @@ -341,11 +343,12 @@=0A= handle =3D CreateFileW(wfname, oflags, sharemode,=0A= NULL, createflags, attributes, 0);=0A= }=0A= - else=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= handle =3D CreateFileA(fname, oflags, sharemode,=0A= NULL, createflags, attributes, 0);=0A= -=0A= +#endif=0A= if (handle =3D=3D INVALID_HANDLE_VALUE) {=0A= return apr_get_os_error();=0A= }=0A= @@ -424,7 +427,7 @@=0A= APR_DECLARE(apr_status_t) apr_file_remove(const char *path, apr_pool_t = *cont)=0A= {=0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT) =0A= + APR_OS_IS_UNICODE(apr_os_level) =0A= {=0A= apr_wchar_t wpath[APR_PATH_MAX];=0A= apr_status_t rv;=0A= @@ -435,10 +438,12 @@=0A= if (DeleteFileW(wpath))=0A= return APR_SUCCESS;=0A= }=0A= - else=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= if (DeleteFile(path))=0A= return APR_SUCCESS;=0A= +#endif=0A= return apr_get_os_error();=0A= }=0A= =0A= @@ -446,7 +451,7 @@=0A= const char *topath,=0A= apr_pool_t *cont)=0A= {=0A= - if (apr_os_level >=3D APR_WIN_NT) =0A= + APR_OS_IS_UNICODE(apr_os_level)=0A= {=0A= #if APR_HAS_UNICODE_FS=0A= apr_wchar_t wfrompath[APR_PATH_MAX], wtopath[APR_PATH_MAX];=0A= @@ -468,7 +473,8 @@=0A= return APR_SUCCESS;=0A= #endif=0A= }=0A= - else=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= {=0A= /* Windows 95 and 98 do not support MoveFileEx, so we'll use=0A= * the old MoveFile function. However, MoveFile requires that=0A= @@ -488,6 +494,7 @@=0A= if (MoveFile(frompath, topath))=0A= return APR_SUCCESS;=0A= } =0A= +#endif=0A= return apr_get_os_error();=0A= }=0A= ------=_NextPart_000_0001_01C1A801.2EC60E90 Content-Type: application/octet-stream; name="proc.c.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="proc.c.diff" Index: proc.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /home/cvspublic/apr/threadproc/win32/proc.c,v=0A= retrieving revision 1.60=0A= diff -u -r1.60 proc.c=0A= --- proc.c 28 Dec 2001 23:50:49 -0000 1.60=0A= +++ proc.c 28 Jan 2002 12:22:19 -0000=0A= @@ -386,7 +386,8 @@=0A= ++iEnvBlockLen;=0A= =0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT) {=0A= + APR_OS_IS_UNICODE(apr_os_level) =0A= + {=0A= apr_wchar_t *pNext;=0A= pEnvBlock =3D (char *)apr_palloc(cont, iEnvBlockLen * 2);=0A= dwCreationFlags |=3D CREATE_UNICODE_ENVIRONMENT;=0A= @@ -407,8 +408,9 @@=0A= *(pNext++) =3D L'\0';=0A= *pNext =3D L'\0';=0A= }=0A= - else =0A= #endif /* APR_HAS_UNICODE_FS */=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANS =0A= {=0A= char *pNext;=0A= pEnvBlock =3D (char *)apr_palloc(cont, iEnvBlockLen);=0A= @@ -424,10 +426,11 @@=0A= *(pNext++) =3D '\0';=0A= *pNext =3D '\0';=0A= }=0A= +#endif /* APR_HAS_ANSI_FS */=0A= } =0A= =0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT)=0A= + APR_OS_IS_UNICODE(apr_os_level)=0A= {=0A= STARTUPINFOW si;=0A= apr_size_t nprg =3D strlen(progname) + 1;=0A= @@ -482,8 +485,10 @@=0A= wcwd, /* Current directory = name */=0A= &si, &pi);=0A= }=0A= - else {=0A= #endif /* APR_HAS_UNICODE_FS */=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI =0A= + {=0A= STARTUPINFOA si;=0A= memset(&si, 0, sizeof(si));=0A= si.cb =3D sizeof(si);=0A= @@ -512,6 +517,7 @@=0A= attr->currdir, /* Current directory = name */=0A= &si, &pi);=0A= }=0A= +#endif /* APR_HAS_ANSI_FS */=0A= =0A= /* Check CreateProcess result =0A= */=0A= ------=_NextPart_000_0001_01C1A801.2EC60E90 Content-Type: application/octet-stream; name="shm.c.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="shm.c.diff" Index: shm.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /home/cvspublic/apr/shmem/win32/shm.c,v=0A= retrieving revision 1.8=0A= diff -u -r1.8 shm.c=0A= --- shm.c 25 Jan 2002 07:16:01 -0000 1.8=0A= +++ shm.c 28 Jan 2002 12:21:20 -0000=0A= @@ -144,15 +144,17 @@=0A= }=0A= =0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT) =0A= + APR_OS_IS_UNICODE(apr_os_level) =0A= {=0A= hMap =3D CreateFileMappingW(hFile, psec, PAGE_READWRITE, 0, = size, mapkey);=0A= }=0A= - else=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= {=0A= hMap =3D CreateFileMappingA(hFile, psec, PAGE_READWRITE, 0, = size, mapkey);=0A= }=0A= +#endif=0A= err =3D apr_get_os_error();=0A= =0A= if (file) {=0A= @@ -214,15 +216,17 @@=0A= }=0A= =0A= #if APR_HAS_UNICODE_FS=0A= - if (apr_os_level >=3D APR_WIN_NT) =0A= + APR_OS_IS_UNICODE(apr_os_level) =0A= {=0A= hMap =3D OpenFileMappingW(FILE_MAP_READ | FILE_MAP_WRITE, = FALSE, mapkey);=0A= }=0A= - else=0A= #endif=0A= +#if APR_HAS_ANSI_FS=0A= + APR_OS_SUPPORT_ANSI=0A= {=0A= hMap =3D OpenFileMappingA(FILE_MAP_READ | FILE_MAP_WRITE, = FALSE, mapkey);=0A= }=0A= +#endif=0A= =0A= if (!hMap) {=0A= return apr_get_os_error();=0A= ------=_NextPart_000_0001_01C1A801.2EC60E90--