X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Flibsigrok-internal.h;h=44be53c6515355bc1a92cd608208643acdf06081;hb=30903c4043cd1cb3eef94036313e782629280883;hp=98d1631e2f4a4a5d3b209f3e85446e464799ccc6;hpb=efce57da322cbe3d8c65332122ab3fb76e02089a;p=libsigrok.git diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index 98d1631e..44be53c6 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -967,6 +967,15 @@ static inline void write_dblle_inc(uint8_t **p, double x) #define SR_DRIVER_LIST_SECTION "__sr_driver_list" #endif +#if !defined SR_DRIVER_LIST_NOREORDER && defined __has_attribute +#if __has_attribute(no_reorder) +#define SR_DRIVER_LIST_NOREORDER __attribute__((no_reorder)) +#endif +#endif +#if !defined SR_DRIVER_LIST_NOREORDER +#define SR_DRIVER_LIST_NOREORDER /* EMPTY */ +#endif + /** * Register a list of hardware drivers. * @@ -996,6 +1005,7 @@ static inline void write_dblle_inc(uint8_t **p, double x) */ #define SR_REGISTER_DEV_DRIVER_LIST(name, ...) \ static const struct sr_dev_driver *name[] \ + SR_DRIVER_LIST_NOREORDER \ __attribute__((section (SR_DRIVER_LIST_SECTION), used, \ aligned(sizeof(struct sr_dev_driver *)))) \ = { \ @@ -1799,6 +1809,7 @@ SR_PRIV void *sr_resource_load(struct sr_context *ctx, int type, SR_PRIV int sr_atol(const char *str, long *ret); SR_PRIV int sr_atol_base(const char *str, long *ret, char **end, int base); +SR_PRIV int sr_atoul_base(const char *str, unsigned long *ret, char **end, int base); SR_PRIV int sr_atoi(const char *str, int *ret); SR_PRIV int sr_atod(const char *str, double *ret); SR_PRIV int sr_atof(const char *str, float *ret);