Browse Source

libobs: Add OBS_COUNTOF for array count

jpark37 3 years ago
parent
commit
6f8b364565
1 changed files with 2 additions and 0 deletions
  1. 2 0
      libobs/util/base.h

+ 2 - 0
libobs/util/base.h

@@ -35,6 +35,8 @@ extern "C" {
 #define INT_CUR_LINE __LINE__
 #define FILE_LINE __FILE__ " (" S__LINE__ "): "
 
+#define OBS_COUNTOF(x) (sizeof(x) / sizeof(x[0]))
+
 enum {
 	/**
 	 * Use if there's a problem that can potentially affect the program,