Hi Cecilio,
PM_CHECK_ERRORS is for debugging and writing simple apps where
you'd rather crash with a sane error message to the console than fail
silently. Since it is for debugging and developing simple apps, it
should never be on in a system installation.
Portmidi is pretty small -- I think you could save a lot of
headaches by linking statically. Then you get exactly what you want and
eliminate the need to install a dynamic library.
-Roger
On 1/5/15 5:42 PM, cecilio wrote:
Hi Roger,
I'm facing a frustrating issue related to portmidi error reporting. It
seems that there are two alternatives:
1. print an error message to stdio and abort program execution, or
2. return an error code.
In my app I would like to use the second option (handle all errors, so
I would expect portmidi returning an error code/message) but the issue
is that this is not a portmidi runtime option but a portmidi build
time option, controlled by macro PM_CHECK_ERRORS. Therefore, *all*
applications are forced to use the reporting option chosen by
sysadmins (or by distro package builders, Linux Mint in may case).
Moreover I can not distribute an application behaving consistently
from one machine to another as a portmidi error (i.e. buffer overflow)
would generate a crash in some machines but in others the app. will be
able to handle the error, depending on the installed portmidi library.
Probably I'm missing something but, if not, I would suggest to change
the code to facilitate applications to choose the desired behaviour
instead of being something determined by sysadmins when installing the
portmidi library or by the distro portmidi package. Perhaps to have a
run time option for setting the error reporting behaviour or to throw
an exception instead of the 'exit(-1);' instruction, so that an
application can opt for catching the exception or ignoring it and
crashing. Could this be feasible?
Thank you very much,
Cecilio Salmeron
_______________________________________________
media_api mailing list
[email protected]
http://lists.create.ucsb.edu/mailman/listinfo/media_api
_______________________________________________
media_api mailing list
[email protected]
http://lists.create.ucsb.edu/mailman/listinfo/media_api