+static DECLARATOR_TYPE
+getPtrType(sym_link *type)
+{
+ //for Z80 anything goes
+ if (TARGET_Z80_LIKE)
+ return POINTER;
+
+ //preserve original behaviour for PIC16
+ if (TARGET_IS_PIC16)
+ return POINTER;
+
+ //for HC08 only zeropage ptr is different
+ if (TARGET_IS_HC08)
+ {
+ if (IS_DATA_PTR (type))
+ return POINTER;
+ else
+ return FPOINTER;
+ }
+
+ if (IS_DATA_PTR (type) && TARGET_MCS51_LIKE)
+ return IPOINTER;
+ if (IS_PTR (type))
+ return DCL_TYPE (type);
+ else if (IS_FUNC (type))
+ return CPOINTER;
+ else if (IS_ARRAY (type))
+ return PTR_TYPE (SPEC_OCLS (getSpec (type)));
+ return UPOINTER;
+}
+