nto not defined

Hello all,
I have a small code which basically allocates physical memory buffers
for DMA purposes. The code was originally written in QNX4.25 and then ported
to QNX6.2 using statements like
#ifdef NTO
mem_offset(…)
#else
qnx_segment_allocate(…)
#endif

The above is just ann example to let you how the code is written. DO NOT
TAKE IT AS IT LOOKS.

My problem is, how do i compile the code?
When I do gcc -c DmaBuffer.cpp … on QNX6.2, it looks for the old header
files in QNX4.25 which are no longer in QNX6.2 by the same name. How do i
mention that NTO is defined??
Any clues are greatly appreciated…
Thanks,
Tray

#if defined(QNXNTO)
#define NTO
#endif

That should do it I think.

chris

Tray Karra <tkarra@ces.clemson.edu> wrote:

Hello all,
I have a small code which basically allocates physical memory buffers
for DMA purposes. The code was originally written in QNX4.25 and then ported
to QNX6.2 using statements like
#ifdef NTO
mem_offset(…)
#else
qnx_segment_allocate(…)
#endif

The above is just ann example to let you how the code is written. DO NOT
TAKE IT AS IT LOOKS.

My problem is, how do i compile the code?
When I do gcc -c DmaBuffer.cpp … on QNX6.2, it looks for the old header
files in QNX4.25 which are no longer in QNX6.2 by the same name. How do i
mention that NTO is defined??
Any clues are greatly appreciated…
Thanks,
Tray


Chris McKillop <cdm@qnx.com> “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/

#ifdef NTO
mem_offset(…)
#else
qnx_segment_allocate(…)
#endif

or

gcc -DNTO=1 -c DmaBuffer.cpp

Or
sed -e “s/NTO/QNXNTO/g” DmaBuffer.cpp >dmabuffer.cpp

:wink:

“Mario Charest” postmaster@127.0.0.1 wrote in message
news:alrjh4$9cg$1@inn.qnx.com

#ifdef NTO
mem_offset(…)
#else
qnx_segment_allocate(…)
#endif


or

gcc -DNTO=1 -c DmaBuffer.cpp

Igor Kovalenko <kovalenko@attbi.com> wrote:

Or
sed -e “s/NTO/QNXNTO/g” DmaBuffer.cpp >dmabuffer.cpp

:wink:

Shudder :slight_smile: I’m against unbounded substitutes like that :slight_smile:
For example, it’ll change PRONTO to PRO__QNXNTO__ :frowning:

Cheers,
-RK

“Mario Charest” postmaster@127.0.0.1 wrote in message
news:alrjh4$9cg$> 1@inn.qnx.com> …


#ifdef NTO
mem_offset(…)
#else
qnx_segment_allocate(…)
#endif


or

gcc -DNTO=1 -c DmaBuffer.cpp
\


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.

Bah, or course it will. That was meant to be a hint/joke, not literal
advice. What’s with the humor sense of people these days… :wink:

“Robert Krten” <nospam83@parse.com> wrote in message
news:alvu62$d4d$1@inn.qnx.com

Igor Kovalenko <> kovalenko@attbi.com> > wrote:
Or
sed -e “s/NTO/QNXNTO/g” DmaBuffer.cpp >dmabuffer.cpp

:wink:

Shudder > :slight_smile: > I’m against unbounded substitutes like that > :slight_smile:
For example, it’ll change PRONTO to PRO__QNXNTO__ > :frowning:

Cheers,
-RK

“Mario Charest” postmaster@127.0.0.1 wrote in message
news:alrjh4$9cg$> 1@inn.qnx.com> …


#ifdef NTO
mem_offset(…)
#else
qnx_segment_allocate(…)
#endif


or

gcc -DNTO=1 -c DmaBuffer.cpp





\

Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at > www.parse.com> .
Email my initials at parse dot com.

Igor Kovalenko <kovalenko@attbi.com> wrote:

Bah, or course it will. That was meant to be a hint/joke, not literal
advice. What’s with the humor sense of people these days… > :wink:

The problem is, I’ve done stuff like that (years ago). And then spent days kicking myself :slight_smile:

Funnier would have been:

sed -e “s/NTO/QNXNTO/g” DmaBuffer.cpp >DmaBuffer.cpp

Been there, done that too :slight_smile:

Cheers,
-RK

“Robert Krten” <> nospam83@parse.com> > wrote in message
news:alvu62$d4d$> 1@inn.qnx.com> …
Igor Kovalenko <> kovalenko@attbi.com> > wrote:
Or
sed -e “s/NTO/QNXNTO/g” DmaBuffer.cpp >dmabuffer.cpp

:wink:

Shudder > :slight_smile: > I’m against unbounded substitutes like that > :slight_smile:
For example, it’ll change PRONTO to PRO__QNXNTO__ > :frowning:

Cheers,
-RK

“Mario Charest” postmaster@127.0.0.1 wrote in message
news:alrjh4$9cg$> 1@inn.qnx.com> …


#ifdef NTO
mem_offset(…)
#else
qnx_segment_allocate(…)
#endif


or

gcc -DNTO=1 -c DmaBuffer.cpp





\

Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at > www.parse.com> .
Email my initials at parse dot com.


Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.

Well, unless you did it they way you did, you have a fallback version.
Pretty safe :wink:
And with your way you don’t have any version at all, so you’d have bigger
problem than PRONTO being replaced by PRO__QNXNTO__ :stuck_out_tongue:

“Robert Krten” <nospam83@parse.com> wrote in message
news:am04hv$gq3$1@inn.qnx.com

Igor Kovalenko <> kovalenko@attbi.com> > wrote:
Bah, or course it will. That was meant to be a hint/joke, not literal
advice. What’s with the humor sense of people these days… > :wink:

The problem is, I’ve done stuff like that (years ago). And then spent
days kicking myself > :slight_smile:

Funnier would have been:

sed -e “s/NTO/QNXNTO/g” DmaBuffer.cpp >DmaBuffer.cpp

Been there, done that too > :slight_smile:

Cheers,
-RK

“Robert Krten” <> nospam83@parse.com> > wrote in message
news:alvu62$d4d$> 1@inn.qnx.com> …
Igor Kovalenko <> kovalenko@attbi.com> > wrote:
Or
sed -e “s/NTO/QNXNTO/g” DmaBuffer.cpp >dmabuffer.cpp

:wink:

Shudder > :slight_smile: > I’m against unbounded substitutes like that > :slight_smile:
For example, it’ll change PRONTO to PRO__QNXNTO__ > :frowning:

Cheers,
-RK

“Mario Charest” postmaster@127.0.0.1 wrote in message
news:alrjh4$9cg$> 1@inn.qnx.com> …


#ifdef NTO
mem_offset(…)
#else
qnx_segment_allocate(…)
#endif


or

gcc -DNTO=1 -c DmaBuffer.cpp





\

Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at > www.parse.com> .
Email my initials at parse dot com.


\

Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at > www.parse.com> .
Email my initials at parse dot com.

“Robert Krten” <nospam83@parse.com> wrote in message
news:am04hv$gq3$1@inn.qnx.com

Igor Kovalenko <> kovalenko@attbi.com> > wrote:
Bah, or course it will. That was meant to be a hint/joke, not literal
advice. What’s with the humor sense of people these days… > :wink:

The problem is, I’ve done stuff like that (years ago). And then spent
days kicking myself > :slight_smile:

Funnier would have been:

sed -e “s/NTO/QNXNTO/g” DmaBuffer.cpp >DmaBuffer.cpp

I’ve done these sort of things before but I usually try something like this
to avoid matching other identifiers:

sed -e"s/([^A-Za-z_])NTO([^A-Za-z_])/\1__QNXNTO__\2/g" DmaBuffer.cpp >
foo

Kris

Kris Warkentin <kewarken@qnx.com> wrote:

“Robert Krten” <> nospam83@parse.com> > wrote in message
news:am04hv$gq3$> 1@inn.qnx.com> …
Igor Kovalenko <> kovalenko@attbi.com> > wrote:
Bah, or course it will. That was meant to be a hint/joke, not literal
advice. What’s with the humor sense of people these days… > :wink:

The problem is, I’ve done stuff like that (years ago). And then spent
days kicking myself > :slight_smile:

Funnier would have been:

sed -e “s/NTO/QNXNTO/g” DmaBuffer.cpp >DmaBuffer.cpp

I’ve done these sort of things before but I usually try something like this
to avoid matching other identifiers:

sed -e"s/([^A-Za-z_])NTO([^A-Za-z_])/\1__QNXNTO__\2/g" DmaBuffer.cpp

Yup… My version of “vi” has { and } that match the beginning and end
of identifier. So I wouldn’t even bother with sed, and just do:

:%s/{NTO}/QNXNTO/g

which is certainly less grief. But I fear we are going down a rathole :slight_smile: :slight_smile:

Cheers,
-RK

\

Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.

“Robert Krten” <nospam83@parse.com> wrote in message
news:am4ojr$o5i$1@inn.qnx.com

Kris Warkentin <> kewarken@qnx.com> > wrote:
I’ve done these sort of things before but I usually try something like
this
to avoid matching other identifiers:

sed -e"s/([^A-Za-z_])NTO([^A-Za-z_])/\1__QNXNTO__\2/g" DmaBuffer.cpp


Yup… My version of “vi” has { and } that match the beginning and end
of identifier. So I wouldn’t even bother with sed, and just do:

:%s/{NTO}/QNXNTO/g

which is certainly less grief. But I fear we are going down a rathole > :slight_smile:
:slight_smile:

Yeah…but don’t you just LOVE regexes? I can think of few things that make
me happier than writing a nasty regex that looks like line noise but does
exactly the weirdness that I was trying to do. :wink:

Kris

Yup! Kind of makes you proud to be an American Nerd!

“Kris Warkentin” <kewarken@qnx.com> wrote in message
news:am4q6f$44q$1@nntp.qnx.com

“Robert Krten” <> nospam83@parse.com> > wrote in message
news:am4ojr$o5i$> 1@inn.qnx.com> …
Kris Warkentin <> kewarken@qnx.com> > wrote:
I’ve done these sort of things before but I usually try something like
this
to avoid matching other identifiers:

sed -e"s/([^A-Za-z_])NTO([^A-Za-z_])/\1__QNXNTO__\2/g"
DmaBuffer.cpp


Yup… My version of “vi” has { and } that match the beginning and end
of identifier. So I wouldn’t even bother with sed, and just do:

:%s/{NTO}/QNXNTO/g

which is certainly less grief. But I fear we are going down a rathole
:slight_smile:
:slight_smile:


Yeah…but don’t you just LOVE regexes? I can think of few things that
make
me happier than writing a nasty regex that looks like line noise but does
exactly the weirdness that I was trying to do. > :wink:

Kris