multiplatform

SYSCALL_INLINE in Android

非 Y 不嫁゛ 提交于 2019-12-24 00:45:14
问题 I need to use syscall internally in Android NDK to prevent hooking of the wrapper functions. In Linux there are macros like SYSCALL_INLINE which allows using syscall without wrapper function. Thus the macro embeds the syscall assembly code into the project directly. I could not find similar macro in Android NDK. Maybe I can write my own functions like this one; https://git.busybox.net/uClibc/tree/libc/sysdeps/linux/arm/syscall.c But I need to have arm, arm_64, x86 and x86_64 versions of the

Choice of language for portable library

为君一笑 提交于 2019-12-23 15:25:46
问题 I want to write a library which will be dynamically linked from other programs running on modern operating systems like Windows, Linux and OS/X (i.e. it will be deployed as a .dll or .so module). What is the most appropriate language in that case? Should I stick with plain C? Or is C++ also ok? 回答1: You can use either C or C++ for the implementation, but I would recommend to define the interface in pure C. It will be much easier to integrate. 回答2: The difficulty with creating a C++ library

Same C++ 'if' statement, different results on Linux/Windows

ε祈祈猫儿з 提交于 2019-12-22 10:56:48
问题 I've found an interesting case where the same C++ code yields different results on different system. #include <cstdio> int main() { int a=20, b=14; if(a*1.0/b*(a+1)/(b+1)==2) printf("YES!"); else printf("NO!"); } Compiled on Ubuntu Linux 12.04 using GCC 4.6.3 it outputs YES! Compiled on Windows 7 using GCC 4.6.2 it outputs NO! However, using: double c = a*1.0/b*(a+1)/(b+1); if (c==2) printf("YES!"); ... will return YES! on both machines. Any ideas why this difference emerges? Is this caused

Android native library linking against another native library from aar

ⅰ亾dé卋堺 提交于 2019-12-21 04:24:12
问题 I have a curious question. I have an aar library, which contains and uses native .so library. Now, I want to write another lib, which depends on that library and also has native part depending on native lib from the first lib. The dependent library uses both the native code and java wrappers from the first lib. I wonder, is there any way, how to do this by standard gradle dependency(with copied headers files from the first lib)? Or have I to build the second lib directly from the sources? Why

Multiplatform Installer

瘦欲@ 提交于 2019-12-19 08:00:16
问题 I am looking for a recommendation on an installer program. The installer needs to support mulitple OS's - Solaris, Linux and Windows. I have three build machines each running one of the OS's. Currently using the same code base - JAVA and C/C++ for all three. 回答1: IzPack is a an open source software installer generator. All you need is a JRE on the target platform. 回答2: InstallAnywhere seems to be the dominant player. 回答3: Maybe is my personal opinion but I think that the installer is probably

Multiplatform Installer

蓝咒 提交于 2019-12-19 07:59:49
问题 I am looking for a recommendation on an installer program. The installer needs to support mulitple OS's - Solaris, Linux and Windows. I have three build machines each running one of the OS's. Currently using the same code base - JAVA and C/C++ for all three. 回答1: IzPack is a an open source software installer generator. All you need is a JRE on the target platform. 回答2: InstallAnywhere seems to be the dominant player. 回答3: Maybe is my personal opinion but I think that the installer is probably

How and when should I use _POSIX_C_SOURCE in C programs?

放肆的年华 提交于 2019-12-19 03:11:16
问题 I've gotten myself into having to maintain some C project which should also compile on older platforms. At the moment, for some platforms, the macro _POSIX_C_SOURCE is defined. I was wondering - if it's acceptable to have it defined, should I not just define it always, on all platforms? And perhaps with the highest relevant value? To generalize, I suppose I'm asking: When and under what conditions should _POSIX_C_SOURCE be used? 回答1: _POSIX_C_SOURCE makes different functionality available.

How to make installer of java desktop application for multi-platform?

孤人 提交于 2019-12-17 18:24:44
问题 How could we made a jar file's installer, which can run on multi-platform. Is there any simple way, because I don't know Java much well. Balwant 回答1: Installer tools for Java have been dealt with in quite many questions on SO, and most options have probably been mentioned already: What’s the best way to distribute Java applications? Java Application Installers What is the best installation tool for java? See also other questions tagged java+installer. If a commercial tool is ok, the best

How to make installer of java desktop application for multi-platform?

我的未来我决定 提交于 2019-12-17 18:21:10
问题 How could we made a jar file's installer, which can run on multi-platform. Is there any simple way, because I don't know Java much well. Balwant 回答1: Installer tools for Java have been dealt with in quite many questions on SO, and most options have probably been mentioned already: What’s the best way to distribute Java applications? Java Application Installers What is the best installation tool for java? See also other questions tagged java+installer. If a commercial tool is ok, the best

Bash/sh - difference between && and ;

一曲冷凌霜 提交于 2019-12-17 17:33:20
问题 I normally use ; to combine more than one command in a line, but some people prefer && . Is there any difference? For example, cd ~; cd - and cd ~ && cd - seems to make the same thing. What version is more portable, e.g. will be supported by a bash-subset like Android's shell or so? 回答1: If previous command failed with ; the second one will run. But with && the second one will not run. This is a "lazy" logical "AND" operand between operations. 回答2: I'm using && because a long time ago at the