portability

Removing Windows library dependencies

浪子不回头ぞ 提交于 2020-01-06 06:46:49
问题 I have a couple of classes here that I would like to remove window library dependencies for portability reasons. One for blocking processes and the other for blocking threads. Both of these classes compile & runs fine as is... As for the BlockProcess class it is currently using a HANDLE for a mutex and using function calls such as: { CreateMutex() , CloseHandle() & GetLastError() }. As for the BlockThread class it uses a pointer to a CRITICAL_SECTION calling functions such as: {

Meson working with data/assets and portable/relative paths

柔情痞子 提交于 2020-01-03 03:32:10
问题 I'd like to use Meson to build a little game in C++. Let's say that theses are my file: . ├── img │ └── img.png ├── meson.buid └── src ├── main.cpp └── meson.build Here are the meson.buid files: # meson.build project('mygame', 'cpp') subdir('src') pkgdatadir = join_paths(get_option('datadir'), 'mygame') install_subdir('img', install_dir : join_paths([pkgdatadir, 'img'])) And the second file: # src/meson.build executable('mygame', 'main.cpp', install : true) In my C++ code, what path should I

Portable Eclipse with JRE

筅森魡賤 提交于 2020-01-02 11:39:31
问题 I'm not able to run a majority of programs from my work computer due to JRE <= 1.6 does not support switch statements for Strings. As I'm not able to install or update due to admin restrictions, would it be possible to create a portable Eclipse on a USB that incorporates the JRE (1.7) as well? 回答1: The Eclipse part is easy. Just unzip Eclipse on your USB. You'll have to install Java to your USB. Afterwards, go into Eclipse Window -> Preferences; Java -> Installed JREs and make sure your Java

Portable Eclipse with JRE

耗尽温柔 提交于 2020-01-02 11:38:10
问题 I'm not able to run a majority of programs from my work computer due to JRE <= 1.6 does not support switch statements for Strings. As I'm not able to install or update due to admin restrictions, would it be possible to create a portable Eclipse on a USB that incorporates the JRE (1.7) as well? 回答1: The Eclipse part is easy. Just unzip Eclipse on your USB. You'll have to install Java to your USB. Afterwards, go into Eclipse Window -> Preferences; Java -> Installed JREs and make sure your Java

What non-Linux unixes support openat()?

喜你入骨 提交于 2020-01-02 08:02:53
问题 openat() was added to POSIX in the POSIX.1-2008 revision, and has been supported by Linux since 2.6.16. How is support on non-Linux UNIXes? eg, Darwin, the *BSDs, and proprietary UNIXes. 回答1: Dragonfly BSD supports it, the rest of the BSDs don't. Solaris of course does. 回答2: Unlike the top answer is saying, all major BSDs and Apple's OS X seem to support it as of today: DragonFly since DragonFly 2.3. FreeBSD since FreeBSD 8.0. Linux since Linux 2.6.16 (for completeness). NetBSD since NetBSD 7

What contraints should I be aware of to maximize portability of Mono code?

送分小仙女□ 提交于 2020-01-02 03:01:08
问题 I'm interested in writing some cross-platform code using Mono, with a view to targeting mobile iOS and Android runtimes. I've perused the Mono and MonoTouch sites, but don't see anything that specifically advises on methods not to use, or Mono hooks which should be avoided. However, that seems a little too good to be true. What limitations should I be aware of going into this project, to ensure maximum portability of the code? 回答1: API wise you get a very similar base class libraries (BCL)

six.moves.builtins.range is not consistent in Python 2 and Python 3

落爺英雄遲暮 提交于 2020-01-01 16:09:20
问题 For a very large integer range, xrange (Python 2) should be used, which is renamed to range in Python 3. I assumed module six can provide a consistent why of writing. But I found six.moves.builtins.range returns a list in Python 2 and an iterable non-list object in Python 3, just as the name range does. Also, six.moves.builtins.xrange does not exist in Python 2. Was I using the wrong function in six ? Or does six simply not provide a solution for the range and xrange functions? I know I can

six.moves.builtins.range is not consistent in Python 2 and Python 3

喜欢而已 提交于 2020-01-01 16:08:33
问题 For a very large integer range, xrange (Python 2) should be used, which is renamed to range in Python 3. I assumed module six can provide a consistent why of writing. But I found six.moves.builtins.range returns a list in Python 2 and an iterable non-list object in Python 3, just as the name range does. Also, six.moves.builtins.xrange does not exist in Python 2. Was I using the wrong function in six ? Or does six simply not provide a solution for the range and xrange functions? I know I can

six.moves.builtins.range is not consistent in Python 2 and Python 3

十年热恋 提交于 2020-01-01 16:08:07
问题 For a very large integer range, xrange (Python 2) should be used, which is renamed to range in Python 3. I assumed module six can provide a consistent why of writing. But I found six.moves.builtins.range returns a list in Python 2 and an iterable non-list object in Python 3, just as the name range does. Also, six.moves.builtins.xrange does not exist in Python 2. Was I using the wrong function in six ? Or does six simply not provide a solution for the range and xrange functions? I know I can

Recommendations: asynchronous, portable file io in c++

好久不见. 提交于 2020-01-01 15:05:08
问题 I'm looking for a C++, async io library that should be compatible with both unix and windows systems. What are some good libraries? Is this asking too much for a library that does both systems? What are peoples' experiences with this matter? 回答1: Use boost::asio with boost::iostreams instead of asio streams. ASIO provides asynchronousness, while IOStreams provide powerful portable IO options. 回答2: Try to take a look at boost::asio. I've never personally used it but I heard good things about