]> code.delx.au - pulseaudio/blobdiff - src/tests/mainloop-test.c
remove glib 1.2 adapter. It started to bitrot and wasn't used by anything anyway.
[pulseaudio] / src / tests / mainloop-test.c
index 2936420c36c199f822bedcfb7b966fd9692e2cb0..b06d0ed1df42a70a047089e25af765e27eb70e23 100644 (file)
@@ -1,20 +1,20 @@
 /* $Id$ */
 
 /***
-  This file is part of polypaudio.
+  This file is part of PulseAudio.
  
-  polypaudio is free software; you can redistribute it and/or modify
+  PulseAudio is free software; you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as published
   by the Free Software Foundation; either version 2 of the License,
   or (at your option) any later version.
  
-  polypaudio is distributed in the hope that it will be useful, but
+  PulseAudio is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   General Public License for more details.
  
   You should have received a copy of the GNU Lesser General Public License
-  along with polypaudio; if not, write to the Free Software
+  along with PulseAudio; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
   USA.
 ***/
 #include <sys/time.h>
 #include <assert.h>
 
-#include <polyp/timeval.h>
+#include <pulse/timeval.h>
 
-#include <polypcore/core-util.h>
-#include <polypcore/gccmacro.h>
+#include <pulsecore/core-util.h>
+#include <pulsecore/gccmacro.h>
 
 #ifdef GLIB_MAIN_LOOP
 
 #include <glib.h>
-#include <polyp/glib-mainloop.h>
+#include <pulse/glib-mainloop.h>
 
 static GMainLoop* glib_main_loop = NULL;
 
-#if GLIB_MAJOR_VERSION >= 2
-#define GLIB20
-#else
-#undef GLIB20
-#endif 
-
-
 #else /* GLIB_MAIN_LOOP */
-#include <polyp/mainloop.h>
+#include <pulse/mainloop.h>
 #endif /* GLIB_MAIN_LOOP */
 
 static pa_defer_event *de;
@@ -68,10 +61,8 @@ static void dcb(pa_mainloop_api*a, pa_defer_event *e, void *userdata) {
 static void tcb(pa_mainloop_api*a, pa_time_event *e, const struct timeval *tv, void *userdata) {
     fprintf(stderr, "TIME EVENT\n");
 
-#if defined(GLIB_MAIN_LOOP) && defined(GLIB20)
+#if defined(GLIB_MAIN_LOOP)
     g_main_loop_quit(glib_main_loop);
-#elif defined(GLIB_MAIN_LOOP)
-    g_main_quit(glib_main_loop);
 #else
     a->quit(a, 0);
 #endif
@@ -86,17 +77,10 @@ int main(PA_GCC_UNUSED int argc, PA_GCC_UNUSED char *argv[]) {
 #ifdef GLIB_MAIN_LOOP
     pa_glib_mainloop *g;
 
-#ifdef GLIB20 
     glib_main_loop = g_main_loop_new(NULL, FALSE);
     assert(glib_main_loop);
 
     g = pa_glib_mainloop_new(NULL);
-#else /* GLIB20 */
-    glib_main_loop = g_main_new(FALSE);
-    assert(glib_main_loop);
-    
-    g = pa_glib_mainloop_new();
-#endif /* GLIB20 */
     assert(g);
 
     a = pa_glib_mainloop_get_api(g);
@@ -121,10 +105,8 @@ int main(PA_GCC_UNUSED int argc, PA_GCC_UNUSED char *argv[]) {
     tv.tv_sec += 10;
     te = a->time_new(a, &tv, tcb, NULL);
 
-#if defined(GLIB_MAIN_LOOP) && defined(GLIB20)
+#if defined(GLIB_MAIN_LOOP)
     g_main_loop_run(glib_main_loop);
-#elif defined(GLIB_MAIN_LOOP)
-    g_main_run(glib_main_loop);
 #else
     pa_mainloop_run(m, NULL);
 #endif
@@ -135,11 +117,7 @@ int main(PA_GCC_UNUSED int argc, PA_GCC_UNUSED char *argv[]) {
 
 #ifdef GLIB_MAIN_LOOP
     pa_glib_mainloop_free(g);
-#ifdef GLIB20
     g_main_loop_unref(glib_main_loop);
-#else
-    g_main_destroy(glib_main_loop);
-#endif
 #else
     pa_mainloop_free(m);
 #endif