2016-11-04 12:59 GMT+01:00 Eric Engestrom <eric.engest...@imgtec.com>: > On Thursday, 2016-11-03 15:25:22 +0100, Christian Gmeiner wrote: >> This makes it possible to 'use' the imx-drm driver. Remeber that it >> is not possible to have sysmbol names in C/C++ with a '-' in it. >> >> Signed-off-by: Christian Gmeiner <christian.gmei...@gmail.com> >> --- >> include/GL/internal/dri_interface.h | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/include/GL/internal/dri_interface.h >> b/include/GL/internal/dri_interface.h >> index 36ba65e..4ec3211 100644 >> --- a/include/GL/internal/dri_interface.h >> +++ b/include/GL/internal/dri_interface.h >> @@ -42,6 +42,7 @@ >> >> #include <stdio.h> >> #include <stdlib.h> >> +#include <string.h> >> #include <dlfcn.h> >> #ifdef HAVE_LIBDRM >> #include <drm.h> >> @@ -617,6 +618,12 @@ dri_get_extensions_name(const char *driver_name) >> if (asprintf(&name, "%s_%s", __DRI_DRIVER_GET_EXTENSIONS, driver_name) >> < 0) >> return NULL; >> >> + const size_t len = strlen(name); >> + for (size_t i = 0; i < len; i++) { >> + if (name[i] == '-') >> + name[i] = '_'; > > Why not replace all non-alnum chars? >
I am not sure with what char I should replace them. > Either way, the series is: > Reviewed-by: Eric Engestrom <eric.engest...@imgtec.com> > > Also, for the asprintf->malloc change, I think that should be a separate > patch, as the code being deduplicated in the first patch was already > using asprintf :) > good point - v2 will hit ml soon. >> + } >> + >> return name; >> } >> >> -- >> 2.7.4 >> greets -- Christian Gmeiner, MSc https://soundcloud.com/christian-gmeiner _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev