Click here to Skip to main content
15,885,914 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 16:28
mvek50544-Jan-21 16:28 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
honey the codewitch4-Jan-21 16:34
mvahoney the codewitch4-Jan-21 16:34 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
k50545-Jan-21 4:23
mvek50545-Jan-21 4:23 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
k50545-Jan-21 4:42
mvek50545-Jan-21 4:42 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
honey the codewitch5-Jan-21 5:49
mvahoney the codewitch5-Jan-21 5:49 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
honey the codewitch5-Jan-21 5:50
mvahoney the codewitch5-Jan-21 5:50 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
honey the codewitch5-Jan-21 5:52
mvahoney the codewitch5-Jan-21 5:52 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
k50545-Jan-21 8:34
mvek50545-Jan-21 8: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 8:53
mvahoney the codewitch5-Jan-21 8:53 
AnswerRe: Does anyone know where/how I can use an Apple for a minute? Pin
Johnny J.4-Jan-21 21:35
professionalJohnny J.4-Jan-21 21:35 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
honey the codewitch5-Jan-21 0:22
mvahoney the codewitch5-Jan-21 0:22 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
dandy725-Jan-21 7:14
dandy725-Jan-21 7:14 
AnswerRe: Does anyone know where/how I can use an Apple for a minute? Pin
Sander Rossel4-Jan-21 21:49
professionalSander Rossel4-Jan-21 21:49 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
Randor 4-Jan-21 21:57
professional Randor 4-Jan-21 21:57 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
honey the codewitch5-Jan-21 0:16
mvahoney the codewitch5-Jan-21 0:16 
AnswerRe: Does anyone know where/how I can use an Apple for a minute? Pin
rnbergren5-Jan-21 2:07
rnbergren5-Jan-21 2:07 
AnswerRe: Does anyone know where/how I can use an Apple for a minute? Pin
Dan Neely5-Jan-21 2:46
Dan Neely5-Jan-21 2:46 
AnswerRe: Does anyone know where/how I can use an Apple for a minute? Pin
  Forogar  5-Jan-21 4:59
professional  Forogar  5-Jan-21 4:59 
GeneralRe: Does anyone know where/how I can use an Apple for a minute? Pin
honey the codewitch5-Jan-21 5:45
mvahoney the codewitch5-Jan-21 5:45 
GeneralI hate Apple Pin
pkfox4-Jan-21 10:58
professionalpkfox4-Jan-21 10:58 
GeneralRe: I hate Apple Pin
Cp-Coder4-Jan-21 11:03
Cp-Coder4-Jan-21 11:03 
GeneralRe: I hate Apple Pin
PIEBALDconsult4-Jan-21 11:12
mvePIEBALDconsult4-Jan-21 11:12 
GeneralRe: I hate Apple Pin
OriginalGriff4-Jan-21 11:18
mveOriginalGriff4-Jan-21 11:18 
GeneralRe: I hate Apple Pin
pkfox4-Jan-21 11:43
professionalpkfox4-Jan-21 11:43 
GeneralRe: I hate Apple Pin
Cp-Coder4-Jan-21 12:10
Cp-Coder4-Jan-21 12: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.