- combine (acc_feb, acc_f, acc_h, acc_c) (ForeignImport id _ spec _)
- = dsFImport mod_name id spec `thenDs` \ (bs, h, c) ->
- returnDs (acc_feb, bs ++ acc_f, h $$ acc_h, c $$ acc_c)
-
- combine (acc_feb, acc_f, acc_h, acc_c) (ForeignExport id _ (CExport (CExportStatic ext_nm cconv)) _)
- = dsFExport mod_name id (idType id) ext_nm cconv False `thenDs` \ (feb, b, h, c) ->
- returnDs (feb:acc_feb, b : acc_f, h $$ acc_h, c $$ acc_c)
+ combine (acc_feb, acc_f, acc_h, acc_c, acc_header)
+ (ForeignImport id _ spec depr loc)
+ = dsFImport mod_name id spec `thenDs` \(bs, h, c, hd) ->
+ warnDepr depr loc `thenDs` \_ ->
+ returnDs (acc_feb, bs ++ acc_f, h $$ acc_h, c $$ acc_c, hd ++ acc_header)
+
+ combine (acc_feb, acc_f, acc_h, acc_c, acc_header)
+ (ForeignExport id _ (CExport (CExportStatic ext_nm cconv)) depr loc)
+ = dsFExport mod_name id (idType id)
+ ext_nm cconv False `thenDs` \(feb, b, h, c) ->
+ warnDepr depr loc `thenDs` \_ ->
+ returnDs (feb:acc_feb, b : acc_f, h $$ acc_h, c $$ acc_c, acc_header)
+
+ warnDepr False _ = returnDs ()
+ warnDepr True loc = dsWarn (addShortWarnLocLine loc msg)
+ where
+ msg = ptext SLIT("foreign declaration uses deprecated non-standard syntax")