NO

Author Topic: __POCC__OLDNAMES  (Read 4066 times)

Offline Akko

  • Member
  • *
  • Posts: 31
__POCC__OLDNAMES
« on: November 17, 2021, 04:44:27 PM »
I am using latest version 11.00.2. My program does not compile with POCC although it does compile with gcc, vcc, clang, tcc.
Reason: the program section for file I/O uses Posix functions like open, read, close.
However POCC prepends them with an _underscore like _open, _read, _close (declared in <io.h>)
IIUC when the preprocessor symbol __POCC__OLDNAMES is defined, they are recognized in Posix syntax as well.
But I just can't get it to work.

CC-flags: -Tx64-coff -std:C99 -Ob1 -fp:precise -W1 -Gd -Ze -Zx -J
LINK-flags: -machine:x64 -subsystem:console kernel32.lib advapi32.lib delayimp64.lib

If this is no bug but just my incompetence, please feel free to move my posting to where it belongs

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: __POCC__OLDNAMES
« Reply #1 on: November 17, 2021, 05:41:01 PM »
Use pocc -Go
Quote
Description:
The /Go option makes the compiler accept alternate names for some C runtime functions. It will also define the symbol __POCC__OLDNAMES in the compiler.

May the source be with you

Offline Akko

  • Member
  • *
  • Posts: 31
Re: __POCC__OLDNAMES
« Reply #2 on: November 17, 2021, 06:13:37 PM »
Thanks a lot, that did it!

Accidently I looked up CC options, but not POCC options which are many more, and not all are accessible by the IDE project options dialog box.

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: __POCC__OLDNAMES
« Reply #3 on: November 17, 2021, 06:15:49 PM »
As general rule of thumbs you should never set compiler internal symbols (those prepended by one or more underscores), because they are automatically set by the compiler when appropriate configuration is selected using compiler switches.
This because the symbols definition could be only a part of internal compiler configuration.
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide