mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	STRUCT_ALIGNOF: use RUBY_ALIGNOF
This was a workaround for RUBY_ALIGNOF's glitch, which has already been fixed. See also https://github.com/ruby/ruby/pull/3570
This commit is contained in:
		
							parent
							
								
									7d594399f6
								
							
						
					
					
						commit
						ae94c5bf5d
					
				
				
				Notes:
				
					git
				
				2020-10-06 14:20:34 +09:00 
				
			
			
			
		
		
					 2 changed files with 2 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -2,8 +2,7 @@
 | 
			
		|||
#include "ruby/memory_view.h"
 | 
			
		||||
 | 
			
		||||
#define STRUCT_ALIGNOF(T, result) do { \
 | 
			
		||||
    struct S { char _; T t; }; \
 | 
			
		||||
    (result) = (int)offsetof(struct S, t); \
 | 
			
		||||
    (result) = RUBY_ALIGNOF(T); \
 | 
			
		||||
} while(0)
 | 
			
		||||
 | 
			
		||||
static ID id_str;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,8 +12,7 @@
 | 
			
		|||
#include "ruby/memory_view.h"
 | 
			
		||||
 | 
			
		||||
#define STRUCT_ALIGNOF(T, result) do { \
 | 
			
		||||
    struct S { char _; T t; }; \
 | 
			
		||||
    (result) = (int)offsetof(struct S, t); \
 | 
			
		||||
    (result) = RUBY_ALIGNOF(T); \
 | 
			
		||||
} while(0)
 | 
			
		||||
 | 
			
		||||
static ID id_memory_view;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue