using std::make_pair;
using boost::shared_ptr;
+/** @param s Number of seconds to sleep for */
void
dcpomatic_sleep (int s)
{
}
-list<string>
-network_interfaces ()
+/* Apparently there is no way to create an ofstream using a UTF-8
+ filename under Windows. We are hence reduced to using fopen
+ with this wrapper.
+*/
+FILE *
+fopen_boost (boost::filesystem::path p, string t)
{
- list<string> interfaces;
-
-#ifdef DCPOMATIC_POSIX
- struct ifaddrs* addresses = 0;
-
- getifaddrs (&addresses);
-
- for (struct ifaddrs* i = addresses; i; i = i->ifa_next) {
- if (i->ifa_addr->sa_family == AF_INET) {
- void* p = &((struct sockaddr_in *) i->ifa_addr)->sin_addr;
- char b[INET_ADDRSTRLEN];
- inet_ntop (AF_INET, p, b, INET_ADDRSTRLEN);
- interfaces.push_back (b);
- }
- }
-
- freeifaddrs (addresses);
+#ifdef DCPOMATIC_WINDOWS
+ wstring w (t.begin(), t.end());
+ /* c_str() here should give a UTF-16 string */
+ return _wfopen (p.c_str(), w.c_str ());
+#else
+ return fopen (p.c_str(), t.c_str ());
#endif
-
- return interfaces;
}