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.
105 questions
4 votes
2 answers
907 views
Cross platform raw input handling in C/C++ for Linux and Windows
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 <...
3 votes
2 answers
116 views
Finding the Size of a File in a Portable Manner (revision 2)
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 ...
7 votes
2 answers
823 views
Consolidating GNU C's and C23's attributes
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 ...
2 votes
2 answers
186 views
A small header-only input output library
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 ...
9 votes
3 answers
2k views
Executing a shell command OS-independently
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. ...
3 votes
3 answers
869 views
Command line calculator in C
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 ...
4 votes
1 answer
221 views
Vectorized 16-bit addition in Standard C
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 ...
2 votes
0 answers
130 views
A Python base class for a family of Postgres server manager classes
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 ...