Skip to content

Commit 3f94ff5

Browse files
committed
Allow contrib/dbase to compile if HAVE_ICONV_H it not defined. This is
only a partial solution but a step in the right direction.
1 parent eb36cdd commit 3f94ff5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

contrib/dbase/dbf2pg.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,12 +742,14 @@ main(int argc, char **argv)
742742
case 'U':
743743
username = (char *) strdup(optarg);
744744
break;
745+
#ifdef HAVE_ICONV_H
745746
case 'F':
746747
charset_from = (char *) strdup(optarg);
747748
break;
748749
case 'T':
749750
charset_to = (char *) strdup(optarg);
750751
break;
752+
#endif
751753
case ':':
752754
usage();
753755
printf("missing argument!\n");
@@ -806,8 +808,10 @@ main(int argc, char **argv)
806808
free(username);
807809
if (password)
808810
free(password);
811+
#ifdef HAVE_ICONV_H
809812
if (charset_from)
810813
iconv_close(iconv_d);
814+
#endif
811815
exit(1);
812816
}
813817

@@ -846,8 +850,10 @@ main(int argc, char **argv)
846850
free(username);
847851
if (password)
848852
free(password);
853+
#ifdef HAVE_ICONV_H
849854
if (charset_from)
850855
iconv_close(iconv_d);
856+
#endif
851857
exit(1);
852858
}
853859

@@ -864,8 +870,10 @@ main(int argc, char **argv)
864870
free(username);
865871
if (password)
866872
free(password);
873+
#ifdef HAVE_ICONV_H
867874
if (charset_from)
868875
iconv_close(iconv_d);
876+
#endif
869877
exit(1);
870878
}
871879
if (del)
@@ -880,8 +888,10 @@ main(int argc, char **argv)
880888
free(username);
881889
if (password)
882890
free(password);
891+
#ifdef HAVE_ICONV_H
883892
if (charset_from)
884893
iconv_close(iconv_d);
894+
#endif
885895
exit(1);
886896
}
887897
if (verbose > 1)
@@ -903,8 +913,10 @@ main(int argc, char **argv)
903913
free(username);
904914
if (password)
905915
free(password);
916+
#ifdef HAVE_ICONV_H
906917
if (charset_from)
907918
iconv_close(iconv_d);
919+
#endif
908920
exit(1);
909921
}
910922
if (verbose > 1)
@@ -933,7 +945,9 @@ main(int argc, char **argv)
933945
free(username);
934946
if (password)
935947
free(password);
948+
#ifdef HAVE_ICONV_H
936949
if (charset_from)
937950
iconv_close(iconv_d);
951+
#endif
938952
exit(0);
939953
}

0 commit comments

Comments
 (0)