/haiku/src/libs/posix_error_mapper/ |
H A D | pthread_specific.cpp | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
H A D | pthread_rwlock.cpp | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
H A D | posix_error_mapper.h | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
H A D | pthread_misc.cpp | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
H A D | pthread_rwlockattr.cpp | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
H A D | pthread_condattr.cpp | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
H A D | pthread_cond.cpp | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
H A D | misc.cpp | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
H A D | pthread_mutex.cpp | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
H A D | pthread_mutexattr.cpp | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
H A D | pthread_thread.cpp | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
H A D | Jamfile | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
H A D | pthread_attr.cpp | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
/haiku/src/system/libroot/posix/ |
H A D | errno.c | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
/haiku/src/system/libroot/posix/string/ |
H A D | strerror.c | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
/haiku/headers/os/support/ |
H A D | Errors.h | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
/haiku/src/libs/ |
H A D | Jamfile | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|
/haiku/build/jam/ |
H A D | OptionalPackages | 39d58e2f49f4b073ded3dbf639fd55730fa520a0 Sun Mar 22 15:43:03 UTC 2009 Ingo Weinhold <ingo_weinhold@gmx.de> 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
|