z / OS USS上的zlib

时间:2009-06-30 08:29:47

标签: zlib mainframe

我试图在z / OS USS上编译z / lib(那就是大型机)。我有gmake和c89编译器(我假设它符合c89标准),USS应该符合POSIX标准。

但是zlib似乎正在绊倒

struct internal_state FAR *state; /* not visible by applications */

出现以下错误

c89 -O3 -DUSE_MMAP -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_SOURCE   -c -o example.o example.c
ERROR CCN3277 ./zlib.h:92    Syntax error: possible missing ';' or ','?
ERROR CCN3007 ./zlib.h:92    "struct internal_state" is undefined.
ERROR CCN3166 ./zlib.h:103   Definition of function FAR requires parentheses.
ERROR CCN3276 ./zlib.h:103   Syntax error: possible missing '{'?
ERROR CCN3273 ./zlib.h:124   Missing type in declaration of gz_header.
ERROR CCN3166 ./zlib.h:126   Definition of function gz_header requires parentheses.
ERROR CCN3276 ./zlib.h:126   Syntax error: possible missing '{'?
WARNING CCN3137 ./zlib.h:1346  Declaration must declare at least one declarator, tag, or the members of an enumeration.
ERROR CCN3275 ./zlib.h:1350  Unexpected text z encountered.
ERROR CCN3282 ./zlib.h:1350  The type of the parameters must be specified in a prototype.
ERROR CCN3275 ./example.c:95    Unexpected text file encountered.
ERROR CCN3045 ./example.c:95    Undeclared identifier gzFile.
ERROR CCN3046 ./example.c:96    Syntax error.
ERROR CCN3045 ./example.c:98    Undeclared identifier file.
ERROR CCN3019 ./example.c:523   Expecting an array or a pointer to object type.
ERROR CCN3280 ./example.c:527   Function argument assignment between types "const char*" and "int" is not allowed.
CCN0793(I) Compilation failed for file ./example.c.  Object file not created.
FSUM3065 The COMPILE step ended with return code 12.
FSUM3017 Could not compile example.c. Correct the errors and try again.
gmake: *** [example.o] Error 3

当我逐步取出FAR *(我认为它是一个远指针,但我真的不那么肯定)时,错误消失了。但由于这是一个库,我不确定通过删除它会产生哪些其他工件。

有人有任何想法吗?

任何旧的主机出现在哪里?

4 个答案:

答案 0 :(得分:3)

事实证明,有一个以前版本的zlib可以在USS版本1.1.4上编译或接近它。它是一个后台,但我认为这是有效的,因为它是在最新代码中实现FAR指针之前。所以atm我认为我已经开始工作了。

感谢您的帮助。

此致

标记。

答案 1 :(得分:1)

FAR不是C89关键字,它是Microsoft / Intelism,可能是某个地方的#defined。如果没有,您需要将其定义为空:

#define FAR

然而,这可能只会解决许多问题中的一个。我猜这个库使用某种形式的条件编译来处理FAR指针之类的东西 - 你需要阅读文档来找到适合你平台的配置。

答案 2 :(得分:1)

我使用xlc而不是c89,因为xlc是你的系统默认编译器,但你仍然可能有问题。我订阅了MVS-OE电子邮件列表,其中的人员非常有帮助。有关列表信息的链接现在似乎已关闭,因此请发送电子邮件至 LISTSERV@VM.MARIST.EDU  消息:INFO MVS-OE

答案 3 :(得分:1)

FWIW,IBM提供了zlib的预构建版本,其中包括对最近老式大型机上可用的压缩硬件(所谓的zEDC)的支持。参见zlib for zEnterprise Data Compression