Skip to main content

Questions tagged [portability]

Portable code can be run with little to no modification in multiple environments. Portable applications can be run from, for example, a USB drive without modifying a computer's environment.

4 votes
2 answers
915 views

For some of my terminal videogames I need to accept input in raw mode, which can be done in Windows by using the nonstandard function getch coming from the header <...
FLAK-ZOSO's user avatar
  • 185
4 votes
1 answer
82 views

The 3 cmake files presented here are the CMakeLists.txt files used to build the testing for the Generic Dictionary. The builds and ctest work on Ubuntu 22.04. The builds previously worked on Windows ...
pacmaninbw's user avatar
  • 26.2k
3 votes
2 answers
116 views

This is a follow up to Find the Size of a File in a Portable Manner (revision). Changes made: The return value of fseek() and ...
Madagascar's user avatar
  • 10.1k
5 votes
2 answers
141 views

This is a follow up to Find the Size of a File in a Portable Manner. What's new: The fast version (POSIX stat()) does not change the position indicator of the ...
Madagascar's user avatar
  • 10.1k
7 votes
2 answers
828 views

C23 has introduced attribute specifier sequences. Consequently, the header below attempts to conditionally define macros for these sequences (for my own use cases). In cases where a compiler does not ...
Madagascar's user avatar
  • 10.1k
4 votes
2 answers
129 views

I'm coding a chat application from scratch in modern C++. I'm currently building an interface for interacting with sockets. I want it to be cross platform. Am I approaching platform independence ...
Cherestes Radu's user avatar
2 votes
2 answers
188 views

The library (inspired by stb libraries) attempts to provide some commonly used functions (reading a file into memory, determining the size of a file) that are missing from the C standard library ...
Madagascar's user avatar
  • 10.1k
3 votes
2 answers
198 views

I needed to unpack a byte into the LSBs of each byte in an 8-byte integer. After some testing, I derived a surprisingly efficient and elegant solution that uses magic numbers multiplication, though ...
CPlus's user avatar
  • 1,467
9 votes
3 answers
2k views

The goal of the code is to convert a Graphviz DOT file to an SVG file, and it achieves this by creating a child process and executing the "dot" command. ...
Madagascar's user avatar
  • 10.1k
13 votes
5 answers
3k views

I recently made a tool called mkfh to create a FHS compliant filesystem structure. I aimed to make it as portable as possible, so I wrote it in C89 and also tried ...
Labricecat's user avatar
3 votes
3 answers
870 views

This code is an arithmetic parser as is the code in a previous question of mine. However this parser handles floating point arguments and mathematical functions, and handles them without needing to ...
CPlus's user avatar
  • 1,467
4 votes
1 answer
802 views

The purpose of this code is to evaluate simple integer expressions that make use of the C arithmetic and bitwise operators while respecting C operator precedence and parenthesis. I wrote this code ...
CPlus's user avatar
  • 1,467
4 votes
1 answer
223 views

The idea is to add a given 16-bit number N to each element of an array of 16-bit integers of arbitrary length, taking advantage of 64-bit integer types and instructions to perform the additions 4 at a ...
CPlus's user avatar
  • 1,467
3 votes
1 answer
530 views

Integers need to be converted to a byte array of defined endianness to be reliably and consistently saved and transmitted, and converted back to be accurately received and read. The goal is to be as ...
CPlus's user avatar
  • 1,467
2 votes
0 answers
130 views

I'm working on a repo the purpose of which is to create and manage a local PostGIS server. (PostGIS is a bit niche, but it boils down to a few extra spatial data types and built-in SQL function. With ...
Tom Hosker's user avatar

15 30 50 per page
1
2 3 4 5
7