1. Leslie P. Polzer
  2. fdisk


pol...@gnu.org  committed 83c7886

cpp conditionals for compiling without GNU extensions (Robert Millan).

  • Participants
  • Parent commits 7db8181
  • Branches default

Comments (0)

Files changed (2)

File configure.ac

View file
 rm -f test00 test01
+AC_ARG_WITH([gnu-ext], AS_HELP_STRING([--with-gnu-ext],[Enable GNU extensions]),
+   AC_DEFINE([GNU_EXT], [1], [Define to 1 if you enable GNU extensions]))
 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile tests/Makefile po/Makefile.in])

File src/fdisk.c

View file
 	{"list",        N_("list partition table(s)")},
 	{"raw-print",	N_("show the raw data in the partition table(s)")},
 	{"size",	N_("show partition size")},
+#ifdef GNU_EXT
 	{"linux-fdisk", N_("enable Linux fdisk compatibility mode")},
 	{"gnu-fdisk",   N_("disable Linux fdisk compatibility mode")},
 	{"interactive",	N_("where necessary, prompts for user intervention")},
 	{"script",	N_("never prompts for user intervention")},
 	{"sector-units",N_("use sectors instead of cylinder as a default unit")},
+#ifdef GNU_EXT
 int fdisk_compatibility_mode = 0;
+#define fdisk_compatibility_mode 1
 int fdisk_opt_script_mode;
 int fdisk_list_table = 0;
 int fdisk_print_raw = 0;
 			case 'i': fdisk_opt_script_mode = 0; break;
 			case 'p': fdisk_opt_script_mode = 1; break;
+#ifdef GNU_EXT
 			case 'G': fdisk_compatibility_mode = 0; break;
 			case 'L': fdisk_compatibility_mode = 1; break;
 			case 's': fdisk_part_size = optarg; break;
 			case 't': print_partition_types(); break;
 			case 'u': ped_unit_set_default(PED_UNIT_SECTOR);
+#ifdef GNU_EXT
 	/* See whether we should enable Linux fdisk compatibility mode */
 	if (argv[0]) {
 		char *program_name = strrchr(argv[0], '/');
 		fdisk_compatibility_mode = 0;
 	dev = _init (&argc, &argv);