Opened 10 years ago

Closed 10 years ago

#280 closed defect (fixed)

include os2safe.h by default

Reported by: KO Myung-Hun Owned by: Silvan Scherrer
Priority: highest Milestone: libc-0.6.6
Component: libc Version: 0.6.5
Severity: blocker Keywords:
Cc:

Description

Hi/2.

Currently, os2safe.h should be included manually. This is meaningful if a program intend to use a high memory. But some libraries does not consider a high memory at first.

So when enabled -Zhigh-memory in one program, it causes many problem when linking against non-high-memory-enabled libraries, especially without including os2safe.h.

However, if os2safe.h is included by default, it is possible to avoid this problem. The libraries without considering a high-memory, can be linked with a high memory enabled programs or libraries.

In addition, even tough os2safe.h is included without -Zhigh-mem, it has no side effects at all, but a little overhead to copy between the source and the buffer.

Change History (3)

comment:1 Changed 10 years ago by Silvan Scherrer

Owner: set to Silvan Scherrer
Status: newaccepted

I did a small chat with Knut, and he also thinks this is a good idea.

comment:2 Changed 10 years ago by dmik

Two things to consider here:

  1. I won’t work out of the box for DLLs that are already there — you will still have to recompile them, right? And if you still have to recompile, you can just add os2safe.h to these DLLs manually…
  1. There still may be some old DLLs using unsafe DOS APIs that are not kLIBC based and will never be recompiled. Your program using high memory will fail when using them just as it fails now with "new" DLLs.

So, what you propose won't solve all possible problems anyway. I think a much better fix would be to make proper wrappers for OS/2 DLLs exposing these bugs APIs.

comment:3 Changed 10 years ago by bird

Resolution: fixed
Status: acceptedclosed

Dimitry, your comment is going totally blowing the scope of the request here. The idea is just to make life a little more convenient by default for users of kLibC, not patch the OS/2 APIs.

r3834 implements the suggestion. kLibC users shouldn't notice anything unless they link against different import libraries for OS/2 APIs.

Note: See TracTickets for help on using tickets.