This is an automated email from Gerrit. Marc Schink (openocd-...@marcschink.de) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/5230
-- gerrit commit 04cc23e360014447abc17c9f7c6c480cd9c8d9ce Author: Marc Schink <openocd-...@marcschink.de> Date: Thu Jun 13 16:15:13 2019 +0200 flash/nor/esirisc: Rename 'PAGE_SIZE' #define On Windows (MSYS2/MinGW), 'PAGE_SIZE' is already defined in limits.h. The error message is the following: ../src/flash/nor/esirisc_flash.c:95:0: error: "PAGE_SIZE" redefined [-Werror] #define PAGE_SIZE 4096 In file included from /usr/lib/gcc/x86_64-pc-msys/7.4.0/include-fixed/limits.h:194:0, from /usr/lib/gcc/x86_64-pc-msys/7.4.0/include-fixed/syslimits.h:7, from /usr/lib/gcc/x86_64-pc-msys/7.4.0/include-fixed/limits.h:34, from /usr/include/sys/param.h:12, from ../src/helper/system.h:75, from ./config.h:335, from ../src/flash/nor/esirisc_flash.c:21: /usr/include/limits.h:223:0: note: this is the location of the previous definition #define PAGE_SIZE PAGESIZE Use 'ESIRISC_PAGE_SIZE' as name to avoid the conflict. Change-Id: I187db689b1867b28c6076a1370120b548e08daa8 Signed-off-by: Marc Schink <openocd-...@marcschink.de> diff --git a/src/flash/nor/esirisc_flash.c b/src/flash/nor/esirisc_flash.c index 4e33b94..cc37c63 100644 --- a/src/flash/nor/esirisc_flash.c +++ b/src/flash/nor/esirisc_flash.c @@ -92,7 +92,7 @@ #endif #define CONTROL_TIMEOUT 5000 /* 5s */ -#define PAGE_SIZE 4096 +#define ESIRISC_PAGE_SIZE 4096 #define PB_MAX 32 #define NUM_NS_PER_S 1000000000ULL @@ -264,7 +264,7 @@ static int esirisc_flash_erase(struct flash_bank *bank, int first, int last) (void)esirisc_flash_disable_protect(bank); for (int page = first; page < last; ++page) { - uint32_t address = page * PAGE_SIZE; + uint32_t address = page * ESIRISC_PAGE_SIZE; target_write_u32(target, esirisc_info->cfg + ADDRESS, address); @@ -464,8 +464,8 @@ static int esirisc_flash_probe(struct flash_bank *bank) if (target->state != TARGET_HALTED) return ERROR_TARGET_NOT_HALTED; - bank->num_sectors = bank->size / PAGE_SIZE; - bank->sectors = alloc_block_array(0, PAGE_SIZE, bank->num_sectors); + bank->num_sectors = bank->size / ESIRISC_PAGE_SIZE; + bank->sectors = alloc_block_array(0, ESIRISC_PAGE_SIZE, bank->num_sectors); retval = esirisc_flash_init(bank); if (retval != ERROR_OK) { -- _______________________________________________ OpenOCD-devel mailing list OpenOCD-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openocd-devel