Click here to Skip to main content
15,559,868 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
AnswerRe: Does anyone know where/how I can use an Apple for a minute? Pin
k50544-Jan-21 17:28
mvek50544-Jan-21 17:28 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
honey the codewitch4-Jan-21 17:34
mvahoney the codewitch4-Jan-21 17:34 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
k50545-Jan-21 5:23
mvek50545-Jan-21 5:23 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
k50545-Jan-21 5:42
mvek50545-Jan-21 5:42 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
honey the codewitch5-Jan-21 6:49
mvahoney the codewitch5-Jan-21 6:49 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
honey the codewitch5-Jan-21 6:50
mvahoney the codewitch5-Jan-21 6:50 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
honey the codewitch5-Jan-21 6:52
mvahoney the codewitch5-Jan-21 6:52 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
k50545-Jan-21 9:34
mvek50545-Jan-21 9:34 
I'd be tempted to go the other way around and do
C++
#if defined( _WIN64  ) || defined( _WIN32 )
// do windows stuff
#else if defined( <arduino def>)
// do arduino stuff
#else
// assume POSIX
#endif
That assumes that anything not Windows or arduino is POSIX, of course. And, as noted above, the mmap calls go back to almost 20 years, so anything that is anything unixish and is less that that old probably supports mmap() munmap().
Of course, if that doesn't float your boat, in the CONFORMING TO section of the mmap man page it states
Quote:
On POSIX systems on which mmap(), msync(2), and munmap() are available, _POSIX_MAPPED_FILES is defined in <unistd.h> to a
value greater than 0.

So that might be the best way to go. I've confirmed the presence of _POSIX_MAPPED_FILES in unistd.h in FreeBSD, NetBSD, OpenBSD and even the oldest Linux I can find, e.g. RedHat 5 (Manhattan (c)1997, not RHEL-5)
Keep Calm and Carry On

GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
honey the codewitch5-Jan-21 9:53
mvahoney the codewitch5-Jan-21 9:53 
AnswerRe: Does anyone know where/how I can use an Apple for a minute? Pin
Johnny J.4-Jan-21 22:35
professionalJohnny J.4-Jan-21 22:35 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
honey the codewitch5-Jan-21 1:22
mvahoney the codewitch5-Jan-21 1:22 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
dandy725-Jan-21 8:14
dandy725-Jan-21 8:14 
AnswerRe: Does anyone know where/how I can use an Apple for a minute? Pin
Sander Rossel4-Jan-21 22:49
professionalSander Rossel4-Jan-21 22:49 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
Randor 4-Jan-21 22:57
professional Randor 4-Jan-21 22:57 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
honey the codewitch5-Jan-21 1:16
mvahoney the codewitch5-Jan-21 1:16 
AnswerRe: Does anyone know where/how I can use an Apple for a minute? Pin
rnbergren5-Jan-21 3:07
rnbergren5-Jan-21 3:07 
AnswerRe: Does anyone know where/how I can use an Apple for a minute? Pin
Dan Neely5-Jan-21 3:46
Dan Neely5-Jan-21 3:46 
AnswerRe: Does anyone know where/how I can use an Apple for a minute? Pin
  Forogar  5-Jan-21 5:59
professional  Forogar  5-Jan-21 5:59 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
honey the codewitch5-Jan-21 6:45
mvahoney the codewitch5-Jan-21 6:45 
GeneralI hate Apple Pin
pkfox4-Jan-21 11:58
professionalpkfox4-Jan-21 11:58 
GeneralRe: I hate Apple Pin
Cp-Coder4-Jan-21 12:03
Cp-Coder4-Jan-21 12:03 
GeneralRe: I hate Apple Pin
PIEBALDconsult4-Jan-21 12:12
professionalPIEBALDconsult4-Jan-21 12:12 
GeneralRe: I hate Apple Pin
OriginalGriff4-Jan-21 12:18
mveOriginalGriff4-Jan-21 12:18 
GeneralRe: I hate Apple Pin
pkfox4-Jan-21 12:43
professionalpkfox4-Jan-21 12:43 
GeneralRe: I hate Apple Pin
Cp-Coder4-Jan-21 13:10
Cp-Coder4-Jan-21 13:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.