summaryrefslogtreecommitdiffstats
path: root/Alc/alstring.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-07-06 03:27:39 -0700
committerChris Robinson <[email protected]>2014-07-06 03:27:39 -0700
commitd0a64fe191aabe085cabe1737c44ff6a47a3d4d8 (patch)
treea22024a773333fd6beb4e1af95af5497477045bd /Alc/alstring.h
parent5de7271bcd4df9a26301a37ed9cf76ddc6641328 (diff)
Don't require pre-declaring vector types
Diffstat (limited to 'Alc/alstring.h')
-rw-r--r--Alc/alstring.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/Alc/alstring.h b/Alc/alstring.h
index 5b37a483..d5f64418 100644
--- a/Alc/alstring.h
+++ b/Alc/alstring.h
@@ -7,13 +7,13 @@
typedef char al_string_char_type;
-DECL_VECTOR(al_string_char_type)
+TYPEDEF_VECTOR(al_string_char_type, al_string)
-typedef vector_al_string_char_type al_string;
-typedef const_vector_al_string_char_type const_al_string;
-
-#define AL_STRING_INIT(_x) VECTOR_INIT(_x)
-#define AL_STRING_DEINIT(_x) VECTOR_DEINIT(_x)
+inline void al_string_deinit(al_string *str)
+{ VECTOR_DEINIT(*str); }
+#define AL_STRING_INIT(_x) do { (_x) = (al_string)NULL; } while(0)
+#define AL_STRING_INIT_STATIC() ((al_string)NULL)
+#define AL_STRING_DEINIT(_x) al_string_deinit(&(_x));
inline ALsizei al_string_length(const_al_string str)
{ return VECTOR_SIZE(str); }
@@ -42,7 +42,4 @@ void al_string_append_range(al_string *str, const al_string_char_type *from, con
void al_string_copy_wcstr(al_string *str, const wchar_t *from);
#endif
-
-DECL_VECTOR(al_string)
-
#endif /* ALSTRING_H */