TNS/R Native Application Migration Guide
C and C++ Migration Tasks
TNS/R Native Application Migration Guide—523745-001
3-8
Replacing Obsolete Keywords
Replacing Obsolete Keywords
D-series TNS C compilers recognize but issue warnings for certain C-series keywords
with D-series replacements. The native C compiler does not recognize the C-series
keywords. Replace the following C-series keywords with the equivalent D-series
keywords:
The extptr keywords identify 32-bit pointers in external function declarations for TAL.
Native programs only support 32-bit pointers, so this keyword is unnecessary. Delete
the extptr keyword.
Changing Use of _cc_status for Return Values
_cc_status is used for calls to Guardian and TAL procedures that set a condition-
code register instead of returning a value. For TNS C and C++ programs, the CCL,
CCE, and CCG macros examine the results of a function declared with the
_cc_status type specifier. For native C and C++ programs, you must replace these
macros with the _status_lt(x), _status_eq(x), and _status_gt(x) macros.
These new macros are defined in the tal.h header and can be used in TNS and
native programs. These macros are:
•
For TNS/R native C and C++:
#define _status_lt(x) ((x) < 0)
#define _status_eq(x) ((x) == 0)
#define _status_gt(x) ((x) > 0)
•
For TNS C and C++:
#define _status_lt(x) ((x) == 2)
#define _status_eq(x) ((x) == 1)
#define _status_gt(x) ((x) == 0)
Example 3-1 on page 3-9 shows the difference between using the new macros defined
at D40 and those used prior to D40 to examine _cc_status.
C-Series Keyword D-Series Keyword
cc_status _cc_status
extensible _extensible
extptr See the following paragraph.
lowmem _lowmem
tal _tal
variable _variable
myproc ="alias-name" _alias("alias-name") myproc
(or use the FUNCTION pragma syntax instead—see C/C++
Programmer’s Guide for more information)