outobj: handle compilers without 64-bit switch() support

OpenWatcom, in particular, doesn't handle switch() statements with
64-bit expressions, sigh.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
This commit is contained in:
H. Peter Anvin 2010-06-07 11:34:28 -07:00
parent 4dff757ba5
commit b714cb27cb

View file

@ -43,6 +43,7 @@
#include <string.h>
#include <ctype.h>
#include <inttypes.h>
#include <limits.h>
#include "nasm.h"
#include "nasmlib.h"
@ -1099,7 +1100,10 @@ static void obj_out(int32_t segto, const void *data,
ldata -= size;
}
switch (size) {
if (size > UINT_MAX)
size = 0;
switch ((unsigned int)size) {
default:
nasm_error(ERR_NONFATAL, "OBJ format can only handle 16- or "
"32-byte relocations");