haiku/headers/os/support
Ingo Weinhold 39d58e2f49 Experimental approach to tackle the problem with Be's negative error codes and
ported software:
* If the macro B_USE_POSITIVE_POSIX_ERRORS is defined the POSIX error code
  constants (ENOMEM, EINTR,...) will have positive values.
* Introduced the macros B_TO_{POSITIVE,NEGATIVE}_ERROR() which do convert a
  given error code to a positive/negative value.
* Added static library libposix_error_mapper.a that overrides all POSIX
  functions (save the ones I forgot to add :-)) directly meddling with error
  codes (having them as parameter or returning them) dealing with the
  positive<->negative error code conversions. The functions have hidden
  visibility, so they affect only the shared object they are linked into.
* So ideally all one has to do is to build a ported software with
  -DB_USE_POSITIVE_POSIX_ERRORS and -lposix_error_mapper and be good with
  respect to error code problems.
* Potential issues:
  - When mixing ported and Haiku native code, i.e. using Haiku native code in
    a ported software or using a ported library in a Haiku native application
    care must be taken to convert error codes where the two interface. That's
    what the B_TO_{POSITIVE,NEGATIVE}_ERROR() macros are supposed to be used
    for.
  - A ported static library can obviously not be linked directly against
    -lposix_error_mapper. The shared object linking a against the ported static
    library has to do that. The previous point applies when that causes mixing
    with Haiku native code.
  - When dependent ported libraries are used probably all of them should use
    the error mapping.

Comments welcome.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29653 a95241bf-73f2-0310-859d-f6bbb57e9c96
2009-03-22 15:43:03 +00:00
..
Archivable.h
Autolock.h
Beep.h
BlockCache.h
BufferIO.h * BBufferIO did not implement Seek() and Position() correctly; it just passed 2008-11-16 21:23:45 +00:00
ByteOrder.h Patch by Scott: 2008-11-10 23:50:42 +00:00
ClassInfo.h
DataIO.h
Debug.h fix gcc4 warning about wrong argument type. 2008-06-15 19:21:00 +00:00
Errors.h Experimental approach to tackle the problem with Be's negative error codes and 2009-03-22 15:43:03 +00:00
Flattenable.h
List.h Revamp BList somewhat to further optimize the resizing behavior. 2008-06-12 21:30:28 +00:00
Locker.h Added InitCheck() method. 2009-03-13 02:05:10 +00:00
parsedate.h
StopWatch.h
String.h * _Realloc() did not initialize the reference count either. 2008-03-10 22:56:27 +00:00
SupportDefs.h Patch by Scott: 2008-11-10 23:50:42 +00:00
TLS.h
TypeConstants.h * Rewrote BeBuild.h which had "a few" consequences (got rid of all those class 2007-10-15 20:13:55 +00:00
UTF8.h