summaryrefslogtreecommitdiff
blob: d909933c2ab882f9b79e529ef3422b38b85e7b3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
--- libprojectM/src/preset.cc.orig	2006-06-28 17:45:36.000000000 -0300
+++ libprojectM/src/preset.cc	2007-02-26 23:58:08.643514331 -0300
@@ -69,6 +69,7 @@
 
 #include "idle_preset.h"
 #include "wipemalloc.h"
+#include "config.h"
 
 /* The maximum number of preset names loaded into buffer */
 #define MAX_PRESETS_IN_DIR 50000 
@@ -638,7 +642,7 @@
   preset->per_pixel_eqn_tree = create_splaytree((int (*)(void*,void*))compare_int, (void* (*)(void*))copy_int, (void (*)(void*))free_int);
 
   /* Convert string to a stream */
-#if !defined(MACOS) && !defined(WIN32)
+#if !defined(MACOS) && !defined(WIN32) && !defined(__FreeBSD__)
 	{
 		FILE* fs = fmemopen (s, strlen(s), "r");
 		char c;
@@ -693,7 +697,7 @@
   preset->per_frame_eqn_tree = create_splaytree((int (*)(void*,void*))compare_int,(void* (*)(void*)) copy_int, (void (*)(void*))free_int);
 
   /* Convert string to a stream */
-#if !defined(MACOS) && !defined(WIN32)
+#if !defined(MACOS) && !defined(WIN32) && !defined(__FreeBSD__)
 	{
 		FILE* fs = fmemopen (s, strlen(s), "r");
 		char c;
--- libprojectM/configure.ac.orig	2006-06-28 17:45:36 -0300
+++ libprojectM/configure.ac	2007-03-04 11:43:06 -0300
@@ -33,6 +33,7 @@
 AC_FUNC_FORK
 AC_FUNC_MALLOC
 AC_FUNC_STRTOD
+AC_SEARCH_LIBS([floor, pow, sqrt], [m])
 AC_CHECK_FUNCS([floor gettimeofday memset pow setenv sqrt strcasecmp strchr strstr strtol strverscmp])
 
 PKG_CHECK_MODULES(FTGL, ftgl >= 2.0.0, [libft="yes"], [libft="no"])
--- libprojectM.orig/m4/ac_proto_scandir.m4	1969-12-31 21:00:00 -0300
+++ libprojectM/m4/ac_proto_scandir.m4	2007-03-04 13:30:14 -0300
@@ -0,0 +1,33 @@
+dnl @synopsis AC_PROTO_SCANDIR
+dnl
+dnl Defines the third scandir() argument with or without a const.
+dnl
+dnl Should be called after checking for the correct <dirent.h>
+dnl
+dnl @category InstalledPackages
+dnl @author Javier Villavicencio <the_paya@gentoo.org>
+dnl @version 2007-03-04
+dnl @license BSD-2
+
+AC_DEFUN([AC_PROTO_SCANDIR],[
+  AC_MSG_CHECKING([for scandir prototype])
+  AC_LANG_PUSH(C++)
+  AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[
+    #include <dirent.h>
+  ]], [[
+    const char * dir = 0;
+    struct dirent ***namelist = 0;
+    int(* select)(const struct dirent *) = 0;
+    scandir(dir, namelist, select, alphasort);
+    ]]),
+    [
+      AC_DEFINE([SCANDIR_ARG3], [const struct dirent*],[Correct third argument to scandir.])
+      AC_MSG_RESULT([const struct dirent*])
+    ],
+    [
+      AC_DEFINE([SCANDIR_ARG3], [struct dirent*],[Correct third argument to scandir.])
+      AC_MSG_RESULT([struct dirent*])
+    ]
+  )
+ AC_LANG_POP(C++)
+])
--- libprojectM.orig/src/preset.cc	2007-03-04 13:31:38 -0300
+++ libprojectM/src/preset.cc	2007-03-04 13:31:22 -0300
@@ -93,7 +93,7 @@
 int preset_index = -1;
 
 preset_t * load_preset(const char * pathname);
-int is_valid_extension(const struct dirent* ent);
+int is_valid_extension(SCANDIR_ARG3 ent);
 int load_preset_file(const char * pathname, preset_t * preset);
 int close_preset(preset_t * preset);
 
@@ -560,7 +560,7 @@
 
 /* Returns nonzero if string 'name' contains .milk or
    (the better) .prjm extension. Not a very strong function currently */
-int is_valid_extension(const struct dirent* ent) {
+int is_valid_extension(SCANDIR_ARG3 ent) {
 	const char* ext = 0;
 	
 	if (!ent) return FALSE;
--- libprojectM/configure.ac.orig	2007-03-04 13:35:57 -0300
+++ libprojectM/configure.ac	2007-03-04 13:36:45 -0300
@@ -35,6 +35,7 @@
 AC_FUNC_STRTOD
 AC_SEARCH_LIBS([floor, pow, sqrt], [m])
 AC_CHECK_FUNCS([floor gettimeofday memset pow setenv sqrt strcasecmp strchr strstr strtol strverscmp])
+AC_PROTO_SCANDIR
 
 PKG_CHECK_MODULES(FTGL, ftgl >= 2.0.0, [libft="yes"], [libft="no"])
 if test x$libft = xno; then