diff -ur libdrm-2.0.1.old/shared-core/drm.h libdrm-2.0.1/shared-core/drm.h --- libdrm-2.0.1.old/shared-core/drm.h 2006-01-02 06:55:31.000000000 +0100 +++ libdrm-2.0.1/shared-core/drm.h 2006-04-19 12:06:18.000000000 +0200 @@ -79,8 +79,8 @@ #define DRM_IOC_WRITE _IOC_WRITE #define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE #define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) -#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) -#if defined(__FreeBSD__) && defined(IN_MODULE) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) +#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && defined(IN_MODULE) /* Prevent name collision when including sys/ioccom.h */ #undef ioctl #include