Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#9125 closed Bugs (invalid)

Boost using of getenv prohibits its use on Windows Store application

Reported by: beholder@… Owned by: Artyom Beilis
Milestone: To Be Determined Component: locale
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

getenv function is absent in Windows Store application so one can't link with at least boost.locale when build an application which targets windows 8.1. It seems that it did link well with apps targeting Windows 8.0, though. I've stuck with Locale part only but I believe other parts of boost may be involved too.

See the full list of the forsaken API here: http://msdn.microsoft.com/en-us/library/windows/apps/jj606124.aspx

Attachments (2)

locale_v1.patch (930 bytes ) - added by ixSci <beholder@…> 9 years ago.
locale_v2.patch (1.4 KB ) - added by ixSci <beholder@…> 9 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Artyom Beilis, 9 years ago

Resolution: invalid
Status: newclosed

Boost.Locale requires support of standard C and C++ libraries. getenv is standard C function and should be supported by the API to work.

Such basic functionality should be present to make any normal application work.

comment:2 by ixSci <beholder@…>, 9 years ago

Still WIndows 8.1 doesn't support it for the Store apps. Don't you think it is better to add a workaround to have a possibility to use Boost.Locale with WinStore rather than just ignore it? All the more you can just cut the getenv part of Boost.Locale without any harm for the end user if he doesn't use environmental variables for the locale determination.

comment:3 by Artyom Beilis, 9 years ago

You are welcome to provide a patch that provides an adoption for WinStore.

Requirements:

  • Automatic detection of build for WinStore (if feasible)
  • If impossible to detect WinStore - provide boost.build option to build for Windows store
  • Make sure the tests pass on this platform

Than I'll apply such a patch. I'm more than sure that getenv would be the least of all the problems and many test would likely to fail for different reasons.

So you are more than welcome to provide a complete solution. I can't provide it as I neither have Windows 8 not interested in it.

by ixSci <beholder@…>, 9 years ago

Attachment: locale_v1.patch added

by ixSci <beholder@…>, 9 years ago

Attachment: locale_v2.patch added

comment:4 by ixSci <beholder@…>, 9 years ago

Added 2 possible patches: v1 is local to locale and v2 is somehow related implementation to another ticket with a similar problem(https://svn.boost.org/trac/boost/ticket/9124)

In both cases it requires to define BOOST_FOR_WINRT during compilation with bjam. Tests pass, as far as I can tell. I've run bjam from test subfolder and seen passed only. I didn't fund any report or conclusion, though.

Automatic detection of build for WinStore? (if feasible)

Impossible since one can use plain old applications on Windows 8 with new Windows Store ones in the same time. So one should be explicit about his choice.

I'm more than sure that getenv would be the least of all the problems and many test would likely to fail for different reasons

It may be true but one can't test it with the tests library has because new thins are applied to WinRT applications only and afaik you can't build console application with WinRT support. So whoever use WinRT with boost.locale will find bugs if there is something other there. I just tested basic functional of translating: it works.

comment:5 by Artyom Beilis, 9 years ago

  1. Have you run full Boost.Locale test suite on WinRT/Store?
  2. Who defines BOOST_FOR_WINRT? Does boost-build defines it automatically?

There are parts that are not related to boost.locale I can't apply them - so first address this issue.

Note: See TracTickets for help on using tickets.