Is it possible to determine on which platform (GNU/Linux, Win32, OS X) my Vala app is running?
Is OS detection possible with GLib?
409 Views Asked by tpimh At
1
There are 1 best solutions below
Related Questions in CROSS-PLATFORM
- Error while connecting to discord WebSocket on specific platform
- How to store metadata for a UTF-8 text file cross-platform?
- JavaScript Web Audio API - Audio Sampling Rate Issue on Android
- Dynamic sizing and responsive design
- What unicode characters are generally displayable across browsers (using system fonts) and not showing missing glyphs?
- Python cross-platform software update mechanism like youtube-dl?
- Back button is not visible in maui, using Prism
- react native system compatibility issues
- Render local pdf reports in c# from .rdlc template for cross platform as using System.Drawing is not supported for non-windows platforms
- Options for building cross-platform applications using HTML as the GUI?
- ScrollView doesnt work in React Native horizontally
- Linking to .so with newer symbol
- Is there a way to create a GIF from network images in flutter?
- In my MAUI application, why when I programmatically add a rotated box to an AbsoluteLayout do I see 2 boxes. One is rotated and the other is not
- Animated components with 'fadeIn' animation making views behind them visible in android but working fine in iOS | React Native
Related Questions in GLIB
- GCOV showing coverage for functions more than 100%
- Parsing DBUS response type as Array of Dictionary or Map using C++
- How to resolve Yocto build error for Glib-2.0 for Qt?
- how do I change the alpha channel along a path in cairo?
- Static assertion failure when compiling GStreamer 1.24.0
- Block any user interaction in GTK4+
- How to implement Label/TextVIew with giraffe library in SML
- Embed gettext translation (po) data into binary
- Memory leak in a C program
- How can I use GObject Introspection to generate Java bindings?
- Adding metadata to a GStreamer pipeline containing jpegenc
- strange behavior of GHashTable in GLib
- Collecting GStreamer logs in Python ends with Segmentation fault
- Is it possible to integrate GLib mainloop into another?
- why does gcc (installed via brew) not recognize glib (also installed via brew)?
Related Questions in VALA
- Writing value to GATT characteristic via DBUS results in "garbage" value during subsequent read
- Stuck at 101 switching protocols in Vala/Liboup websocket client
- Static enums in Vala?
- GTK: "Object with ID not found" error, but the ID is empty
- how to read a string array property of an outer class?
- How do I return a C array of strings to be used in Vala code?
- Bind more than one source properties to a target property in Vala?
- Write into stdin, read from stdout Subprocess/Process in Glib/GTK Vala
- How do I make a Gtk4 application with a menu bar in Vala?
- gtk4 styleprovider vs set_css_classes
- Looking for an example how to use ColumnView in GTK4 with editable cells
- Replace a paintable with another in vala Gtk4
- What does the class keyword do to a method in Vala?
- Giving vala a variable to function doesn't pass right
- Simple image viewer with Vala and GTK4
Related Questions in OS-DETECTION
- Is there methods to detect Windows-11 vs Windows-10 in Firefox browser?
- how to detect MacOS Sierra version in plain javascript
- How to detect Android OS from a Python script?
- How can I detect IOS version with server code at cshtml?
- Where does the OS take the value for $OSTYPE
- snort rules for OS detection
- How to detect Mac OS X version using C preprocessor?
- OS detection to display different links on WordPress page
- Determining the visitor's OS in PHP
- How to detect Windows 10 Anniversary Update on website?
- Is there a way to distinguish Android Arm os from the Android x86 os in JavaScript?
- Deprecated Javascript OS detection techniques
- Is OS detection possible with GLib?
- remote OS detection in python
- Is there a way to detect OS in fish shell akin to the OSTYPE variable in bash?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
As Vala is a compiled language (as opposed to intermediate or interpreted) you can determine the platform using your favorite build tool and use conditional compilation.
Something like:
The build tool would have to pass
-D LINUX, etc to the compiler.I would be careful and only do something like this as a last resort, because it can backfire. Usually it's better to use cross platform libraries that already handle the differences for you.
BTW: See also how this is done in C++.