portability

Portable makefile creation of directories

I'm looking to save myself some effort further down the line by making a fairly generic makefile that will put together relatively simple C++ projects for me with minimal modifications required to the makefile. So far I've got it so it will use all .cpp files in the same directory and specified child directories, place all these within ...

What field of PE Headers tells that whether a valid PE file or not?

Hello, i need to validate whether given binary is a PE file or not. e.g if I rename jS/HTML or .class files to .exe or .dll , it won't be PE files still then. Parsing PE these files would give me info about this problem. What field indicates that given binary is a valid PE file or not..? Note : I have checked about "e_magic" field of ...

Tool to determine .NET assembly framework dependencies

I'm looking for a tool that can tell me what frameworks a .NET assembly will work under. Or more specifically, what BCL (base class libraries) versions the methods within it requires. What triggered me was this: Today I got a bug-report against an application we're making that basically said: "you're using WaitOne(Int32) but that only w...

C++ Portability between Windows and Linux

I have a question about writing programs to be portable between windows and linux. Recently I have realized that if you write a program that uses any sort of external library, if that library doesn't have a linux version (or a windows version when developing in linux) then you're screwed. Here then is my question: if I write a program ...

C stat() and daylight savings

I'm having serious trouble with the function stat(). I have an application compiled under cygwin ond Windows 7 and the same app compiled with MSVC++ on Windows 7. The app contains the following code: struct stat stb; memset( &stb, 0, sizeof( stb ) ); stat( szPath, &stb ); cout << hex << uppercase << setw(8) << stb.st_mtime << endl; ...

A simple, uniform and portable way of including tracing and backtracing into a C program.

GNU libc's backtrace and In-circuit emulators/debuggers are not always available when porting code to a new platform, especially when the target is a micro C compiler such as for the Z80. (Typically a program bug would "just hang" somewhere, or crash the gadget.) Is there an alternative to the classic "wolf fencing" method of manually i...

Is there a tool to analyse a J2SE app's portability to Android?

I'm looking for an easy way to identify potential issues when porting a J2SE app to Android without having to go through line by line. Ideally I'd like a tool that would flag SE classes and members for which there is no Android equivalent, but if not, a crude library level flag would be sufficient. If there's no tool, is there a J2SE li...

Different int sizes on my computer and Arduino

Hi there Im working on a sparetime project, making some server code to an Arduino Duemilanove, but before I test this code on the controller I am testing it on my own machine (An OS X based macbook). I am using ints some places, and I am worried that this will bring up strange errors when code is compiled and run on the Arduino Duemilan...

Maintaining product for Android + iPhone

This is a question to all of you out there who develop for both Android and iPhone. How do you maintain support for the two platforms? Specifically, do you maintain the two products totally separate from each other? create "native" GUIs in Java/ObjC and a "core" library in C/C++? write both versions in the same language (e.g. Java) an...

Is it possible to write shared libraries between iPhone, Android, Blackberry, Mac and Windows?

I'm tasked with "porting" a few apps from a Windows environment to various mobile platforms and Mac as well. I plan on writing MVC patterned apps in which I write as many controllers as I can in some sort of universal library, probably in C or C++. Then writing the views in various choice languages (Objective C, Java, .NET, whatever) fo...

Is there a way to substitute \ with / for Gnu Make command goals?

I'm running a recursive make on windows using targets for each directory using forward slashes to separate path components. If someone runs > make foo/bar it will run fine. But if someone runs > make foo\bar it won't find the target to build: make: Nothing to be done for `foo\bar'. I would love it if I could add something like t...

Portable C++ build system

I'm looking for a good and easy in maintenance portable build system for C++ projects. Main platforms should include Windows (Visual Studio 8+) and Linux (gcc); Cygwin may be an advantage. We're considering two main possibilities: CMake and Boost.Jam. SCons can be also an option, but I haven't investigated it yet. CMake and Boost.Jam see...

IE6 only allowing $.get(..) through server

Hello, I am not sure if this issue exists in other browsers; however, if I am simply trying to run a jquery $.get() in IE6, without running through a server, then it[$.get] will fail. As in it wont actually get the file. I am simply trying to grab an xml file in the same directory. I am trying to bundle this stuff up on a disk and distri...

Does inline assembly mess with portability?

Suppose you've written a portable C++ code which runs smoothly on different platforms. To make some modifications to optimize performance, you use inline assembly inside your code. Is it a good practice (compiler optimization set aside) or will it make troubles for portability? ...

is it good practice to create functions which use other functions that you built?

I was wondering if it was good to have this since it makes code less portable. Thanks ...

How to write Portable C/C++/Objective-C++ code to target Apple iPhone/Mac OSX?

I'm working with some C/C++ code that runs on Win32 and also VxWorks. It uses #ifdef WIN32 to switch to platform specific implementations. I've been using the code on the iPhone and I want to update it and keep it as portable as possible, but I'm not sure what's the best practice. So far I've been using #ifdef __APPLE__ blocks. What ...

Alternate way of computing size of a type using pointer arithmetic

Is the following code 100% portable? int a=10; size_t size_of_int = (char *)(&a+1)-(char*)(&a); // No problem here? std::cout<<size_of_int;// or printf("%zu",size_of_int); P.S: The question is only for learning purpose. So please don't give answers like Use sizeof() etc ...

Is it possible to create Portable VM?

I want to know that is it possible to create a fully portable virtual machine using any of the VMWare like products? My objective is to create a virtual machine (XP as guest OS), install some app in it, put the vm in a usb2 drive (performance is not a matter), and run it in any windows os (xp, vista, 7) without installing anything in hos...

Why do people define their own offsetof?

Having just seen http://stackoverflow.com/questions/3453063/what-does-the-following-macro-do I gotta ask my own question: why do so many applications' headers define offsetof themselves? Is there some reason why <stddef.h> is not to be relied upon? ...

Portable JDBC vs SQLite on Android

I am using SQLite in a project used by an android application. Currently I am using the SQLite implementation provided in android.database.sqlite. I want to make a desktop application which uses the same codebase. So I need to separate all the shared behaviour into a separate portable project/jar. My problem is I'm currently making hea...