Questions tagged [platform-specific]

A piece of software, such as a program, a library or driver that only runs on a specific platform, such as Windows only, or Linux only.

A piece of software, such as a program, a library or driver that only runs on a specific platform, such as Windows only, or Linux only.

53 questions
339
votes
5 answers

How can I find the current OS in Python?

As the title says, how can I find the current operating system in python?
UnkwnTech
  • 88,102
  • 65
  • 184
  • 229
325
votes
5 answers

How do I check if I'm running on Windows in Python?

I found the platform module but it says it returns 'Windows' and it's returning 'Microsoft' on my machine. I notice in another thread here on stackoverflow it returns 'Vista' sometimes. So, the question is, how do implemement? if is_windows(): …
gman
  • 100,619
  • 31
  • 269
  • 393
31
votes
5 answers

Right shift and signed integer

On my compiler, the following pseudo code (values replaced with binary): sint32 word = (10000000 00000000 00000000 00000000); word >>= 16; produces a word with a bitfield that looks like this: (11111111 11111111 10000000 00000000) Can I rely on…
Anne Quinn
  • 12,609
  • 8
  • 54
  • 101
20
votes
1 answer

How to write platform-independent code in Haskell (ghc)

There are a few platform-specific libraries in Hackage that I'd like to use (e.g. inotify, kqueue). However, documentation on how to switch between platforms using conditional compilation seems a little bit sparse. I'm having some trouble finding…
Rehno Lindeque
  • 4,236
  • 2
  • 23
  • 31
12
votes
3 answers

Using Cocoapods libraries in Flutter iOS platform specific code

I'm trying to use a Cocoapods library (for an external SDK) but I haven't found any documentation to do it. I've already integrated it in the Android part by just adding a line to the Gradle file. Simply, I would like to create (or maybe find) a…
julient-monisnap
  • 774
  • 2
  • 8
  • 25
10
votes
0 answers

SwiftUI ScrollView and alignment

Okay, I know SwiftUI is a shift in thinking, especially coming from a world of HTML and css. But I've spent like 4 days trying to get something to work that I feel should be pretty easy and just can't so please help! I have an app where one screen…
Lamprizzle
  • 115
  • 2
  • 5
9
votes
5 answers

I got problem with GeneratedPluginRegistrant.registerWith method and MethodChannel object while using flutter

I'm trying the example here https://flutter.dev/docs/development/platform-integration/platform-channels#step-1-create-a-new-app-project But it doesn't work if I type exactly same code. (I'm using Kotlin) When I try…
7
votes
1 answer

Can I save into a specific folder?

While learning how to create Lua file output code with the support of LÖVE, I've always hated that LÖVE filesystem handler always saved the specific file somewhere in C:/Documents and Settings/... How can I create a code that saves a file into a…
Zoltán Schmidt
  • 1,286
  • 2
  • 28
  • 48
5
votes
3 answers

Determining whether compiling on Windows or other system

I'm currently developing a cross-platform C application. Is there any compiler macro which is defined only during compilation on Windows, so I can #ifdef some Windows specific #includes? Typical example is selecting between WinSock and Berkeley…
NumberFour
  • 3,551
  • 8
  • 48
  • 72
4
votes
2 answers

Referencing a platform-specific library from a non-specific .NET app

I often need to include little bits of native code in my C# apps, which I tend to do via C++/CLI. Usually I just need to use a C++ library for which there exists no good alternative for .NET; but sometimes performance is a factor too. This is…
Eamon Nerbonne
  • 47,023
  • 20
  • 101
  • 166
4
votes
2 answers

inline namespace technique for managing platform specific code in c++

I have seen usage of #ifdef macros ( example Eigen library ) to manage platform specific, but haven't seen any one use "inline namespace"s to manage platform specific code. The github repo belows gives specific code and example…
Tej
  • 61
  • 3
4
votes
2 answers

Is a C .lib file platform specific?

I'm trying to use an API for a proprietary interface device on an embedded system (Freescale HCS08), and the provided files include headers (.h) and libraries (.lib). The header compiles fine with the rest of my code (standard C), but when trying…
Nick T
  • 25,754
  • 12
  • 83
  • 121
3
votes
3 answers

Partial platform specific methods in .NET MAUI

I'm trying to implement plattform specific partial method in .NET MAUI to get the connection string for the database. In the "main application": namespace TestApp.DL; public partial class BaseHandler { public partial string GetDBPath(); …
Cliffhanger
  • 1,057
  • 1
  • 9
  • 18
3
votes
0 answers

Compiling data.table in R 4.0.2 with OpenMP

Since R 4.0 data.table can no longer can use OpenMP if installed as a binary from CRAN. The message upon loading the package is: "data.table 1.12.8 using 1 threads (see ?getDTthreads). Latest news: r-datatable.com" However, it is possible to…
Yan Alperovych
  • 1,039
  • 7
  • 5
3
votes
2 answers

Is there any way to know whether an npm package has OS specific build requirements?

Some node modules have specific platform install requirements. For example, node-sass cannot be built on a mac and used on windows or linux. It can run on windows, but only if you build it on windows. Because of its node-gyp dependency, it must be…
Joe Fraley
  • 33
  • 3
1
2 3 4