X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=vg_platform.h;fp=vg_platform.h;h=1f388988b2f7e101175d3a0a4d01670a4b4c5a4a;hb=bd0220bf8c44fc5d368e6edf4d0769bbcd5eba5d;hp=b04ce672b9afa8d0803dec16dffb7f5bcbc48c77;hpb=e490893eb0e952a5e0672faeba7250e053e4175e;p=vg.git diff --git a/vg_platform.h b/vg_platform.h index b04ce67..1f38898 100644 --- a/vg_platform.h +++ b/vg_platform.h @@ -129,6 +129,19 @@ VG_STATIC u32 vg_strdjb2( const char *str ) return hash; } +VG_STATIC int vg_strdjb2_eq( const char *s1, u32 h1, + const char *s2, u32 h2 ) +{ + if( h1 == h2 ){ + if(!strcmp(s1, s2)) return 1; + else return 0; + } else return 0; +} + +#define VG_STRDJB2_EQ( CS1, S2, H2 ) \ + vg_strdjb2_eq( CS1, vg_strdjb2(CS1), S2, H2 ) + + #define VG_MIN( A, B ) ((A)<(B)?(A):(B)) #define VG_MAX( A, B ) ((A)>(B)?(A):(B)) #endif