avr-c.c (avr_cpu_cpp_builtins): Add __AVR_DEVICE_NAME__.
authorSenthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
Thu, 24 Jul 2014 18:41:03 +0000 (18:41 +0000)
committerDenis Chertykov <denisc@gcc.gnu.org>
Thu, 24 Jul 2014 18:41:03 +0000 (22:41 +0400)
* config/avr/avr-c.c (avr_cpu_cpp_builtins): Add __AVR_DEVICE_NAME__.

From-SVN: r213031

gcc/ChangeLog
gcc/config/avr/avr-c.c

index 4f66d80552b1d0acdefd15e4574d5215eca4730c..a039c5a4d555b47f9e183b2ad32ca562a24a1cef 100644 (file)
@@ -1,3 +1,7 @@
+2014-07-23  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
+
+       * config/avr/avr-c.c (avr_cpu_cpp_builtins): Add __AVR_DEVICE_NAME__.
+
 2014-07-24  Kyle McMartin  <kyle@redhat.com>
 
        * config/aarch64/aarch64-linux.h (TARGET_ASM_FILE_END): Define.
index c6a2f1f94718f1a5069390e4ca248ca37dbcb1e3..c1ba134deee4929c2a1f6a05bcaa91efda20aa1d 100644 (file)
@@ -299,7 +299,11 @@ avr_cpu_cpp_builtins (struct cpp_reader *pfile)
   if (avr_current_arch->macro)
     cpp_define_formatted (pfile, "__AVR_ARCH__=%s", avr_current_arch->macro);
   if (avr_current_device->macro)
-    cpp_define (pfile, avr_current_device->macro);
+    {
+      cpp_define (pfile, avr_current_device->macro);
+      cpp_define_formatted (pfile, "__AVR_DEVICE_NAME__=%s",
+                           avr_current_device->name);
+    }
   if (AVR_HAVE_RAMPD)    cpp_define (pfile, "__AVR_HAVE_RAMPD__");
   if (AVR_HAVE_RAMPX)    cpp_define (pfile, "__AVR_HAVE_RAMPX__");
   if (AVR_HAVE_RAMPY)    cpp_define (pfile, "__AVR_HAVE_RAMPY__");