| 1 |
/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. |
| 2 |
This software is licensed as OpenSource, under the Apache License, Version 2.0. |
| 3 |
This license is available at: http://opensource.org/licenses/Apache-2.0. */ |
| 4 |
|
| 5 |
/* |
| 6 |
canthappen.c |
| 7 |
*/ |
| 8 |
|
| 9 |
#include "supportenvironment.h" |
| 10 |
#include "supportexcept.h" |
| 11 |
#include "supportcanthappen.h" |
| 12 |
#if STAGE == DEVELOP |
| 13 |
#include <stdio.h> |
| 14 |
#endif |
| 15 |
|
| 16 |
#if STAGE == DEVELOP |
| 17 |
/* both are used because support is compiled |
| 18 |
nonANSI for _asm fixmul & fixdiv and ANSI |
| 19 |
is used wherever possible */ |
| 20 |
PUBLIC procedure AssertForANSIDevelop(Card32 errID, |
| 21 |
readonly char* pMessage, |
| 22 |
readonly char* pPgmFileName, |
| 23 |
IntX pgmLineNum, |
| 24 |
readonly char* pAssertCond) { |
| 25 |
fprintf(stderr, "ErrID: %u; %s %s L:%d (%s)\n", errID, pMessage, pPgmFileName, pgmLineNum, pAssertCond); |
| 26 |
os_abort(); |
| 27 |
} |
| 28 |
|
| 29 |
PUBLIC procedure AssertForNonANSIDevelop(Card32 errID, |
| 30 |
readonly char* pMessage, |
| 31 |
readonly char* pPgmFileName, |
| 32 |
IntX pgmLineNum) |
| 33 |
|
| 34 |
{ |
| 35 |
fprintf(stderr, "ErrID: %u; %s %s L:%d \n", errID, pMessage, pPgmFileName, pgmLineNum); |
| 36 |
os_abort(); |
| 37 |
} |
| 38 |
|
| 39 |
#else /* STAGE == DEVELOP */ |
| 40 |
PUBLIC procedure AssertForExport(Card32 errID) { |
| 41 |
os_abort(); |
| 42 |
} |
| 43 |
|
| 44 |
#endif |
| 45 |
|
| 46 |
PUBLIC procedure CantHappenForDevelop(Card32 errID, |
| 47 |
readonly char* pMessage, |
| 48 |
readonly char* pPgmFileName, |
| 49 |
IntX lineNum) { |
| 50 |
fprintf(stderr, "ErrID: %u; %s %s L:%d \n", errID, pMessage, pPgmFileName, lineNum); |
| 51 |
os_abort(); |
| 52 |
} |
| 53 |
|
| 54 |
PUBLIC procedure CantHappenForExport(Card32 errID) |
| 55 |
|
| 56 |
{ |
| 57 |
os_abort(); |
| 58 |
} |