/[svn]/linuxsampler/trunk/src/scriptvm/common.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/scriptvm/common.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3034 by schoenebeck, Mon Oct 31 00:05:00 2016 UTC revision 3035 by schoenebeck, Mon Oct 31 12:00:00 2016 UTC
# Line 539  namespace LinuxSampler { Line 539  namespace LinuxSampler {
539          }          }
540      };      };
541    
542        #if HAVE_CXX_EMBEDDED_PRAGMA_DIAGNOSTICS
543        # define COMPILER_DISABLE_OFFSETOF_WARNING                    \
544            _Pragma("GCC diagnostic push")                            \
545            _Pragma("GCC diagnostic ignored \"-Winvalid-offsetof\"")
546        # define COMPILER_RESTORE_OFFSETOF_WARNING \
547            _Pragma("GCC diagnostic pop")
548        #else
549        # define COMPILER_DISABLE_OFFSETOF_WARNING
550        # define COMPILER_RESTORE_OFFSETOF_WARNING
551        #endif
552    
553      /**      /**
554       * Convenience macro for initializing VMIntRelPtr and VMInt8RelPtr       * Convenience macro for initializing VMIntRelPtr and VMInt8RelPtr
555       * structures. Usage example:       * structures. Usage example:
# Line 583  namespace LinuxSampler { Line 594  namespace LinuxSampler {
594       */       */
595      #define DECLARE_VMINT(basePtr, T_struct, T_member) (          \      #define DECLARE_VMINT(basePtr, T_struct, T_member) (          \
596          /* Disable offsetof warning, trust us, we are cautios. */ \          /* Disable offsetof warning, trust us, we are cautios. */ \
597          _Pragma("GCC diagnostic push")                            \          COMPILER_DISABLE_OFFSETOF_WARNING                         \
         _Pragma("GCC diagnostic ignored \"-Winvalid-offsetof\"")  \  
598          (VMRelPtr) {                                              \          (VMRelPtr) {                                              \
599              (void**) &basePtr,                                    \              (void**) &basePtr,                                    \
600              offsetof(T_struct, T_member),                         \              offsetof(T_struct, T_member),                         \
601              false                                                 \              false                                                 \
602          }                                                         \          }                                                         \
603          _Pragma("GCC diagnostic pop")                             \          COMPILER_RESTORE_OFFSETOF_WARNING                         \
604      )                                                             \      )                                                             \
605    
606      /**      /**
# Line 608  namespace LinuxSampler { Line 618  namespace LinuxSampler {
618       */       */
619      #define DECLARE_VMINT_READONLY(basePtr, T_struct, T_member) ( \      #define DECLARE_VMINT_READONLY(basePtr, T_struct, T_member) ( \
620          /* Disable offsetof warning, trust us, we are cautios. */ \          /* Disable offsetof warning, trust us, we are cautios. */ \
621          _Pragma("GCC diagnostic push")                            \          COMPILER_DISABLE_OFFSETOF_WARNING                         \
         _Pragma("GCC diagnostic ignored \"-Winvalid-offsetof\"")  \  
622          (VMRelPtr) {                                              \          (VMRelPtr) {                                              \
623              (void**) &basePtr,                                    \              (void**) &basePtr,                                    \
624              offsetof(T_struct, T_member),                         \              offsetof(T_struct, T_member),                         \
625              true                                                  \              true                                                  \
626          }                                                         \          }                                                         \
627          _Pragma("GCC diagnostic pop")                             \          COMPILER_RESTORE_OFFSETOF_WARNING                         \
628      )                                                             \      )                                                             \
629    
630      /** @brief Built-in VM 8 bit integer array variable.      /** @brief Built-in VM 8 bit integer array variable.

Legend:
Removed from v.3034  
changed lines
  Added in v.3035

  ViewVC Help
Powered by ViewVC