From 1139650320e764b6ba3582174a13babaa88fb1a1 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sun, 28 Jun 2009 12:02:43 -0700 Subject: Use "static inline" instead of "extern inline" for now. --- Makefile | 2 +- upb.h | 11 ++--------- upb_msg.h | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index c395e75..12d37e4 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ CC=gcc CXX=g++ CFLAGS=-std=c99 CPPFLAGS=-O3 -Wall -Wextra -pedantic -g -DNDEBUG -DUPB_UNALIGNED_READS_OK -fomit-frame-pointer -OBJ=upb_parse.o upb_table.o upb_msg.o upb_context.o descriptor.o upb_inlinedefs.o +OBJ=upb_parse.o upb_table.o upb_msg.o upb_context.o descriptor.o all: $(OBJ) test_table tests clean: rm -f $(OBJ) tests diff --git a/upb.h b/upb.h index 5197395..2e62b5a 100644 --- a/upb.h +++ b/upb.h @@ -16,15 +16,8 @@ extern "C" { #endif -/* Portable inlining strategy: use C99 rules except on GCC. - * see: http://www.greenend.org.uk/rjk/2003/03/inline.html. */ -#ifndef INLINE -# if __GNUC__ && !__GNUC_STDC_INLINE__ -# define INLINE extern inline -# else -# define INLINE inline -# endif -#endif +/* inline if possible, emit standalone code if required. */ +#define INLINE static inline /* The maximum that any submessages can be nested. Matches proto2's limit. */ #define UPB_MAX_NESTING 64 diff --git a/upb_msg.h b/upb_msg.h index f7b07f3..78fd2ce 100644 --- a/upb_msg.h +++ b/upb_msg.h @@ -96,7 +96,7 @@ struct upb_fieldsbyname_entry { struct upb_abbrev_msg_field f; }; -struct upb_msg_field *upb_get_msg_field( +INLINE struct upb_msg_field *upb_get_msg_field( struct upb_abbrev_msg_field *f, struct upb_msg *m) { return &m->fields[f->field_index]; } -- cgit v1.2.3