--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/wildmidi-02-sunstudio.diff Sat Jun 13 19:24:40 2009 +0000
@@ -0,0 +1,1333 @@
+--- wildmidi-0.2.2/src/wildmidi_lib.c 2009-06-13 19:01:17.737707714 +0200
++++ wildmidi-0.2.2-patch/src/wildmidi_lib.c 2009-06-13 19:01:14.950440156 +0200
+@@ -584,8 +584,8 @@
+ char *buffer_file = malloc(strlen(filename) + 1);
+
+ if (buffer_file == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, errno);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, filename, errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, filename, errno);
+ return NULL;
+ }
+
+@@ -600,8 +600,8 @@
+ if (home) {
+ buffer_file = realloc(buffer_file,(strlen(buffer_file) + strlen(home) + 1));
+ if (buffer_file == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, errno);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, filename, errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, filename, errno);
+ free(buffer_file);
+ return NULL;
+ }
+@@ -616,8 +616,8 @@
+ }
+ buffer_file = realloc(buffer_file,(strlen(buffer_file) + strlen(buffer_dir) + 1));
+ if (buffer_file == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, errno);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, filename, errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, filename, errno);
+ free(buffer_file);
+ return NULL;
+ }
+@@ -626,15 +626,15 @@
+ }
+ #endif
+ if (stat(buffer_file,&buffer_stat)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_STAT, filename, errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_STAT, filename, errno);
+ free(buffer_file);
+ return NULL;
+ }
+ *size = buffer_stat.st_size;
+ data = malloc(*size);
+ if (data == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, errno);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, filename, errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, filename, errno);
+ free(buffer_file);
+ return NULL;
+ }
+@@ -643,13 +643,13 @@
+ #else
+ if ((buffer_fd = open(buffer_file,O_RDONLY)) == -1) {
+ #endif
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_OPEN, filename, errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_OPEN, filename, errno);
+ free(buffer_file);
+ free(data);
+ return NULL;
+ }
+ if (read(buffer_fd,data,*size) != buffer_stat.st_size) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_READ, filename, errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_READ, filename, errno);
+ free(buffer_file);
+ free(data);
+ close(buffer_fd);
+@@ -749,8 +749,8 @@
+ if (dir_end != NULL) {
+ config_dir = malloc((dir_end - config_file + 2));
+ if (config_dir == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse config", errno);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse config", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ free (config_buffer);
+ return -1;
+@@ -791,8 +791,8 @@
+ // copy line into a workable buffer
+ line_buffer = realloc(line_buffer, (config_ptr - line_start_ptr + 1));
+ if (line_buffer == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse config", errno);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse config", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ if (config_dir != NULL)
+ free(config_dir);
+@@ -822,8 +822,8 @@
+ if (line_buffer[strlen(line_buffer) - 1] == '/') {
+ config_dir = realloc(config_dir, strlen(&line_buffer[4]) + 1);
+ if (config_dir == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse config", errno);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse config", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ free (line_buffer);
+ free (config_buffer);
+@@ -833,8 +833,8 @@
+ } else {
+ config_dir = realloc(config_dir, strlen(&line_buffer[4]) + 2);
+ if (config_dir == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse config", errno);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse config", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ free (line_buffer);
+ free (config_buffer);
+@@ -848,8 +848,8 @@
+ if (config_dir != NULL) {
+ new_config = malloc(strlen(config_dir) + strlen(&line_buffer[7]) + 1);
+ if (new_config == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse config", errno);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse config", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ free (config_dir);
+ free (line_buffer);
+@@ -861,8 +861,8 @@
+ } else {
+ new_config = malloc(strlen(&line_buffer[7]) + 1);
+ if (new_config == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse config", errno);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse config", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ free (line_buffer);
+ free (config_buffer);
+@@ -882,8 +882,8 @@
+ continue;
+ } else if (strncasecmp(line_buffer, "bank ", 5) == 0) {
+ if (!isdigit(line_buffer[5])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in bank line)", 0);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in bank line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ if (config_dir != NULL)
+ free (config_dir);
+@@ -895,8 +895,8 @@
+ continue;
+ } else if (strncasecmp(line_buffer, "drumset ", 8) == 0) {
+ if (!isdigit(line_buffer[8])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in drumset line)", 0);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in drumset line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ if (config_dir != NULL)
+ free (config_dir);
+@@ -911,8 +911,8 @@
+ if (patch[(patchid & 0x7F)] == NULL) {
+ patch[(patchid & 0x7F)] = malloc (sizeof(struct _patch));
+ if (patch[(patchid & 0x7F)] == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, errno);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ if (config_dir != NULL)
+ free (config_dir);
+@@ -946,8 +946,8 @@
+ if (tmp_patch->next == NULL) {
+ tmp_patch->next = malloc (sizeof(struct _patch));
+ if (tmp_patch->next == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, 0);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ if (config_dir != NULL)
+ free (config_dir);
+@@ -974,8 +974,8 @@
+ } else {
+ tmp_patch->next = malloc (sizeof(struct _patch));
+ if (tmp_patch->next == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, errno);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ if (config_dir != NULL)
+ free (config_dir);
+@@ -998,8 +998,8 @@
+
+ chr_ptr = strchr(line_buffer,' ') + 1;
+ if (chr_ptr == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ if (config_dir != NULL)
+ free (config_dir);
+@@ -1016,8 +1016,8 @@
+ if (config_dir != NULL) {
+ tmp_patch->filename = malloc(strlen(config_dir) + strlen(&line_buffer[line_ptr]) + 5);
+ if (tmp_patch->filename == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, 0);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ if (config_dir != NULL)
+ free (config_dir);
+@@ -1030,8 +1030,8 @@
+ } else {
+ tmp_patch->filename = malloc(strlen(&line_buffer[line_ptr]) + 5);
+ if (tmp_patch->filename == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, 0);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ free (line_buffer);
+ free (config_buffer);
+@@ -1044,8 +1044,8 @@
+ if (config_dir != NULL) {
+ tmp_patch->filename = malloc(strlen(config_dir) + strlen(&line_buffer[line_ptr]) + 1);
+ if (tmp_patch->filename == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, 0);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ if (config_dir != NULL)
+ free (config_dir);
+@@ -1058,8 +1058,8 @@
+ } else {
+ tmp_patch->filename = malloc(strlen(&line_buffer[line_ptr]) + 1);
+ if (tmp_patch->filename == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, 0);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, config_file, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, config_file, 0);
+ WM_FreePatches();
+ free (line_buffer);
+ free (config_buffer);
+@@ -1083,7 +1083,7 @@
+ chr_ptr = strstr(&line_buffer[line_ptr], "amp=");
+ if (chr_ptr != NULL) {
+ if (!isdigit(chr_ptr[4])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
+ } else {
+ tmp_patch->amp = ((atoi(&chr_ptr[4]) << 10) / 100);
+ }
+@@ -1091,7 +1091,7 @@
+ chr_ptr = strstr(&line_buffer[line_ptr], "note=");
+ if (chr_ptr != NULL) {
+ if (!isdigit(chr_ptr[5])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
+ } else {
+ tmp_patch->note = atoi(&chr_ptr[5]);
+ }
+@@ -1111,11 +1111,11 @@
+ chr_ptr = strstr(&line_buffer[line_ptr], "env_time0=");
+ if (chr_ptr != NULL) {
+ if (!isdigit(chr_ptr[10])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
+ } else {
+ tmp_patch->env[0].time = atof(&chr_ptr[10]);
+ if ((tmp_patch->env[0].time > 45000.0) || (tmp_patch->env[0].time < 1.47)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
+ tmp_patch->env[0].set &= 0xFE;
+ } else {
+ tmp_patch->env[0].set |= 0x01;
+@@ -1126,11 +1126,11 @@
+ chr_ptr = strstr(&line_buffer[line_ptr], "env_time1=");
+ if (chr_ptr != NULL) {
+ if (!isdigit(chr_ptr[10])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
+ } else {
+ tmp_patch->env[1].time = atof(&chr_ptr[10]);
+ if ((tmp_patch->env[1].time > 45000.0) || (tmp_patch->env[1].time < 1.47)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
+ tmp_patch->env[1].set &= 0xFE;
+ } else {
+ tmp_patch->env[1].set |= 0x01;
+@@ -1140,11 +1140,11 @@
+ chr_ptr = strstr(&line_buffer[line_ptr], "env_time2=");
+ if (chr_ptr != NULL) {
+ if (!isdigit(chr_ptr[10])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
+ } else {
+ tmp_patch->env[2].time = atof(&chr_ptr[10]);
+ if ((tmp_patch->env[2].time > 45000.0) || (tmp_patch->env[2].time < 1.47)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
+ tmp_patch->env[2].set &= 0xFE;
+ } else {
+ tmp_patch->env[2].set |= 0x01;
+@@ -1154,11 +1154,11 @@
+ chr_ptr = strstr(&line_buffer[line_ptr], "env_time3=");
+ if (chr_ptr != NULL) {
+ if (!isdigit(chr_ptr[10])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
+ } else {
+ tmp_patch->env[3].time = atof(&chr_ptr[10]);
+ if ((tmp_patch->env[3].time > 45000.0) || (tmp_patch->env[3].time < 1.47)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
+ tmp_patch->env[3].set &= 0xFE;
+ } else {
+ tmp_patch->env[3].set |= 0x01;
+@@ -1168,11 +1168,11 @@
+ chr_ptr = strstr(&line_buffer[line_ptr], "env_time4=");
+ if (chr_ptr != NULL) {
+ if (!isdigit(chr_ptr[10])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
+ } else {
+ tmp_patch->env[4].time = atof(&chr_ptr[10]);
+ if ((tmp_patch->env[4].time > 45000.0) || (tmp_patch->env[4].time < 1.47)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
+ tmp_patch->env[4].set &= 0xFE;
+ } else {
+ tmp_patch->env[4].set |= 0x01;
+@@ -1182,11 +1182,11 @@
+ chr_ptr = strstr(&line_buffer[line_ptr], "env_time5=");
+ if (chr_ptr != NULL) {
+ if (!isdigit(chr_ptr[10])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
+ } else {
+ tmp_patch->env[5].time = atof(&chr_ptr[10]);
+ if ((tmp_patch->env[5].time > 45000.0) || (tmp_patch->env[5].time < 1.47)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
+ tmp_patch->env[5].set &= 0xFE;
+ } else {
+ tmp_patch->env[5].set |= 0x01;
+@@ -1196,11 +1196,11 @@
+ chr_ptr = strstr(&line_buffer[line_ptr], "env_level0=");
+ if (chr_ptr != NULL) {
+ if (!isdigit(chr_ptr[11])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
+ } else {
+ tmp_patch->env[0].level = atof(&chr_ptr[10]);
+ if ((tmp_patch->env[0].level > 1.0) || (tmp_patch->env[0].level < 0.0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
+ tmp_patch->env[0].set &= 0xFD;
+ } else {
+ tmp_patch->env[0].set |= 0x02;
+@@ -1211,11 +1211,11 @@
+ chr_ptr = strstr(&line_buffer[line_ptr], "env_level1=");
+ if (chr_ptr != NULL) {
+ if (!isdigit(chr_ptr[11])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
+ } else {
+ tmp_patch->env[1].level = atof(&chr_ptr[10]);
+ if ((tmp_patch->env[1].level > 1.0) || (tmp_patch->env[1].level < 0.0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
+ tmp_patch->env[1].set &= 0xFD;
+ } else {
+ tmp_patch->env[1].set |= 0x02;
+@@ -1225,11 +1225,11 @@
+ chr_ptr = strstr(&line_buffer[line_ptr], "env_level2=");
+ if (chr_ptr != NULL) {
+ if (!isdigit(chr_ptr[11])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
+ } else {
+ tmp_patch->env[2].level = atof(&chr_ptr[10]);
+ if ((tmp_patch->env[2].level > 1.0) || (tmp_patch->env[2].level < 0.0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
+ tmp_patch->env[2].set &= 0xFD;
+ } else {
+ tmp_patch->env[2].set |= 0x02;
+@@ -1239,11 +1239,11 @@
+ chr_ptr = strstr(&line_buffer[line_ptr], "env_level3=");
+ if (chr_ptr != NULL) {
+ if (!isdigit(chr_ptr[11])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
+ } else {
+ tmp_patch->env[3].level = atof(&chr_ptr[10]);
+ if ((tmp_patch->env[3].level > 1.0) || (tmp_patch->env[3].level < 0.0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
+ tmp_patch->env[3].set &= 0xFD;
+ } else {
+ tmp_patch->env[3].set |= 0x02;
+@@ -1253,11 +1253,11 @@
+ chr_ptr = strstr(&line_buffer[line_ptr], "env_level4=");
+ if (chr_ptr != NULL) {
+ if (!isdigit(chr_ptr[11])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
+ } else {
+ tmp_patch->env[4].level = atof(&chr_ptr[10]);
+ if ((tmp_patch->env[4].level > 1.0) || (tmp_patch->env[4].level < 0.0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
+ tmp_patch->env[4].set &= 0xFD;
+ } else {
+ tmp_patch->env[4].set |= 0x02;
+@@ -1267,11 +1267,11 @@
+ chr_ptr = strstr(&line_buffer[line_ptr], "env_level5=");
+ if (chr_ptr != NULL) {
+ if (!isdigit(chr_ptr[11])) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(syntax error in patch line)", 0);
+ } else {
+ tmp_patch->env[5].level = atof(&chr_ptr[10]);
+ if ((tmp_patch->env[5].level > 1.0) || (tmp_patch->env[5].level < 0.0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, "(range error in patch line)", 0);
+ tmp_patch->env[5].set &= 0xFD;
+ } else {
+ tmp_patch->env[5].set |= 0x02;
+@@ -1306,7 +1306,7 @@
+ unsigned char *read_end = data + gus_sample->data_length;
+ signed short int *write_data = NULL;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc((gus_sample->data_length + 1), sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data;
+@@ -1322,7 +1322,7 @@
+ return 0;
+ }
+
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -1338,7 +1338,7 @@
+ signed short int *write_data_a = NULL;
+ signed short int *write_data_b = NULL;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc((new_length + 1), sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data;
+@@ -1391,7 +1391,7 @@
+ return 0;
+ }
+
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -1403,7 +1403,7 @@
+ signed short int *write_data = NULL;
+ unsigned long int tmp_loop = 0;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc((gus_sample->data_length + 1), sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data + gus_sample->data_length - 1;
+@@ -1423,7 +1423,7 @@
+ gus_sample->modes ^= SAMPLE_REVERSE;
+ return 0;
+ }
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -1440,7 +1440,7 @@
+ signed short int *write_data_a = NULL;
+ signed short int *write_data_b = NULL;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc((new_length + 1), sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data;
+@@ -1491,7 +1491,7 @@
+ return 0;
+ }
+
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -1502,7 +1502,7 @@
+ unsigned char *read_end = data + gus_sample->data_length;
+ signed short int *write_data = NULL;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc((gus_sample->data_length + 1), sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data;
+@@ -1518,7 +1518,7 @@
+ gus_sample->modes ^= SAMPLE_UNSIGNED;
+ return 0;
+ }
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -1534,7 +1534,7 @@
+ signed short int *write_data_a = NULL;
+ signed short int *write_data_b = NULL;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc((new_length + 1), sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data;
+@@ -1587,7 +1587,7 @@
+ return 0;
+ }
+
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -1599,7 +1599,7 @@
+ signed short int *write_data = NULL;
+ unsigned long int tmp_loop = 0;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc((gus_sample->data_length + 1), sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data + gus_sample->data_length - 1;
+@@ -1619,7 +1619,7 @@
+ gus_sample->modes ^= SAMPLE_REVERSE | SAMPLE_UNSIGNED;
+ return 0;
+ }
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -1635,7 +1635,7 @@
+ signed short int *write_data_a = NULL;
+ signed short int *write_data_b = NULL;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc((new_length + 1), sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data;
+@@ -1686,7 +1686,7 @@
+ return 0;
+ }
+
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -1697,7 +1697,7 @@
+ unsigned char *read_end = data + gus_sample->data_length;
+ signed short int *write_data = NULL;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc(((gus_sample->data_length >> 1) + 1),sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data;
+@@ -1717,7 +1717,7 @@
+ gus_sample->data_length >>= 1;
+ return 0;
+ }
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -1733,7 +1733,7 @@
+ signed short int *write_data_a = NULL;
+ signed short int *write_data_b = NULL;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc(((new_length >> 1) + 1), sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data;
+@@ -1794,7 +1794,7 @@
+ return 0;
+ }
+
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -1806,7 +1806,7 @@
+ signed short int *write_data = NULL;
+ unsigned long int tmp_loop = 0;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc(((gus_sample->data_length >> 1) + 1), sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data + (gus_sample->data_length >> 1) - 1;
+@@ -1830,7 +1830,7 @@
+ gus_sample->modes ^= SAMPLE_REVERSE;
+ return 0;
+ }
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -1847,7 +1847,7 @@
+ signed short int *write_data_a = NULL;
+ signed short int *write_data_b = NULL;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc(((new_length >> 1) + 1), sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data;
+@@ -1904,7 +1904,7 @@
+ return 0;
+ }
+
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -1915,7 +1915,7 @@
+ unsigned char *read_end = data + gus_sample->data_length;
+ signed short int *write_data = NULL;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc(((gus_sample->data_length >> 1) + 1),sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data;
+@@ -1935,7 +1935,7 @@
+ gus_sample->modes ^= SAMPLE_UNSIGNED;
+ return 0;
+ }
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -1951,7 +1951,7 @@
+ signed short int *write_data_a = NULL;
+ signed short int *write_data_b = NULL;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc(((new_length >> 1) + 1), sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data;
+@@ -2012,7 +2012,7 @@
+ return 0;
+ }
+
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -2024,7 +2024,7 @@
+ signed short int *write_data = NULL;
+ unsigned long int tmp_loop = 0;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc(((gus_sample->data_length >> 1) + 1), sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data + (gus_sample->data_length >> 1) - 1;
+@@ -2048,7 +2048,7 @@
+ gus_sample->modes ^= SAMPLE_REVERSE | SAMPLE_UNSIGNED;
+ return 0;
+ }
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -2064,7 +2064,7 @@
+ signed short int *write_data_a = NULL;
+ signed short int *write_data_b = NULL;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ gus_sample->data = calloc(((new_length >> 1) + 1), sizeof(signed short int));
+ if (__builtin_expect((gus_sample->data != NULL),1)) {
+ write_data = gus_sample->data;
+@@ -2120,7 +2120,7 @@
+ return 0;
+ }
+
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to parse sample", errno);
+ return -1;
+ }
+
+@@ -2156,33 +2156,33 @@
+ };
+ unsigned long int tmp_loop;
+
+- SAMPLE_CONVERT_DEBUG(__FUNCTION__);
++ SAMPLE_CONVERT_DEBUG(__func__);
+ SAMPLE_CONVERT_DEBUG(sample_patch->filename);
+ sample_patch->loaded = 1;
+ if ((gus_patch = WM_BufferFile(sample_patch->filename,&gus_size)) == NULL) {
+ return -1;
+ }
+ if (gus_size < 239) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
+ free(gus_patch);
+ return -1;
+ }
+ if (memcmp(gus_patch, "GF1PATCH110\0ID#000002", 22) && memcmp(gus_patch, "GF1PATCH100\0ID#000002", 22)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID,"(unsupported format)", 0);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID,"(unsupported format)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
+ free(gus_patch);
+ return -1;
+ }
+ if (gus_patch[82] > 1) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID,"(unsupported format)", 0);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID,"(unsupported format)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
+ free(gus_patch);
+ return -1;
+ }
+ if (gus_patch[151] > 1) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID,"(unsupported format)", 0);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID,"(unsupported format)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
+ free(gus_patch);
+ return -1;
+ }
+@@ -2200,8 +2200,8 @@
+ gus_sample = gus_sample->next;
+ }
+ if (gus_sample == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, 0);
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_LOAD, sample_patch->filename, 0);
+ return -1;
+ }
+
+@@ -2259,7 +2259,7 @@
+ } else {
+ gus_sample->env_rate[i] = (unsigned long int)(4194303.0 / ((float)WM_SampleRate * env_time_table[env_rate]));
+ if (gus_sample->env_rate[i] == 0) {
+- fprintf(stderr,"\rWarning: libWildMidi %s found invalid envelope(%lu) rate setting in %s. Using %f instead.\n",__FUNCTION__, i, sample_patch->filename, env_time_table[63]);
++ fprintf(stderr,"\rWarning: libWildMidi %s found invalid envelope(%lu) rate setting in %s. Using %f instead.\n",__func__, i, sample_patch->filename, env_time_table[63]);
+ gus_sample->env_rate[i] = (unsigned long int)(4194303.0 / ((float)WM_SampleRate * env_time_table[63]));
+ }
+ }
+@@ -2420,7 +2420,7 @@
+ var_data |= mdi->data[track->ptr] & 0x7f;
+ track->ptr++;
+ if (track->ptr > mdi->size) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
+ return 0xFFFFFFFF;
+ }
+ var_data = (var_data << 7);
+@@ -2430,7 +2430,7 @@
+ track->ptr++;
+
+ if (track->ptr > mdi->size) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
+ return 0xFFFFFFFF;
+ }
+
+@@ -2441,7 +2441,7 @@
+ do_note_off (unsigned char ch, struct _mdi *mdi, unsigned long int ptr) {
+ struct _note *nte;
+
+- MIDI_EVENT_DEBUG(__FUNCTION__,ch);
++ MIDI_EVENT_DEBUG(__func__,ch);
+
+ nte = &mdi->note_table[0][ch][mdi->data[ptr]];
+ if (!nte->active)
+@@ -2530,7 +2530,7 @@
+ return;
+ }
+
+- MIDI_EVENT_DEBUG(__FUNCTION__,ch);
++ MIDI_EVENT_DEBUG(__func__,ch);
+
+ if (ch != 9) {
+ patch = mdi->channel[ch].patch;
+@@ -2597,7 +2597,7 @@
+ do_aftertouch (unsigned char ch, struct _mdi *mdi, unsigned long int ptr) {
+ struct _note *nte;
+
+- MIDI_EVENT_DEBUG(__FUNCTION__,ch);
++ MIDI_EVENT_DEBUG(__func__,ch);
+
+ nte = &mdi->note_table[0][ch][mdi->data[ptr]];
+ if (!nte->active) {
+@@ -2945,7 +2945,7 @@
+
+ void
+ do_patch (unsigned char ch, struct _mdi *mdi, unsigned long int ptr) {
+- MIDI_EVENT_DEBUG(__FUNCTION__,ch);
++ MIDI_EVENT_DEBUG(__func__,ch);
+ if (ch != 9) {
+ mdi->channel[ch].patch = get_patch_data(mdi, ((mdi->channel[ch].bank << 8) | mdi->data[ptr]));
+ } else {
+@@ -2956,7 +2956,7 @@
+ void
+ do_channel_pressure (unsigned char ch, struct _mdi *mdi, unsigned long int ptr) {
+ struct _note **note_data = mdi->note;
+- MIDI_EVENT_DEBUG(__FUNCTION__,ch);
++ MIDI_EVENT_DEBUG(__func__,ch);
+
+ if (note_data != mdi->last_note) {
+ do {
+@@ -2978,7 +2978,7 @@
+ do_pitch (unsigned char ch, struct _mdi *mdi, unsigned long int ptr) {
+ struct _note **note_data = mdi->note;
+
+- MIDI_EVENT_DEBUG(__FUNCTION__,ch);
++ MIDI_EVENT_DEBUG(__func__,ch);
+ mdi->channel[ch].pitch = ((mdi->data[ptr+1] << 7) | mdi->data[ptr]) - 0x2000;
+
+ if (mdi->channel[ch].pitch < 0) {
+@@ -3002,7 +3002,7 @@
+ unsigned char event_type = 0xF0 | ch;
+ static unsigned long int tempo = 500000;
+
+- MIDI_EVENT_DEBUG(__FUNCTION__,ch);
++ MIDI_EVENT_DEBUG(__func__,ch);
+ if (event_type == 0xFF) {
+ if ((mdi->data[ptr] == 0x51) && (mdi->data[ptr+1] == 3)) {
+ tempo = (mdi->data[ptr+2] << 16) | (mdi->data[ptr+3] << 8) | mdi->data[ptr+4];
+@@ -3017,7 +3017,7 @@
+
+ void
+ do_null (unsigned char ch, struct _mdi *mdi, unsigned long int ptr) {
+- MIDI_EVENT_DEBUG(__FUNCTION__,ch);
++ MIDI_EVENT_DEBUG(__func__,ch);
+ };
+
+
+@@ -3138,7 +3138,7 @@
+
+ void
+ do_amp_setup_note_off (unsigned char ch, struct _mdi *mdi, struct _miditrack *track) {
+- MIDI_EVENT_DEBUG(__FUNCTION__,ch);
++ MIDI_EVENT_DEBUG(__func__,ch);
+
+ mdi->lin_cur_vol -= (lin_volume[mdi->note_vel[ch][mdi->data[track->ptr]]] *
+ lin_volume[mdi->ch_exp[ch]] * lin_volume[mdi->ch_vol[ch]]) / 1048576;
+@@ -3154,7 +3154,7 @@
+
+ void
+ do_amp_setup_note_on (unsigned char ch, struct _mdi *mdi, struct _miditrack *track) {
+- MIDI_EVENT_DEBUG(__FUNCTION__,ch);
++ MIDI_EVENT_DEBUG(__func__,ch);
+ if (mdi->data[track->ptr+1] == 0x00) {
+ do_amp_setup_note_off(ch, mdi, track);
+ track->running_event = 0x90 | ch;
+@@ -3194,7 +3194,7 @@
+ do_amp_setup_aftertouch (unsigned char ch, struct _mdi *mdi, struct _miditrack *track) {
+ unsigned char pres = mdi->data[track->ptr+1];
+
+- MIDI_EVENT_DEBUG(__FUNCTION__,ch);
++ MIDI_EVENT_DEBUG(__func__,ch);
+
+ if (pres == 0)
+ pres = 1;
+@@ -3229,7 +3229,7 @@
+ do_amp_setup_control (unsigned char ch, struct _mdi *mdi, struct _miditrack *track) {
+ int i;
+
+- MIDI_EVENT_DEBUG(__FUNCTION__,ch);
++ MIDI_EVENT_DEBUG(__func__,ch);
+ if (mdi->data[track->ptr] == 0x00) {
+ mdi->channel[ch].bank = mdi->data[track->ptr + 1];
+ } else if (mdi->data[track->ptr] == 0x07) {
+@@ -3300,7 +3300,7 @@
+ int i;
+ unsigned char pres = mdi->data[track->ptr];
+
+- MIDI_EVENT_DEBUG(__FUNCTION__,ch);
++ MIDI_EVENT_DEBUG(__func__,ch);
+
+ if (pres == 0)
+ pres = 1;
+@@ -3334,7 +3334,7 @@
+
+ void
+ do_amp_setup_pitch (unsigned char ch, struct _mdi *mdi, struct _miditrack *track) {
+- MIDI_EVENT_DEBUG(__FUNCTION__,ch);
++ MIDI_EVENT_DEBUG(__func__,ch);
+ track->running_event = 0xE0 | ch;
+ track->ptr += 2;
+ return;
+@@ -3347,7 +3347,7 @@
+ unsigned char event_data = mdi->data[track->ptr];
+ static unsigned long int tempo = 500000;
+
+- MIDI_EVENT_DEBUG(__FUNCTION__,ch);
++ MIDI_EVENT_DEBUG(__func__,ch);
+ if (event_type == 0xF0) {
+ track->running_event = 0x00;
+ do {
+@@ -3407,7 +3407,7 @@
+
+ mdi = malloc(sizeof(struct _mdi));
+ if (mdi == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
+ free (mididata);
+ return NULL;
+ }
+@@ -3421,7 +3421,7 @@
+
+ mdi->index = malloc(((midisize / 2) + 1)* sizeof(struct _mdi_index));
+ if (mdi->index == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
+ free(mdi);
+ return NULL;
+ }
+@@ -3444,14 +3444,14 @@
+ midiofs = 20;
+
+ if (strncmp(&mididata[midiofs],"MThd",4) != 0) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID,"(not a midi file)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID,"(not a midi file)", 0);
+ free(mdi->index);
+ free(mdi);
+ return NULL;
+ }
+
+ if ((midiofs + 25) > midisize) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT,"(too short)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT,"(too short)", 0);
+ free(mdi->index);
+ free(mdi);
+ return NULL;
+@@ -3459,7 +3459,7 @@
+
+ midiofs += 9;
+ if (mididata[midiofs] > 1) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID, NULL, 0);
+ free(mdi->index);
+ free(mdi);
+ return NULL;
+@@ -3478,7 +3478,7 @@
+ if (first_handle == NULL) {
+ first_handle = malloc(sizeof(struct _hndl));
+ if (first_handle == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
+ free(mdi->data);
+ free(mdi);
+ return NULL;
+@@ -3495,7 +3495,7 @@
+ }
+ tmp_handle->next = malloc(sizeof(struct _hndl));
+ if (tmp_handle->next == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM," to parse midi data", errno);
+ free(mdi->data);
+ free(mdi);
+ return NULL;
+@@ -3512,13 +3512,13 @@
+ midi_track_counter = 0;
+ while (midi_track_counter != no_tracks) {
+ if ((midiofs + 12) > midisize) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
+ WildMidi_Close(mdi);
+ free(tmp_trackdata);
+ return NULL;
+ }
+ if (strncmp(&mididata[midiofs],"MTrk",4) != 0) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(Expected track header)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(Expected track header)", 0);
+ WildMidi_Close(mdi);
+ free(tmp_trackdata);
+ return NULL;
+@@ -3528,7 +3528,7 @@
+ midiofs += 4;
+
+ if (midisize < (midiofs + tmp_trackdata[midi_track_counter].length)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(too short)", 0);
+ WildMidi_Close(mdi);
+ free(tmp_trackdata);
+ return NULL;
+@@ -3545,7 +3545,7 @@
+ midiofs += tmp_trackdata[midi_track_counter].length;
+
+ if (memcmp(&mididata[midiofs-3], eot,3) != 0) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(Expected EOT)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(Expected EOT)", 0);
+ WildMidi_Close(mdi);
+ free(tmp_trackdata);
+ return NULL;
+@@ -3579,7 +3579,7 @@
+ if (mdi->data[tmp_trackdata[i].ptr] < 0x80) {
+ current_event = tmp_trackdata[i].running_event;
+ if (current_event < 0x80) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_CORUPT, "(expected event)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_CORUPT, "(expected event)", 0);
+ WildMidi_Close(mdi);
+ free(tmp_trackdata);
+ return NULL;
+@@ -3630,7 +3630,7 @@
+ mdi->index_size = index_count;
+ mdi->index = realloc(mdi->index, (sizeof(struct _mdi_index) * mdi->index_size));
+ if (mdi->index == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, NULL, errno);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, NULL, errno);
+ WildMidi_Close(mdi);
+ free(tmp_trackdata);
+ return NULL;
+@@ -3704,12 +3704,12 @@
+ int
+ WildMidi_Init (const char * config_file, unsigned short int rate, unsigned short int options) {
+ if (WM_Initialized) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
+ return -1;
+ }
+
+ if (config_file == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL config file pointer)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL config file pointer)", 0);
+ return -1;
+ }
+ WM_InitPatches();
+@@ -3718,14 +3718,14 @@
+ }
+
+ if (options & 0xFFD8) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(invalid option)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(invalid option)", 0);
+ WM_FreePatches();
+ return -1;
+ }
+ WM_MixerOptions = options;
+
+ if ((rate < 11000) || (rate > 65000)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(rate out of bounds, range is 11000 - 65000)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(rate out of bounds, range is 11000 - 65000)", 0);
+ WM_FreePatches();
+ return -1;
+ }
+@@ -3745,11 +3745,11 @@
+ int i = 0;
+
+ if (!WM_Initialized) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
+ return -1;
+ }
+ if (master_volume > 127) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(master volume out of range, range is 0-127)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(master volume out of range, range is 0-127)", 0);
+ return -1;
+ }
+
+@@ -3776,15 +3776,15 @@
+ int i;
+
+ if (!WM_Initialized) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
+ return -1;
+ }
+ if (handle == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
+ return -1;
+ }
+ if (first_handle == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(no midi's open)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(no midi's open)", 0);
+ return -1;
+ }
+ WM_Lock(&mdi->lock);
+@@ -3799,7 +3799,7 @@
+ while (tmp_handle->handle != handle) {
+ tmp_handle = tmp_handle->next;
+ if (tmp_handle == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(handle does not exist)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(handle does not exist)", 0);
+ return -1;
+ }
+ }
+@@ -3850,11 +3850,11 @@
+ unsigned long int midisize = 0;
+
+ if (!WM_Initialized) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
+ return NULL;
+ }
+ if (midifile == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL filename)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL filename)", 0);
+ return NULL;
+ }
+
+@@ -3868,11 +3868,11 @@
+ midi *
+ WildMidi_OpenBuffer (unsigned char *midibuffer, unsigned long int size) {
+ if (!WM_Initialized) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
+ return NULL;
+ }
+ if (midibuffer == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL midi data buffer)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL midi data buffer)", 0);
+ return NULL;
+ }
+
+@@ -3901,16 +3901,16 @@
+ unsigned long int real_samples_to_mix = 0;
+
+ if (!WM_Initialized) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
+ return -1;
+ }
+ if (handle == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
+ return -1;
+ }
+ WM_Lock(&mdi->lock);
+ if (sample_pos == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL seek position pointer)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL seek position pointer)", 0);
+ WM_Unlock(&mdi->lock);
+ return -1;
+ }
+@@ -3992,16 +3992,16 @@
+ unsigned long int tmp_samples_to_mix = 0;
+
+ if (!WM_Initialized) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
+ return -1;
+ }
+ if (handle == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
+ return -1;
+ }
+ WM_Lock(&mdi->lock);
+ if (sample_pos == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL seek position pointer)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL seek position pointer)", 0);
+ WM_Unlock(&mdi->lock);
+ return -1;
+ }
+@@ -4191,15 +4191,15 @@
+ unsigned long int count;
+
+ if (__builtin_expect((!WM_Initialized),0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
+ return -1;
+ }
+ if (__builtin_expect((handle == NULL),0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
+ return -1;
+ }
+ if (__builtin_expect((buffer == NULL),0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL buffer pointer)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL buffer pointer)", 0);
+ return -1;
+ }
+
+@@ -4208,7 +4208,7 @@
+ }
+
+ if (__builtin_expect((size % 4),0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(size not a multiple of 4)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(size not a multiple of 4)", 0);
+ return -1;
+ }
+
+@@ -4548,15 +4548,15 @@
+
+
+ if (__builtin_expect((!WM_Initialized),0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
+ return -1;
+ }
+ if (__builtin_expect((handle == NULL),0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
+ return -1;
+ }
+ if (__builtin_expect((buffer == NULL),0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL buffer pointer)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL buffer pointer)", 0);
+ return -1;
+ }
+
+@@ -4565,7 +4565,7 @@
+ }
+
+ if (__builtin_expect((size % 4),0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(size not a multiple of 4)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(size not a multiple of 4)", 0);
+ return -1;
+ }
+
+@@ -4922,15 +4922,15 @@
+ struct _mdi *mdi = (struct _mdi *)handle;
+
+ if (__builtin_expect((!WM_Initialized),0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
+ return -1;
+ }
+ if (__builtin_expect((handle == NULL),0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
+ return -1;
+ }
+ if (__builtin_expect((buffer == NULL),0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL buffer pointer)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL buffer pointer)", 0);
+ return -1;
+ }
+
+@@ -4939,7 +4939,7 @@
+ }
+
+ if (__builtin_expect((size % 4),0)) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(size not a multiple of 4)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(size not a multiple of 4)", 0);
+ return -1;
+ }
+ if (mdi->info.mixer_options & WM_MO_EXPENSIVE_INTERPOLATION) {
+@@ -4956,21 +4956,21 @@
+ int i;
+
+ if (!WM_Initialized) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
+ return -1;
+ }
+ if (handle == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
+ return -1;
+ }
+ WM_Lock(&mdi->lock);
+ if ((!(options & 0x0007)) || (options & 0xFFF8)){
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(invalid option)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(invalid option)", 0);
+ WM_Unlock(&mdi->lock);
+ return -1;
+ }
+ if (setting & 0xFFF8) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(invalid setting)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(invalid setting)", 0);
+ WM_Unlock(&mdi->lock);
+ return -1;
+ }
+@@ -5023,18 +5023,18 @@
+ WildMidi_GetInfo (midi * handle) {
+ struct _mdi *mdi = (struct _mdi *)handle;
+ if (!WM_Initialized) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
+ return NULL;
+ }
+ if (handle == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_INVALID_ARG, "(NULL handle)", 0);
+ return NULL;
+ }
+ WM_Lock(&mdi->lock);
+ if (mdi->tmp_info == NULL) {
+ mdi->tmp_info = malloc(sizeof(struct _WM_Info));
+ if (mdi->tmp_info == NULL) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_MEM, "to set info", 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_MEM, "to set info", 0);
+ WM_Unlock(&mdi->lock);
+ return NULL;
+ }
+@@ -5051,7 +5051,7 @@
+ struct _hndl * tmp_hdle;
+
+ if (!WM_Initialized) {
+- WM_ERROR(__FUNCTION__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
++ WM_ERROR(__func__, __LINE__, WM_ERR_NOT_INIT, NULL, 0);
+ return -1;
+ }
+ if (first_handle != NULL) {