Opened 9 years ago

Closed 5 years ago

#6132 closed enhancement (wontfix)

Switching #defines to enums

Reported by: Kurt Schwehr Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: default Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

Do we already have a strategy for switching old #defines to enums for better error checking and to have symbols during debugging?

If not, what about something like this? Then those who want can just add -DGDAL_STRICT to their builds

#define GDAL_STRICT

#ifdef GDAL_STRICT
typedef enum  {
  CPLES_BackslashQuotable,
  CPLES_XML,
  CPLES_URL,
  CPLES_SQL,
  CPLES_CSV,
  CPLES_XML_BUT_QUOTES
} CPLQuotingType;
#else
#define CPLES_BackslashQuotable 0
#define CPLES_XML               1
#define CPLES_URL               2
#define CPLES_SQL               3
#define CPLES_CSV               4
#define CPLES_XML_BUT_QUOTES    5
#endif

Change History (1)

comment:1 by Even Rouault, 5 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.