I am aware that you want to quit if your equation system cannot be solved. however, this should be done in a controlled manner and not by simply stopping the programme. maybe see here for more info:
http://stackoverflow.com/questions/1116493/how-to-quit-a-c-program
http://stackoverflow.com/questions/14109358/correct-usage-of-exit-in-c

there are no ifdefs necessary. simply return false and check if the solver terminated correctly or not in the object from which this was called. if not, handle the situation in that object accordingly, and so on ....