isl_test_cpp17-generic.cc: work around std::optional::value issue in older macOS
[isl.git] / isl_read_from_str_templ.c
blob51fa8ed12810c735b920bae662005027924bed1e
1 /*
2 * Copyright 2008 Katholieke Universiteit Leuven
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege, K.U.Leuven, Departement
7 * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
8 */
10 #define xCAT(A,B) A ## B
11 #define CAT(A,B) xCAT(A,B)
12 #undef TYPE
13 #define TYPE CAT(isl_,TYPE_BASE)
15 /* Read an object of type TYPE from "str" (using an isl_stream).
17 __isl_give TYPE *FN(isl,FN(TYPE_BASE,read_from_str))(isl_ctx *ctx,
18 const char *str)
20 TYPE *obj;
21 isl_stream *s = isl_stream_new_str(ctx, str);
22 if (!s)
23 return NULL;
24 obj = FN(isl_stream_read,TYPE_BASE)(s);
25 isl_stream_free(s);
26 return obj;